OpenWrt support for Xiaomi AX9000

Hello, I also run ax9000 according to your method, prompt {"msg":"wifi connect faild!","code":1616}
I want to know, do I need another openwrt router to run, thank you!

Yes you need to set up another OpenWrt router

If you have UART access, you can try to run this command to get the default SSH login password:

mkxqimage -I

If it works, so we could change xqsystem.lua, to change the wireless password to our SSH login password.

function getToken()
    local result = {}
    result["code"] = 0
    result["token"] = "; nvram set ssh_en=1; nvram set uart_en=1; nvram set boot_wait=on; nvram commit; uci set wireless.@wifi-iface[0].key=\`mkxqimage -I\`; uci commit; sed -i 's/channel=.*/channel=\"debug\"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"
    LuciHttp.write_json(result)
end

@kirdes No, it's not intentional, I just copied the URL that worked for me.
Which FW version are you using?

@zmcjs Yes, you need a second OpenWrt router, it's even written in the instructions.

@robimarko: got it. Problem was, I installed luci-ssl on the second router. This seems not to work due to ssl and self-signed certificate. Solution: uninstall luci-ssl

Great, that makes sense.
I pushed WIP support couple of minutes ago, its only initramfs tested(No sysupgrade yet).
Its esentially downclocked as I need to get the voltages for higher OPP points, thermal points as well.
Fan controller requires a driver as well, there was one sent last year but its full of bugs.

@Flole The I2C bus you required was also added.

1 Like

regarding OPP:

this is that i found as voltage range for the ipq8072 (from the Linksys MX5300) for the certain cpu frequency:

1017600 688 - 704
1382400 760 - 776
1651200 792 - 816
1843200 832 - 864
1920000 848 - 880
2208000 928 - 960

I fetched this from the running qsdk kernel.

Great, I will see what ones from the stock FW are(Should be pretty close) and then add them.
They will differ bit since CPR should adjust them based on load, but should be close enough with average between ones you provided and stock ones.

Just one question: why did you use phy_address = 24 for port@4? Regarding to the extracted dts it's id 18.

Its from the stock DTS, 0x18 is 24 in decimal.

Yes, of cause

BTW, IoT radio is not working as Gen2 PCI port will cause the board to hang, I even have to use earlycon to even see that.
So, its disabled for now.
Only the 5.8GHz high band and 2.4G radios work as lower band is QCN9024 connected via PCI which ath11k semi supports and will require patches from wlan-open

I thought this was fixed with one of Apache14's PCI patches?

But never mind, IOT radio is not that imported (at least to me)

QCN9024 would be more important :wink:

Gen3 port was fixed as that is what was used on AX3600 for IoT, Gen2 has had upstream support by QCA for a while now.
But like all QCA related things it does not work.

BTW, it looks like they are running the RGB strip on the top with a PWM signal from the PWM HW controller inside of the SoC.
Off course, no support for that upstream.

Maybe there's a driver in the ipq-5.4 kernel repo?

There is, but its broken by default.
But, its a low priority for now to be able and pulse the LED-s

classic QCA.

And yes, the two gpio leds in the front are enough so far.

Which driver is this exactly?

https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-ipq-5.4/tree/drivers/pwm/pwm-ipq.c?h=NHSS.QSDK.11.4.1.r1

@robimarko : Iā€™m playing around with the initramfs image.

Seems to work fine so far.

There's only one problem with the wifi:

iw reports no available 5 Ghz channel:

Frequencies:
			* 5180 MHz [36] (disabled)
			* 5200 MHz [40] (disabled)
			* 5220 MHz [44] (disabled)
			* 5240 MHz [48] (disabled)
			* 5260 MHz [52] (disabled)
			* 5280 MHz [56] (disabled)
			* 5300 MHz [60] (disabled)
			* 5320 MHz [64] (disabled)
			* 5500 MHz [100] (disabled)
			* 5520 MHz [104] (disabled)
			* 5540 MHz [108] (disabled)
			* 5560 MHz [112] (disabled)
			* 5580 MHz [116] (disabled)
			* 5600 MHz [120] (disabled)
			* 5620 MHz [124] (disabled)
			* 5640 MHz [128] (disabled)
			* 5660 MHz [132] (disabled)
			* 5680 MHz [136] (disabled)
			* 5700 MHz [140] (disabled)
			* 5720 MHz [144] (disabled)
			* 5745 MHz [149] (disabled)
			* 5765 MHz [153] (disabled)
			* 5785 MHz [157] (disabled)
			* 5805 MHz [161] (disabled)
			* 5825 MHz [165] (disabled)
			* 5845 MHz [169] (disabled)
			* 5865 MHz [173] (disabled)

If I set up a channel (I tried 36 and 149) and start wifi this happens:

WARNING: CPU: 3 PID: 2159 at ath11k_reg_update_chan_list+0x210/0x240 [ath11k]
[  148.497285] Modules linked in: iptable_nat ath11k_ahb ath11k ath10k_pci ath10k_core ath xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD nf_nat nf_flow_table nf_conntrack mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG ppp_async nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables hwmon crc_ccitt compat qca_nss_pppoe pppoe pppox ppp_generic slhc nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 qca_nss_drv qca_nss_dp qca_ssdk michael_mic leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug
[  148.544406] CPU: 3 PID: 2159 Comm: hostapd Not tainted 5.10.42 #0
[  148.566635] Hardware name: Xiaomi AX9000 (DT)
[  148.572800] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[  148.577154] pc : ath11k_reg_update_chan_list+0x210/0x240 [ath11k]
[  148.583223] lr : ath11k_wmi_detach+0x23e0/0x4298 [ath11k]
[  148.589203] sp : ffffffc01581ba00
[  148.594582] x29: ffffffc01581ba00 x28: ffffff8003866780 
[  148.597885] x27: ffffff8012c70c00 x26: ffffff80124c8000 
[  148.603267] x25: 0000000000000000 x24: ffffff80075cb6e0 
[  148.608562] x23: ffffff8004b40000 x22: ffffff80075c8c40 
[  148.613857] x21: ffffff80075c8c18 x20: 0000000000000000 
[  148.619152] x19: ffffff80075ca6e0 x18: 0000000000000071 
[  148.624447] x17: 0000000000000003 x16: 0000000000000018 
[  148.629741] x15: 00000000000000c6 x14: ffffff80075cb21c 
[  148.635036] x13: 0000000000000018 x12: 0000000000000008 
[  148.640332] x11: 0000000000000004 x10: ffffff8004b48104 
[  148.645628] x9 : 00000000000000c7 x8 : 000000000000000d 
[  148.650923] x7 : 00000000ffffffff x6 : ffffff80075cb1fc 
[  148.656218] x5 : 0000000000000040 x4 : ffffff80075c8c40 
[  148.661512] x3 : ffffff80038ea6cc x2 : 0000000000000031 
[  148.666808] x1 : 0000000000000000 x0 : ffffff80075ca6e0 
[  148.672104] Call trace:
[  148.677402]  ath11k_reg_update_chan_list+0x210/0x240 [ath11k]
[  148.679577]  ath11k_wmi_detach+0x23e0/0x4298 [ath11k]
[  148.685496]  drv_start+0x34/0x68 [mac80211]
[  148.690518]  ieee80211_do_open+0x3c0/0x940 [mac80211]
[  148.694513]  ieee80211_do_open+0x924/0x940 [mac80211]
[  148.699712]  __dev_open+0xf4/0x178
[  148.704739]  __dev_change_flags+0x13c/0x1a0
[  148.708041]  dev_change_flags+0x24/0x68
[  148.712122]  devinet_ioctl+0x3f8/0x790
[  148.715938]  inet_ioctl+0x360/0x808
[  148.719759]  sock_do_ioctl+0x4c/0x238
[  148.723144]  sock_ioctl+0x33c/0x510
[  148.726966]  __arm64_sys_ioctl+0x94/0xd0
[  148.730266]  el0_svc_common.constprop.3+0xac/0x170
[  148.734430]  do_el0_svc+0x70/0x90
[  148.739031]  el0_svc+0x18/0x28
[  148.742414]  el0_sync_handler+0x90/0xb8
[  148.745366]  el0_sync+0x184/0x1c0
[  148.749097] ---[ end trace d088e0284293c4b8 ]---
[  148.759005] br-lan: port 5(wlan0) entered blocking state
[  148.759042] br-lan: port 5(wlan0) entered disabled state
[  148.763738] device wlan0 entered promiscuous mode
[  148.770226] device wlan0 left promiscuous mode
[  148.773424] br-lan: port 5(wlan0) entered disabled state

ath11k loads the right board file:

ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0x294 soc_id 0xffffffff

The 2.4 Ghz wifi is working, but there seems to be a problem with the output power.

I've set the region to 'DE', that should limit the output to 20db, but it's actually 30db:

phy#1
	Interface wlan1
		ifindex 16
		wdev 0x100000002
		addr 9c:9d:7e:7c:4b:5f
		ssid OpenWrt
		type AP
		channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
		txpower 30.00 dBm

iw reg get:

global
country DE: DFS-ETSI
	(2400 - 2483 @ 40), (N/A, 20), (N/A)
	(5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
	(5725 - 5875 @ 80), (N/A, 13), (N/A)
	(57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#1 (self-managed)
country DE: DFS-ETSI
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5490 - 5590 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
	(5590 - 5650 @ 40), (N/A, 24), (600000 ms), DFS, AUTO-BW
	(5650 - 5710 @ 40), (N/A, 24), (0 ms), DFS, AUTO-BW

phy#0 (self-managed)
country DE: DFS-ETSI
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5490 - 5590 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
	(5590 - 5650 @ 40), (N/A, 24), (600000 ms), DFS, AUTO-BW
	(5650 - 5710 @ 40), (N/A, 24), (0 ms), DFS, AUTO-BW

So there seems to be a problem with the wifi, or am I missing something?