AR9341 needs analog switch reset
Username: vuhuy
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=329
This is a bug report for the AR9341 SOC on LEDE trunk reboot-2445-gee5a6c10.
I have builded a custom firmware for a unsupported device based on the Atheros DB120 reference board.
The analog port of the ethernet switch needs to be resetted before it can operate.
Part of bootlog without analog reset:
[ 2.179262] ag71xx-mdio.1: unknown phy id 'ffff:ffff'
Br-lan is not intialized due no analog switch reset.
Part of bootlog with analog reset:
[ 2.059037] ag71xx-mdio.1: Found an AR934X built-in switch
And br-lan is initialized and networking is working fine.
A reset is performed by the function ath79_register_eth (defined in dev-eth.c):
ath79_device_reset_set(AR934X_RESET_ETH_SWITCH); ath79_device_reset_clear(AR934X_RESET_ETH_SWITCH);
However, no analog reset is performed, for example:
ath79_device_reset_set(AR934X_RESET_ETH_SWITCH); ath79_device_reset_clear(AR934X_RESET_ETH_SWITCH);
ath79_device_reset_set(AR934X_RESET_ETH_SWITCH_ANALOG); ath79_device_reset_clear(AR934X_RESET_ETH_SWITCH_ANALOG);
Omitting the analog reset does not break the DB120 builds because the analog reset is already performed by ar934x_nfc_hw_reset in dev-nfc.c.
An easy fix is to do a analog reset in the device’s mach file. However, for the sake of consistency and autism, the reset should be performed by ath79_register_eth in dev_eth.c and not by ar934x_nfc_hw_reset in dev_nfc.c. My AR9341 device doesn’t even use a NAND flash.