[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamical
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamically |
Date: |
Tue, 19 Jun 2012 21:15:08 +0200 |
Signed-off-by: Alexander Graf <address@hidden>
---
v2 -> v3:
- use snprintf
- use new multi-cell setting api
---
hw/ppce500_mpc8544ds.c | 17 +++++++++++++++++
pc-bios/mpc8544ds.dts | 9 ---------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index a078e24..c7c16c1 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -43,6 +43,8 @@
#define RAM_SIZES_ALIGN (64UL << 20)
#define MPC8544_CCSRBAR_BASE 0xE0000000
+#define MPC8544_CCSRBAR_REGSIZE 0x00001000
+#define MPC8544_CCSRBAR_SIZE 0x00100000
#define MPC8544_MPIC_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x40000)
#define MPC8544_SERIAL0_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x4500)
#define MPC8544_SERIAL1_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x4600)
@@ -78,6 +80,7 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
int i;
char compatible[] = "MPC8544DS\0MPC85xxDS";
char model[] = "MPC8544DS";
+ char soc[128];
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
if (!filename) {
@@ -179,6 +182,20 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
}
}
+ /* XXX These should go into their respective devices' code */
+ snprintf(soc, sizeof(soc), "/address@hidden", MPC8544_CCSRBAR_BASE);
+ qemu_devtree_add_subnode(fdt, soc);
+ qemu_devtree_setprop_string(fdt, soc, "device_type", "soc");
+ qemu_devtree_setprop_string(fdt, soc, "compatible", "simple-bus");
+ qemu_devtree_setprop_cell(fdt, soc, "#address-cells", 1);
+ qemu_devtree_setprop_cell(fdt, soc, "#size-cells", 1);
+ qemu_devtree_setprop_cells(fdt, soc, "ranges", 0x0, MPC8544_CCSRBAR_BASE,
+ MPC8544_CCSRBAR_SIZE);
+ qemu_devtree_setprop_cells(fdt, soc, "reg", MPC8544_CCSRBAR_BASE,
+ MPC8544_CCSRBAR_REGSIZE);
+ /* XXX should contain a reasonable value */
+ qemu_devtree_setprop_cell(fdt, soc, "bus-frequency", 0);
+
ret = rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
if (ret < 0) {
goto out;
diff --git a/pc-bios/mpc8544ds.dts b/pc-bios/mpc8544ds.dts
index 1eac8ef..01b53ba 100644
--- a/pc-bios/mpc8544ds.dts
+++ b/pc-bios/mpc8544ds.dts
@@ -18,15 +18,6 @@
};
address@hidden {
- #address-cells = <1>;
- #size-cells = <1>;
- device_type = "soc";
- compatible = "simple-bus";
-
- ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR 1M
- bus-frequency = <0>; // Filled out by uboot.
-
serial0: address@hidden {
cell-index = <0>;
device_type = "serial";
--
1.6.0.2
- [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically, (continued)
- [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 02/31] dt: add helpers for multi-cell adds, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 06/31] dt: add helper for empty dt creation, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 03/31] dt: add helper for phandle references, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 09/31] PPC: e500: require libfdt, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 12/31] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 05/31] dt: add helper for phandle enumeration, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 01/31] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 07/31] dt: add helper for phandle allocation, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 17/31] PPC: e500: dt: create mpic node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamically,
Alexander Graf <=
- [Qemu-devel] [PATCH 18/31] PPC: e500: dt: create global-utils node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 04/31] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 22/31] PPC: e500: dt: use 64bit cell helper, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 13/31] PPC: e500: dt: create / node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 14/31] PPC: e500: dt: create /chosen node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 11/31] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 21/31] dt: Add -machine dumpdtb option to dump the current dtb, Alexander Graf, 2012/06/19
- [Qemu-devel] [PATCH 10/31] PPC: e500: dt: create memory node dynamically, Alexander Graf, 2012/06/19