aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/pegasos2.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc/pegasos2.c')
-rw-r--r--hw/ppc/pegasos2.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index bb4d008ba9..f46d4bf51d 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -102,7 +102,7 @@ static void pegasos2_init(MachineState *machine)
CPUPPCState *env;
MemoryRegion *rom = g_new(MemoryRegion, 1);
PCIBus *pci_bus;
- PCIDevice *dev;
+ PCIDevice *dev, *via;
I2CBus *i2c_bus;
const char *fwname = machine->firmware ?: PROM_FILENAME;
char *filename;
@@ -159,30 +159,23 @@ static void pegasos2_init(MachineState *machine)
pci_bus = mv64361_get_pci_bus(pm->mv, 1);
/* VIA VT8231 South Bridge (multifunction PCI device) */
- /* VT8231 function 0: PCI-to-ISA Bridge */
- dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
+ via = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
TYPE_VT8231_ISA);
- qdev_connect_gpio_out(DEVICE(dev), 0,
+ object_property_add_alias(OBJECT(machine), "rtc-time",
+ object_resolve_path_component(OBJECT(via),
+ "rtc"),
+ "date");
+ qdev_connect_gpio_out(DEVICE(via), 0,
qdev_get_gpio_in_named(pm->mv, "gpp", 31));
- /* VT8231 function 1: IDE Controller */
- dev = pci_create_simple(pci_bus, PCI_DEVFN(12, 1), "via-ide");
+ dev = PCI_DEVICE(object_resolve_path_component(OBJECT(via), "ide"));
pci_ide_create_devs(dev);
- /* VT8231 function 2-3: USB Ports */
- pci_create_simple(pci_bus, PCI_DEVFN(12, 2), "vt82c686b-usb-uhci");
- pci_create_simple(pci_bus, PCI_DEVFN(12, 3), "vt82c686b-usb-uhci");
-
- /* VT8231 function 4: Power Management Controller */
- dev = pci_create_simple(pci_bus, PCI_DEVFN(12, 4), TYPE_VT8231_PM);
+ dev = PCI_DEVICE(object_resolve_path_component(OBJECT(via), "pm"));
i2c_bus = I2C_BUS(qdev_get_child_bus(DEVICE(dev), "i2c"));
spd_data = spd_data_generate(DDR, machine->ram_size);
smbus_eeprom_init_one(i2c_bus, 0x57, spd_data);
- /* VT8231 function 5-6: AC97 Audio & Modem */
- pci_create_simple(pci_bus, PCI_DEVFN(12, 5), TYPE_VIA_AC97);
- pci_create_simple(pci_bus, PCI_DEVFN(12, 6), TYPE_VIA_MC97);
-
/* other PC hardware */
pci_vga_init(pci_bus);