Commit 08854f41 authored by Rob Herring's avatar Rob Herring

metag: use unflatten_and_copy_device_tree

Use the common unflatten_and_copy_device_tree to copy the built-in FDT
out of init section.
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Cc: James Hogan <james.hogan@imgtec.com>
parent 3104021c
...@@ -94,21 +94,5 @@ struct machine_desc * __init setup_machine_fdt(void *dt) ...@@ -94,21 +94,5 @@ struct machine_desc * __init setup_machine_fdt(void *dt)
of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
return mdesc_best; return mdesc_best;
}
/**
* copy_fdt - Copy device tree into non-init memory.
*
* We must copy the flattened device tree blob into non-init memory because the
* unflattened device tree will reference the strings in it directly.
*/
void __init copy_fdt(void)
{
void *alloc = early_init_dt_alloc_memory_arch(
be32_to_cpu(initial_boot_params->totalsize), 0x40);
if (alloc) {
memcpy(alloc, initial_boot_params,
be32_to_cpu(initial_boot_params->totalsize));
initial_boot_params = alloc;
}
} }
...@@ -408,9 +408,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -408,9 +408,7 @@ void __init setup_arch(char **cmdline_p)
cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id(); cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id();
hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id(); hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id();
/* Copy device tree blob into non-init memory before unflattening */ unflatten_and_copy_device_tree();
copy_fdt();
unflatten_device_tree();
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
smp_init_cpus(); smp_init_cpus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment