aboutsummaryrefslogtreecommitdiff
path: root/hw
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
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')
-rw-r--r--hw/ppc440_bamboo.c9
-rw-r--r--hw/ppce500_mpc8544ds.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index c407b1863f..b249e00c69 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -27,7 +27,7 @@
#define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
-static void *bamboo_load_device_tree(void *addr,
+static void *bamboo_load_device_tree(target_phys_addr_t addr,
uint32_t ramsize,
target_phys_addr_t initrd_base,
target_phys_addr_t initrd_size,
@@ -37,6 +37,7 @@ static void *bamboo_load_device_tree(void *addr,
#ifdef HAVE_FDT
uint32_t mem_reg_property[] = { 0, 0, ramsize };
char *path;
+ int fdt_size;
int pathlen;
int ret;
@@ -45,7 +46,7 @@ static void *bamboo_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);
free(path);
if (fdt == NULL)
goto out;
@@ -75,6 +76,8 @@ static void *bamboo_load_device_tree(void *addr,
if (kvm_enabled())
kvmppc_fdt_update(fdt);
+ cpu_physical_memory_write (addr, (void *)fdt, fdt_size);
+
out:
#endif
@@ -165,7 +168,7 @@ static void bamboo_init(ram_addr_t ram_size, int vga_ram_size,
else
dt_base = kernel_size + loadaddr;
- fdt = bamboo_load_device_tree(phys_ram_base + dt_base, ram_size,
+ fdt = bamboo_load_device_tree(dt_base, ram_size,
initrd_base, initrd_size, kernel_cmdline);
if (fdt == NULL) {
fprintf(stderr, "couldn't load device tree\n");
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");