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

I ran into an issue with DFS radar detection. If I understand correctly, hostapd will disable wifi, which it does. 30 minutes later, it should then scan again and bring wifi back up if radar is not detected. But the scan fails

Tue Nov 26 09:44:02 2024 daemon.notice hostapd: phy1-ap0: DFS-RADAR-DETECTED freq=5260 ht_enabled=0 chan_offset=0 chan_width=5 cf1=5250 cf2=0
Tue Nov 26 09:44:02 2024 daemon.warn hostapd: Can't set DFS state for freq 5180 MHz
Tue Nov 26 09:44:02 2024 daemon.warn hostapd: Can't set DFS state for freq 5200 MHz
Tue Nov 26 09:44:02 2024 daemon.warn hostapd: Can't set DFS state for freq 5220 MHz
Tue Nov 26 09:44:02 2024 daemon.warn hostapd: Can't set DFS state for freq 5240 MHz
Tue Nov 26 09:44:02 2024 daemon.notice hostapd: dfs_downgrade_bandwidth: no DFS channels left, waiting for NOP to finish
Tue Nov 26 09:44:02 2024 daemon.notice hostapd: phy1-ap0: AP-DISABLED
Tue Nov 26 09:44:02 2024 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:xx:84:f5
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:xx:39:f3
Tue Nov 26 09:44:03 2024 daemon.err hostapd: 20/40 MHz: center segment 0 (=50) and center freq 1 (=5270) not in sync
Tue Nov 26 09:44:03 2024 daemon.err hostapd: Failed to set beacon parameters
Tue Nov 26 09:44:03 2024 daemon.err hostapd: 20/40 MHz: center segment 0 (=50) and center freq 1 (=5270) not in sync
Tue Nov 26 09:44:03 2024 daemon.err hostapd: Failed to set beacon parameters
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: nl80211: Failed to remove interface phy1-ap1 from bridge br-lan: No such device
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: nl80211: deinit ifname=phy1-ap0 disabled_11b_rates=0
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: phy1-ap0: interface state ENABLED->DISABLED
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: phy1-ap0: interface state DISABLED->COUNTRY_UPDATE
Tue Nov 26 09:44:03 2024 daemon.notice hostapd: phy1-ap0: interface state COUNTRY_UPDATE->HT_SCAN
Tue Nov 26 09:44:04 2024 daemon.err hostapd: could not get valid channel
Tue Nov 26 09:44:04 2024 daemon.notice hostapd: phy1-ap0: interface state HT_SCAN->DFS
Tue Nov 26 09:44:06 2024 daemon.err hostapd: nl80211: kernel reports: key addition failed
Tue Nov 26 09:44:06 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:39:f3 IEEE 802.11: associated (aid 1)
Tue Nov 26 09:44:06 2024 daemon.notice hostapd: phy0-ap1: AP-STA-CONNECTED xx:xx:xx:xx:39:f3 auth_alg=ft
Tue Nov 26 09:47:05 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:84:f5 IEEE 802.11: authenticated
Tue Nov 26 09:47:05 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:84:f5 IEEE 802.11: associated (aid 2)
Tue Nov 26 09:47:06 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:84:f5 IEEE 802.11: associated (aid 2)
Tue Nov 26 09:47:06 2024 daemon.notice hostapd: phy0-ap1: AP-STA-CONNECTED xx:xx:xx:xx:84:f5 auth_alg=sae
Tue Nov 26 09:47:06 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:84:f5 RADIUS: starting accounting session CC1D1F2AB041E14D
Tue Nov 26 09:47:06 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:84:f5 WPA: pairwise key handshake completed (RSN)
Tue Nov 26 09:47:06 2024 daemon.notice hostapd: phy0-ap1: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:xx:84:f5
Tue Nov 26 09:59:16 2024 daemon.notice hostapd: phy0-ap1: AP-STA-DISCONNECTED xx:xx:xx:xx:39:f3
Tue Nov 26 09:59:16 2024 daemon.err hostapd: nl80211: kernel reports: key addition failed
Tue Nov 26 09:59:16 2024 daemon.info hostapd: phy0-ap1: STA xx:xx:xx:xx:39:f3 IEEE 802.11: associated (aid 1)
Tue Nov 26 09:59:16 2024 daemon.notice hostapd: phy0-ap1: AP-STA-CONNECTED xx:xx:xx:xx:39:f3 auth_alg=ft
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-NOP-FINISHED freq=5260 ht_enabled=0 chan_offset=0 chan_width=0 cf1=5260 cf2=0
Tue Nov 26 10:14:33 2024 daemon.err hostapd: could not get valid channel
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: interface state DFS->DFS
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-NOP-FINISHED freq=5280 ht_enabled=0 chan_offset=0 chan_width=0 cf1=5280 cf2=0
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: interface state DFS->DFS
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-CAC-START freq=5260 chan=52 sec_chan=1, width=0, seg0=50, seg1=0, cac_time=60s
Tue Nov 26 10:14:33 2024 daemon.err hostapd: 20/40 MHz: center segment 0 (=50) and center freq 1 (=5270) not in sync
Tue Nov 26 10:14:33 2024 daemon.err hostapd: Can't set freq params
Tue Nov 26 10:14:33 2024 daemon.err hostapd: DFS start_dfs_cac() failed, -1
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-NOP-FINISHED freq=5300 ht_enabled=0 chan_offset=0 chan_width=0 cf1=5300 cf2=0
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: interface state DFS->DFS
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-CAC-START freq=5260 chan=52 sec_chan=1, width=0, seg0=50, seg1=0, cac_time=60s
Tue Nov 26 10:14:33 2024 daemon.err hostapd: 20/40 MHz: center segment 0 (=50) and center freq 1 (=5270) not in sync
Tue Nov 26 10:14:33 2024 daemon.err hostapd: Can't set freq params
Tue Nov 26 10:14:33 2024 daemon.err hostapd: DFS start_dfs_cac() failed, -1
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-NOP-FINISHED freq=5320 ht_enabled=0 chan_offset=0 chan_width=0 cf1=5320 cf2=0
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: interface state DFS->DFS
Tue Nov 26 10:14:33 2024 daemon.notice hostapd: phy1-ap0: DFS-CAC-START freq=5260 chan=52 sec_chan=1, width=0, seg0=50, seg1=0, cac_time=60s
Tue Nov 26 10:14:33 2024 daemon.err hostapd: 20/40 MHz: center segment 0 (=50) and center freq 1 (=5270) not in sync
Tue Nov 26 10:14:33 2024 daemon.err hostapd: Can't set freq params
Tue Nov 26 10:14:33 2024 daemon.err hostapd: DFS start_dfs_cac() failed, -1
Tue Nov 26 10:22:33 2024 daemon.notice hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: did not acknowledge authentication response
Tue Nov 26 10:22:33 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: associated (aid 2)
Tue Nov 26 10:22:33 2024 daemon.notice hostapd: phy0-ap2: AP-STA-CONNECTED xx:xx:xx:xx:cd:c0 auth_alg=open
Tue Nov 26 10:22:33 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 RADIUS: starting accounting session EFF0EFE24B3850A8
Tue Nov 26 10:22:33 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 WPA: pairwise key handshake completed (RSN)
Tue Nov 26 10:22:33 2024 daemon.notice hostapd: phy0-ap2: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:xx:cd:c0
Tue Nov 26 10:22:53 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: disconnected due to excessive missing ACKs
Tue Nov 26 10:22:53 2024 daemon.notice hostapd: phy0-ap2: AP-STA-DISCONNECTED xx:xx:xx:xx:cd:c0
Tue Nov 26 10:22:56 2024 daemon.notice hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: did not acknowledge authentication response
Tue Nov 26 10:23:04 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: authenticated
Tue Nov 26 10:23:04 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 IEEE 802.11: associated (aid 2)
Tue Nov 26 10:23:04 2024 daemon.notice hostapd: phy0-ap2: AP-STA-CONNECTED xx:xx:xx:xx:cd:c0 auth_alg=open
Tue Nov 26 10:23:04 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 RADIUS: starting accounting session CB19C90DEE2BCF43
Tue Nov 26 10:23:04 2024 daemon.info hostapd: phy0-ap2: STA xx:xx:xx:xx:cd:c0 WPA: pairwise key handshake completed (RSN)
Tue Nov 26 10:23:04 2024 daemon.notice hostapd: phy0-ap2: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:xx:cd:c0

Does anyone have any idea on how to resolve this?

@robimarko: I've updated the patches I intend to submit as a PR to merge the ipq50xx target:

As requested, I've added more descriptions, including patches I haven't written for as far as my knowledge goes. Also, I have much simplified the patches for QCN6122 wifi, including description as well.
The Makefile for ath11k-firmware includes a Download routine to download the firmware files for IPQ5018/QCN6122 wifi from the old QUIC repo.

Are we good to go?

All of the SSDK and NSS-DP patches have no descriptions in them, not to mention that signoff is not enough.

Also, is there a reason for those ath11k patches not to land upstream?

I’ll make a start but I’ll probably need @hzyitc to weigh in on those as the author

I do intend to send them upstream

Anything else? Does the rest look okay?

I dont really have time to fully review it now, after you sort out the wired networking patches it would be great to open a PR.

@hzyitc: can you provide a description for this patch?

111-hsl_phy-split-MP_PHY-config.patch

Your new driver for the internal GE PHY is probed, why do we still need to enable IN_MP_PHY? Are there still dependencies on the SSDK?

I'd like to submit the PR asap so I would kindly request you to check the descriptions I've written for the patches for both qca-ssdk and qca-nss-dp and let me know if they're accurate or whether you have anything you'd like to add/change:

It's disabled in Makefile

I see now..
So you’re basically putting conditions in place to include/exclude MP PHY specific code at compile time.
Why do you still enable it in config?

--- a/config
+++ b/config
@@ -299,6 +299,7 @@ else ifeq (DESS, $(CHIP_TYPE))
 else ifeq (MP, $(CHIP_TYPE))
 	IN_QCA803X_PHY=TRUE
 	IN_QCA808X_PHY=TRUE
+	IN_MP_PHY=TRUE
 	IN_SFP_PHY=TRUE
 	IN_SFP=TRUE
 else ifeq (APPE, $(CHIP_TYPE))

just to keep origin logic. In origin code, it's enabled. What I do is to add a switch, so we can disable it.

2 Likes

PR created! Massive thanks @hzyitc for your support and invaluable contribution.
qualcommax: add support for ipq50xx target · Pull Request #17182 · openwrt/openwrt

@robimarko: for your awareness

5 Likes

@hzyitc: I’ve got v1 bootargs working, so we’re able to control the PCIE index, user PD id, and GPIO reset by passing them as boot args to Q6.

I know this may be the wrong thread, but there is currently a price reduction for Linksys routers on ibood https://www.ibood.com/pl/s-pl/t/sieci/42 with Qualcomm IPQ5018

and Zyxel 6E https://www.ibood.com/pl/s-pl/o/router-zyxel-scr50axe-wifi-6e-vpn/1173289

Would it be possible to add support for Linksys Hydra Pro 6 Mesh Router MR5500-KE?

I don't own such device, but I could give it a try if you have a stock dts I can work from

When I receive the router, I will try to read stock dts, although I have never done it :slight_smile:
TTL cable with what chip will PL2303HX or PL2303T or FTDI be good? 3.3V or 5V?

I think I'll answer it myself --> https://openwrt.org/docs/techref/hardware/port.serial.cables

@hzyitc: I've resumed work on the SPNMX56 device. As per my understanding, ethernet is wired as follows, but I don't know what phy/mac the GE Phy is connected to:

/*
* ===============================================================
*     _______________________           _______________________
*    |        IPQ5018        |         |        QCA8337        |
*    | +------+   +--------+ |         | +--------+   +------+ |
*    | | MAC0 |---| GE Phy |-+-- MDI --+ | ?????? |---|MAC0/6| |
*    | +------+   +--------+ |         | +--------+   +------+ |
*    |                       |         |_______________________|
*    |                       |          _______________________
*    |                       |         |        QCA8081        |
*    | +------+   +--------+ |         | +--------+   +------+ |
*    | | MAC1 |---| Uniphy |-+--SGMII+-+ | Phy    |---| MAC  | |
*    | +------+   +--------+ |         | +--------+   +------+ |
*    |_______________________|         |_______________________|
*
* ===============================================================
*/

I've created a simple patch that should enable the qca tag header on the user ports too, I've tried all of them, but it doesn't work:

dsa_switch_for_each_user_port(dp, ds) {
		// if (of_property_read_bool(dp->dn, "qca,enable-qca-header")) {
		ret = qca8k_write(priv, QCA8K_REG_PORT_HDR_CTRL(dp->index),
				FIELD_PREP(QCA8K_PORT_HDR_CTRL_TX_MASK, QCA8K_PORT_HDR_CTRL_ALL) |
				FIELD_PREP(QCA8K_PORT_HDR_CTRL_RX_MASK, QCA8K_PORT_HDR_CTRL_ALL));
		if (ret) {
			dev_err(priv->dev, "failed enabling QCA header mode on port %d", dp->index);
			return ret;
		}
		dev_info(priv->dev, "Enabled QCA header mode on port %d", dp->index);
		// }
	}

ifconfig shows that the CPU doesn't receive any traffic:

lan3      Link encap:Ethernet  HWaddr 80:69:1A:xx:xx:xx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:7768 (7.5 KiB)

CPU port in DTS:

port@6 {
	reg = <6>;
	phy-mode = "1000base-x";		/* tried both sgmii and 1000base-x
	ethernet = <&dp1>;
	phy-handle = <&qca8337_4>;		/* tried both fixed link and phy 5 which is connected to port 6 as per datasheet*/
	/*qca,sgmii-enable-pll;*/

	/*
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
	*/
};

Do you have any other ideas? Any other adjustments needed in the DSA driver?

Seems like the patch is working.. the REO status bug may have been the actual culprit for the other firmware crashes. It’s been running stably now on 3 devices.

Only messages I still occasionally see are:

[1129127.745948] ath11k c000000.wifi: failed to flush transmit queue, data pkts pending 15

This seems to be a wider issue with the ath11k driver, impacting other ath11k wifi chipsets as well.

I note a few observations

there are 2 RGMI interfaces 0 and 1
Looking at the connections
most of the links between the qca8337 - IPQ5018 occur in the bottom right corner of the 8337 - this indicates CH4 of the datasheet as ~ B33-A38 and above

1 Like

Affirmative ... seeing the same thing here on the b3000's. 7 days in and still running along. 1 of the 3 units produce the failed to flush message 1 time over 7 days. The other 2 have not complained a bit .

Great job ... as usual :love_you_gesture:

1 Like

Very useful.. that confirms the IPQ5018 gephy is connected to PHY4. As per datasheet, I think we’ll need to configure PORT6_PAD_CTRL to enable RGMII on PHY4 mode (CH4), with PORT6 being the CPU port. This will likely need changes to the DSA driver accordingly.. stay tuned