]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: build driver for built-in 2.5GE PHY as module
authorDaniel Golle <daniel@makrotopia.org>
Fri, 10 Apr 2026 20:00:29 +0000 (21:00 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 17 Apr 2026 13:37:52 +0000 (14:37 +0100)
The by-now-upstream driver for the built-in 2.5GE PHY of the MediaTek
MT7988 and MT7987 SoC loads firmware at probe time.

Build the driver as a module in order to make sure the driver only
attempts to load the firmware by the time the rootfs with the firmware
file has become available.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/firmware/linux-firmware/mediatek.mk
target/linux/mediatek/modules.mk

index 54d8f118d8e347bc8fc850531772434108e7f62f..cf4803ee86e85a2455e02bf20f58c8c671ca675b 100644 (file)
@@ -97,7 +97,7 @@ define Package/mt7986-wo-firmware/install
 endef
 $(eval $(call BuildPackage,mt7986-wo-firmware))
 
-Package/mt7987-2p5g-phy-firmware = $(call Package/firmware-default,MT7987 built-in 2.5G Ethernet PHY firmware,,LICENCE.mediatek)
+Package/mt7987-2p5g-phy-firmware = $(call Package/firmware-default,MT7987 built-in 2.5G Ethernet PHY firmware,+LINUX_6_18:kmod-phy-mediatek-2p5g,LICENCE.mediatek)
 define Package/mt7987-2p5g-phy-firmware/install
        $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7987
        $(INSTALL_DATA) \
@@ -107,7 +107,7 @@ define Package/mt7987-2p5g-phy-firmware/install
 endef
 $(eval $(call BuildPackage,mt7987-2p5g-phy-firmware))
 
-Package/mt7988-2p5g-phy-firmware = $(call Package/firmware-default,MT7988 built-in 2.5G Ethernet PHY firmware,,LICENCE.mediatek)
+Package/mt7988-2p5g-phy-firmware = $(call Package/firmware-default,MT7988 built-in 2.5G Ethernet PHY firmware,+LINUX_6_18:kmod-phy-mediatek-2p5g,LICENCE.mediatek)
 define Package/mt7988-2p5g-phy-firmware/install
        $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7988
        $(INSTALL_DATA) \
index 3a970821117ecf26d47f61d6ee8ca53c1f6c9513..6d09694c3d5e9eff2080fc5ff4d9b8f4069851db 100644 (file)
@@ -38,6 +38,25 @@ define KernelPackage/iio-mt6577-auxadc
 endef
 $(eval $(call KernelPackage,iio-mt6577-auxadc))
 
+
+define KernelPackage/phy-mediatek-2p5g
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=MediaTek 2.5G Ethernet PHY
+  DEPENDS:=@TARGET_mediatek_filogic @!LINUX_6_12 +kmod-libphy
+  KCONFIG:=CONFIG_MEDIATEK_2P5GE_PHY
+  FILES:= \
+   $(LINUX_DIR)/drivers/net/phy/mediatek/mtk-2p5ge.ko
+  AUTOLOAD:=$(call AutoLoad,18,mtk-2p5ge,1)
+endef
+
+define KernelPackage/phy-mediatek-2p5g/description
+  Kernel modules for 2.5G Ethernet PHY built-into the MediaTek MT7988
+  and MT7987 SoCs.
+endef
+
+$(eval $(call KernelPackage,phy-mediatek-2p5g))
+
+
 define KernelPackage/switch-rtl8367s
   SUBMENU:=Network Devices
   TITLE:=Realtek RTL8367S switch support