mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-23 14:06:06 +00:00
of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
This patch refactors the early init parsing of the chosen node so that architectures aren't forced to provide an empty implementation of early_init_dt_scan_chosen_arch. Instead, if an architecture wants to do something different, it can either use a wrapper function around early_init_dt_scan_chosen(), or it can replace it altogether. This patch was written in preparation to adding device tree support to both x86 ad MIPS. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: David Daney <ddaney@caviumnetworks.com>
This commit is contained in:
parent
7096d04221
commit
32c97689c4
@ -42,11 +42,6 @@
|
|||||||
#include <asm/sections.h>
|
#include <asm/sections.h>
|
||||||
#include <asm/pci-bridge.h>
|
#include <asm/pci-bridge.h>
|
||||||
|
|
||||||
void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
|
||||||
{
|
|
||||||
/* No Microblaze specific code here */
|
|
||||||
}
|
|
||||||
|
|
||||||
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||||
{
|
{
|
||||||
memblock_add(base, size);
|
memblock_add(base, size);
|
||||||
|
@ -363,10 +363,15 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname,
|
||||||
|
int depth, void *data)
|
||||||
{
|
{
|
||||||
unsigned long *lprop;
|
unsigned long *lprop;
|
||||||
|
|
||||||
|
/* Use common scan routine to determine if this is the chosen node */
|
||||||
|
if (early_init_dt_scan_chosen(node, uname, depth, data) == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
/* check if iommu is forced on or off */
|
/* check if iommu is forced on or off */
|
||||||
if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
|
if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
|
||||||
@ -398,6 +403,9 @@ void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
|||||||
if (lprop)
|
if (lprop)
|
||||||
crashk_res.end = crashk_res.start + *lprop - 1;
|
crashk_res.end = crashk_res.start + *lprop - 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* break now */
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_PSERIES
|
#ifdef CONFIG_PPC_PSERIES
|
||||||
@ -679,7 +687,7 @@ void __init early_init_devtree(void *params)
|
|||||||
* device-tree, including the platform type, initrd location and
|
* device-tree, including the platform type, initrd location and
|
||||||
* size, TCE reserve, and more ...
|
* size, TCE reserve, and more ...
|
||||||
*/
|
*/
|
||||||
of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
|
of_scan_flat_dt(early_init_dt_scan_chosen_ppc, NULL);
|
||||||
|
|
||||||
/* Scan memory nodes and rebuild MEMBLOCKs */
|
/* Scan memory nodes and rebuild MEMBLOCKs */
|
||||||
memblock_init();
|
memblock_init();
|
||||||
|
@ -533,8 +533,6 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
|||||||
strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
|
strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
|
||||||
#endif /* CONFIG_CMDLINE */
|
#endif /* CONFIG_CMDLINE */
|
||||||
|
|
||||||
early_init_dt_scan_chosen_arch(node);
|
|
||||||
|
|
||||||
pr_debug("Command line is: %s\n", cmd_line);
|
pr_debug("Command line is: %s\n", cmd_line);
|
||||||
|
|
||||||
/* break now */
|
/* break now */
|
||||||
|
@ -72,7 +72,7 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
|
|||||||
unsigned long *size);
|
unsigned long *size);
|
||||||
extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
|
extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
|
||||||
extern unsigned long of_get_flat_dt_root(void);
|
extern unsigned long of_get_flat_dt_root(void);
|
||||||
extern void early_init_dt_scan_chosen_arch(unsigned long node);
|
|
||||||
extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
||||||
int depth, void *data);
|
int depth, void *data);
|
||||||
extern void early_init_dt_check_for_initrd(unsigned long node);
|
extern void early_init_dt_check_for_initrd(unsigned long node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user