mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
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>
This commit is contained in:
parent
01984a6f99
commit
0cdde83926
7 changed files with 13 additions and 15 deletions
|
@ -67,9 +67,7 @@
|
||||||
|
|
||||||
extern int mips_revision_sconid;
|
extern int mips_revision_sconid;
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
extern char __dtb_start[];
|
||||||
extern struct boot_param_header __dtb_start;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
extern void mips_pcibios_init(void);
|
extern void mips_pcibios_init(void);
|
||||||
|
|
|
@ -21,13 +21,13 @@ extern void device_tree_init(void);
|
||||||
|
|
||||||
struct boot_param_header;
|
struct boot_param_header;
|
||||||
|
|
||||||
extern void __dt_setup_arch(struct boot_param_header *bph);
|
extern void __dt_setup_arch(void *bph);
|
||||||
|
|
||||||
#define dt_setup_arch(sym) \
|
#define dt_setup_arch(sym) \
|
||||||
({ \
|
({ \
|
||||||
extern struct boot_param_header __dtb_##sym##_begin; \
|
extern char __dtb_##sym##_begin[]; \
|
||||||
\
|
\
|
||||||
__dt_setup_arch(&__dtb_##sym##_begin); \
|
__dt_setup_arch(__dtb_##sym##_begin); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#else /* CONFIG_OF */
|
#else /* CONFIG_OF */
|
||||||
|
|
|
@ -47,7 +47,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||||
return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
|
return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init __dt_setup_arch(struct boot_param_header *bph)
|
void __init __dt_setup_arch(void *bph)
|
||||||
{
|
{
|
||||||
if (!early_init_dt_scan(bph))
|
if (!early_init_dt_scan(bph))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -71,7 +71,7 @@ void __init plat_mem_setup(void)
|
||||||
* Load the builtin devicetree. This causes the chosen node to be
|
* Load the builtin devicetree. This causes the chosen node to be
|
||||||
* parsed resulting in our memory appearing
|
* parsed resulting in our memory appearing
|
||||||
*/
|
*/
|
||||||
__dt_setup_arch(&__dtb_start);
|
__dt_setup_arch(__dtb_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init device_tree_init(void)
|
void __init device_tree_init(void)
|
||||||
|
|
|
@ -26,6 +26,6 @@ struct ltq_soc_info {
|
||||||
extern void ltq_soc_detect(struct ltq_soc_info *i);
|
extern void ltq_soc_detect(struct ltq_soc_info *i);
|
||||||
extern void ltq_soc_init(void);
|
extern void ltq_soc_init(void);
|
||||||
|
|
||||||
extern struct boot_param_header __dtb_start;
|
extern char __dtb_start[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -69,17 +69,17 @@ static void __init parse_memsize_param(void)
|
||||||
if (!memsize)
|
if (!memsize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
offset = fdt_path_offset(&__dtb_start, "/memory");
|
offset = fdt_path_offset(__dtb_start, "/memory");
|
||||||
if (offset > 0) {
|
if (offset > 0) {
|
||||||
uint64_t new_value;
|
uint64_t new_value;
|
||||||
/*
|
/*
|
||||||
* reg contains 2 32-bits BE values, offset and size. We just
|
* reg contains 2 32-bits BE values, offset and size. We just
|
||||||
* want to replace the size value without affecting the offset
|
* want to replace the size value without affecting the offset
|
||||||
*/
|
*/
|
||||||
prop_value = fdt_getprop(&__dtb_start, offset, "reg", &prop_len);
|
prop_value = fdt_getprop(__dtb_start, offset, "reg", &prop_len);
|
||||||
new_value = be64_to_cpu(*prop_value);
|
new_value = be64_to_cpu(*prop_value);
|
||||||
new_value = (new_value & ~0xffffffffllu) | memsize;
|
new_value = (new_value & ~0xffffffffllu) | memsize;
|
||||||
fdt_setprop_inplace_u64(&__dtb_start, offset, "reg", new_value);
|
fdt_setprop_inplace_u64(__dtb_start, offset, "reg", new_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void __init plat_mem_setup(void)
|
||||||
* Load the builtin devicetree. This causes the chosen node to be
|
* Load the builtin devicetree. This causes the chosen node to be
|
||||||
* parsed resulting in our memory appearing
|
* parsed resulting in our memory appearing
|
||||||
*/
|
*/
|
||||||
__dt_setup_arch(&__dtb_start);
|
__dt_setup_arch(__dtb_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init device_tree_init(void)
|
void __init device_tree_init(void)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
__iomem void *rt_sysc_membase;
|
__iomem void *rt_sysc_membase;
|
||||||
__iomem void *rt_memc_membase;
|
__iomem void *rt_memc_membase;
|
||||||
|
|
||||||
extern struct boot_param_header __dtb_start;
|
extern char __dtb_start[];
|
||||||
|
|
||||||
__iomem void *plat_of_remap_node(const char *node)
|
__iomem void *plat_of_remap_node(const char *node)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ void __init plat_mem_setup(void)
|
||||||
* Load the builtin devicetree. This causes the chosen node to be
|
* Load the builtin devicetree. This causes the chosen node to be
|
||||||
* parsed resulting in our memory appearing
|
* parsed resulting in our memory appearing
|
||||||
*/
|
*/
|
||||||
__dt_setup_arch(&__dtb_start);
|
__dt_setup_arch(__dtb_start);
|
||||||
|
|
||||||
if (soc_info.mem_size)
|
if (soc_info.mem_size)
|
||||||
add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
|
add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue