aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-08-26 11:13:01 -0400
committerRob Herring <rob.herring@calxeda.com>2013-10-09 12:38:10 -0400
commit56dc1f474add364b07254ad9690f4e244ca65ef4 (patch)
treed602a31dc492fa307e859ac7d30a86eb977f2aa8 /arch/arm
parentad81fcb53033be98ab29c6cfb6ef0249a8e2ffaa (diff)
arm: use early_init_dt_scan
Convert arm to use new early_init_dt_scan function. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: linux-arm-kernel@lists.infradead.org
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/devtree.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index f35906b3d8c9..e7ce175b99e3 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -183,7 +183,6 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
183 */ 183 */
184const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) 184const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
185{ 185{
186 struct boot_param_header *devtree;
187 const struct machine_desc *mdesc, *mdesc_best = NULL; 186 const struct machine_desc *mdesc, *mdesc_best = NULL;
188 unsigned int score, mdesc_score = ~1; 187 unsigned int score, mdesc_score = ~1;
189 unsigned long dt_root; 188 unsigned long dt_root;
@@ -196,17 +195,11 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
196 mdesc_best = &__mach_desc_GENERIC_DT; 195 mdesc_best = &__mach_desc_GENERIC_DT;
197#endif 196#endif
198 197
199 if (!dt_phys) 198 if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys)))
200 return NULL; 199 return NULL;
201 200
202 devtree = phys_to_virt(dt_phys);
203
204 /* check device tree validity */
205 if (be32_to_cpu(devtree->magic) != OF_DT_HEADER)
206 return NULL;
207 201
208 /* Search the mdescs for the 'best' compatible value match */ 202 /* Search the mdescs for the 'best' compatible value match */
209 initial_boot_params = devtree;
210 dt_root = of_get_flat_dt_root(); 203 dt_root = of_get_flat_dt_root();
211 for_each_machine_desc(mdesc) { 204 for_each_machine_desc(mdesc) {
212 score = of_flat_dt_match(dt_root, mdesc->dt_compat); 205 score = of_flat_dt_match(dt_root, mdesc->dt_compat);
@@ -240,13 +233,6 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
240 model = "<unknown>"; 233 model = "<unknown>";
241 pr_info("Machine: %s, model: %s\n", mdesc_best->name, model); 234 pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
242 235
243 /* Retrieve various information from the /chosen node */
244 of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
245 /* Initialize {size,address}-cells info */
246 of_scan_flat_dt(early_init_dt_scan_root, NULL);
247 /* Setup memory, calling early_init_dt_add_memory_arch */
248 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
249
250 /* Change machine number to match the mdesc we're using */ 236 /* Change machine number to match the mdesc we're using */
251 __machine_arch_type = mdesc_best->nr; 237 __machine_arch_type = mdesc_best->nr;
252 238