]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: mikrotik: also compile AG71XX_LEGACY as a module 23748/head
authorMichał Kępień <openwrt@kempniu.pl>
Fri, 12 Jun 2026 07:28:03 +0000 (09:28 +0200)
committerRobert Marko <robimarko@gmail.com>
Fri, 12 Jun 2026 08:38:02 +0000 (10:38 +0200)
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 <daniel@makrotopia.org>
Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/23748
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ath79/mikrotik/config-default
target/linux/ath79/mikrotik/target.mk

index f0e094c3cc332a150fdc3c67179a602095c253f3..cab9af98745960313a7b898536e7e6c14d764fc0 100644 (file)
@@ -1,3 +1,4 @@
+# CONFIG_AG71XX_LEGACY is not set
 # CONFIG_AR8216_PHY is not set
 CONFIG_CRC16=y
 CONFIG_CRYPTO_DEFLATE=y
index ddc375976c3ae89b7bb6a847b03321eddfc73b59..0d314e8ab72e72f698d34b0f91b272f822d5ef28 100644 (file)
@@ -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