1
0

702-MIPS-ath79-fixup-routerboot-board-parameter.patch 1.4 KB

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