IPQ5018: Support for Linksys MX2000 Atlas 6 & MX5500 Atlas 6 Pro

My device also show that Port5 (connect to IPQ50XX's GE_PHY) is down. But it can transfer data.

root@OpenWrt:/# swconfig dev switch1 show | grep link
        link: port:0 link:up speed:1000baseT full-duplex
        link: port:1 link:down
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:up speed:1000baseT full-duplex
root@OpenWrt:/# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x004dd036  down
0x01  0x004dd036  up
0x02  0x004dd036  down
0x03  0x004dd036  down
0x04  0x004dd036  up

qca8k supports using ports 0 and 6 as the CPU ports as those are the only MAC-s, there is a multi-cpu patch in ipq806x as well.

I have also seen and have a device using a weird combination where QCA8337 is not connected MAC to MAC but over ethernet PHY-s to the CPU.

Yeah, but your device shows the PHY links are up in mdio while mine doesn’t. Hence, the stock fw doesn’t have 2 DPs enabled but only one connected to Port 6 (combined with Port 0) on the switch.

@hzyitc Redmi AX3000 has got both connected via the PHYs and MAC to MAC. Guess these devices are just wired up differently.

From his email:


root@OpenWrt:/# mdio 8*
  DEV      PHY-ID  LINK
...
0x07  0x004dd0c0  up
...
root@OpenWrt:/# mdio 9*
  DEV      PHY-ID  LINK
0x00  0x004dd036  down
0x01  0x004dd036  up
0x02  0x004dd036  down
0x03  0x004dd036  down
0x04  0x004dd036  up

Again, outpout of mdio in regards to status is only valid if the MDIO device is ethernet PHY, nothing else

understood, but what I'm highlighting here is that on the Redmi AX3000 the PHY links are reported is 'up' while on the Linksys MX2000 it's 'down'. Same PHY ids on both ends (see previous posts). So Linksys chose not to physically wire the PHYs up and only opted for the MAC to MAC link, while Redmi has chosen both links through PHYs and MAC to MAC.

Yeah, I get what you mean.

MAC to MAC is the traditional link as it costs nothing and is meant for board interconnects while PHY-s are more of a workaround and cost money

Anyone has got any ideas as to why swconfig doesn’t detect the switches in 6.1 while it does work in 5.15 on @hzyitc’s repo?
I did try rolling back netifd to an earlier version as suggested but that didn’t help either.
At least I’ve confirmed how the device is wired and tested that traffic flows through Port 0 and 6 on the qca8337 to and from GMAC1 on the ipq5018 switch (MAC to MAC).

Awesome.

I try again, and now I can setup DSA, but the data transmission still fail. But I can confirm the following point:

  1. DSA can work with phylink. So we don't need to upgrade to phylink.
  2. The mainline qca8k driver use ethernet frame to manage the switch, so it need to be probed after qca-nss-dp.
  3. qca-nss-dp need modified to support fixed-link.

I will roll back to linux 5.4 ( which use mdio instand of ethernet frame ) and try again. Will share the results and codes later.

Ahh, a mistake. What I want to say is MAC1-MAC5(PHY0-PHY4), same as what your device.

This lead to the following problem:

  1. The driver don't support to use them as CPU port
  2. How to describe the PHY-to-PHY link in dts. As the stacked DSA switch ?

Maybe the GEPhy in your device connected directly to the WAN port? The SGMII port only work in 1G mode with QCA8337, so if the GEPhy isn't used, the bidirectional bandwidth will be limited to 1Gbps instand of 2Gbps.

on 1. there's a multi-CPU patch for the qca8337 driver
on 2. I figure you'd essentially describe it as the example below:

port@5 {
	reg = <5>;                  <--- on your device it would be port 5
	label = "cpu";
	ethernet = <&gmac1>;        <--- phandle to your dp1 alias
	phy-mode = "sgmii";
	fixed-link {                <--- not sure this will be needed
		speed = <1000>;
		full-duplex;
	};
};

  1. I mean use PHY(MAC1-MAC5) as CPU port, not the xMII port( MAC0 or MAC6)
  2. This is describe the MAC-to-MAC link. I mean PHY-to-PHY link, the middle part of the following link:

IPQ5018 GMAC0 -> IPQ5018 GE Phy -> QCA8337 Phy -> QCA8337 MAC

New progress: Now I can setup DSA with qca8k driver and qca-nss-dp on linux 5.4 and get ip by DHCP successfully. Will push the code tonight.

1 Like

have finally got the switch to work, thought I was going nuts because I had gone from borrowing 'some' of @hzyitc's code to literally everything line by line and it still didn't work. Compared nss-dp and ssdk versions, they're all the same. It was only after I rolled back the kernel version from 5.15.134 to 5.15.120 with the associated patches in target/linux/generic that the switch started working. I haven't figured out when and where the code breaks, but in .134 the RX counters on the LAN ports stayed at 0 while TX counters showed traffic.

Anyone knows what might have changed between .120 and .134 that could have caused this?

code checked in with support for ipq50xx target + ethernet: ipq50xx-openwrt-23.05 (github.com)

be aware, haven't had the need and/or courage to flash yet. I'd rather wait until the redesigned QPIC driver has been submitted fully rather than the hack it is now. First few patches were submitted yesterday:
[RFC,0/5] Add QPIC SPI NAND driver support - Patchwork (kernel.org)

will now focus on adding wifi (ipq5018, qcn6122, qcn9074) and DSA support.

@hzyitc: did you manage to check in your code with support for DSA?

Has push to Github

Hi @georgem83, @hzyitc,

I've just started working with the DR5018 router board from WallysTech and have been following your progress with interest.

I have not ported OpenWrt to a new board before so I was wondering if you would be able to provide a high level overview of the steps you have followed? This would help me and anyone else interested to start the process.

Thanks!

That's a very broiad question, but I would start with:
[OpenWrt Wiki] Build system essentials
[OpenWrt Wiki] Build system setup
[OpenWrt Wiki] Build system usage

Hi everyone,

I have a MX5500 and I was wondering if you managed make openwrt work on that device.
Do you have any updates on it?