diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-01-16 04:34:24 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2014-01-16 08:23:16 -0500 |
commit | e57d339a6264355df8c98948f05a46ff2bc5d504 (patch) | |
tree | b176d8540cad72142941dcdf96ee60644088db50 /arch/arc | |
parent | 59ed9413533897823bcdb4c79fd2904718e25b0a (diff) |
ARC: [cmdline] support External Device Trees from u-boot
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/kernel/setup.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index ffb60b4f6f86..119dddb752b2 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -323,22 +323,31 @@ static inline int is_kernel(unsigned long addr) | |||
323 | 323 | ||
324 | void __init setup_arch(char **cmdline_p) | 324 | void __init setup_arch(char **cmdline_p) |
325 | { | 325 | { |
326 | /* make sure that uboot passed pointer to cmdline/dtb is valid */ | ||
327 | if (uboot_tag && is_kernel((unsigned long)uboot_arg)) | ||
328 | panic("Invalid uboot arg\n"); | ||
329 | |||
330 | /* See if u-boot passed an external Device Tree blob */ | ||
331 | machine_desc = setup_machine_fdt(uboot_arg); /* uboot_tag == 2 */ | ||
332 | if (!machine_desc) { | ||
333 | /* No, so try the embedded one */ | ||
326 | machine_desc = setup_machine_fdt(__dtb_start); | 334 | machine_desc = setup_machine_fdt(__dtb_start); |
327 | if (!machine_desc) | 335 | if (!machine_desc) |
328 | panic("Embedded DT invalid\n"); | 336 | panic("Embedded DT invalid\n"); |
329 | 337 | ||
330 | /* | 338 | /* |
331 | * Append uboot cmdline to embedded DT cmdline. | 339 | * If we are here, it is established that @uboot_arg didn't |
340 | * point to DT blob. Instead if u-boot says it is cmdline, | ||
341 | * Appent to embedded DT cmdline. | ||
332 | * setup_machine_fdt() would have populated @boot_command_line | 342 | * setup_machine_fdt() would have populated @boot_command_line |
333 | */ | 343 | */ |
334 | if (uboot_tag == 1) { | 344 | if (uboot_tag == 1) { |
335 | BUG_ON(is_kernel(unsigned long)uboot_arg); | ||
336 | |||
337 | /* Ensure a whitespace between the 2 cmdlines */ | 345 | /* Ensure a whitespace between the 2 cmdlines */ |
338 | strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); | 346 | strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); |
339 | strlcat(boot_command_line, uboot_arg, | 347 | strlcat(boot_command_line, uboot_arg, |
340 | COMMAND_LINE_SIZE); | 348 | COMMAND_LINE_SIZE); |
341 | } | 349 | } |
350 | } | ||
342 | 351 | ||
343 | /* Save unparsed command line copy for /proc/cmdline */ | 352 | /* Save unparsed command line copy for /proc/cmdline */ |
344 | *cmdline_p = boot_command_line; | 353 | *cmdline_p = boot_command_line; |