ath79: Upstream b53 DSA driver for Ubiquiti EdgeSwitch 8XP
authorRoger Pueyo Centelles <roger.pueyo@guifi.net>
Fri, 18 Nov 2022 00:18:09 +0000 (01:18 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 19 Oct 2024 12:10:34 +0000 (14:10 +0200)
The swconfig-based b53 driver for the BCM53128 switch stopped working
after commits b2cfed48f6 (Revert "swconfig: fix Broadcom b53 support")
and e4e410733f (kernel: export switch_generic_set_link() symbol). This
rendered the 8 LAN ports of the EdgeSwitch 8XP non-functional, so the
image compilation for the device was disabled (5a1d7d8c1b).

This commit adds the kmod-dsa-b53-mdio and kmod-dsa-b53 packages
with the upstream B53 DSA driver, replacing the swconfig-based
kmod and kmod-switch-bcm53xx-mdio downstream ones that are not used by
any other device.

The 8 LAN ports of the EdgeSwitch 8XP are usable again. The 02_network
init script has been updated with the new DSA interfaces lan1 .. lan8.

Image building has been reenabled for the device, adding the usual DSA
incompatibility notice.

Tested on a Ubiquiti EdgeSwitch 8XP.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Link: https://github.com/openwrt/openwrt/pull/11680
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/linux/modules/netdevices.mk
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/image/generic-ubnt.mk

index 64a373a80dba33b18f7797d970e1f668caf84a01..0ca626610fcbbd1ecdb2f4f7afac1d9a6460cbed 100644 (file)
@@ -538,6 +538,44 @@ endef
 
 $(eval $(call KernelPackage,dsa))
 
+
+define KernelPackage/dsa-b53
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Broadcom BCM53xx managed switch DSA support
+  DEPENDS:=+kmod-dsa
+  KCONFIG:=CONFIG_B53 \
+  CONFIG_NET_DSA_TAG_BRCM \
+  CONFIG_NET_DSA_TAG_BRCM_LEGACY \
+  CONFIG_NET_DSA_TAG_BRCM_PREPEND
+  FILES:= \
+  $(LINUX_DIR)/drivers/net/dsa/b53/b53_common.ko \
+  $(LINUX_DIR)/net/dsa/tag_brcm.ko
+  AUTOLOAD:=$(call AutoProbe,b53_common)
+endef
+
+define KernelPackage/dsa-b53/description
+  Broadcom BCM53xx managed switch support
+endef
+
+$(eval $(call KernelPackage,dsa-b53))
+
+
+define KernelPackage/dsa-b53-mdio
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=B53 MDIO connected switch DSA driver
+  DEPENDS:=+kmod-dsa-b53
+  KCONFIG:=CONFIG_B53_MDIO_DRIVER
+  FILES:=$(LINUX_DIR)/drivers/net/dsa/b53/b53_mdio.ko
+  AUTOLOAD:=$(call AutoProbe,b53_mdio)
+endef
+
+define KernelPackage/dsa-b53-mdio/description
+  B53 MDIO connected switch driver
+endef
+
+$(eval $(call KernelPackage,dsa-b53-mdio))
+
+
 define KernelPackage/dsa-tag-dsa
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Marvell DSA type DSA and EDSA taggers
@@ -608,36 +646,6 @@ endef
 
 $(eval $(call KernelPackage,swconfig))
 
-define KernelPackage/switch-bcm53xx
-  SUBMENU:=$(NETWORK_DEVICES_MENU)
-  TITLE:=Broadcom bcm53xx switch support
-  DEPENDS:=+kmod-swconfig
-  KCONFIG:=CONFIG_SWCONFIG_B53
-  FILES:=$(LINUX_DIR)/drivers/net/phy/b53/b53_common.ko
-  AUTOLOAD:=$(call AutoLoad,42,b53_common)
-endef
-
-define KernelPackage/switch-bcm53xx/description
-  Broadcom bcm53xx switch support
-endef
-
-$(eval $(call KernelPackage,switch-bcm53xx))
-
-define KernelPackage/switch-bcm53xx-mdio
-  SUBMENU:=$(NETWORK_DEVICES_MENU)
-  TITLE:=Broadcom bcm53xx switch MDIO support
-  DEPENDS:=+kmod-switch-bcm53xx
-  KCONFIG:=CONFIG_SWCONFIG_B53_PHY_DRIVER
-  FILES:=$(LINUX_DIR)/drivers/net/phy/b53/b53_mdio.ko
-  AUTOLOAD:=$(call AutoLoad,42,b53_mdio)
-endef
-
-define KernelPackage/switch-bcm53xx-mdio/description
-  Broadcom bcm53xx switch MDIO support
-endef
-
-$(eval $(call KernelPackage,switch-bcm53xx-mdio))
-
 
 define KernelPackage/switch-ip17xx
   SUBMENU:=$(NETWORK_DEVICES_MENU)
index 742892a2f3c79dc87a9d473471ff4fbc2ca15bcf..ee9409d7a5f22c643f4cc423d882c9581ac09873 100644 (file)
@@ -569,9 +569,7 @@ ath79_setup_interfaces()
                        "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
                ;;
        ubnt,edgeswitch-8xp)
-               ucidef_set_interface_wan "eth1"
-               ucidef_add_switch "switch0" \
-                       "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:lan:5" "5:lan:6" "6:lan:7" "7:lan:8"  "8@eth0"
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8" "eth1"
                ;;
        ubnt,routerstation-pro)
                ucidef_set_interface_wan "eth0"
index 2faf51949acdd33642e164e7cc82eabfce660526..51d0aaef03ae112cbe2b30a1ee5cbe2f5bd7fd53 100644 (file)
@@ -58,8 +58,9 @@ TARGET_DEVICES += ubnt_edgeswitch-5xp
 define Device/ubnt_edgeswitch-8xp
   $(Device/ubnt-sw)
   DEVICE_MODEL := EdgeSwitch 8XP
-  DEVICE_PACKAGES += kmod-switch-bcm53xx-mdio
-  DEFAULT := n
+  DEVICE_PACKAGES += kmod-dsa-b53-mdio
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
 endef
 TARGET_DEVICES += ubnt_edgeswitch-8xp