* [Qemu-devel] ehci and low/full speed peripherals @ 2012-12-13 10:38 M P 2012-12-13 12:25 ` Gerd Hoffmann 0 siblings, 1 reply; 4+ messages in thread From: M P @ 2012-12-13 10:38 UTC (permalink / raw) To: qemu-devel Developers [-- Attachment #1: Type: text/plain, Size: 539 bytes --] In the i.MX23 emulation, there is a EHCI sysbus device which is supported and seems to work well already (using -usbdevice host:...) However most of the other peripherals (serial, hub, net) fail do to a 'speed mismatch' error. I looked into a bit more details, and it seems the EHCI has to be complimented to support lower speed peripherals. However, none of the attempts I made at 'complimenting' my ehci instance with ohci seems to work, and grepping doesn't shows any other device using this. How is this supposed to work ? Michael [-- Attachment #2: Type: text/html, Size: 660 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] ehci and low/full speed peripherals 2012-12-13 10:38 [Qemu-devel] ehci and low/full speed peripherals M P @ 2012-12-13 12:25 ` Gerd Hoffmann 2012-12-13 13:56 ` M P 0 siblings, 1 reply; 4+ messages in thread From: Gerd Hoffmann @ 2012-12-13 12:25 UTC (permalink / raw) To: M P; +Cc: qemu-devel Developers On 12/13/12 11:38, M P wrote: > In the i.MX23 emulation, there is a EHCI sysbus device which is supported > and seems to work well already (using -usbdevice host:...) > > However most of the other peripherals (serial, hub, net) fail do to a > 'speed mismatch' error. I looked into a bit more details, and it seems the > EHCI has to be complimented to support lower speed peripherals. > > However, none of the attempts I made at 'complimenting' my ehci instance > with ohci seems to work, and grepping doesn't shows any other device using > this. > > How is this supposed to work ? See docs/ich9-ehci-uhci.cfg how that works in the x86 world. Using ohci instead of uhci works too. You need a single ohci controller only when setting the num-ports property to 6. Doing the same on sysbus needs some coding work to add masterbus + firstport properties and to wind up initialization accordingly. HTH, Gerd ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] ehci and low/full speed peripherals 2012-12-13 12:25 ` Gerd Hoffmann @ 2012-12-13 13:56 ` M P 2012-12-13 14:25 ` Gerd Hoffmann 0 siblings, 1 reply; 4+ messages in thread From: M P @ 2012-12-13 13:56 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: qemu-devel Developers [-- Attachment #1: Type: text/plain, Size: 2946 bytes --] On Thu, Dec 13, 2012 at 12:25 PM, Gerd Hoffmann <kraxel@redhat.com> wrote: > On 12/13/12 11:38, M P wrote: > > In the i.MX23 emulation, there is a EHCI sysbus device which is supported > > and seems to work well already (using -usbdevice host:...) > > > > However most of the other peripherals (serial, hub, net) fail do to a > > 'speed mismatch' error. I looked into a bit more details, and it seems > the > > EHCI has to be complimented to support lower speed peripherals. > > > > However, none of the attempts I made at 'complimenting' my ehci instance > > with ohci seems to work, and grepping doesn't shows any other device > using > > this. > > > > How is this supposed to work ? > > See docs/ich9-ehci-uhci.cfg how that works in the x86 world. Using ohci > instead of uhci works too. You need a single ohci controller only when > setting the num-ports property to 6. > > Doing the same on sysbus needs some coding work to add masterbus + > firstport properties and to wind up initialization accordingly. > > HTH, > Gerd > I added the properties (see patch lower down) and I Use the following to create a companion ohci, however qemu starts, seems to let me attach lower speed devices, but linux reports: "hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad" I have to say I'm not sure where that comes from -- so I need some sort of kernel support for companion ports perhaps? + DeviceState * d = qdev_create(NULL, "sysbus-ohci"); + qdev_prop_set_string(d, "masterbus", u->bus.qbus.name); + qdev_prop_set_uint32(d, "firstport", 0); + qdev_prop_set_uint32(d, "num-ports", 6); + qdev_init_nofail(d); -- patch bellow to hcd-ohci.c appears straigthforward enough @@ -1849,7 +1849,9 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev) typedef struct { SysBusDevice busdev; OHCIState ohci; + char *masterbus; uint32_t num_ports; + uint32_t firstport; dma_addr_t dma_offset; } OHCISysBusState; @@ -1858,8 +1860,9 @@ static int ohci_init_pxa(SysBusDevice *dev) OHCISysBusState *s = FROM_SYSBUS(OHCISysBusState, dev); /* Cannot fail as we pass NULL for masterbus */ - usb_ohci_init(&s->ohci, &dev->qdev, s->num_ports, s->dma_offset, NULL, 0, - &dma_context_memory); + usb_ohci_init(&s->ohci, &dev->qdev, s->num_ports, s->dma_offset, + s->masterbus, s->firstport, + &dma_context_memory); sysbus_init_irq(dev, &s->ohci.irq); sysbus_init_mmio(dev, &s->ohci.mem); @@ -1897,6 +1900,8 @@ static TypeInfo ohci_pci_info = { static Property ohci_sysbus_properties[] = { DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3), DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 3), + DEFINE_PROP_STRING("masterbus", OHCISysBusState, masterbus), + DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0), DEFINE_PROP_END_OF_LIST(), }; [-- Attachment #2: Type: text/html, Size: 4972 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] ehci and low/full speed peripherals 2012-12-13 13:56 ` M P @ 2012-12-13 14:25 ` Gerd Hoffmann 0 siblings, 0 replies; 4+ messages in thread From: Gerd Hoffmann @ 2012-12-13 14:25 UTC (permalink / raw) To: M P; +Cc: qemu-devel Developers Hi, > I added the properties (see patch lower down) and I Use the following to > create a companion ohci, however qemu starts, seems to let me attach lower > speed devices, but linux reports: > "hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad" I have to > say I'm not sure where that comes from -- so I need some sort of kernel > support for companion ports perhaps? Hmm, no idea offhand, patch looks ok. Which controller is usb1? ohci or ehci? cheers, Gerd ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-13 14:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-12-13 10:38 [Qemu-devel] ehci and low/full speed peripherals M P 2012-12-13 12:25 ` Gerd Hoffmann 2012-12-13 13:56 ` M P 2012-12-13 14:25 ` Gerd Hoffmann
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 NNTP newsgroup(s).