OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | From: Gabor Juhos <juhosg@freemail.hu> |
2 | Date: Sat, 2 Dec 2017 19:15:29 +0100 |
||
3 | Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions |
||
4 | |||
5 | Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) |
||
6 | use "Board=" kernel parameter instead of "board=" to pass the board |
||
7 | name to the kernel. Due to this change the board detection code is |
||
8 | not working on the devices shipped with the new RouterBOOT version. |
||
9 | Because the kernel is unable to identify these boards they become |
||
10 | unusable despite that they are supported by the current code. |
||
11 | |||
12 | Update the prom_init code to convert the 'Board' kernel parameter to |
||
13 | 'board'. After this change, the board detection works also with the |
||
14 | new RouterBOOT versions. |
||
15 | |||
16 | Signed-off-by: Gabor Juhos <juhosg@freemail.hu> |
||
17 | --- |
||
18 | --- a/arch/mips/ath79/prom.c |
||
19 | +++ b/arch/mips/ath79/prom.c |
||
20 | @@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload |
||
21 | void __init prom_init(void) |
||
22 | { |
||
23 | const char *env; |
||
24 | + char *c; |
||
25 | |||
26 | if (ath79_prom_init_myloader()) |
||
27 | return; |
||
28 | @@ -137,6 +138,15 @@ void __init prom_init(void) |
||
29 | } |
||
30 | #endif |
||
31 | |||
32 | + /* |
||
33 | + * RouterBOOT uses "Board" kernel parameter instead of "board" since |
||
34 | + * version 3.41 (or so). Replace the first character of the parameter |
||
35 | + * to keep board detection working. |
||
36 | + */ |
||
37 | + c = strstr(arcs_cmdline, "Board="); |
||
38 | + if (c) |
||
39 | + c[0] = 'b'; |
||
40 | + |
||
41 | if (strstr(arcs_cmdline, "board=750Gr3") || |
||
42 | strstr(arcs_cmdline, "board=750i") || |
||
43 | strstr(arcs_cmdline, "board=750-hb") || |