diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2015-01-02 16:48:20 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2015-01-02 16:48:20 +0000 |
commit | e0cc65f36d0460282963c0fbd8793eb3af78db78 (patch) | |
tree | 293424b80752d52a8bc94f4fd5f0398dff9d9630 | |
parent | 1b9d0109a82edd9a955e2effb90b9c0eadf13713 (diff) | |
download | upstream-e0cc65f36d0460282963c0fbd8793eb3af78db78.tar.gz upstream-e0cc65f36d0460282963c0fbd8793eb3af78db78.tar.bz2 upstream-e0cc65f36d0460282963c0fbd8793eb3af78db78.zip |
[ramips]: honor the bootloader's bootargs
Only overwrite the bootloader's bootargs if "chosen" exists in the dtb
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43802 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/ramips/patches-3.14/0110-fix_bootargs_handling.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-3.14/0110-fix_bootargs_handling.patch b/target/linux/ramips/patches-3.14/0110-fix_bootargs_handling.patch new file mode 100644 index 0000000000..203d2455d2 --- /dev/null +++ b/target/linux/ramips/patches-3.14/0110-fix_bootargs_handling.patch @@ -0,0 +1,40 @@ +--- a/arch/mips/ralink/of.c ++++ b/arch/mips/ralink/of.c +@@ -3,7 +3,7 @@ + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * +- * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> ++ * Copyright (C) 2008-2014 Imre Kaloz <kaloz@openwrt.org> + * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> + * Copyright (C) 2013 John Crispin <blogic@openwrt.org> + */ +@@ -91,6 +91,17 @@ static int __init early_init_dt_find_mem + return 0; + } + ++static int chosen_dtb; ++ ++static int __init early_init_dt_find_chosen(unsigned long node, const char *uname, ++ int depth, void *data) ++{ ++ if (depth == 1 && !strcmp(uname, "chosen")) ++ chosen_dtb = 1; ++ ++ return 0; ++} ++ + extern struct boot_param_header __image_dtb; + + void __init plat_mem_setup(void) +@@ -103,7 +114,9 @@ void __init plat_mem_setup(void) + */ + __dt_setup_arch(&__image_dtb); + +- strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); ++ of_scan_flat_dt(early_init_dt_find_chosen, NULL); ++ if (chosen_dtb) ++ strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); + + of_scan_flat_dt(early_init_dt_find_memory, NULL); + if (memory_dtb) |