From: Michał Kępień Date: Fri, 12 Jun 2026 07:28:03 +0000 (+0200) Subject: ath79: mikrotik: also compile AG71XX_LEGACY as a module X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F23748%2Fhead;p=thirdparty%2Fopenwrt.git ath79: mikrotik: also compile AG71XX_LEGACY as a module Commit 9091c9f8cbd9 ("ath79: mikrotik: compile SWCONFIG and AR8216_PHY as modules") caused the hybrid PHY/MDIO ar8xxx driver to be built as a module instead of built-in. On at least MikroTik RouterBOARD 951G-2HnD, this prevents the kernel from binding the correct PHY driver at boot because the ar8xxx driver is not yet available when the MDIO bus is probed: - before: ag71xx-legacy 19000000.eth: invalid MAC address, using random address switch0: Atheros AR8327 rev. 4 switch registered on mdio.0 ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii - after: ag71xx-legacy 19000000.eth: invalid MAC address, using random address ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd034, driver=Generic PHY] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii As the PHY is already bound to the fallback "Generic PHY" driver when the ar8xxx module is loaded, the switch remains non-functional and the router has no network connectivity. Fix by also compiling the MAC driver (ag71xx-legacy) as a module, deferring switch initialization until control is transferred to userspace during boot. The configured module autoload priorities (ar8xxx: 43, ag71xx-legacy: 50) ensure that the ar8xxx driver is loaded before ag71xx-legacy. Fixes: https://github.com/openwrt/openwrt/issues/23739 Fixes: 9091c9f8cbd9 ("ath79: mikrotik: compile SWCONFIG and AR8216_PHY as modules") Suggested-by: Daniel Golle Signed-off-by: Michał Kępień Link: https://github.com/openwrt/openwrt/pull/23748 Signed-off-by: Robert Marko --- diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default index f0e094c3cc3..cab9af98745 100644 --- a/target/linux/ath79/mikrotik/config-default +++ b/target/linux/ath79/mikrotik/config-default @@ -1,3 +1,4 @@ +# CONFIG_AG71XX_LEGACY is not set # CONFIG_AR8216_PHY is not set CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y diff --git a/target/linux/ath79/mikrotik/target.mk b/target/linux/ath79/mikrotik/target.mk index ddc375976c3..0d314e8ab72 100644 --- a/target/linux/ath79/mikrotik/target.mk +++ b/target/linux/ath79/mikrotik/target.mk @@ -3,7 +3,7 @@ FEATURES += minor nand KERNELNAME := vmlinux vmlinuz IMAGES_DIR := ../../.. -DEFAULT_PACKAGES += wpad-basic-mbedtls yafut kmod-switch-ar8xxx +DEFAULT_PACKAGES += kmod-ag71xx-legacy kmod-switch-ar8xxx wpad-basic-mbedtls yafut define Target/Description Build firmware images for MikroTik devices based on Qualcomm Atheros