aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-08-28 11:05:10 -0400
committerRob Herring <rob.herring@calxeda.com>2013-10-09 12:38:15 -0400
commit7745fc1fec6ec9556e4cc36c21b0e02589078902 (patch)
tree9aaf7c317070ada0bc8b764acdad94b97e81816b /arch/xtensa/kernel
parente94353890aaae1ab81dcacb3cafb449432224d3f (diff)
xtensa: use early_init_dt_scan
Convert xtensa to use new early_init_dt_scan function. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Cc: Chris Zankel <chris@zankel.net> Cc: linux-xtensa@linux-xtensa.org
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/setup.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index fc31ec1e977d..65974a8f41a4 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -219,9 +219,13 @@ static int __init parse_bootparam(const bp_tag_t* tag)
219} 219}
220 220
221#ifdef CONFIG_OF 221#ifdef CONFIG_OF
222bool __initdata dt_memory_scan = false;
222 223
223void __init early_init_dt_add_memory_arch(u64 base, u64 size) 224void __init early_init_dt_add_memory_arch(u64 base, u64 size)
224{ 225{
226 if (!dt_memory_scan)
227 return;
228
225 size &= PAGE_MASK; 229 size &= PAGE_MASK;
226 add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); 230 add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size);
227} 231}
@@ -233,20 +237,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
233 237
234void __init early_init_devtree(void *params) 238void __init early_init_devtree(void *params)
235{ 239{
236 /* Setup flat device-tree pointer */ 240 if (sysmem.nr_banks == 0)
237 initial_boot_params = params; 241 dt_memory_scan = true;
238 242
239 /* Retrieve various informations from the /chosen node of the 243 early_init_dt_scan(params);
240 * device-tree, including the platform type, initrd location and
241 * size, TCE reserve, and more ...
242 */
243 if (!command_line[0])
244 of_scan_flat_dt(early_init_dt_scan_chosen, command_line);
245 244
246 /* Scan memory nodes and rebuild MEMBLOCKs */ 245 if (!command_line[0])
247 of_scan_flat_dt(early_init_dt_scan_root, NULL); 246 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
248 if (sysmem.nr_banks == 0)
249 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
250} 247}
251 248
252static int __init xtensa_device_probe(void) 249static int __init xtensa_device_probe(void)