aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/metag/include/asm/prom.h1
-rw-r--r--arch/metag/kernel/devtree.c17
-rw-r--r--arch/metag/kernel/setup.c2
3 files changed, 20 insertions, 0 deletions
diff --git a/arch/metag/include/asm/prom.h b/arch/metag/include/asm/prom.h
index d881396c392c..ccac97e865d0 100644
--- a/arch/metag/include/asm/prom.h
+++ b/arch/metag/include/asm/prom.h
@@ -18,6 +18,7 @@
18#define HAVE_ARCH_DEVTREE_FIXUPS 18#define HAVE_ARCH_DEVTREE_FIXUPS
19 19
20extern struct machine_desc *setup_machine_fdt(void *dt); 20extern struct machine_desc *setup_machine_fdt(void *dt);
21extern void copy_fdt(void);
21extern void metag_dt_memblock_reserve(void); 22extern void metag_dt_memblock_reserve(void);
22 23
23#endif /* __ASM_METAG_PROM_H */ 24#endif /* __ASM_METAG_PROM_H */
diff --git a/arch/metag/kernel/devtree.c b/arch/metag/kernel/devtree.c
index 5b6b1d855492..7cd02529636e 100644
--- a/arch/metag/kernel/devtree.c
+++ b/arch/metag/kernel/devtree.c
@@ -95,3 +95,20 @@ struct machine_desc * __init setup_machine_fdt(void *dt)
95 95
96 return mdesc_best; 96 return mdesc_best;
97} 97}
98
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 */
105void __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}
diff --git a/arch/metag/kernel/setup.c b/arch/metag/kernel/setup.c
index dd6c5ad73917..879246170aec 100644
--- a/arch/metag/kernel/setup.c
+++ b/arch/metag/kernel/setup.c
@@ -406,6 +406,8 @@ void __init setup_arch(char **cmdline_p)
406 cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id(); 406 cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id();
407 hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id(); 407 hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id();
408 408
409 /* Copy device tree blob into non-init memory before unflattening */
410 copy_fdt();
409 unflatten_device_tree(); 411 unflatten_device_tree();
410 412
411#ifdef CONFIG_SMP 413#ifdef CONFIG_SMP