diff options
author | Alexander Graf <agraf@suse.de> | 2012-05-17 14:51:51 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-06-24 01:04:48 +0200 |
commit | 19ac9deacbadf77532723950ce3e128e18c31573 (patch) | |
tree | 1ddaa29e817d9b0258855f56fa804d3e50bfdefc /hw/ppce500_mpc8544ds.c | |
parent | 0cfc6e8d9e18856b1db0cb5cd5624df7fb19b469 (diff) |
PPC: e500: dt: create mpic node dynamically
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppce500_mpc8544ds.c')
-rw-r--r-- | hw/ppce500_mpc8544ds.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index c68e9949b8..5c2b6ab79a 100644 --- a/hw/ppce500_mpc8544ds.c +++ b/hw/ppce500_mpc8544ds.c @@ -83,6 +83,8 @@ static int mpc8544_load_device_tree(CPUPPCState *env, char soc[128]; char ser0[128]; char ser1[128]; + char mpic[128]; + uint32_t mpic_ph; filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); if (!filename) { @@ -199,6 +201,20 @@ static int mpc8544_load_device_tree(CPUPPCState *env, /* XXX should contain a reasonable value */ qemu_devtree_setprop_cell(fdt, soc, "bus-frequency", 0); + snprintf(mpic, sizeof(mpic), "%s/pic@%x", soc, + MPC8544_MPIC_REGS_BASE - MPC8544_CCSRBAR_BASE); + qemu_devtree_add_subnode(fdt, mpic); + qemu_devtree_setprop_string(fdt, mpic, "device_type", "open-pic"); + qemu_devtree_setprop_string(fdt, mpic, "compatible", "chrp,open-pic"); + qemu_devtree_setprop_cells(fdt, mpic, "reg", MPC8544_MPIC_REGS_BASE - + MPC8544_CCSRBAR_BASE, 0x40000); + qemu_devtree_setprop_cell(fdt, mpic, "#address-cells", 0); + qemu_devtree_setprop_cell(fdt, mpic, "#interrupt-cells", 2); + mpic_ph = qemu_devtree_alloc_phandle(fdt); + qemu_devtree_setprop_cell(fdt, mpic, "phandle", mpic_ph); + qemu_devtree_setprop_cell(fdt, mpic, "linux,phandle", mpic_ph); + qemu_devtree_setprop(fdt, mpic, "interrupt-controller", NULL, 0); + /* * We have to generate ser1 first, because Linux takes the first * device it finds in the dt as serial output device. And we generate |