aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@freemail.hu>2017-12-08 23:31:55 +0100
committerYousong Zhou <yszhou4tech@gmail.com>2017-12-12 17:05:25 +0800
commite7b48fcfe18f14cf3f4915dc3622599f7a91f9fc (patch)
tree2e795f8298496c51278ff138fe8671530f10b31e
parentb8220883fd8fa209dae71def9b6d2a7656bca8bb (diff)
downloadupstream-e7b48fcfe18f14cf3f4915dc3622599f7a91f9fc.tar.gz
upstream-e7b48fcfe18f14cf3f4915dc3622599f7a91f9fc.tar.bz2
upstream-e7b48fcfe18f14cf3f4915dc3622599f7a91f9fc.zip
ar71xx: fix board detection with newer RouterBOOT versions
Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) use "Board=" kernel parameter instead of "board=" to pass the board name to the kernel. Due to this change the board detection code is not working on the devices shipped with the new RouterBOOT version. Because the kernel is unable to identify these boards they become unusable despite that they are supported by the current code. Update the prom_init code to convert the 'Board' kernel parameter to 'board'. After this change, the board detection works also with the new RouterBOOT versions. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
-rw-r--r--target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch43
-rw-r--r--target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch43
2 files changed, 86 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch
new file mode 100644
index 0000000000..b8715bba9e
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch
@@ -0,0 +1,43 @@
+From: Gabor Juhos <juhosg@freemail.hu>
+Date: Sat, 2 Dec 2017 19:15:29 +0100
+Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions
+
+Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD)
+use "Board=" kernel parameter instead of "board=" to pass the board
+name to the kernel. Due to this change the board detection code is
+not working on the devices shipped with the new RouterBOOT version.
+Because the kernel is unable to identify these boards they become
+unusable despite that they are supported by the current code.
+
+Update the prom_init code to convert the 'Board' kernel parameter to
+'board'. After this change, the board detection works also with the
+new RouterBOOT versions.
+
+Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
+---
+--- a/arch/mips/ath79/prom.c
++++ b/arch/mips/ath79/prom.c
+@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload
+ void __init prom_init(void)
+ {
+ const char *env;
++ char *c;
+
+ if (ath79_prom_init_myloader())
+ return;
+@@ -137,6 +138,15 @@ void __init prom_init(void)
+ }
+ #endif
+
++ /*
++ * RouterBOOT uses "Board" kernel parameter instead of "board" since
++ * version 3.41 (or so). Replace the first character of the parameter
++ * to keep board detection working.
++ */
++ c = strstr(arcs_cmdline, "Board=");
++ if (c)
++ c[0] = 'b';
++
+ if (strstr(arcs_cmdline, "board=750Gr3") ||
+ strstr(arcs_cmdline, "board=750i") ||
+ strstr(arcs_cmdline, "board=750-hb") ||
diff --git a/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch
new file mode 100644
index 0000000000..b8715bba9e
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch
@@ -0,0 +1,43 @@
+From: Gabor Juhos <juhosg@freemail.hu>
+Date: Sat, 2 Dec 2017 19:15:29 +0100
+Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions
+
+Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD)
+use "Board=" kernel parameter instead of "board=" to pass the board
+name to the kernel. Due to this change the board detection code is
+not working on the devices shipped with the new RouterBOOT version.
+Because the kernel is unable to identify these boards they become
+unusable despite that they are supported by the current code.
+
+Update the prom_init code to convert the 'Board' kernel parameter to
+'board'. After this change, the board detection works also with the
+new RouterBOOT versions.
+
+Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
+---
+--- a/arch/mips/ath79/prom.c
++++ b/arch/mips/ath79/prom.c
+@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload
+ void __init prom_init(void)
+ {
+ const char *env;
++ char *c;
+
+ if (ath79_prom_init_myloader())
+ return;
+@@ -137,6 +138,15 @@ void __init prom_init(void)
+ }
+ #endif
+
++ /*
++ * RouterBOOT uses "Board" kernel parameter instead of "board" since
++ * version 3.41 (or so). Replace the first character of the parameter
++ * to keep board detection working.
++ */
++ c = strstr(arcs_cmdline, "Board=");
++ if (c)
++ c[0] = 'b';
++
+ if (strstr(arcs_cmdline, "board=750Gr3") ||
+ strstr(arcs_cmdline, "board=750i") ||
+ strstr(arcs_cmdline, "board=750-hb") ||