Skip to contentSkip to conversation

MIPS: BCM47XX: Add support for Netgear R6200 V1

PATCH Applied Edward Matijević 3 participants 4 messages Jun 17, 2019 – Jul 26, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: BCM47XX: Add support for Netgear R6200 V1

The Netgear R6200 v1 uses a BCM4718A1 SOC and a BCM4352/BCM4360 for 5GHz wireless. This patch adds support for detecting this model board and registers the 3 buttons. I have tested that the device can boot kernels 4.14 and 4.19 under OpenWRT.

There is one issue that the LEDs on the device are controlled by a 74HC164 that uses bit-banging instead of SPI so it isn't accessible to the kernel without adding a workaround. Without any workaround the device on boot will flash all LEDs once then the power LED will remain amber as all other LEDs stay off.

I placed my change in board.c in that location because in OpenWRT it would be above the R6300 V1 in one of their patches.

---
 arch/mips/bcm47xx/board.c                          | 1  + arch/mips/bcm47xx/buttons.c                        | 10 ++++++++++ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1  +

 3 files changed, 12 insertions(+)
arch/mips/bcm47xx/board.c +0 -0
@@ -163,6 +163,7 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {

     {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"}, +    {{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},

arch/mips/bcm47xx/buttons.c +0 -0
@@ -384,6 +384,13 @@ bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {


 /* Netgear */

+static const struct gpio_keys_button +bcm47xx_buttons_netgear_r6200_v1[] __initconst = {
+    BCM47XX_GPIO_KEY(2, KEY_RFKILL),
+    BCM47XX_GPIO_KEY(3, KEY_RESTART),
+    BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+};
+
 static const struct gpio_keys_button bcm47xx_buttons_netgear_wndr3400v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART),
@@ -664,6 +671,9 @@ int __init bcm47xx_buttons_register(void) err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3); break;

+    case BCM47XX_BOARD_NETGEAR_R6200_V1:
+        err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); +        break;
     case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
         err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); break;

arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +0 -0
@@ -98,6 +98,7 @@ enum bcm47xx_board {

     BCM47XX_BOARD_MOTOROLA_WR850GP,
     BCM47XX_BOARD_MOTOROLA_WR850GV2V3,

+    BCM47XX_BOARD_NETGEAR_R6200_V1,
     BCM47XX_BOARD_NETGEAR_WGR614V8,
     BCM47XX_BOARD_NETGEAR_WGR614V9,
     BCM47XX_BOARD_NETGEAR_WGR614_V10,

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Edward Matijević

The Netgear R6200 v1 uses a BCM4718A1 SOC and a BCM4352/BCM4360 for 5GHz wireless. This patch adds support for detecting this model board and registers the 3 buttons. I have tested that the device can boot kernels 4.14 and 4.19 under OpenWRT.

There is one issue that the LEDs on the device are controlled by a 74HC164 that uses bit-banging instead of SPI so it isn't accessible to the kernel without adding a workaround. Without any workaround the device on boot will flash all LEDs once then the power LED will remain amber as all other LEDs stay off.

I placed my change in board.c in that location because in OpenWRT it would be above the R6300 V1 in one of their patches.

arch/mips/bcm47xx/board.c struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { · line 166

Quoted 13 lines

---
 arch/mips/bcm47xx/board.c                          | 1  + arch/mips/bcm47xx/buttons.c                        | 10 ++++++++++ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1  +

 3 files changed, 12 insertions(+)
arch/mips/bcm47xx/board.c +1 -0
@@ -163,6 +163,7 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
      {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
+    {{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"},

Why not order this alphabetically?

Quoted 40 lines
arch/mips/bcm47xx/board.c +0 -0
      {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
arch/mips/bcm47xx/buttons.c +0 -0
@@ -384,6 +384,13 @@ bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {


 /* Netgear */

arch/mips/bcm47xx/buttons.c +7 -0
+static const struct gpio_keys_button
+bcm47xx_buttons_netgear_r6200_v1[] __initconst = {
+    BCM47XX_GPIO_KEY(2, KEY_RFKILL),
+    BCM47XX_GPIO_KEY(3, KEY_RESTART),
+    BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+};
+

 static const struct gpio_keys_button bcm47xx_buttons_netgear_wndr3400v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART),

arch/mips/bcm47xx/buttons.c +0 -0
@@ -664,6 +671,9 @@ int __init bcm47xx_buttons_register(void)
          err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
          break;


+    case BCM47XX_BOARD_NETGEAR_R6200_V1:
+        err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); +        break;
     case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
         err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); break;

arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +0 -0
@@ -98,6 +98,7 @@ enum bcm47xx_board {
      BCM47XX_BOARD_MOTOROLA_WR850GP,
      BCM47XX_BOARD_MOTOROLA_WR850GV2V3,


+    BCM47XX_BOARD_NETGEAR_R6200_V1,
     BCM47XX_BOARD_NETGEAR_WGR614V8,
     BCM47XX_BOARD_NETGEAR_WGR614V9,
     BCM47XX_BOARD_NETGEAR_WGR614_V10,

#2 lore raw
In reply to Edward Matijević

Hi Edward,

Quoted 7 lines · Edward Matijević

The Netgear R6200 v1 uses a BCM4718A1 SOC and a BCM4352/BCM4360 for 5GHz wireless. This patch adds support for detecting this model board and registers the 3 buttons. I have tested that the device can boot kernels 4.14 and 4.19 under OpenWRT.

There is one issue that the LEDs on the device are controlled by a 74HC164 that uses bit-banging instead of SPI so it isn't accessible to the kernel without adding a workaround. Without any workaround the device on boot will flash all LEDs once then the power LED will remain amber as all other LEDs stay off.

Quoted 8 lines

I placed my change in board.c in that location because in OpenWRT it would be above the R6300 V1 in one of their patches.

---
 arch/mips/bcm47xx/board.c                          | 1  + arch/mips/bcm47xx/buttons.c                        | 10 ++++++++++ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1  +

 3 files changed, 12 insertions(+)

Thanks for the patch - unfortunately it doesn't apply cleanly - I suspect your email client messed it up somehow:

  $ wget -O - https://patchwork.kernel.org/patch/10997983/mbox/ | git am
  --2019-06-19 16:06:54--  https://patchwork.kernel.org/patch/10997983/mbox/
  Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
  Resolving patchwork.kernel.org (patchwork.kernel.org)... 198.145.29.83
  Connecting to patchwork.kernel.org (patchwork.kernel.org)|198.145.29.83|:443... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 7834 (7.7K) [text/plain]
  Saving to: ‘STDOUT’

- 100%[==============================================================>] 7.65K --.-KB/s in 0s

  2019-06-19 16:06:54 (156 MB/s) - written to stdout [7834/7834]

Applying: MIPS: BCM47XX: Add support for Netgear R6200 V1
error: corrupt patch at line 10
Patch failed at 0001 MIPS: BCM47XX: Add support for Netgear R6200 V1
hint: Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

I do see that in the below tabs have been replaced with spaces, not sure what else may have been munged.

Could you take a look at your email setup & resubmit?

Thanks,
Paul

Quoted 47 lines
arch/mips/bcm47xx/board.c +1 -0
@@ -163,6 +163,7 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
      {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
+    {{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
      {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
arch/mips/bcm47xx/buttons.c +0 -0
@@ -384,6 +384,13 @@ bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {


 /* Netgear */

arch/mips/bcm47xx/buttons.c +7 -0
+static const struct gpio_keys_button
+bcm47xx_buttons_netgear_r6200_v1[] __initconst = {
+    BCM47XX_GPIO_KEY(2, KEY_RFKILL),
+    BCM47XX_GPIO_KEY(3, KEY_RESTART),
+    BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+};
+

 static const struct gpio_keys_button bcm47xx_buttons_netgear_wndr3400v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART),

arch/mips/bcm47xx/buttons.c +0 -0
@@ -664,6 +671,9 @@ int __init bcm47xx_buttons_register(void)
          err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
          break;


+    case BCM47XX_BOARD_NETGEAR_R6200_V1:
+        err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); +        break;
     case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
         err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); break;

arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +0 -0
@@ -98,6 +98,7 @@ enum bcm47xx_board {
      BCM47XX_BOARD_MOTOROLA_WR850GP,
      BCM47XX_BOARD_MOTOROLA_WR850GV2V3,


+    BCM47XX_BOARD_NETGEAR_R6200_V1,
     BCM47XX_BOARD_NETGEAR_WGR614V8,
     BCM47XX_BOARD_NETGEAR_WGR614V9,
     BCM47XX_BOARD_NETGEAR_WGR614_V10,

Applied
#3 lore raw
In reply to Edward Matijević

Hello,

Quoted 11 lines · Edward Matijević

The Netgear R6200 v1 uses a BCM4718A1 SOC and a BCM4352/BCM4360 for 5GHz wireless. This patch adds support for detecting this model board and registers the 3 buttons. I have tested that the device can boot kernels 4.14 and 4.19 under OpenWRT.

There is one issue that the LEDs on the device are controlled by a 74HC164 that uses bit-banging instead of SPI so it isn't accessible to the kernel without adding a workaround. Without any workaround the device on boot will flash all LEDs once then the power LED will remain amber as all other LEDs stay off.

I placed my change in board.c in that location because in OpenWRT it would be above the R6300 V1 in one of their patches.

Applied to mips-next.

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]