diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-07-19 17:58:40 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-07-19 17:58:40 +0000 |
commit | 78b1a6b773aaebdeff6f6b43df98598749e44930 (patch) | |
tree | 1cacb1c7de856ee70af780d86e6c70b9559bb247 /target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch | |
parent | d26e8d9439052ed8f433b6ffb15a5f0c54712121 (diff) | |
download | upstream-78b1a6b773aaebdeff6f6b43df98598749e44930.tar.gz upstream-78b1a6b773aaebdeff6f6b43df98598749e44930.tar.bz2 upstream-78b1a6b773aaebdeff6f6b43df98598749e44930.zip |
ar71xx: add 4.1 support
Signed-off-by: Roman Yeryomin <roman@advem.lv>
SVN-Revision: 46426
Diffstat (limited to 'target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch')
-rw-r--r-- | target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch b/target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch new file mode 100644 index 0000000000..0cf4869ff6 --- /dev/null +++ b/target/linux/ar71xx/patches-4.1/508-MIPS-ath79-prom-image-command-line-hack.patch @@ -0,0 +1,57 @@ +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -32,6 +32,35 @@ static void __init ath79_prom_append_cmd + strlcat(arcs_cmdline, ath79_cmdline_buf, sizeof(arcs_cmdline)); + } + ++#ifdef CONFIG_IMAGE_CMDLINE_HACK ++extern char __image_cmdline[]; ++ ++static int __init ath79_use_image_cmdline(void) ++{ ++ char *p = __image_cmdline; ++ int replace = 0; ++ ++ if (*p == '-') { ++ replace = 1; ++ p++; ++ } ++ ++ if (*p == '\0') ++ return 0; ++ ++ if (replace) { ++ strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } else { ++ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); ++ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } ++ ++ return 1; ++} ++#else ++static inline int ath79_use_image_cmdline(void) { return 0; } ++#endif ++ + static int __init ath79_prom_init_myloader(void) + { + struct myloader_info *mylo; +@@ -60,6 +89,8 @@ static int __init ath79_prom_init_myload + + ath79_prom_append_cmdline("ethaddr", mac_buf); + ++ ath79_use_image_cmdline(); ++ + return 1; + } + +@@ -70,7 +101,8 @@ void __init prom_init(void) + if (ath79_prom_init_myloader()) + return; + +- fw_init_cmdline(); ++ if (!ath79_use_image_cmdline()) ++ fw_init_cmdline(); + + env = fw_getenv("ethaddr"); + if (env) |