aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-07-12 08:54:49 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-12 08:54:49 +0000
commit53e3c4f9183af22ab5426faa901a507c6ee5b13c (patch)
treeb4c4e34ba9ddaaef6c7584b7924b6dc9b011f028 /hw
parent5210977a8511fc0c4a8a1a68c01fa3b65e29edc0 (diff)
Sparc64: convert ebus to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/sun4u.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c
index dfe1578b67..9d2a7f59e3 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -305,9 +305,12 @@ static void ebus_mmio_mapfunc(PCIDevice *pci_dev, int region_num,
static void
pci_ebus_init(PCIBus *bus, int devfn)
{
- PCIDevice *s;
+ pci_create_simple(bus, devfn, "ebus");
+}
- s = pci_register_device(bus, "EBUS", sizeof(*s), devfn, NULL, NULL);
+static void
+pci_ebus_init1(PCIDevice *s)
+{
pci_config_set_vendor_id(s->config, PCI_VENDOR_ID_SUN);
pci_config_set_device_id(s->config, PCI_DEVICE_ID_SUN_EBUS);
s->config[0x04] = 0x06; // command = bus master, pci mem
@@ -326,6 +329,19 @@ pci_ebus_init(PCIBus *bus, int devfn)
ebus_mmio_mapfunc);
}
+static PCIDeviceInfo ebus_info = {
+ .qdev.name = "ebus",
+ .qdev.size = sizeof(PCIDevice),
+ .init = pci_ebus_init1,
+};
+
+static void pci_ebus_register(void)
+{
+ pci_qdev_register(&ebus_info);
+}
+
+device_init(pci_ebus_register);
+
static void sun4uv_init(ram_addr_t RAM_size,
const char *boot_devices,
const char *kernel_filename, const char *kernel_cmdline,