public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Frank Pagliughi <fpagliughi@mindspring.com>
To: Chris Holgate <chris@zynaptic.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	  Simon Kallweit <simon.kallweit@intefo.ch>,
	 ecos-devel@sourceware.org
Subject: Re: STM32 USB support
Date: Wed, 20 May 2009 03:09:00 -0000	[thread overview]
Message-ID: <4A137430.2010903@mindspring.com> (raw)
In-Reply-To: <4A12D3CC.1070707@zynaptic.com>

Chris Holgate wrote:
> Andrew Lunn wrote:
>
>   
>> The AT91 USB driver has something similar to this. It can configure
>> the endpoints by looking at the USB descriptors.
>>
>>     
> I've just had a quick look back at the AT91, and while there's a certain
> degree of flexibility there, it's still limited to the particular
> configuration decreed by Atmel as far as buffer sizes, endpoint number
> etc. is concerned.
>
> With the STM32, ST seem to have taken the opposite approach - you have a
> chunk of buffer memory and 8 endpoint state machines.  Beyond that
> you've got complete flexibility to choose how many endpoints you want -
> input or output (or bidirectional[1] if you don't need double
> buffering).  You can also choose an arbitrary set of logical (ie visible
> to the host) endpoint IDs and buffer sizes.
>
> Given this flexibility, it seemed to be a bit of a waste to define a
> fixed standard configuration similar to the Atmel device.  Instead, when
> the host sends the configuration select to the STM32 EP0 I intercept it
> and scan the descriptor data structures for a corresponding
> configuration.  Using the descriptor configuration I can then set up the
> buffer memory and endpoint state machines 'on the fly' to correspond
> directly to the configuration requested by the host.
>
> All this gives the application specific driver layered on top of the
> STM32 driver complete freedom to specify one or more supported endpoint
> configurations.
>
>   
>> I don't remember how it works with respect to devtab entries.
>>     
>
> Since the Atmel and other USB drivers have fixed endpoint
> configurations, it's reasonable to statically allocate and configure the
> devtab entries during the device init sequence.  Unfortunately, this has
> obvious problems when using the dynamic configuration scheme described
> above.
>
> Chris.
>
> [1] I used the bidirectional mode for the control endpoint, but
> otherwise decided it was more bother than it was worth!
>
>   
Yeah, the USB subsystem for eCos was written at a time when USB chips 
were quite rigid - endpoints with fixed sizes and functions. Now, most 
chips are more flexible than not, with generic endpoints and 
configurable memory allocation. So the existing eCos infrastructure is 
showing it's age.  So each new driver is hitting this same problem and 
trying to solve it in a new and different way.

A search of this mailing list and 'ecos-devel' will show a couple 
different complaints and suggestions that I and a few other people made 
a while back. I haven't used eCos all year, but am close to jumping back 
in for a bit, and would need to refresh my own memory with the details.

IIRC, at the time I had fairly convinced myself that what was needed was 
an entirely new USB subsystem that would:
- make it much easier to work with the flexible new chips
- handle much more of the device enumeration
- provide a very specific callbacks structure (like read/write an 
endpoint, respond to a bus reset, set the chips' address, etc)
- handle more of the buffering

In general, make it much easier to knock out USB drivers.

Maybe now it's time to start considering this in earnest?  Count me in.

Frank

  reply	other threads:[~2009-05-20  3:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4A11CAAA.8040900@intefo.ch>
     [not found] ` <4A11D861.8090206@zynaptic.com>
     [not found]   ` <4A11E5DF.2000403@intefo.ch>
2009-05-19 11:47     ` Chris Holgate
2009-05-19 12:00       ` Andrew Lunn
2009-05-19 15:17         ` Simon Kallweit
2009-05-19 16:28           ` Chris Holgate
2009-05-20  8:20             ` Simon Kallweit
2009-05-19 15:44         ` Chris Holgate
2009-05-20  3:09           ` Frank Pagliughi [this message]
2009-05-20 10:19             ` Chris Holgate
2009-05-20 14:54               ` Frank Pagliughi
2009-05-20 16:06                 ` Chris Holgate
2009-05-20 22:31                   ` Frank Pagliughi
2009-05-19 13:33       ` John Dallaway
2009-05-20 21:22         ` Chris Holgate
2009-05-21  7:27           ` John Dallaway
2009-05-31 15:01             ` Chris Holgate
2009-05-31 15:46               ` John Dallaway

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A137430.2010903@mindspring.com \
    --to=fpagliughi@mindspring.com \
    --cc=andrew@lunn.ch \
    --cc=chris@zynaptic.com \
    --cc=ecos-devel@sourceware.org \
    --cc=simon.kallweit@intefo.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).