1 --- a/arch/mips/ralink/of.c
2 +++ b/arch/mips/ralink/of.c
4 * under the terms of the GNU General Public License version 2 as published
5 * by the Free Software Foundation.
7 - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 + * Copyright (C) 2008-2014 Imre Kaloz <kaloz@openwrt.org>
9 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
10 * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
12 @@ -66,6 +66,17 @@ static int __init early_init_dt_find_mem
16 +static int chosen_dtb;
18 +static int __init early_init_dt_find_chosen(unsigned long node, const char *uname,
19 + int depth, void *data)
21 + if (depth == 1 && !strcmp(uname, "chosen"))
27 extern struct boot_param_header __image_dtb;
29 void __init plat_mem_setup(void)
30 @@ -78,7 +89,9 @@ void __init plat_mem_setup(void)
32 __dt_setup_arch(&__image_dtb);
34 - strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
35 + of_scan_flat_dt(early_init_dt_find_chosen, NULL);
37 + strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
39 of_scan_flat_dt(early_init_dt_find_memory, NULL);