[PATCH v2 1/2] kernel: netdevices: Create Realtek DSA switch packages

Linus Walleij linus.walleij at linaro.org
Mon Jan 13 00:12:20 PST 2025


This adds kernel packages for the Realtek RTL836x switches.

My intended usage is for RTL8366RB, but let's package
RTL8365MB while we are at it. I did not create separate
packages for the two switches, as it complicates things.

I have split the switches into MDIO and SMI subvariants
as this is how the kernel deals with them.

Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 package/kernel/linux/modules/netdevices.mk | 51 ++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk
index 2a6ecb7a2bd4b08083aee06f2a40b1c4e13894f5..f95337665b75224f5062a550708feb53aa79110b 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -636,6 +636,57 @@ endef
 
 $(eval $(call KernelPackage,dsa-qca8k))
 
+define KernelPackage/dsa-realtek
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Realtek RTL836x DSA switch family support
+  DEPENDS:=+kmod-dsa +kmod-phy-realtek +kmod-fixed-phy
+  KCONFIG:= \
+	CONFIG_NET_DSA_REALTEK \
+	CONFIG_NET_DSA_REALTEK_RTL8365MB \
+	CONFIG_NET_DSA_REALTEK_RTL8366RB
+  FILES:= \
+	$(LINUX_DIR)/drivers/net/dsa/realtek/rtl8365mb.ko \
+	$(LINUX_DIR)/drivers/net/dsa/realtek/rtl8366.ko \
+	$(LINUX_DIR)/net/dsa/tag_rtl8_4.ko \
+	$(LINUX_DIR)/net/dsa/tag_rtl4_a.ko
+endef
+
+define KernelPackage/dsa-realtek/description
+  Kernel modules for Realtek switches
+endef
+
+$(eval $(call KernelPackage,dsa-realtek))
+
+define KernelPackage/dsa-realtek-mdio
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Realtek DSA switches on MDIO
+  DEPENDS:=+kmod-dsa-realtek
+  KCONFIG:= CONFIG_NET_DSA_REALTEK_MDIO
+  FILES:= $(LINUX_DIR)/drivers/net/dsa/realtek/realtek-mdio.ko
+  AUTOLOAD:=$(call AutoProbe,realtek-mdio)
+endef
+
+define KernelPackage/dsa-realtek-mdio/description
+  Kernel modules for Realtek switches on MDIO
+endef
+
+$(eval $(call KernelPackage,dsa-realtek-mdio))
+
+define KernelPackage/dsa-realtek-smi
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Realtek DSA switches on SMI
+  DEPENDS:=+kmod-dsa-realtek
+  KCONFIG:= CONFIG_NET_DSA_REALTEK_SMI
+  FILES:= $(LINUX_DIR)/drivers/net/dsa/realtek/realtek-smi.ko
+  AUTOLOAD:=$(call AutoProbe,realtek-smi)
+endef
+
+define KernelPackage/dsa-realtek-smi/description
+  Kernel modules for Realtek switches on SMI
+endef
+
+$(eval $(call KernelPackage,dsa-realtek-smi))
+
 define KernelPackage/swconfig
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=switch configuration API

-- 
2.47.1




More information about the openwrt-devel mailing list