diff options
author | Andreas Färber <andreas.faerber@web.de> | 2012-12-16 04:49:44 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-01-07 12:57:24 +0100 |
commit | 4a4343671e183824a3f5db76ad561ce01e6c6e0a (patch) | |
tree | ef9327effd2c96fe3b569277a67810dd16dc06f6 /hw/usb/hcd-ehci-sysbus.c | |
parent | 5aa3ca9f53cc7a1bf76b7583c46937a73914394a (diff) | |
download | qemu-4a4343671e183824a3f5db76ad561ce01e6c6e0a.zip qemu-4a4343671e183824a3f5db76ad561ce01e6c6e0a.tar.gz qemu-4a4343671e183824a3f5db76ad561ce01e6c6e0a.tar.bz2 |
usb/ehci: Move capsbase and opregbase into SysBus EHCI class
This allows specific derived models to use different values.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci-sysbus.c')
-rw-r--r-- | hw/usb/hcd-ehci-sysbus.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index d431193..5a94ce3 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -35,10 +35,11 @@ static Property ehci_sysbus_properties[] = { static int usb_ehci_sysbus_initfn(SysBusDevice *dev) { EHCISysBusState *i = SYS_BUS_EHCI(dev); + SysBusEHCIClass *sec = SYS_BUS_EHCI_GET_CLASS(dev); EHCIState *s = &i->ehci; - s->capsbase = 0x100; - s->opregbase = 0x140; + s->capsbase = sec->capsbase; + s->opregbase = sec->opregbase; s->dma = &dma_context_memory; usb_ehci_initfn(s, DEVICE(dev)); @@ -63,11 +64,21 @@ static const TypeInfo ehci_type_info = { .instance_size = sizeof(EHCISysBusState), .abstract = true, .class_init = ehci_sysbus_class_init, + .class_size = sizeof(SysBusEHCIClass), }; +static void ehci_xlnx_class_init(ObjectClass *oc, void *data) +{ + SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); + + sec->capsbase = 0x100; + sec->opregbase = 0x140; +} + static const TypeInfo ehci_xlnx_type_info = { .name = "xlnx,ps7-usb", .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_xlnx_class_init, }; static void ehci_sysbus_register_types(void) |