1 From 67b7bff0fd364c194e653f69baa623ba2141bd4c Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 4 Aug 2014 18:46:02 +0200
4 Subject: [PATCH 07/53] MIPS: ralink: copy the commandline from the devicetree
6 Signed-off-by: John Crispin <blogic@openwrt.org>
8 arch/mips/ralink/of.c | 2 ++
9 1 file changed, 2 insertions(+)
11 --- a/arch/mips/ralink/of.c
12 +++ b/arch/mips/ralink/of.c
14 * under the terms of the GNU General Public License version 2 as published
15 * by the Free Software Foundation.
17 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
18 + * Copyright (C) 2008-2014 Imre Kaloz <kaloz@openwrt.org>
19 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
20 * Copyright (C) 2013 John Crispin <john@phrozen.org>
22 @@ -66,6 +66,19 @@ static int __init early_init_dt_find_mem
26 +static int chosen_dtb;
28 +static int __init early_init_dt_find_chosen(unsigned long node, const char *uname,
29 + int depth, void *data)
31 + if (depth == 1 && !strcmp(uname, "chosen"))
37 +extern struct boot_param_header __image_dtb;
39 void __init plat_mem_setup(void)
42 @@ -82,7 +95,11 @@ void __init plat_mem_setup(void)
43 else if (__dtb_start != __dtb_end)
44 dtb = (void *)__dtb_start;
46 - __dt_setup_arch(dtb);
47 + __dt_setup_arch(&__image_dtb);
49 + of_scan_flat_dt(early_init_dt_find_chosen, NULL);
51 + strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
53 strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
55 --- a/arch/mips/kernel/head.S
56 +++ b/arch/mips/kernel/head.S
57 @@ -85,6 +85,9 @@ EXPORT(__image_cmdline)
59 #endif /* CONFIG_IMAGE_CMDLINE_HACK */
66 NESTED(kernel_entry, 16, sp) # kernel entry point