aboutsummaryrefslogtreecommitdiff
path: root/hw/ppce500_mpc8544ds.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-10 16:23:59 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-10 16:23:59 +0000
commit7ec632b45c223bc6a01a8f5a6549854e8624b0c0 (patch)
tree8baa43f3512ceb9962c193624e40b7df9cc9573b /hw/ppce500_mpc8544ds.c
parent5c130f659b20d53667e07957ebaa3e656f72b276 (diff)
Wean device tree code off phys_ram_base.
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7068 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppce500_mpc8544ds.c')
-rw-r--r--hw/ppce500_mpc8544ds.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index 868dd90c08..50ad8149e5 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -71,7 +71,7 @@ out:
}
#endif
-static void *mpc8544_load_device_tree(void *addr,
+static void *mpc8544_load_device_tree(target_phys_addr_t addr,
uint32_t ramsize,
target_phys_addr_t initrd_base,
target_phys_addr_t initrd_size,
@@ -81,6 +81,7 @@ static void *mpc8544_load_device_tree(void *addr,
#ifdef HAVE_FDT
uint32_t mem_reg_property[] = {0, ramsize};
char *path;
+ int fdt_size;
int pathlen;
int ret;
@@ -89,7 +90,7 @@ static void *mpc8544_load_device_tree(void *addr,
snprintf(path, pathlen, "%s/%s", bios_dir, BINARY_DEVICE_TREE_FILE);
- fdt = load_device_tree(path, addr);
+ fdt = load_device_tree(path, &fdt_size);
qemu_free(path);
if (fdt == NULL)
goto out;
@@ -142,6 +143,8 @@ static void *mpc8544_load_device_tree(void *addr,
mpc8544_copy_soc_cell(fdt, buf, "timebase-frequency");
}
+ cpu_physical_memory_write (addr, (void *)fdt, fdt_size);
+
out:
#endif
@@ -259,7 +262,7 @@ static void mpc8544ds_init(ram_addr_t ram_size, int vga_ram_size,
/* If we're loading a kernel directly, we must load the device tree too. */
if (kernel_filename) {
- fdt = mpc8544_load_device_tree(phys_ram_base + dt_base, ram_size,
+ fdt = mpc8544_load_device_tree(dt_base, ram_size,
initrd_base, initrd_size, kernel_cmdline);
if (fdt == NULL) {
fprintf(stderr, "couldn't load device tree\n");