82 |
82 |
}
|
83 |
83 |
#endif
|
84 |
84 |
|
85 |
|
static int mpc8544_load_device_tree(target_phys_addr_t addr,
|
86 |
|
uint32_t ramsize,
|
87 |
|
target_phys_addr_t initrd_base,
|
88 |
|
target_phys_addr_t initrd_size,
|
89 |
|
const char *kernel_cmdline)
|
|
85 |
static int mpc8544_load_device_tree(CPUState *env,
|
|
86 |
target_phys_addr_t addr,
|
|
87 |
uint32_t ramsize,
|
|
88 |
target_phys_addr_t initrd_base,
|
|
89 |
target_phys_addr_t initrd_size,
|
|
90 |
const char *kernel_cmdline)
|
90 |
91 |
{
|
91 |
92 |
int ret = -1;
|
92 |
93 |
#ifdef CONFIG_FDT
|
... | ... | |
94 |
95 |
char *filename;
|
95 |
96 |
int fdt_size;
|
96 |
97 |
void *fdt;
|
|
98 |
uint8_t hypercall[16];
|
97 |
99 |
|
98 |
100 |
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
99 |
101 |
if (!filename) {
|
... | ... | |
157 |
159 |
|
158 |
160 |
mpc8544_copy_soc_cell(fdt, buf, "clock-frequency");
|
159 |
161 |
mpc8544_copy_soc_cell(fdt, buf, "timebase-frequency");
|
|
162 |
|
|
163 |
/* indicate KVM hypercall interface */
|
|
164 |
qemu_devtree_setprop_string(fdt, "/hypervisor", "compatible",
|
|
165 |
"linux,kvm");
|
|
166 |
kvmppc_get_hypercall(env, hypercall, sizeof(hypercall));
|
|
167 |
qemu_devtree_setprop(fdt, "/hypervisor", "hcall-instructions",
|
|
168 |
hypercall, sizeof(hypercall));
|
160 |
169 |
} else {
|
161 |
170 |
const uint32_t freq = 400000000;
|
162 |
171 |
|
... | ... | |
330 |
339 |
cpu_abort(env, "Compiled without FDT support - can't load kernel\n");
|
331 |
340 |
#endif
|
332 |
341 |
dt_base = (kernel_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
|
333 |
|
if (mpc8544_load_device_tree(dt_base, ram_size,
|
|
342 |
if (mpc8544_load_device_tree(env, dt_base, ram_size,
|
334 |
343 |
initrd_base, initrd_size, kernel_cmdline) < 0) {
|
335 |
344 |
fprintf(stderr, "couldn't load device tree\n");
|
336 |
345 |
exit(1);
|