Commit 7745fc1f authored by Rob Herring's avatar Rob Herring

xtensa: use early_init_dt_scan

Convert xtensa to use new early_init_dt_scan function.
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: linux-xtensa@linux-xtensa.org
parent e9435389
...@@ -219,9 +219,13 @@ static int __init parse_bootparam(const bp_tag_t* tag) ...@@ -219,9 +219,13 @@ static int __init parse_bootparam(const bp_tag_t* tag)
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
bool __initdata dt_memory_scan = false;
void __init early_init_dt_add_memory_arch(u64 base, u64 size) void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{ {
if (!dt_memory_scan)
return;
size &= PAGE_MASK; size &= PAGE_MASK;
add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size);
} }
...@@ -233,20 +237,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) ...@@ -233,20 +237,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
void __init early_init_devtree(void *params) void __init early_init_devtree(void *params)
{ {
/* Setup flat device-tree pointer */ if (sysmem.nr_banks == 0)
initial_boot_params = params; dt_memory_scan = true;
/* Retrieve various informations from the /chosen node of the early_init_dt_scan(params);
* device-tree, including the platform type, initrd location and
* size, TCE reserve, and more ...
*/
if (!command_line[0])
of_scan_flat_dt(early_init_dt_scan_chosen, command_line);
/* Scan memory nodes and rebuild MEMBLOCKs */ if (!command_line[0])
of_scan_flat_dt(early_init_dt_scan_root, NULL); strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
if (sysmem.nr_banks == 0)
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
} }
static int __init xtensa_device_probe(void) static int __init xtensa_device_probe(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment