~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to hw/ppc440_bamboo.c

  • Committer: pbrook
  • Date: 2009-04-10 16:23:59 UTC
  • Revision ID: git-v1:7ec632b45c223bc6a01a8f5a6549854e8624b0c0
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

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
29
29
 
30
 
static void *bamboo_load_device_tree(void *addr,
 
30
static void *bamboo_load_device_tree(target_phys_addr_t addr,
31
31
                                     uint32_t ramsize,
32
32
                                     target_phys_addr_t initrd_base,
33
33
                                     target_phys_addr_t initrd_size,
37
37
#ifdef HAVE_FDT
38
38
    uint32_t mem_reg_property[] = { 0, 0, ramsize };
39
39
    char *path;
 
40
    int fdt_size;
40
41
    int pathlen;
41
42
    int ret;
42
43
 
45
46
 
46
47
    snprintf(path, pathlen, "%s/%s", bios_dir, BINARY_DEVICE_TREE_FILE);
47
48
 
48
 
    fdt = load_device_tree(path, addr);
 
49
    fdt = load_device_tree(path, &fdt_size);
49
50
    free(path);
50
51
    if (fdt == NULL)
51
52
        goto out;
75
76
    if (kvm_enabled())
76
77
        kvmppc_fdt_update(fdt);
77
78
 
 
79
    cpu_physical_memory_write (addr, (void *)fdt, fdt_size);
 
80
 
78
81
out:
79
82
#endif
80
83
 
165
168
        else
166
169
            dt_base = kernel_size + loadaddr;
167
170
 
168
 
        fdt = bamboo_load_device_tree(phys_ram_base + dt_base, ram_size,
 
171
        fdt = bamboo_load_device_tree(dt_base, ram_size,
169
172
                                      initrd_base, initrd_size, kernel_cmdline);
170
173
        if (fdt == NULL) {
171
174
            fprintf(stderr, "couldn't load device tree\n");