diff options
author | Rob Herring <robh@kernel.org> | 2014-03-31 16:13:07 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-04-30 01:59:13 -0400 |
commit | 0cdde839265d5f258b36b871b083324f62c1fbb9 (patch) | |
tree | bac63daf0535676f41f0d1d6744872be1b2f499a | |
parent | 01984a6f99cf1463a89592eff6e57af898743022 (diff) |
mips: convert fdt pointers to opaque pointers
The architecture code does not need to access the internals of the FDT
blob directly, so make the pointers to it void * and use char arrays
for section variables.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Tested-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r-- | arch/mips/include/asm/mips-boards/generic.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/prom.h | 6 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 2 | ||||
-rw-r--r-- | arch/mips/lantiq/prom.c | 2 | ||||
-rw-r--r-- | arch/mips/lantiq/prom.h | 2 | ||||
-rw-r--r-- | arch/mips/mti-sead3/sead3-setup.c | 8 | ||||
-rw-r--r-- | arch/mips/ralink/of.c | 4 |
7 files changed, 13 insertions, 15 deletions
diff --git a/arch/mips/include/asm/mips-boards/generic.h b/arch/mips/include/asm/mips-boards/generic.h index 48616816bcbc..b969491aa98d 100644 --- a/arch/mips/include/asm/mips-boards/generic.h +++ b/arch/mips/include/asm/mips-boards/generic.h | |||
@@ -67,9 +67,7 @@ | |||
67 | 67 | ||
68 | extern int mips_revision_sconid; | 68 | extern int mips_revision_sconid; |
69 | 69 | ||
70 | #ifdef CONFIG_OF | 70 | extern char __dtb_start[]; |
71 | extern struct boot_param_header __dtb_start; | ||
72 | #endif | ||
73 | 71 | ||
74 | #ifdef CONFIG_PCI | 72 | #ifdef CONFIG_PCI |
75 | extern void mips_pcibios_init(void); | 73 | extern void mips_pcibios_init(void); |
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h index ccd2b75f152c..a9494c0141fb 100644 --- a/arch/mips/include/asm/prom.h +++ b/arch/mips/include/asm/prom.h | |||
@@ -21,13 +21,13 @@ extern void device_tree_init(void); | |||
21 | 21 | ||
22 | struct boot_param_header; | 22 | struct boot_param_header; |
23 | 23 | ||
24 | extern void __dt_setup_arch(struct boot_param_header *bph); | 24 | extern void __dt_setup_arch(void *bph); |
25 | 25 | ||
26 | #define dt_setup_arch(sym) \ | 26 | #define dt_setup_arch(sym) \ |
27 | ({ \ | 27 | ({ \ |
28 | extern struct boot_param_header __dtb_##sym##_begin; \ | 28 | extern char __dtb_##sym##_begin[]; \ |
29 | \ | 29 | \ |
30 | __dt_setup_arch(&__dtb_##sym##_begin); \ | 30 | __dt_setup_arch(__dtb_##sym##_begin); \ |
31 | }) | 31 | }) |
32 | 32 | ||
33 | #else /* CONFIG_OF */ | 33 | #else /* CONFIG_OF */ |
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 3c3b0df8f48d..5d39bb85bf35 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c | |||
@@ -47,7 +47,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | |||
47 | return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); | 47 | return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); |
48 | } | 48 | } |
49 | 49 | ||
50 | void __init __dt_setup_arch(struct boot_param_header *bph) | 50 | void __init __dt_setup_arch(void *bph) |
51 | { | 51 | { |
52 | if (!early_init_dt_scan(bph)) | 52 | if (!early_init_dt_scan(bph)) |
53 | return; | 53 | return; |
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index cdea687ad490..7447d322d14e 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c | |||
@@ -71,7 +71,7 @@ void __init plat_mem_setup(void) | |||
71 | * Load the builtin devicetree. This causes the chosen node to be | 71 | * Load the builtin devicetree. This causes the chosen node to be |
72 | * parsed resulting in our memory appearing | 72 | * parsed resulting in our memory appearing |
73 | */ | 73 | */ |
74 | __dt_setup_arch(&__dtb_start); | 74 | __dt_setup_arch(__dtb_start); |
75 | } | 75 | } |
76 | 76 | ||
77 | void __init device_tree_init(void) | 77 | void __init device_tree_init(void) |
diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h index 8e07b5f28ef1..69a4c582338d 100644 --- a/arch/mips/lantiq/prom.h +++ b/arch/mips/lantiq/prom.h | |||
@@ -26,6 +26,6 @@ struct ltq_soc_info { | |||
26 | extern void ltq_soc_detect(struct ltq_soc_info *i); | 26 | extern void ltq_soc_detect(struct ltq_soc_info *i); |
27 | extern void ltq_soc_init(void); | 27 | extern void ltq_soc_init(void); |
28 | 28 | ||
29 | extern struct boot_param_header __dtb_start; | 29 | extern char __dtb_start[]; |
30 | 30 | ||
31 | #endif | 31 | #endif |
diff --git a/arch/mips/mti-sead3/sead3-setup.c b/arch/mips/mti-sead3/sead3-setup.c index bf7fe48bf2f9..e43f4801a245 100644 --- a/arch/mips/mti-sead3/sead3-setup.c +++ b/arch/mips/mti-sead3/sead3-setup.c | |||
@@ -69,17 +69,17 @@ static void __init parse_memsize_param(void) | |||
69 | if (!memsize) | 69 | if (!memsize) |
70 | return; | 70 | return; |
71 | 71 | ||
72 | offset = fdt_path_offset(&__dtb_start, "/memory"); | 72 | offset = fdt_path_offset(__dtb_start, "/memory"); |
73 | if (offset > 0) { | 73 | if (offset > 0) { |
74 | uint64_t new_value; | 74 | uint64_t new_value; |
75 | /* | 75 | /* |
76 | * reg contains 2 32-bits BE values, offset and size. We just | 76 | * reg contains 2 32-bits BE values, offset and size. We just |
77 | * want to replace the size value without affecting the offset | 77 | * want to replace the size value without affecting the offset |
78 | */ | 78 | */ |
79 | prop_value = fdt_getprop(&__dtb_start, offset, "reg", &prop_len); | 79 | prop_value = fdt_getprop(__dtb_start, offset, "reg", &prop_len); |
80 | new_value = be64_to_cpu(*prop_value); | 80 | new_value = be64_to_cpu(*prop_value); |
81 | new_value = (new_value & ~0xffffffffllu) | memsize; | 81 | new_value = (new_value & ~0xffffffffllu) | memsize; |
82 | fdt_setprop_inplace_u64(&__dtb_start, offset, "reg", new_value); | 82 | fdt_setprop_inplace_u64(__dtb_start, offset, "reg", new_value); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
@@ -92,7 +92,7 @@ void __init plat_mem_setup(void) | |||
92 | * Load the builtin devicetree. This causes the chosen node to be | 92 | * Load the builtin devicetree. This causes the chosen node to be |
93 | * parsed resulting in our memory appearing | 93 | * parsed resulting in our memory appearing |
94 | */ | 94 | */ |
95 | __dt_setup_arch(&__dtb_start); | 95 | __dt_setup_arch(__dtb_start); |
96 | } | 96 | } |
97 | 97 | ||
98 | void __init device_tree_init(void) | 98 | void __init device_tree_init(void) |
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c index 0170d829d073..91d7060d5aea 100644 --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c | |||
@@ -28,7 +28,7 @@ | |||
28 | __iomem void *rt_sysc_membase; | 28 | __iomem void *rt_sysc_membase; |
29 | __iomem void *rt_memc_membase; | 29 | __iomem void *rt_memc_membase; |
30 | 30 | ||
31 | extern struct boot_param_header __dtb_start; | 31 | extern char __dtb_start[]; |
32 | 32 | ||
33 | __iomem void *plat_of_remap_node(const char *node) | 33 | __iomem void *plat_of_remap_node(const char *node) |
34 | { | 34 | { |
@@ -63,7 +63,7 @@ void __init plat_mem_setup(void) | |||
63 | * Load the builtin devicetree. This causes the chosen node to be | 63 | * Load the builtin devicetree. This causes the chosen node to be |
64 | * parsed resulting in our memory appearing | 64 | * parsed resulting in our memory appearing |
65 | */ | 65 | */ |
66 | __dt_setup_arch(&__dtb_start); | 66 | __dt_setup_arch(__dtb_start); |
67 | 67 | ||
68 | if (soc_info.mem_size) | 68 | if (soc_info.mem_size) |
69 | add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, | 69 | add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, |