diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2014-07-15 13:03:34 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-07-29 23:26:37 -0400 |
commit | 4972a74b888c6b52ca41fae6076786dbbeb746d5 (patch) | |
tree | 6240aa1e50e06cc007ac258420127b396e13d08b | |
parent | 64aa90f26c06e1cb2aacfb98a7d0eccfbd6c1a91 (diff) |
of: Split early_init_dt_scan into two parts
Currently, early_init_dt_scan validates the header, sets the
boot params, and scans for chosen/memory all in one function.
Split this up into two separate functions (validation/setting
boot params in one, scanning in another) to allow for
additional setup between boot params and scanning the memory.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Tested-by: Andreas Färber <afaerber@suse.de>
[glikely: s/early_init_dt_scan_all/early_init_dt_scan_nodes/]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r-- | drivers/of/fdt.c | 18 | ||||
-rw-r--r-- | include/linux/of_fdt.h | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index b777d8f46bd5..ecc7a02d868e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -937,7 +937,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, | |||
937 | } | 937 | } |
938 | #endif | 938 | #endif |
939 | 939 | ||
940 | bool __init early_init_dt_scan(void *params) | 940 | bool __init early_init_dt_verify(void *params) |
941 | { | 941 | { |
942 | if (!params) | 942 | if (!params) |
943 | return false; | 943 | return false; |
@@ -951,6 +951,12 @@ bool __init early_init_dt_scan(void *params) | |||
951 | return false; | 951 | return false; |
952 | } | 952 | } |
953 | 953 | ||
954 | return true; | ||
955 | } | ||
956 | |||
957 | |||
958 | void __init early_init_dt_scan_nodes(void) | ||
959 | { | ||
954 | /* Retrieve various information from the /chosen node */ | 960 | /* Retrieve various information from the /chosen node */ |
955 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); | 961 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); |
956 | 962 | ||
@@ -959,7 +965,17 @@ bool __init early_init_dt_scan(void *params) | |||
959 | 965 | ||
960 | /* Setup memory, calling early_init_dt_add_memory_arch */ | 966 | /* Setup memory, calling early_init_dt_add_memory_arch */ |
961 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | 967 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); |
968 | } | ||
969 | |||
970 | bool __init early_init_dt_scan(void *params) | ||
971 | { | ||
972 | bool status; | ||
973 | |||
974 | status = early_init_dt_verify(params); | ||
975 | if (!status) | ||
976 | return false; | ||
962 | 977 | ||
978 | early_init_dt_scan_nodes(); | ||
963 | return true; | 979 | return true; |
964 | } | 980 | } |
965 | 981 | ||
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 05117899fcb4..ebb2449082fb 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -73,6 +73,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, | |||
73 | int depth, void *data); | 73 | int depth, void *data); |
74 | 74 | ||
75 | extern bool early_init_dt_scan(void *params); | 75 | extern bool early_init_dt_scan(void *params); |
76 | extern bool early_init_dt_verify(void *params); | ||
77 | extern void early_init_dt_scan_nodes(void); | ||
76 | 78 | ||
77 | extern const char *of_flat_dt_get_machine_name(void); | 79 | extern const char *of_flat_dt_get_machine_name(void); |
78 | extern const void *of_flat_dt_match_machine(const void *default_match, | 80 | extern const void *of_flat_dt_match_machine(const void *default_match, |