mirror of https://github.com/xemu-project/xemu.git
PPC: E500: Move PCI slot information into params
We have a params struct that allows us to expose differences between e500 machine models. Include PCI slot information there, so we can have different machines with different PCI slot topology. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
347dd79dcc
commit
492ec48dc2
|
@ -339,7 +339,8 @@ static int ppce500_load_device_tree(CPUPPCState *env,
|
||||||
qemu_devtree_setprop_cells(fdt, pci, "interrupt-map-mask", 0xf800, 0x0,
|
qemu_devtree_setprop_cells(fdt, pci, "interrupt-map-mask", 0xf800, 0x0,
|
||||||
0x0, 0x7);
|
0x0, 0x7);
|
||||||
pci_map = pci_map_create(fdt, qemu_devtree_get_phandle(fdt, mpic),
|
pci_map = pci_map_create(fdt, qemu_devtree_get_phandle(fdt, mpic),
|
||||||
0x11, 2, &len);
|
params->pci_first_slot, params->pci_nr_slots,
|
||||||
|
&len);
|
||||||
qemu_devtree_setprop(fdt, pci, "interrupt-map", pci_map, len);
|
qemu_devtree_setprop(fdt, pci, "interrupt-map", pci_map, len);
|
||||||
qemu_devtree_setprop_phandle(fdt, pci, "interrupt-parent", mpic);
|
qemu_devtree_setprop_phandle(fdt, pci, "interrupt-parent", mpic);
|
||||||
qemu_devtree_setprop_cells(fdt, pci, "interrupts", 24, 2);
|
qemu_devtree_setprop_cells(fdt, pci, "interrupts", 24, 2);
|
||||||
|
@ -569,6 +570,7 @@ void ppce500_init(PPCE500Params *params)
|
||||||
|
|
||||||
/* PCI */
|
/* PCI */
|
||||||
dev = qdev_create(NULL, "e500-pcihost");
|
dev = qdev_create(NULL, "e500-pcihost");
|
||||||
|
qdev_prop_set_uint32(dev, "first_slot", params->pci_first_slot);
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
s = SYS_BUS_DEVICE(dev);
|
s = SYS_BUS_DEVICE(dev);
|
||||||
sysbus_connect_irq(s, 0, mpic[pci_irq_nrs[0]]);
|
sysbus_connect_irq(s, 0, mpic[pci_irq_nrs[0]]);
|
||||||
|
|
|
@ -9,6 +9,8 @@ typedef struct PPCE500Params {
|
||||||
const char *kernel_cmdline;
|
const char *kernel_cmdline;
|
||||||
const char *initrd_filename;
|
const char *initrd_filename;
|
||||||
const char *cpu_model;
|
const char *cpu_model;
|
||||||
|
int pci_first_slot;
|
||||||
|
int pci_nr_slots;
|
||||||
|
|
||||||
/* e500-specific params */
|
/* e500-specific params */
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ static void e500plat_init(QEMUMachineInitArgs *args)
|
||||||
.kernel_cmdline = kernel_cmdline,
|
.kernel_cmdline = kernel_cmdline,
|
||||||
.initrd_filename = initrd_filename,
|
.initrd_filename = initrd_filename,
|
||||||
.cpu_model = cpu_model,
|
.cpu_model = cpu_model,
|
||||||
|
.pci_first_slot = 0x11,
|
||||||
|
.pci_nr_slots = 2,
|
||||||
.fixup_devtree = e500plat_fixup_devtree,
|
.fixup_devtree = e500plat_fixup_devtree,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ static void mpc8544ds_init(QEMUMachineInitArgs *args)
|
||||||
.kernel_cmdline = kernel_cmdline,
|
.kernel_cmdline = kernel_cmdline,
|
||||||
.initrd_filename = initrd_filename,
|
.initrd_filename = initrd_filename,
|
||||||
.cpu_model = cpu_model,
|
.cpu_model = cpu_model,
|
||||||
|
.pci_first_slot = 0x11,
|
||||||
|
.pci_nr_slots = 2,
|
||||||
.fixup_devtree = mpc8544ds_fixup_devtree,
|
.fixup_devtree = mpc8544ds_fixup_devtree,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue