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

I'm using the same values as the ones @hzyitc's repo (for reserved mem regions and addresses in the wifi nodes). It's worth mentioning that ipq5018 wifi works when qcn6122 is disabled. When enabled, ipq5018 wifi seems to stall.
These are the logs:

[   10.774084] ath11k c000000.wifi: ipq5018 hw1.0
[   10.774134] ath11k c000000.wifi: FW memory mode: 2
[   10.828479] remoteproc remoteproc2: powering up pd-1
[   10.828801] remoteproc remoteproc2: Booting fw image ath11k/IPQ5018/hw1.0/q6_fw.mdt, size 1820
[   10.832590] remoteproc remoteproc1: powering up cd00000.remoteproc
[   10.841096] remoteproc remoteproc1: Booting fw image ath11k/IPQ5018/hw1.0/q6_fw.mdt, size 1820
[   10.953525] remoteproc remoteproc1: remote processor cd00000.remoteproc is now up
[   10.972149] remoteproc remoteproc2: remote processor pd-1 is now up
[   10.976083] ath11k soc@0:wifi1@c000000: qcn6122
[   10.977254] ath11k soc@0:wifi1@c000000: FW memory mode: 2
[   11.001934] ath11k c000000.wifi: qmi fail to get qcom,m3-dump-addr, ignore m3 dump mem req
[   11.034654] remoteproc remoteproc3: powering up pd-2
[   11.034934] remoteproc remoteproc3: Booting fw image ath11k/IPQ5018/hw1.0/q6_fw.mdt, size 1820
[   11.050292] remoteproc remoteproc3: remote processor pd-2 is now up
[   11.062832] batman_adv: B.A.T.M.A.N. advanced 2024.2-openwrt-1 (compatibility version 15) loaded
[   11.072617] kmodloader: done loading kernel modules from /etc/modules.d/*
[   11.099661] ath11k c000000.wifi: chip_id 0x0 chip_family 0x4 board_id 0x23 soc_id 0xffffffff
[   11.099727] ath11k c000000.wifi: fw_version 0x270206d0 fw_build_timestamp 2022-08-04 13:28 fw_build_id WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
[   11.675066] mtdblock: MTD device 'devinfo' is NAND, please consider using UBI block devices instead.
[   12.167148] mtdblock: MTD device 'devinfo' is NAND, please consider using UBI block devices instead.
[   20.886457] nss-dp 39d00000.dp2 eth1: PHY Link is down
[   20.904204] nss-dp 39d00000.dp2 eth1: PHY Link up speed: 1000
[   20.932576] qca8k 90000.mdio-1:11 lan1: configuring for phy/gmii link mode
[   20.982461] br-lan: port 1(lan1) entered blocking state
[   20.982530] br-lan: port 1(lan1) entered disabled state
[   20.987024] qca8k 90000.mdio-1:11 lan1: entered allmulticast mode
[   20.991895] nss-dp 39d00000.dp2 eth1: entered allmulticast mode
[   21.019241] qca8k 90000.mdio-1:11 lan1: entered promiscuous mode
[   21.075974] qca8k 90000.mdio-1:11 lan2: configuring for phy/gmii link mode
[   21.078998] br-lan: port 2(lan2) entered blocking state
[   21.081779] br-lan: port 2(lan2) entered disabled state
[   21.098042] qca8k 90000.mdio-1:11 lan2: entered allmulticast mode
[   21.101192] qca8k 90000.mdio-1:11 lan2: entered promiscuous mode
[   21.129642] qca8k 90000.mdio-1:11 lan3: configuring for phy/gmii link mode
[   21.138481] br-lan: port 3(lan3) entered blocking state
[   21.138560] br-lan: port 3(lan3) entered disabled state
[   21.143453] qca8k 90000.mdio-1:11 lan3: entered allmulticast mode
[   21.167932] qca8k 90000.mdio-1:11 lan3: entered promiscuous mode
[   21.214248] qca8k 90000.mdio-1:11 wan: configuring for phy/gmii link mode
[   21.928113] adpt_mp_port_netdev_change_notify[1186]:ERROR:netdev change notify with incorrect port 0
[   21.928187] ssdk_dev_event[2313]:ERROR:netdev change notify failed
[   24.410487] qca8k 90000.mdio-1:11 lan3: Link is Up - 1Gbps/Full - flow control rx/tx
[   24.410630] adpt_mp_port_netdev_change_notify[1186]:ERROR:netdev change notify with incorrect port 0
[   24.417323] ssdk_dev_event[2313]:ERROR:netdev change notify failed
[   24.426548] br-lan: port 3(lan3) entered blocking state
[   24.432473] br-lan: port 3(lan3) entered forwarding state
[   51.161602] qcom-q6-mpd cd00000.remoteproc: fatal error received: err_smem_ver.2.1:
[   51.161602] QC Image Version : QC_IMAGE_VERSION_STRING=WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
[   51.161602] Image Variant : IMAGE_VARIANT_STRING=5018.wlanfw2.map_spr_spr_evalQ
[   51.161602] dog_virtual_user.c:242 USER-PD DOG detects stalled initialization, triage with IMAGE OWNER param0 :zero,param1 :zero,param2 :zero
[   51.161602] Thread ID : 0x00000050 Thread name : TIMER_CLIENT_2 Process ID : 0x00000002 Process name :wlan1
[   51.161602]
[   51.161602] Registers:
[   51.161602] SP : 0x4bfc7020
[   51.161602] FP : 0x4bfc7030
[   51.161602] PC : 0xd025bc70
[   51.161602] SSR : 0x00000000
[   51.161602] BADVA : 0x00000000
[   51.161602] LR : 0xd000a3fc
[   51.161602]
[   51.161602] StackDump
[   51.161602] from:0x4bfc7020
[   51.161602] to: 0x00000000:
[   51.161602]
[   51.216593] remoteproc remoteproc1: crash detected in cd00000.remoteproc: type fatal error
[   51.239179] remoteproc remoteproc1: handling crash #1 in cd00000.remoteproc
[   51.246986] remoteproc remoteproc1: recovering cd00000.remoteproc
[   51.261780] remoteproc remoteproc1: stopped remote processor cd00000.remoteproc
[   51.361350] remoteproc remoteproc1: remote processor cd00000.remoteproc is now up

the current mpd driver doesn't support v1 bootargs.

So if your qcn6122 connect to pcie0 or use different reset gpio. it will fail.

1 Like

the stock dts for MX2000 has 3 userpds, 1 for the internal ipq5018 wifi, and 2 for qcn6122 while there's only 1 qcn6122 radio in it:

userpd1 -> ipq5018 wifi
userpd2 -> qcn6122 wifi (disabled)
userpd3 -> qcn6122 wifi (enabled)

wifi1@c000000 {
    compatible = "qcom,cnss-qcn6122";
    qcom,rproc = <0x00 0x00 0x00 0x25>;
    status = "ok";
    qcom,multipd_arch = <>;
    qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
    qcom,tgt-mem-mode = <0x00 0x00 0x00 0x01>;
    qcom,board_id = <0x00 0x00 0x00 0x60>;
    qcom,bdf-addr = <0x4E 0xD0 0x00 0x00 0x4E 0xD0 0x00 0x00 0x4E 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00>;
    qcom,caldb-addr = <0x4F 0xF0 0x00 0x00 0x4F 0xF0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00>;
    qcom,caldb-size = <0x00 0x50 0x00 0x00>;
};

q6v5 bootargs:

qcom,bootargs_smem = <0x00 0x00 0x01 0xFB>;
boot-args = <0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x0F 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x12 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00>;

looks like it has 2 sets of bootargs (based on the description in your repo):


            </*       type: */ 0x1 /* PCIE0?? */
		     /*     length: */ 4
		     /*      PD id: */ 3
		     /* reset GPIO: */ 15
		     /*   reserved: */ 0 0>;
and

            </*       type: */ 0x2 /* PCIE1 */
		     /*     length: */ 4
		     /*      PD id: */ 2
		     /* reset GPIO: */ 18
		     /*   reserved: */ 0 0>;

your stock dts is simular to the stock b3000 dts. And what i am seeing using hzytic values is very similar to what you are seeing as well. When I use the "stock" values, it crashes iat the same spot, only it throws a a different error

Unable to handle kernel paging request at virtual address ffffffc10a200000.

if its any help, the stock b3000 dts, uses the PCIE1 bootargs


	qcom,bootargs_smem = <507>;
	boot-args = </*       type: */ 0x2 /* PCIE1 */
		     /*     length: */ 4
		     /*      PD id: */ 2
		     /* reset GPIO: */ 27
		     /*   reserved: */ 0 0>;

	status = "ok";

could i have a peek at your dts ... i'll show you mine, if you show me yours :stuck_out_tongue:

1 Like

I’ll push an update today or tomorrow

I’ve looked at the downstream driver on codelinaro and have implemented loading bootargs from the DTS and passing that using smem to q6, still doing some testing to try and get it to work.

How did you get yours to load the bootargs?
Or does it coincidentally default to your values by not passing any bootargs?

Ive also made some minor changes to the patch for ath11k driver support for qcn6122. The way it is currently implemented breaks loading the right cal data file for other ath11 wifi chips on existing implementations such as qcn9074. I’ll push an update to my repo later today or tomorrow with those changes.

1 Like

brilliant work mate !

I have pretty much the same results as you on 5.15 at this point. So moving on to 6.6 going forward.

  119.873825] qcom-q6-mpd cd00000.remoteproc: fatal error received: err_smem_ver.2.1: 

[  119.873825] QC Image Version : QC_IMAGE_VERSION_STRING=WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

[  119.873825] Image Variant : IMAGE_VARIANT_STRING=5018.wlanfw2.map_spr_spr_evalQ

[  119.873825] dog_virtual_user.c:242 USER-PD DOG detects stalled initialization, triage with IMAGE OWNER param0 :zero,param1 :zero,param2 :zero

[  119.873825] Thread ID : 0x00000062 Thread name : TIMER_CLIENT_2 Process ID : 0x00000002 Process name :wlan1

also, i seem to have 2 different stock dts files for the b3000. one is using the bootargs. Not sure if it'll help you currently or not ...

&q6v5_wcss {
	compatible = "qcom,ipq5018-q6-mpd";
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;
	firmware = "IPQ5018/q6_fw.mdt";
	
	reg = 	
		<0x0cd00000 0x4040>,
		<0x1938000 0x8>,
		<0x193d204 0x4>;
			
	reg-names = 
			"qdsp6",
			"tcsr-msip",
			"tcsr-q6";
			
	resets = <&gcc GCC_WCSSAON_RESET>,
			 <&gcc GCC_WCSS_Q6_BCR>;

	reset-names = "wcss_aon_reset",
			"wcss_q6_reset";

	clocks = <&gcc GCC_Q6_AXIS_CLK>,
		<&gcc GCC_WCSS_ECAHB_CLK>,
		<&gcc GCC_Q6_AXIM_CLK>,
		<&gcc GCC_Q6_AXIM2_CLK>,
		<&gcc GCC_Q6_AHB_CLK>,
		<&gcc GCC_Q6_AHB_S_CLK>,
		<&gcc GCC_WCSS_AXI_S_CLK>;
	clock-names = "gcc_q6_axis_clk",
		"gcc_wcss_ecahb_clk",
		"gcc_q6_axim_clk",
		"gcc_q6_axim2_clk",
		"gcc_q6_ahb_clk",
		"gcc_q6_ahb_s_clk",
		"gcc_wcss_axi_s_clk";

	#ifdef __IPQ_MEM_PROFILE_256_MB__
		memory-region = <&q6_mem_regions>, <&q6_etr_region>;
	#else
		memory-region = <&q6_mem_regions>, <&q6_etr_region>,
				<&q6_caldb_region>;
	#endif

	qcom,rproc = <&q6v5_wcss>;
	qcom,bootargs_smem = <507>;
	boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
			<0x2 0x4 0x2 0x12 0x0 0x0>;
			
	status = "ok";

This bootargs is the default value.

If you support bootargs, you can let PD2 use PCIE0.

Or you can try the following DTS:

NOTE: the path of caldata will be changed to ath11k/qcn6122/hw1.0/caldata_2.bin, you need to update it in target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata

&q6v5_wcss {
	...

	// IPQ5018
	q6_wcss_pd1: pd-1 {
		...
	};

	// QCN6102
	q6_wcss_pd3: pd-3 {
		interrupts-extended =
			<&wcss_smp2p_in 24 0>,
			<&wcss_smp2p_in 25 0>,
			<&wcss_smp2p_in 28 0>,
			<&wcss_smp2p_in 27 0>;
		interrupt-names =
			"fatal",
			"ready",
			"spawn-ack",
			"stop-ack";

		qcom,smem-states =
			<&wcss_smp2p_out 24>,
			<&wcss_smp2p_out 25>,
			<&wcss_smp2p_out 26>;
		qcom,smem-state-names =
			"shutdown",
			"stop",
			"spawn";

		firmware-name = "IPQ5018/q6_fw.mdt";
		// m3_firmware = "qcn6122/m3_fw.mdt";
	};
};

&wifi1 {
	// QCN6102
	qcom,multipd_arch;
	qcom,rproc = <&q6_wcss_pd3>;
	qcom,userpd-subsys-name = "q6v5_wcss_userpd3";

	qcom,board_id = <0x60>;

	// qcom,ath11k-fw-memory-mode = <0>;
	// qcom,bdf-addr = <0x4d500000>;
	// qcom,caldb-addr = <0x4e500000>;
	// qcom,m3-dump-addr = <0x4ea00000>;

	qcom,ath11k-fw-memory-mode = <2>;
	qcom,bdf-addr = <0x4d100000>;
	qcom,m3-dump-addr = <0x4df00000>;

	status = "okay";
};
1 Like

got the radios working now on the MX2000 (IPQ5018 & QCN6122):

bootargs aren't necessary, but to get it working I needed the latest board-2.bin from here:

AND assign user pd-3 to the qcn6122 5G radio, I think it's somehow hardcoded in the firmware or something. (pd-2 is for the 6G qcn6122 radio)

I'll be pushing the code to my repo shortly..

1 Like

bootargs can control this. to let PD2 use pcie0, set it like this:

boot-args = </*       type: */ 0x1 /* PCIE0 */
		     /*     length: */ 4
		     /*      PD id: */ 2
		     /* reset GPIO: */ 15
		     /*   reserved: */ 0 0>;

and yes, there is a incompatible field change in BDF between 2.4 and 2.7. So it need to be adjust. will post the method here latter.

1 Like

code pushed to main-ipq50xx-kernel6.6 (github.com)

I'll check if I can get v1 bootargs working with these params later.
I played around with them yesterday but couldn't get it to work, but that was with the older board-2.bin. I'll give it a try with the new one (v2.7.0.1-01744)

this would be great as I'm now using a new version of a generic board-2.bin instead of a device-specific one which has channel restrictions.
On the Linksys MX2000 for ex, qcn6122 is restricted to channel 36-140. But with the generic board file, I can select channels higher than 140 too, which I assume may cause damage.

and before I forget, you have been of great help!! thanks for that

great work guys ! I sure I can speak on behalf of about every member when i say .. thank you both for your amazing work and sharing of info. Truly paving the way for the rest of us.

yes, please do share the method, my vague understanding has been haunting me all week.

Can you try to use these board files: https://filebin.net/kvj8qzqluns5w57g

  • MX5500 - BDF updated to latest version, removed regdomain and updated regdb (ipq5018 and qcn9074)
  • MX2000 - removed regdomain and updated regdb (ipq5018 and qcn6122)

no, please use the board-special one. The reason is IPQ5018: Support for Linksys MX2000 Atlas 6 & MX5500 Atlas 6 Pro - #162 by hzyitc.

The value in 0x45c should be changed from 0x3 to 0x0. And than fix the checksum in 0xa.