Merge branch 'master' of https://github.com/DifuseHQ/difos
This commit is contained in:
commit
2bda400eb7
21 changed files with 535 additions and 39 deletions
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
||||||
PKG_MIRROR_HASH:=dbb3d721eb606606c2fc0875067449e5c882d22affaa8dc70367daff7c198152
|
PKG_MIRROR_HASH:=4ec370a1cdc9fa69131f1403b064d2e05d54ee865411917410d7540454265319
|
||||||
PKG_SOURCE_DATE:=2023-02-15
|
PKG_SOURCE_DATE:=2023-02-28
|
||||||
PKG_SOURCE_VERSION:=12155d3881b9bdd44b8682970638dbfd9f55e2cb
|
PKG_SOURCE_VERSION:=bfe882d5ff4eeebb8f57c8a0f9b9e767a57870d8
|
||||||
CMAKE_INSTALL:=1
|
CMAKE_INSTALL:=1
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
|
@ -15,7 +15,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
|
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -289,6 +289,12 @@ bcm47xx_buttons_linksys_wrt320n_v1[] __i
|
@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -28,9 +28,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
@@ -644,6 +650,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
|
||||||
break;
|
break;
|
||||||
+ case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
+ case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
||||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
|
@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
|
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
|
@@ -283,6 +283,12 @@ bcm47xx_buttons_linksys_wrt310n_v2[] __i
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -41,9 +41,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
||||||
break;
|
break;
|
||||||
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
||||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
|
@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_asus_rtn12[] __initconst = {
|
bcm47xx_buttons_asus_rtn12[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
|
||||||
BCM47XX_GPIO_KEY(1, KEY_RESTART),
|
BCM47XX_GPIO_KEY(1, KEY_RESTART),
|
||||||
@@ -502,6 +508,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -490,6 +496,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (board) {
|
switch (board) {
|
||||||
|
@ -55,7 +55,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_leds_asus_rtn12[] __initconst = {
|
bcm47xx_leds_asus_rtn12[] __initconst = {
|
||||||
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
||||||
BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
@@ -571,6 +579,9 @@ void __init bcm47xx_leds_register(void)
|
@@ -563,6 +571,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
enum bcm47xx_board board = bcm47xx_board_get();
|
enum bcm47xx_board board = bcm47xx_board_get();
|
||||||
|
|
||||||
switch (board) {
|
switch (board) {
|
|
@ -26,7 +26,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
|
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -398,6 +398,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
|
@@ -410,6 +410,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
||||||
@@ -683,6 +688,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -701,6 +706,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_R6200_V1:
|
case BCM47XX_BOARD_NETGEAR_R6200_V1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
|
||||||
break;
|
break;
|
|
@ -27,7 +27,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
|
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -403,6 +403,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
|
@@ -415,6 +415,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -40,7 +40,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
||||||
@@ -691,6 +697,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -709,6 +715,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_R6300_V1:
|
case BCM47XX_BOARD_NETGEAR_R6300_V1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
|
||||||
break;
|
break;
|
|
@ -36,7 +36,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
|
{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -448,6 +448,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
|
@@ -460,6 +460,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -50,7 +50,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
|
bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
};
|
};
|
||||||
@@ -718,6 +725,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -736,6 +743,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
|
||||||
break;
|
break;
|
||||||
|
@ -62,7 +62,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
break;
|
break;
|
||||||
--- a/arch/mips/bcm47xx/leds.c
|
--- a/arch/mips/bcm47xx/leds.c
|
||||||
+++ b/arch/mips/bcm47xx/leds.c
|
+++ b/arch/mips/bcm47xx/leds.c
|
||||||
@@ -520,6 +520,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
|
@@ -528,6 +528,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_led
|
static const struct gpio_led
|
||||||
|
@ -77,7 +77,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
|
bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
|
||||||
BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
||||||
BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
|
BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
@@ -780,6 +788,9 @@ void __init bcm47xx_leds_register(void)
|
@@ -791,6 +799,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
||||||
bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
|
bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
|
||||||
break;
|
break;
|
|
@ -0,0 +1,65 @@
|
||||||
|
From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 8 Feb 2023 08:03:01 +0100
|
||||||
|
Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325
|
||||||
|
switch, on-SoC 802.11n radio.
|
||||||
|
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||||
|
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
|
---
|
||||||
|
arch/mips/bcm47xx/board.c | 1 +
|
||||||
|
arch/mips/bcm47xx/buttons.c | 9 +++++++++
|
||||||
|
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||||
|
3 files changed, 11 insertions(+)
|
||||||
|
|
||||||
|
--- a/arch/mips/bcm47xx/board.c
|
||||||
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
|
@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"},
|
||||||
|
+ {{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"},
|
||||||
|
/* like WRT610N v2.0 */
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"},
|
||||||
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
|
@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct gpio_keys_button
|
||||||
|
+bcm47xx_buttons_linksys_e2500v3[] __initconst = {
|
||||||
|
+ BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
|
||||||
|
+ BCM47XX_GPIO_KEY(10, KEY_RESTART),
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const struct gpio_keys_button
|
||||||
|
bcm47xx_buttons_linksys_e3000v1[] __initconst = {
|
||||||
|
BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
|
||||||
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
|
@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
|
case BCM47XX_BOARD_LINKSYS_E2000V1:
|
||||||
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
|
||||||
|
break;
|
||||||
|
+ case BCM47XX_BOARD_LINKSYS_E2500V3:
|
||||||
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3);
|
||||||
|
+ break;
|
||||||
|
case BCM47XX_BOARD_LINKSYS_E3000V1:
|
||||||
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
|
||||||
|
break;
|
||||||
|
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
@@ -61,6 +61,7 @@ enum bcm47xx_board {
|
||||||
|
BCM47XX_BOARD_LINKSYS_E1000V21,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E1200V2,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E2000V1,
|
||||||
|
+ BCM47XX_BOARD_LINKSYS_E2500V3,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E3000V1,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E3200V1,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E4200V1,
|
|
@ -0,0 +1,46 @@
|
||||||
|
From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 8 Feb 2023 10:16:37 +0100
|
||||||
|
Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
|
||||||
|
incorrectly unified. Chip package values are not unique and cannot be
|
||||||
|
checked independently. They are meaningful only in a context of a given
|
||||||
|
chip.
|
||||||
|
|
||||||
|
Packages BCM5358 and BCM47188 share the same value but then belong to
|
||||||
|
different chips. Code unification resulted in treating BCM5358 as
|
||||||
|
BCM47188 and broke its initialization.
|
||||||
|
|
||||||
|
Link: https://github.com/openwrt/openwrt/issues/8278
|
||||||
|
Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
|
||||||
|
Cc: Jon Mason <jdmason@kudzu.us>
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||||
|
Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5@gmail.com
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||||
|
@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
|
||||||
|
- if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
|
||||||
|
- ci->pkg == BCMA_PKG_ID_BCM47186) {
|
||||||
|
+ if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
|
||||||
|
+ (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
|
||||||
|
}
|
||||||
|
- if (ci->pkg == BCMA_PKG_ID_BCM5358)
|
||||||
|
+ if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
|
||||||
|
break;
|
||||||
|
case BCMA_CHIP_ID_BCM53573:
|
|
@ -0,0 +1,61 @@
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Mon, 27 Feb 2023 07:44:38 +0100
|
||||||
|
Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
It's a BCM5358 based home router. One of very few bcm47xx devices with
|
||||||
|
cellular modems (here: LTE).
|
||||||
|
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
---
|
||||||
|
arch/mips/bcm47xx/board.c | 1 +
|
||||||
|
arch/mips/bcm47xx/leds.c | 8 ++++++++
|
||||||
|
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||||
|
3 files changed, 10 insertions(+)
|
||||||
|
|
||||||
|
--- a/arch/mips/bcm47xx/board.c
|
||||||
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
|
@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
|
||||||
|
/* boardtype, boardnum, boardrev */
|
||||||
|
static const
|
||||||
|
struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
|
||||||
|
+ {{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"},
|
||||||
|
{{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"},
|
||||||
|
{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
|
||||||
|
{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
|
||||||
|
--- a/arch/mips/bcm47xx/leds.c
|
||||||
|
+++ b/arch/mips/bcm47xx/leds.c
|
||||||
|
@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst
|
||||||
|
/* Huawei */
|
||||||
|
|
||||||
|
static const struct gpio_led
|
||||||
|
+bcm47xx_leds_huawei_b593u_12[] __initconst = {
|
||||||
|
+ BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const struct gpio_led
|
||||||
|
bcm47xx_leds_huawei_e970[] __initconst = {
|
||||||
|
BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
|
};
|
||||||
|
@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
|
bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case BCM47XX_BOARD_HUAWEI_B593U_12:
|
||||||
|
+ bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12);
|
||||||
|
+ break;
|
||||||
|
case BCM47XX_BOARD_HUAWEI_E970:
|
||||||
|
bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
|
||||||
|
break;
|
||||||
|
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
@@ -53,6 +53,7 @@ enum bcm47xx_board {
|
||||||
|
BCM47XX_BOARD_DLINK_DIR130,
|
||||||
|
BCM47XX_BOARD_DLINK_DIR330,
|
||||||
|
|
||||||
|
+ BCM47XX_BOARD_HUAWEI_B593U_12,
|
||||||
|
BCM47XX_BOARD_HUAWEI_E970,
|
||||||
|
|
||||||
|
BCM47XX_BOARD_LINKSYS_E900V1,
|
|
@ -0,0 +1,76 @@
|
||||||
|
From 327dabbd0111910a7d174b0b812d608d6b67bead Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Mon, 8 Aug 2022 23:05:25 +0200
|
||||||
|
Subject: [PATCH] bgmac: fix *initial* chip reset to support BCM5358
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
While bringing hardware up we should perform a full reset including the
|
||||||
|
switch bit (BGMAC_BCMA_IOCTL_SW_RESET aka SICF_SWRST). It's what
|
||||||
|
specification says and what reference driver does.
|
||||||
|
|
||||||
|
This seems to be critical for the BCM5358. Without this hardware doesn't
|
||||||
|
get initialized properly and doesn't seem to transmit or receive any
|
||||||
|
packets.
|
||||||
|
|
||||||
|
Originally bgmac was calling bgmac_chip_reset() before setting
|
||||||
|
"has_robosw" property which resulted in expected behaviour. That has
|
||||||
|
changed as a side effect of adding platform device support which
|
||||||
|
regressed BCM5358 support.
|
||||||
|
|
||||||
|
Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
|
||||||
|
Cc: Jon Mason <jdmason@kudzu.us>
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
---
|
||||||
|
drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
|
||||||
|
drivers/net/ethernet/broadcom/bgmac.h | 2 ++
|
||||||
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac.c
|
||||||
|
@@ -891,13 +891,13 @@ static void bgmac_chip_reset_idm_config(
|
||||||
|
|
||||||
|
if (iost & BGMAC_BCMA_IOST_ATTACHED) {
|
||||||
|
flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
|
||||||
|
- if (!bgmac->has_robosw)
|
||||||
|
+ if (bgmac->in_init || !bgmac->has_robosw)
|
||||||
|
flags |= BGMAC_BCMA_IOCTL_SW_RESET;
|
||||||
|
}
|
||||||
|
bgmac_clk_enable(bgmac, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (iost & BGMAC_BCMA_IOST_ATTACHED && !bgmac->has_robosw)
|
||||||
|
+ if (iost & BGMAC_BCMA_IOST_ATTACHED && (bgmac->in_init || !bgmac->has_robosw))
|
||||||
|
bgmac_idm_write(bgmac, BCMA_IOCTL,
|
||||||
|
bgmac_idm_read(bgmac, BCMA_IOCTL) &
|
||||||
|
~BGMAC_BCMA_IOCTL_SW_RESET);
|
||||||
|
@@ -1502,6 +1502,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||||
|
struct net_device *net_dev = bgmac->net_dev;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
+ bgmac->in_init = true;
|
||||||
|
+
|
||||||
|
bgmac_chip_intrs_off(bgmac);
|
||||||
|
|
||||||
|
net_dev->irq = bgmac->irq;
|
||||||
|
@@ -1562,6 +1564,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||||
|
bgmac->b53_device = &bgmac_b53_dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ bgmac->in_init = false;
|
||||||
|
+
|
||||||
|
err = register_netdev(bgmac->net_dev);
|
||||||
|
if (err) {
|
||||||
|
dev_err(bgmac->dev, "Cannot register net device\n");
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac.h
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac.h
|
||||||
|
@@ -513,6 +513,8 @@ struct bgmac {
|
||||||
|
int irq;
|
||||||
|
u32 int_mask;
|
||||||
|
|
||||||
|
+ bool in_init;
|
||||||
|
+
|
||||||
|
/* Current MAC state */
|
||||||
|
int mac_speed;
|
||||||
|
int mac_duplex;
|
|
@ -15,7 +15,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
|
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -289,6 +289,12 @@ bcm47xx_buttons_linksys_wrt320n_v1[] __i
|
@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -28,9 +28,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
@@ -644,6 +650,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
|
||||||
break;
|
break;
|
||||||
+ case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
+ case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
||||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
|
@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
|
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
|
@@ -283,6 +283,12 @@ bcm47xx_buttons_linksys_wrt310n_v2[] __i
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -41,9 +41,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
||||||
break;
|
break;
|
||||||
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
||||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
|
@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_asus_rtn12[] __initconst = {
|
bcm47xx_buttons_asus_rtn12[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
|
||||||
BCM47XX_GPIO_KEY(1, KEY_RESTART),
|
BCM47XX_GPIO_KEY(1, KEY_RESTART),
|
||||||
@@ -502,6 +508,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -490,6 +496,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (board) {
|
switch (board) {
|
||||||
|
@ -55,7 +55,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_leds_asus_rtn12[] __initconst = {
|
bcm47xx_leds_asus_rtn12[] __initconst = {
|
||||||
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
||||||
BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
@@ -571,6 +579,9 @@ void __init bcm47xx_leds_register(void)
|
@@ -563,6 +571,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
enum bcm47xx_board board = bcm47xx_board_get();
|
enum bcm47xx_board board = bcm47xx_board_get();
|
||||||
|
|
||||||
switch (board) {
|
switch (board) {
|
|
@ -26,7 +26,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
|
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -398,6 +398,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
|
@@ -410,6 +410,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
||||||
@@ -683,6 +688,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -701,6 +706,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_R6200_V1:
|
case BCM47XX_BOARD_NETGEAR_R6200_V1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
|
||||||
break;
|
break;
|
|
@ -27,7 +27,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
|
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -403,6 +403,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
|
@@ -415,6 +415,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -40,7 +40,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
||||||
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
||||||
@@ -691,6 +697,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -709,6 +715,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_R6300_V1:
|
case BCM47XX_BOARD_NETGEAR_R6300_V1:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
|
||||||
break;
|
break;
|
|
@ -36,7 +36,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
|
{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
|
||||||
--- a/arch/mips/bcm47xx/buttons.c
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
+++ b/arch/mips/bcm47xx/buttons.c
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
@@ -448,6 +448,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
|
@@ -460,6 +460,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_keys_button
|
static const struct gpio_keys_button
|
||||||
|
@ -50,7 +50,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
|
bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
|
||||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
};
|
};
|
||||||
@@ -718,6 +725,9 @@ int __init bcm47xx_buttons_register(void
|
@@ -736,6 +743,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
||||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
|
||||||
break;
|
break;
|
||||||
|
@ -62,7 +62,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
break;
|
break;
|
||||||
--- a/arch/mips/bcm47xx/leds.c
|
--- a/arch/mips/bcm47xx/leds.c
|
||||||
+++ b/arch/mips/bcm47xx/leds.c
|
+++ b/arch/mips/bcm47xx/leds.c
|
||||||
@@ -520,6 +520,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
|
@@ -528,6 +528,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gpio_led
|
static const struct gpio_led
|
||||||
|
@ -77,7 +77,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
|
bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
|
||||||
BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
||||||
BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
|
BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
@@ -780,6 +788,9 @@ void __init bcm47xx_leds_register(void)
|
@@ -791,6 +799,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
case BCM47XX_BOARD_NETGEAR_WNR3500L:
|
||||||
bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
|
bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
|
||||||
break;
|
break;
|
|
@ -0,0 +1,65 @@
|
||||||
|
From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 8 Feb 2023 08:03:01 +0100
|
||||||
|
Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325
|
||||||
|
switch, on-SoC 802.11n radio.
|
||||||
|
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||||
|
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||||
|
---
|
||||||
|
arch/mips/bcm47xx/board.c | 1 +
|
||||||
|
arch/mips/bcm47xx/buttons.c | 9 +++++++++
|
||||||
|
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||||
|
3 files changed, 11 insertions(+)
|
||||||
|
|
||||||
|
--- a/arch/mips/bcm47xx/board.c
|
||||||
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
|
@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"},
|
||||||
|
+ {{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"},
|
||||||
|
/* like WRT610N v2.0 */
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"},
|
||||||
|
{{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"},
|
||||||
|
--- a/arch/mips/bcm47xx/buttons.c
|
||||||
|
+++ b/arch/mips/bcm47xx/buttons.c
|
||||||
|
@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct gpio_keys_button
|
||||||
|
+bcm47xx_buttons_linksys_e2500v3[] __initconst = {
|
||||||
|
+ BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
|
||||||
|
+ BCM47XX_GPIO_KEY(10, KEY_RESTART),
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const struct gpio_keys_button
|
||||||
|
bcm47xx_buttons_linksys_e3000v1[] __initconst = {
|
||||||
|
BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
|
||||||
|
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||||
|
@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
|
||||||
|
case BCM47XX_BOARD_LINKSYS_E2000V1:
|
||||||
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
|
||||||
|
break;
|
||||||
|
+ case BCM47XX_BOARD_LINKSYS_E2500V3:
|
||||||
|
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3);
|
||||||
|
+ break;
|
||||||
|
case BCM47XX_BOARD_LINKSYS_E3000V1:
|
||||||
|
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
|
||||||
|
break;
|
||||||
|
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
@@ -61,6 +61,7 @@ enum bcm47xx_board {
|
||||||
|
BCM47XX_BOARD_LINKSYS_E1000V21,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E1200V2,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E2000V1,
|
||||||
|
+ BCM47XX_BOARD_LINKSYS_E2500V3,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E3000V1,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E3200V1,
|
||||||
|
BCM47XX_BOARD_LINKSYS_E4200V1,
|
|
@ -0,0 +1,46 @@
|
||||||
|
From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 8 Feb 2023 10:16:37 +0100
|
||||||
|
Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
|
||||||
|
incorrectly unified. Chip package values are not unique and cannot be
|
||||||
|
checked independently. They are meaningful only in a context of a given
|
||||||
|
chip.
|
||||||
|
|
||||||
|
Packages BCM5358 and BCM47188 share the same value but then belong to
|
||||||
|
different chips. Code unification resulted in treating BCM5358 as
|
||||||
|
BCM47188 and broke its initialization.
|
||||||
|
|
||||||
|
Link: https://github.com/openwrt/openwrt/issues/8278
|
||||||
|
Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
|
||||||
|
Cc: Jon Mason <jdmason@kudzu.us>
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||||
|
Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5@gmail.com
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||||
|
@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
|
||||||
|
- if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
|
||||||
|
- ci->pkg == BCMA_PKG_ID_BCM47186) {
|
||||||
|
+ if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
|
||||||
|
+ (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
|
||||||
|
}
|
||||||
|
- if (ci->pkg == BCMA_PKG_ID_BCM5358)
|
||||||
|
+ if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
|
||||||
|
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
|
||||||
|
break;
|
||||||
|
case BCMA_CHIP_ID_BCM53573:
|
|
@ -0,0 +1,61 @@
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Mon, 27 Feb 2023 07:44:38 +0100
|
||||||
|
Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
It's a BCM5358 based home router. One of very few bcm47xx devices with
|
||||||
|
cellular modems (here: LTE).
|
||||||
|
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
---
|
||||||
|
arch/mips/bcm47xx/board.c | 1 +
|
||||||
|
arch/mips/bcm47xx/leds.c | 8 ++++++++
|
||||||
|
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||||
|
3 files changed, 10 insertions(+)
|
||||||
|
|
||||||
|
--- a/arch/mips/bcm47xx/board.c
|
||||||
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
|
@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
|
||||||
|
/* boardtype, boardnum, boardrev */
|
||||||
|
static const
|
||||||
|
struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
|
||||||
|
+ {{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"},
|
||||||
|
{{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"},
|
||||||
|
{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
|
||||||
|
{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
|
||||||
|
--- a/arch/mips/bcm47xx/leds.c
|
||||||
|
+++ b/arch/mips/bcm47xx/leds.c
|
||||||
|
@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst
|
||||||
|
/* Huawei */
|
||||||
|
|
||||||
|
static const struct gpio_led
|
||||||
|
+bcm47xx_leds_huawei_b593u_12[] __initconst = {
|
||||||
|
+ BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const struct gpio_led
|
||||||
|
bcm47xx_leds_huawei_e970[] __initconst = {
|
||||||
|
BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||||
|
};
|
||||||
|
@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void)
|
||||||
|
bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case BCM47XX_BOARD_HUAWEI_B593U_12:
|
||||||
|
+ bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12);
|
||||||
|
+ break;
|
||||||
|
case BCM47XX_BOARD_HUAWEI_E970:
|
||||||
|
bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
|
||||||
|
break;
|
||||||
|
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||||
|
@@ -53,6 +53,7 @@ enum bcm47xx_board {
|
||||||
|
BCM47XX_BOARD_DLINK_DIR130,
|
||||||
|
BCM47XX_BOARD_DLINK_DIR330,
|
||||||
|
|
||||||
|
+ BCM47XX_BOARD_HUAWEI_B593U_12,
|
||||||
|
BCM47XX_BOARD_HUAWEI_E970,
|
||||||
|
|
||||||
|
BCM47XX_BOARD_LINKSYS_E900V1,
|
|
@ -0,0 +1,76 @@
|
||||||
|
From 327dabbd0111910a7d174b0b812d608d6b67bead Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Mon, 8 Aug 2022 23:05:25 +0200
|
||||||
|
Subject: [PATCH] bgmac: fix *initial* chip reset to support BCM5358
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
While bringing hardware up we should perform a full reset including the
|
||||||
|
switch bit (BGMAC_BCMA_IOCTL_SW_RESET aka SICF_SWRST). It's what
|
||||||
|
specification says and what reference driver does.
|
||||||
|
|
||||||
|
This seems to be critical for the BCM5358. Without this hardware doesn't
|
||||||
|
get initialized properly and doesn't seem to transmit or receive any
|
||||||
|
packets.
|
||||||
|
|
||||||
|
Originally bgmac was calling bgmac_chip_reset() before setting
|
||||||
|
"has_robosw" property which resulted in expected behaviour. That has
|
||||||
|
changed as a side effect of adding platform device support which
|
||||||
|
regressed BCM5358 support.
|
||||||
|
|
||||||
|
Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
|
||||||
|
Cc: Jon Mason <jdmason@kudzu.us>
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
---
|
||||||
|
drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
|
||||||
|
drivers/net/ethernet/broadcom/bgmac.h | 2 ++
|
||||||
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac.c
|
||||||
|
@@ -891,13 +891,13 @@ static void bgmac_chip_reset_idm_config(
|
||||||
|
|
||||||
|
if (iost & BGMAC_BCMA_IOST_ATTACHED) {
|
||||||
|
flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
|
||||||
|
- if (!bgmac->has_robosw)
|
||||||
|
+ if (bgmac->in_init || !bgmac->has_robosw)
|
||||||
|
flags |= BGMAC_BCMA_IOCTL_SW_RESET;
|
||||||
|
}
|
||||||
|
bgmac_clk_enable(bgmac, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (iost & BGMAC_BCMA_IOST_ATTACHED && !bgmac->has_robosw)
|
||||||
|
+ if (iost & BGMAC_BCMA_IOST_ATTACHED && (bgmac->in_init || !bgmac->has_robosw))
|
||||||
|
bgmac_idm_write(bgmac, BCMA_IOCTL,
|
||||||
|
bgmac_idm_read(bgmac, BCMA_IOCTL) &
|
||||||
|
~BGMAC_BCMA_IOCTL_SW_RESET);
|
||||||
|
@@ -1502,6 +1502,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||||
|
struct net_device *net_dev = bgmac->net_dev;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
+ bgmac->in_init = true;
|
||||||
|
+
|
||||||
|
bgmac_chip_intrs_off(bgmac);
|
||||||
|
|
||||||
|
net_dev->irq = bgmac->irq;
|
||||||
|
@@ -1562,6 +1564,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
|
||||||
|
bgmac->b53_device = &bgmac_b53_dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ bgmac->in_init = false;
|
||||||
|
+
|
||||||
|
err = register_netdev(bgmac->net_dev);
|
||||||
|
if (err) {
|
||||||
|
dev_err(bgmac->dev, "Cannot register net device\n");
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bgmac.h
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bgmac.h
|
||||||
|
@@ -475,6 +475,8 @@ struct bgmac {
|
||||||
|
int irq;
|
||||||
|
u32 int_mask;
|
||||||
|
|
||||||
|
+ bool in_init;
|
||||||
|
+
|
||||||
|
/* Current MAC state */
|
||||||
|
int mac_speed;
|
||||||
|
int mac_duplex;
|
Loading…
Reference in a new issue