OpenWrt support for Xiaomi AX9000

Hm, for me channels 149 and later are advertised.
I have not tested whether it actually works.

36 should not work at all as anything below 149 is handled by the QCN9024.

You can see that the power limit is 30dBm according to the in firmware regulatory dabatase.
That is a big issue as they dont appear to update that one at all.

Update: I looked in detail and you can see that regulatory in firmware is limiting 5G to 5710MHz hence why 149 and so are disabled.
With US it should be enabled.

This is again regulatory issue with ath11k fw, no idea how to work around this.

Yes with reg set US 5Ghz is working.

The in firmware regulatory seems very bad at the moment.

btw
I had a look at the ax3600 sysupgrade logic and as far as i can see ax9000 has the very same u-boot env flags.
So i would assume we can use the same sysupgrade logic.

Yes, it should be the same but I have not tested it and that is why its not added.
Yeah, regulatory info in the FW is outdated completely, but I dont see a way to work around that, I tried looking for patches in wlan-open but nothing looks interesting.

If running from initramfs, dp1 - dp5 are working.

If running from flash, the dp1 - dp4 don't work:

ssdk_phy_driver_init[328]:INFO:dev_id = 0, phy_adress = 0, phy_id = 0xffffffff phytype doesn't match
[    7.606689] ssdk_phy_driver_init[328]:INFO:dev_id = 0, phy_adress = 1, phy_id = 0xffffffff phytype doesn't match
[    7.616845] ssdk_phy_driver_init[328]:INFO:dev_id = 0, phy_adress = 2, phy_id = 0xffffffff phytype doesn't match
[    7.627034] ssdk_phy_driver_init[328]:INFO:dev_id = 0, phy_adress = 3, phy_id = 0xffffffff phytype doesn't match
nss-dp: probe of 3a001000.dp1 failed with error -14
[    9.214065] nss-dp: probe of 3a001200.dp2 failed with error -14
[    9.224443] nss-dp: probe of 3a001400.dp3 failed with error -14
[    9.235034] nss-dp: probe of 3a001600.dp4 failed with error -14

If I change the mdio reset to 37, when dp1 - dp4 are working, but the dp5 (QCA 8081) isn't working any more
(neither from initramfs nor from flash)

Xiaomi is using both mdio resets in the dts.

I know, but I have not had time to debug it.
Essentially its due to upstream kernel not supporting multiple resets for the PHY-s.
That is why I added only QCA8081 one, techically it should work by defining the reset per PHY, but that is flaky as well.

I am working on the fan controller driver now, hopefully I should have time in a day or two to see what can be done about the PHY resets.

2 Likes

https://lkml.kernel.org/r/20210615211348.92168-1-jouni@codeaurora.org

That at least sounds rather promising.

The FW mentioned in that commit was added 9 days ago to the public git.

Yeah, I just saw the patch series earlier today.
Its gonna be a hell to backport to 5.10, but at least they even pushed their local data path improvements.
It looks like they hired Jouni Malinen to accellerate the upstreaming.

BTW, I already updated the ath11k-firmware with that fw version

@Apache14 Ahh, I was backporting QCN9074 stuff, got halfway through and then the old backports started causing issues.
All of the bugfixing/stability fixes for QCA6390 that are used for QCN9074 as well are missing.
I would essentially need to add all of the PCI changes from 5.11 and later.

I actually got somewhat through backporting the QCN9074 support, unfortunately, the issue is that 5.10.42 includes a lot of backported stuff from 5.13 and therefore I cannot easily see what needs to be backported.

1 Like

Has anybody else give backporting the PCI changes a go?
I even tried making 5.13-rc6 backports for OpenWrt, but I cannot figure out why the hell does Coccinelle patch not apply.

A

/usr/lib/lua/luci/controller/admin/xqsystem.lua

module("luci.controller.admin.xqsystem", package.seeall)

function index()
local page = node("api")
page.target = firstchild()
page.title = ("")
page.order = 100
page.index = true
page = node("api","xqsystem")
page.target = firstchild()
page.title = ("")
page.order = 100
page.index = true
entry({"api", "xqsystem", "token"}, call("getToken"), (""), 103, 0x08)
end

local LuciHttp = require("luci.http")

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; sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"
LuciHttp.write_json(result)
end

Hello everyone,

I try this but not possible, i send one picture
i dont have admin folder , but the system not permitted create folder i try this commands but not have sucess

mkdir /usr/lib/lua/luci/controller/admin

vi /usr/lib/lua/luci/controller/admin/xqsystem.lua

*I'm using xiaomi ac2100 as a secondary router

What are you running on the AC2100?
There have been multiple confirmations that this works.

http://www1.miwifi.com/miwifi_download.html

this version

If it was not obvious, then it requires actual OpenWrt, not Xiaomi FW on the second device.

thank you

ax9000 router is first?
other router with firmware openwrt is secondary?

cable conection ax9000 to secondary router ?

Its all written in the wiki.

No cable connection, they will get connected via WLAN

Thank you,

I'll get a tp-link router with openwrt and as soon as I can, I'll give feedback

regards

I finally got the patches for QCN9074 backported.
I ended up pretty much backporting everything from 5.10.42 to 5.13-rc6.

Unfortunately though it compiles and boots it fails:

[   10.007807] ath11k c000000.wifi: ipq8074 hw2.0
[   10.008033] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[   10.011271] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[   10.374792] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[   10.377093] ath11k c000000.wifi: qmi ignore invalid mem req type 3
[   10.381830] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0x294 soc_id 0xffffffff
[   10.387279] ath11k c000000.wifi: fw_version 0x240284a5 fw_build_timestamp 2021-05-05 02:23 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HK.2.4.0.1-01746-QCAHKSWPL_SILICONZ-1
[   10.562645] remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss
[   10.562686] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[   10.568986] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[   15.837334] qcom-q6v5-wcss-pil cd00000.q6v5_wcss: start timed out
[   15.837376] remoteproc remoteproc0: can't start rproc cd00000.q6v5_wcss: -110
[   15.842534] ath11k c000000.wifi: failed to boot the remote processor Q6
[   15.851347] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[   15.856112] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[   15.864639] ath11k_pci 0000:01:00.0: qcn9074 hw1.0
[   15.871070] debugfs: Directory 'ath11k' with parent '/' already present!
[   15.875000] ath11k_pci 0000:01:00.0: failed to create ath11k debugfs
[   15.901329] ath11k_pci 0000:01:00.0: failed to create soc core: -17
[   15.901356] ath11k_pci 0000:01:00.0: failed to init core: -17
[   16.114154] ath11k_pci: probe of 0000:01:00.0 failed with error -17

With the AHB driver disabled we get this:

[    9.014093] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[    9.014228] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[    9.021409] ath11k_pci 0000:01:00.0: qcn9074 hw1.0
[    9.083114] mhi 0000:01:00.0: Requested to power ON
[    9.083349] mhi 0000:01:00.0: Power on setup success

Looks better, it was failing due to ath11k_ahb and then ath11k_pci trying to created the same debugfs directory.
But it does not init fully as FW is not loaded and its not registered.

I gave it a go with 5.13-rc6 and it has the same issue.
My guess is that its a PCI related issue.

1 Like