|
From: | M P |
Subject: | Re: [Qemu-devel] ehci and low/full speed peripherals |
Date: | Thu, 13 Dec 2012 13:56:06 +0000 |
See docs/ich9-ehci-uhci.cfg how that works in the x86 world. Using ohciOn 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 ?
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
+ 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);
@@ -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(),
};
[Prev in Thread] | Current Thread | [Next in Thread] |