qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] RFC: ehci -> uhci handoff suggestions


From: Kevin Wolf
Subject: Re: [Qemu-devel] RFC: ehci -> uhci handoff suggestions
Date: Wed, 26 May 2010 14:25:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4

Am 26.05.2010 13:47, schrieb Gerd Hoffmann:
> On 05/25/10 15:40, David S. Ahern wrote:
>>
>> USB 2.0 leverages companion UHCI or OHCI host controllers for full and
>> low speed devices. I do not see an appropriate means for doing that bus
>> transition and could use some suggestions.
> 
> Hmm.  Well.  That doesn't really fit into the qdev tree model ...
> 
>> As I understand the code at this point it is a top down setup: device
>> added, bus found, device attached.
> 
> Devices are always added to some bus.  In the case of usb the devices 
> can also be attached/detached.  Emulated devices usually attached right 
> after creating them.  Host devices are attached when a matching physical 
> device shows up.
> 
>> ie., key point is the expectation that the bus to which the device is
>> assigned is known early in the code path.
> 
> Yes.  You can even specify the bus you want attach the device to.
> 
>>      --------------------      --------------------
>>     |   EHCI controller  |--->|    UHCI / OHCI     |
>>      --------------------      --------------------
>>               |                         |
>>      --------------------      --------------------
>>     |  USB device model  |    |  USB device model  |
>>     |    (or driver )    |    |    (or driver )    |
>>      --------------------      --------------------
>>           high speed             full / low speed
>>
>>
>> To know which bus to attach it to the device needs to be queried/probed
>> for basic information - something the current architecture does not have.
> 
> USB devices can support both 1.1 and 2.0, right?  Who decides which 
> protocol is used then?  I think the OS can speak 1.1 to the device even 
> in case a ehci controller is present (but unused by the OS), right?

AFAIK the OS must tell the EHCI that it should hand the device off to
the UHCI/OHCI companion before it can use it there.

>> Suggestions?
> 
> Maybe it makes more sense to look at ehci/uhci as *one* (physical) 
> device with multiple interfaces?  They share the physical ports after 
> all, at least on real hardware.
> 
> The tricky case is assigning host devices, right?  For the emulated ones 
> we can probably could get away by simply forcing them into 2.0-only or 
> 1.1-only mode depending on which bus they got attached to.

If they should be accessed via the EHCI or a companion controller
depends on what the OS requests. And USB 2.0 says that any device that
supports High Speed must also support Full Speed and therefore be
accessible using the companion (at least that's what I understand).

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]