aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/prep.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc/prep.c')
-rw-r--r--hw/ppc/prep.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 9266453dd9..4a0cb434a6 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -35,6 +35,7 @@
#include "hw/pci/pci_host.h"
#include "hw/ppc/ppc.h"
#include "hw/boards.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "hw/irq.h"
@@ -243,6 +244,7 @@ static void ibm_40p_init(MachineState *machine)
SysBusDevice *pcihost, *s;
Nvram *m48t59 = NULL;
PCIBus *pci_bus;
+ ISADevice *isa_dev;
ISABus *isa_bus;
void *fw_cfg;
int i;
@@ -268,7 +270,7 @@ static void ibm_40p_init(MachineState *machine)
qemu_register_reset(ppc_prep_reset, cpu);
/* PCI host */
- dev = qdev_create(NULL, "raven-pcihost");
+ dev = qdev_new("raven-pcihost");
if (!bios_name) {
bios_name = "openbios-ppc";
}
@@ -276,7 +278,7 @@ static void ibm_40p_init(MachineState *machine)
qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
pcihost = SYS_BUS_DEVICE(dev);
object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev));
- qdev_init_nofail(dev);
+ sysbus_realize_and_unref(pcihost, &error_fatal);
pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
if (!pci_bus) {
error_report("could not create PCI host controller");
@@ -291,14 +293,16 @@ static void ibm_40p_init(MachineState *machine)
isa_bus = ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0"));
/* Memory controller */
- dev = DEVICE(isa_create(isa_bus, "rs6000-mc"));
+ isa_dev = isa_new("rs6000-mc");
+ dev = DEVICE(isa_dev);
qdev_prop_set_uint32(dev, "ram-size", machine->ram_size);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
/* RTC */
- dev = DEVICE(isa_create(isa_bus, TYPE_MC146818_RTC));
+ isa_dev = isa_new(TYPE_MC146818_RTC);
+ dev = DEVICE(isa_dev);
qdev_prop_set_int32(dev, "base_year", 1900);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
/* initialize CMOS checksums */
cmos_checksum = 0x6aa9;
@@ -309,19 +313,22 @@ static void ibm_40p_init(MachineState *machine)
if (defaults_enabled()) {
m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
- dev = DEVICE(isa_create(isa_bus, "cs4231a"));
+ isa_dev = isa_new("cs4231a");
+ dev = DEVICE(isa_dev);
qdev_prop_set_uint32(dev, "iobase", 0x830);
qdev_prop_set_uint32(dev, "irq", 10);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
- dev = DEVICE(isa_create(isa_bus, "pc87312"));
+ isa_dev = isa_new("pc87312");
+ dev = DEVICE(isa_dev);
qdev_prop_set_uint32(dev, "config", 12);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
- dev = DEVICE(isa_create(isa_bus, "prep-systemio"));
+ isa_dev = isa_new("prep-systemio");
+ dev = DEVICE(isa_dev);
qdev_prop_set_uint32(dev, "ibm-planar-id", 0xfc);
qdev_prop_set_uint32(dev, "equipment", 0xc0);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
dev = DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0),
"lsi53c810"));
@@ -338,14 +345,14 @@ static void ibm_40p_init(MachineState *machine)
}
/* Prepare firmware configuration for OpenBIOS */
- dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
+ dev = qdev_new(TYPE_FW_CFG_MEM);
fw_cfg = FW_CFG(dev);
qdev_prop_set_uint32(dev, "data_width", 1);
qdev_prop_set_bit(dev, "dma_enabled", false);
object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG,
OBJECT(fw_cfg));
- qdev_init_nofail(dev);
s = SYS_BUS_DEVICE(dev);
+ sysbus_realize_and_unref(s, &error_fatal);
sysbus_mmio_map(s, 0, CFG_ADDR);
sysbus_mmio_map(s, 1, CFG_ADDR + 2);