Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Which ones?

Your router has two locations.

With the command below you will know which one you are on

nvram get flag_boot_rootfs

0 = mtd12
1 = mtd13.
Upload your openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-nand-factory.ubi file to the tmp directory.
Then you can run the following command replacing the mtd13 according to your location

ubiformat / dev / mtd13 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-nand-factory.ubi

Then you switch to mtd13 with the commands. (switch Xiaomi to OpenWrt)

nvram set flag_last_success = 1
nvram set flag_boot_rootfs = 1
nvram commit
reboot

To switch from OpenWrt to Xiaomi you execute

fw_setenv flag_last_success 0
fw_setenv flag_boot_rootfs 0
reboot

Have fun.

2 Likes

So if I want to write back it to original firmware, I just need to switch to original firmware and update firmware?

This can help to understand
Tuto

1 Like

This is the full list of patches I got from the fork:

15c18b04200696358bcd6ff1493fd041218e0006 lede files
include/kernel-version.mk
package/kernel/mac80211/Makefile
package/kernel/mac80211/ath.mk
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
package/kernel/mac80211/files/lib/wifi/mac80211.sh
package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch
package/kernel/mac80211/patches/ath10k/999-ath10k-Enable-802.11-encap-offload-in-tx-path.patch
package/kernel/mac80211/patches/ath11k/983-ath11k-Enable-VHT-for-2G.patch

package/kernel/mac80211/patches/ath11k/004-v5.12-ath11k-fix-ZERO-address-in-probe-request.patch
package/kernel/mac80211/patches/ath11k/005-v5.13-ath11k-Fix-sounding-dimension-config-in-HE-cap.patch
package/kernel/mac80211/patches/ath11k/006-v5.11-ath11k-use-MHI-provided-APIs-to-allocate-and-free-MHI-con.patch
package/kernel/mac80211/patches/ath11k/006-v5.13-ath11k-Update-signal-filled-flag-during-sta_statistics-drv-op.patch
package/kernel/mac80211/patches/ath11k/007-2-ath11k-fix-4addr-multicast-packet-tx.patch
package/kernel/mac80211/patches/ath11k/007-ath11k-switch-to-using-ieee80211_tx_status_ext.patch
package/kernel/mac80211/patches/ath11k/008-ath11k-decode-HE-status-tlv.patch
package/kernel/mac80211/patches/ath11k/008-v5.14-ath11k-Avoid-memcpy-over-reading-of-he_cap.patch
package/kernel/mac80211/patches/ath11k/009-ath11k-translate-HE-status-to-radiotap-format.patch
package/kernel/mac80211/patches/ath11k/009-v5.15-ath11k-set-register-access-length-for-MHI-driver.patch
package/kernel/mac80211/patches/ath11k/011-ath11k-fix-4-addr-tx-failure-for-AP-and-STA-modes.patch
package/kernel/mac80211/patches/ath11k/014-ath11k-add-support-for-setting-fixed-HE-rate-gi-ltf.patch
package/kernel/mac80211/patches/ath11k/015-ath11k-Enable-radar-detection-for-160MHz-secondary-segment.patch
package/kernel/mac80211/patches/ath11k/143-ath11k-disabling-credit-flow-for-ath11k.patch
package/kernel/mac80211/patches/ath11k/191-ath11k-add-mgmt-and-data-ack-rssi.patch
package/kernel/mac80211/patches/ath11k/237-001-ath11k-Disable-unused-CE8-interrupts.patch
package/kernel/mac80211/patches/ath11k/302-ath11k-tx-mgmt-cleanup-fix.patch
package/kernel/mac80211/patches/ath11k/314-002-ath11k-fix-ce-dp-address-alignment.patch
package/kernel/mac80211/patches/ath11k/802-ath11k-small-tx-queue.patch
package/kernel/mac80211/patches/ath11k/999-ath11k-Enable-512MB-profile-in-ath11k.patch
package/kernel/mac80211/Makefile

package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch
package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
package/kernel/mac80211/patches/subsys/380-mac80211-introduce-aql_enable-node-in-debugfs.patch
package/kernel/mac80211/patches/subsys/381-mac80211-rearrange-struct-txq_info-for-fewer-holes.patch
package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch
package/kernel/mac80211/patches/subsys/383-mac80211-fix-enabling-4-address-mode-on-a-sta-vif-af.patch
package/kernel/mac80211/patches/subsys/384-nl80211-add-common-API-to-configure-SAR-power-limita.patch
package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch
package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch
package/kernel/mac80211/patches/subsys/999-mac80211-add-option-for-NSS-support.patch
package/kernel/mac80211/patches/subsys/999-mac80211-nss-classify-tx.patch
package/kernel/mac80211/patches/subsys/999-mac80211-xmit-busy.patch
target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch
target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch
target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch
target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch
target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
target/linux/generic/backport-5.10/610-v5.13-54-netfilter-flowtable-dst_check-from-garbage-collector.patch
target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
target/linux/generic/backport-5.10/610-v5.13-57-netfilter-flowtable-Set-offload-timeouts-according-t.patch
target/linux/generic/config-5.10
target/linux/generic/hack-5.10/204-module_strip.patch
target/linux/generic/hack-5.10/221-module_exports.patch
target/linux/generic/hack-5.10/301-mips_image_cmdline_hack.patch
target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch
target/linux/generic/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch
target/linux/generic/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
target/linux/generic/hack-5.10/992-add-ndo-do-ioctl.patch
target/linux/ipq807x/Makefile
target/linux/ipq807x/base-files/etc/board.d/01_leds
target/linux/ipq807x/base-files/etc/board.d/02_network
target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
target/linux/ipq807x/base-files/etc/init.d/bootcount
target/linux/ipq807x/base-files/lib/upgrade/platform.sh
target/linux/ipq807x/config-5.10
target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi
target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts
target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-memory-512m.dtsi
target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-sxr80.dts
target/linux/ipq807x/files/drivers/hwmon/emc2305.c
target/linux/ipq807x/image/generic.mk
target/linux/ipq807x/patches-5.10/140-clk-qcom-ipq8074-make-apss-clock-as-child-of-mailbox.patch
target/linux/ipq807x/patches-5.10/600-qca-nss-ecm-support-CORE.patch
target/linux/ipq807x/patches-5.10/900-arm64-dts-add-OpenWrt-DTS-files.patch

I'm just wrote them over robi's branch. I also adjusted them a little bit to use the nss from the feed rather than the packages they have in their fork(use qca-nss-drv instead of qca-nss-drv-64).

Some of the patches are clearly not related, but like I said above there is some package corruption bug that affects ethernet.

I basically checked out the fork and added the files above, including updating to linux 5.10.51

you have it on github?

Sure, I put it here: https://github.com/hgblob/openwrt

PS: I can't know if it works for you, be careful when using random code from internet, etc.. etc..

Still that version (I've picked default branch) is having problem with connection frequently disrupted (while VLANs are enabled). Actually just re-tested without VLANs: everything Ethernet connected is getting scrambled.
And on top it is flooding logs with:

Aug  1 13:15:04 router kernel: [  279.333924] wlan1: NSS TX failed with error[8]: NSS_TX_FAILURE_NOT_ENABLED

Perhaps a config problem, maybe missing something?

Here is my config at the moment: https://clbin.com/FVAoU

That indicates they are using NSS cores for WiFi.
You might want to ask them.

Might be a problem with my device. I have built image based on your config adding just luci-openssl, acme and dnscrypt-proxy2 and it is right away breaking transmissions over Ethernet.
The only config more or less working is the one without any NSS related package but that is dropping WAN every few minutes.

I believe I found the problem. Looks like multi-threaded building is not working.
For anybody with similar issue I had to replace make -j12 with make -j1.
Edit: actually that worked with limited .config. Something bigger is still having the same issue.
Edit 2: even build with limited number of packages can start to scramble communication.

Hi, first post here.

Under ubuntu 20.04.2 running in WSL2 I can build multithreaded just fine, or at least the build produced a valid flash file just fine :expressionless:

My problem is more about the WiFi throughput.. I built the https://github.com/hgblob/openwrt branch and installed it on my R3600, all three WLAN interfaces come up fine (there's a 802.11n/ac radio0, a 802.11n/ac/ax radio1 and a 2.4g radio2) and using fast.com speed test I get about the same bandwidth with the original firmware; but when I start iperf3 on the R3600 and try to connect to it over 802.11ax on my laptop, all radios and the bridge interface reset after less than a second and it takes over a minute for it to come back online. Dmesg shows nothing of interest other than

[  124.810003] br-lan: port 7(wlan1) entered disabled state
[  124.813807] ath10k_pci 0000:01:00.0: mac flush null vif, drop 0 queues 0xffff

wlan1 is the 802.11ax radio interface that I am connected over.

The R3600 is running in dumb AP mode by the way. All interfaces are bridged together. Connected to another OpenWrt router (RPi4) over gigabit Ethernet.

Can I get a sample /etc/config/wireless file from someone who got it working maybe? I set bandwidth and channels to custom values and maybe that's messing something up.

Also I can't figure out what the radio0 is for. Its device path is more of a PCI path soc/20000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0 while radio1 and radio2 seem to be SoC interfaces. I set it up in AP mode but its SSID doesn't even show up anywhere.

Edit : I disabled radio0 then set the radio1 bandwidth to 80 MHz (down from 160MHz) and channel number to auto; it's more stable now. I'm not sure which of these three fixed my issue but iperf3 doesn't crash the radio anymore.

The only issue I noticed so far is.. the 802.11ax interface boots ... slow. It takes another 2 minutes after the AP is SSH-able over Ethernet, to the radio interface starting to accept connections.

Cheers..

This is to be expected, it needs to do it's radar scan before enabling the interface. The scan is suppose to last 1 minute, I think

Is there any way I can skip this? It's slow even if I pick non-DFS channels manually.

this is the secondary (aka IoT) device ath10.

For some reason this is organized differently. You can use radio0 for 2.4 n and 5 GHz ac mode at the same time while ath11 uses two separate radio devices for 2.4 and 5.

Regarding the instability:
have you monitored ram usage?
Standard config seems to be a bit too generous in assigning memory, and starting bulk send/receive could push it over the edge.

HTH

The load issue seems to have been fixed after I set channel mode down to 80 MHz and disabled radio0.

I have collectd setup and the memory usage has been hovering around a stable 200 MB so I'd say it's fine, though it's only been a couple hours.

5 devices over ax and 27 devices connected over 2.4g. iperf3 pushes a solid 600-700 Mbps with no drops.

I struggle to keep it around 100 and it gets unstable below 70. 200 is luxury :slight_smile:

Would be nice if you can create a PR against Robi's "AX3600-5.10-restart" branch, so we can test it relatively easily.

first post, just wondering if hacking a USB port out of AX3600 is possible?

from the below image, it shows IPQ8071A has a USB3
in below qualcomm website also state the same thing.

and in this product, it use the same IPQ8071A chip, and has a usb3 port
https://m.alibaba.com/product/1600069303672/Wire-network-5G-Dual-Mode-IPQ8071A.html