Adding OpenWrt support for Archer A6 v3

No more updates? Or topic switched to another place?

Except MDIO ETH issue when booted from SPI Flash, other things are working fine.

Pull request is WIP due to ETH issue only.

2 Likes

BTW My tester say that if you init ethernet with uboot command ethon than mt7530 switch works. And after any tftpboot command switch works too.

Not able find much help on spi command implementation. Else can try to emulate ethon and spi boot manually to check if it resolves.

Or any command to reset the MT7530 MDIO from OpenWrt Linux?

Yet another note. From breed botloader all works correctly too. As I understand breed always init ethernet/switch. So I think that the problem is incorrect or incomplete init code in openwrt source.

I'm experiencing the same MDIO issue porting the EAP235-Wall. I've requested the GPL sources for the EAP235-Wall and EAP230-Wall, which are also both MT7621 based. I've been looking a bit at the sources for the RE650, since these are also MT7621-based, but haven't found anything obvious yet.

There is phytool ( https://github.com/wkz/phytool ) - pure C implementation.

From the OEM Boot logs I see below

Raeth v3.1 (Tasklet)
set CLK_CFG_0 = 0x40a00020!!!!!!!!!!!!!!!!!!1

phy_tx_ring = 0x00c3c000, tx_ring = 0xa0c3c000

phy_rx_ring0 = 0x00c40000, rx_ring[0] = 0xa0c40000

phy_rx_ring0 = 0x00c40000, rx_ring[0] = 0xa0c40000
MT7530 Reset Timeout!!
change HW-TRAP to 0x17c8f
set TPlink LAN/WAN Partition
not turn on phy in gsw ,flag = 0
GMAC1_MAC_ADRH -- : 0xdeadbeaf
GMAC1_MAC_ADRL -- : 0xdeadbeaf
GDMA2_MAC_ADRH -- : 0xdeadbeaf
GDMA2_MAC_ADRL -- : 0xdeadbeaf
eth1: ===> VirtualIF_open
MT7621 GE2 link rate to 1G
CDMA_CSG_CFG = 81000000
GDMA1_FWD_CFG = 20710000
GDMA2_FWD_CFG = 20710000

I see same in OpenWrt logs mt7530 mdio-bus:1f: reset timeout from MT7530 DSA driver logs also.
Is it something to do with HW-TRAP? Or something with DSA driver?
Ignore: deadbeaf, its edited.

Did you try to build firmware based on stable openwrt-19.07 branch?
Old (non-dsa) switch driver of openwrt-19.07 have init mt7530 code which is the same as OEM (SDK) code.

Yes. tried but switch config was little different and wasnt working with tftpboot...basically there was no /etc/config/network created..and networking wasnt working...didn't try later on.

And you didn't try to config mt7350 with swconfig command?

swconfig is detecting active links , but not sure if it is due to booting from tftp.


root@(none):/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 0
        mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 0
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0

Port 0:
        mib: Port 0 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 7
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 7
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 558
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 91
RxBroad    : 80
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 117
Rx65Byte   : 27
Rx128Byte  : 16
Rx256Byte  : 11
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 17857
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex
Port 1:
        mib: Port 1 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 7
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 7
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 558
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 5
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 5
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 1730
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:1 link:up speed:100baseT full-duplex
Port 2:
        mib: Port 2 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:2 link:down
Port 3:
        mib: Port 3 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:3 link:down
Port 4:
        mib: Port 4 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:4 link:down
Port 5:
        mib: Port 5 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:5 link:down
Port 6:
        mib: Port 6 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 91
TxBroad    : 86
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 118
Tx65Byte   : 27
Tx128Byte  : 16
Tx256Byte  : 16
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 19651
RxDrop     : 0
RxFiltered : 4
RxUni      : 0
RxMulti    : 10
RxBroad    : 1
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 10
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 1
RxByte     : 1883
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
Port 7:
        mib: Port 7 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:7 link:down

02_network config is as below

		ucidef_add_switch "switch0" \
			"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"

Any hint why interfaces are not showing up?

In openwrt-19.07 your switch config was not applied. You can run commands:

swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports '0 1 2 3 6t'
swconfig dev switch0 vlan 2 set ports '4 6t'
swconfig dev switch0 set apply 1

to configure switch by hand.

May be im doing some mistake with naming of the board?

Tried above, doesnt bring any new interfaces.

As I understand in current trunk all system (mt7621 SoC) dependent code was removed from mt7530 dsa-driver: GPIOMODE setting, correction of mt7530 core clock based on SoC xtal frequency and so on. What part of those code is critical need to be tested. So it's intresting does old non dsa-driver work.
BTW the most simple and correctly fixable is to check/set mdio and rgmii1 to right GPIOMODE. Just add into dts-file:

&state_default {
        mdio {
                group = "mdio";
                function = "mdio";
        };

        rgmii1 {
                group = "rgmii1";
                function = "rgmii1";
        };
};

ok will give it a try. Need get used to different form of naming used in 19.07, to fix auto switch config.

Those commands don't create new interface but only correctly config switch.

Not helping, still seeing below error

[    0.757873] 8021q: 802.1Q VLAN Support v1.8
[    0.764018] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    1.773636] mt7530 mdio-bus:1f: reset timeout
[    1.778064] mt7530: probe of mdio-bus:1f failed with error -145

Sorry. It seems that I make typo group instead of groups. Can you try this change:

&state_default {
        mdio {
                groups = "mdio";
                function = "mdio";
        };

        rgmii1 {
                groups = "rgmii1";
                function = "rgmii1";
        };
};

or

&ethernet {
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii1_pins &mdio_pins>;
};

Really it's equivalent but I don't know which variant is better. So try both, pls.

to change network interfaces without building:

# delete board.json
rm /etc/board.json

# edit 02_network (i for edit mode, escape to leave edit mode, :wq enter to write)
vi /etc/board.d/02_network

# generate new board.json and network config file
board_detect
config_generate

# restart network
./etc/init.d/network restart