From 78e4cffcd882389cb8f0bf818303f85f8d1e9c8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 31 Jul 2025 10:25:52 +0200 Subject: [PATCH] bcm53xx: add Tenda AC9 switch workaround MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes regressed support for Tenda AC9 which got broken somewhere between LEDE 17.01 and OpenWrt 18.06. At some point bcm47xx_nvram_gpio_pin() started working on bcm53xx devices and it resulted in swconfig b53 performing GPIO-based switch reset. It exposed some bug as switch stopped working. The problem is most likely to be some missing initialization step. Tenda AC9 comes with BCM53125 rev 4 (pretty common chip) but apparently needs some extra quirk. As a workaround (it doesn't make much sense to debug swconfig driver which has a working DSA replacement) simply avoid full switch reset. Signed-off-by: Rafał Miłecki --- ...dd-Tenda-AC9-switch-reset-workaround.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/701-b53-add-Tenda-AC9-switch-reset-workaround.patch diff --git a/target/linux/bcm53xx/patches-5.4/701-b53-add-Tenda-AC9-switch-reset-workaround.patch b/target/linux/bcm53xx/patches-5.4/701-b53-add-Tenda-AC9-switch-reset-workaround.patch new file mode 100644 index 00000000000..1b4cf5f85a2 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/701-b53-add-Tenda-AC9-switch-reset-workaround.patch @@ -0,0 +1,39 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 30 Jul 2025 12:37:12 +0000 +Subject: [PATCH] b53: add Tenda AC9 switch reset workaround +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Avoid switch reset to keep it in a working state. + +Signed-off-by: Rafał Miłecki +--- + drivers/net/phy/b53/b53_priv.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/net/phy/b53/b53_priv.h ++++ b/drivers/net/phy/b53/b53_priv.h +@@ -21,6 +21,7 @@ + + #include + #include ++#include + #include + + struct b53_device; +@@ -318,6 +319,14 @@ static inline int b53_write64(struct b53 + + static inline int b53_switch_get_reset_gpio(struct b53_device *dev) + { ++ /* ++ * Tenda AC9 comes with gpio2=robo_reset but performing switch reset ++ * leaves it in a non-working state. It seems b53 swconfig driver misses ++ * some initialization bit. ++ */ ++ if (of_machine_is_compatible("tenda,ac9")) ++ return -ENOENT; ++ + #ifdef CONFIG_BCM47XX + enum bcm47xx_board board = bcm47xx_board_get(); + -- 2.47.2