diff options
author | Rob Herring <rob.herring@calxeda.com> | 2013-08-27 22:39:46 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2013-10-09 12:38:06 -0400 |
commit | 08854f41809293b283b96c642562cd4119d6b5db (patch) | |
tree | a47068630950ca37c1456b075bed9fd0beae69b2 /arch | |
parent | 3104021c12747df63843fedf3ceb6a54410e2c18 (diff) |
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: Rob Herring <rob.herring@calxeda.com>
Cc: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/metag/kernel/devtree.c | 16 | ||||
-rw-r--r-- | arch/metag/kernel/setup.c | 4 |
2 files changed, 1 insertions, 19 deletions
diff --git a/arch/metag/kernel/devtree.c b/arch/metag/kernel/devtree.c index 7cd02529636e..049af569cd49 100644 --- a/arch/metag/kernel/devtree.c +++ b/arch/metag/kernel/devtree.c | |||
@@ -94,21 +94,5 @@ struct machine_desc * __init setup_machine_fdt(void *dt) | |||
94 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); | 94 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); |
95 | 95 | ||
96 | return mdesc_best; | 96 | return mdesc_best; |
97 | } | ||
98 | 97 | ||
99 | /** | ||
100 | * copy_fdt - Copy device tree into non-init memory. | ||
101 | * | ||
102 | * We must copy the flattened device tree blob into non-init memory because the | ||
103 | * unflattened device tree will reference the strings in it directly. | ||
104 | */ | ||
105 | void __init copy_fdt(void) | ||
106 | { | ||
107 | void *alloc = early_init_dt_alloc_memory_arch( | ||
108 | be32_to_cpu(initial_boot_params->totalsize), 0x40); | ||
109 | if (alloc) { | ||
110 | memcpy(alloc, initial_boot_params, | ||
111 | be32_to_cpu(initial_boot_params->totalsize)); | ||
112 | initial_boot_params = alloc; | ||
113 | } | ||
114 | } | 98 | } |
diff --git a/arch/metag/kernel/setup.c b/arch/metag/kernel/setup.c index c396cd0b425f..2c697d343088 100644 --- a/arch/metag/kernel/setup.c +++ b/arch/metag/kernel/setup.c | |||
@@ -408,9 +408,7 @@ void __init setup_arch(char **cmdline_p) | |||
408 | cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id(); | 408 | cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id(); |
409 | hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id(); | 409 | hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id(); |
410 | 410 | ||
411 | /* Copy device tree blob into non-init memory before unflattening */ | 411 | unflatten_and_copy_device_tree(); |
412 | copy_fdt(); | ||
413 | unflatten_device_tree(); | ||
414 | 412 | ||
415 | #ifdef CONFIG_SMP | 413 | #ifdef CONFIG_SMP |
416 | smp_init_cpus(); | 414 | smp_init_cpus(); |