diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-04-09 10:48:04 (GMT) |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-05-07 08:13:57 (GMT) |
commit | 9593a933d538a726b341cb06b3362d74931aa281 (patch) | |
tree | 1a4addd683e8e7a7f88eefa4c2a49382a23192ab | |
parent | 6971881f2ae0e0208375dc40e1a9a4ce56f7c9d6 (diff) | |
download | linux-fsl-qoriq-9593a933d538a726b341cb06b3362d74931aa281.tar.xz |
ARC: [cmdline] Don't overwrite u-boot provided bootargs
The existing code was wrong on several counts:
* uboot provided bootargs were copied into @boot_command_line, only to
be over-written by setup_machine_fdt(), effectively lost
* @cmdline_p returned by setup_arch() to start_kernel() didn't include
the DT /bootargs
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/kernel/setup.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 1876315..b2b3731 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -318,18 +318,20 @@ void __cpuinit setup_processor(void) void __init setup_arch(char **cmdline_p) { + /* This also populates @boot_command_line from /bootargs */ + machine_desc = setup_machine_fdt(__dtb_start); + if (!machine_desc) + panic("Embedded DT invalid\n"); + + /* Append any u-boot provided cmdline */ #ifdef CONFIG_CMDLINE_UBOOT - /* Make sure that a whitespace is inserted before */ - strlcat(command_line, " ", sizeof(command_line)); + /* Add a whitespace seperator between the 2 cmdlines */ + strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); + strlcat(boot_command_line, command_line, COMMAND_LINE_SIZE); #endif /* Save unparsed command line copy for /proc/cmdline */ - strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); - *cmdline_p = command_line; - - machine_desc = setup_machine_fdt(__dtb_start); - if (!machine_desc) - panic("Embedded DT invalid\n"); + *cmdline_p = boot_command_line; /* To force early parsing of things like mem=xxx */ parse_early_param(); |