Adding OpenWrt support for Xiaomi AX3600 (Part 1)

They are defined in the dtsi which is downloaded at compile time.

You will have to create a patch and place it in the target patches directory.

Thanks,
which file in ./target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ you mean?

/home/develop/openwrt$ for i in `find -type f -iname "ipq*.dtsi"` ; do grep -i mtd $i ; done

does found nothing

Partitions aren't defined in the dts since we are using qcom smem parser.

What you are trying to achieve has been discussed a lot times in this thread. It's not that simple.

1 Like

@dchard question for you to see if you've experienced this.

I got my AX3600 from Aliexpress and have installed Robi's 5.10-backport build on it now. Compiling via my own workflow with below package selection.

I ran it for a couple of days with the AX3600 WAN plugged into my main router's LAN, and with a different SSID just to see how well it would stand up / to allow me to configure things. This went well.

I decided to flip the router to become the main router over the weekend to see how it would fair before Monday / before work required stability.

The main issue I noticed, and which caused me to pull for now until I get a chance to dig deeper, likely next weekend if time allows, was that while watching Netflix on our AppleTV (which is wired to the router), there were multiple times when the show would stop with netflix showing a message to the account of "there was a problem."

Clicking to pickup the show again would start playing again until it did the same thing. Repeated a few times before I had to flip back to the old (Tomato based R7000) router. There have been no hiccups with the R7000 (before or after).

Wondering if you've experienced anything similar on your AX6?

My setup itself is nothing special - A number of wireless clients, a few wired clients. No VLANs or anything that someone would consider "fancy"...

Will give it a bit longer until 5.15 branch is deemed "ready-ish" for a main router by Robi and I'll try that.

Thanks!

            - name: Generate config for IPQ807x - Xiaomi AX3600
              run: |
                echo 'CONFIG_TARGET_ipq807x=y' > .config
                echo 'CONFIG_TARGET_ipq807x_generic=y' >> .config
                echo 'CONFIG_TARGET_ipq807x_generic_DEVICE_xiaomi_ax3600=y' >> .config
                echo 'CONFIG_HAS_SUBTARGETS=y' >> .config
                echo 'CONFIG_TARGET_BOARD="ipq807x"' >> .config
                echo 'CONFIG_TARGET_SUBTARGET="generic"' >> .config
                echo 'CONFIG_TARGET_PROFILE="DEVICE_xiaomi_ax3600"' >> .config
                echo 'CONFIG_TARGET_ARCH_PACKAGES="aarch64_cortex-a53"' >> .config
                echo 'CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"' >> .config
                echo 'CONFIG_TARGET_ROOTFS_INITRAMFS=y' >> .config
                echo 'CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD=y' >> .config
                echo 'CONFIG_TARGET_ROOTFS_SQUASHFS=y' >> .config
                echo 'CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256' >> .config
                echo 'CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP=y' >> .config
                echo 'CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"' >> .config
                echo 'CONFIG_TARGET_SUFFIX="musl"' >> .config

                echo "CONFIG_PACKAGE_nss-firmware-ipq8074=y" >> .config
                echo "CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe=y" >> .config
                echo "CONFIG_PACKAGE_kmod-qca-nss-ecm=y" >> .config
                echo "CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr=y" >> .config
                echo "CONFIG_PACKAGE_kmod-sched=y" >> .config

                echo "CONFIG_PACKAGE_announce=y" >> .config
                echo "CONFIG_PACKAGE_arp-scan=y" >> .config
                echo "CONFIG_PACKAGE_bind-host=y" >> .config
                echo "CONFIG_PACKAGE_ca-certificates=y" >> .config                
                echo "CONFIG_PACKAGE_ca-bundle=y" >> .config
                echo "CONFIG_PACKAGE_dawn=y" >> .config
                echo "CONFIG_PACKAGE_ddns-scripts=y" >> .config
                echo "CONFIG_PACKAGE_ddns-scripts-cloudflare=y" >> .config
                echo "CONFIG_PACKAGE_ddns-scripts-services=y" >> .config
                echo "CONFIG_PACKAGE_findutils-xargs=y" >> .config
                echo "CONFIG_PACKAGE_fping=y" >> .config
                echo "CONFIG_PACKAGE_gawk=y" >> .config
                echo "CONFIG_PACKAGE_iputils-arping=y" >> .config
                echo "CONFIG_PACKAGE_irqbalance=y" >> .config
                echo "CONFIG_PACKAGE_iwinfo=y" >> .config
                echo "CONFIG_PACKAGE_less-wide=y" >> .config
                echo "CONFIG_PACKAGE_lldpd=y" >> .config
                echo "CONFIG_PACKAGE_miniupnpd=y" >> .config
                echo "CONFIG_PACKAGE_openvpn-wolfssl=y" >> .config
                echo "CONFIG_PACKAGE_procd-seccomp=y" >> .config
                echo "CONFIG_PACKAGE_qos-scripts=y" >> .config
                echo "CONFIG_PACKAGE_umdns=y" >> .config
                echo "CONFIG_PACKAGE_wget=y" >> .config
                echo "CONFIG_PACKAGE_wpad-wolfssl=y" >> .config
    
            echo "CONFIG_PACKAGE_luci=y" >> .config
                echo "CONFIG_PACKAGE_luci-base=y" >> .config
                echo "CONFIG_PACKAGE_luci-compat=y" >> .config
                echo "CONFIG_PACKAGE_luci-theme-openwrt-2020=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-banip=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-nlbwmon=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-dawn=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-ddns=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-firewall=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-openvpn=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-qos=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-sqm=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-upnp=y" >> .config
                echo "CONFIG_PACKAGE_luci-app-vpn-policy-routing=y" >> .config
                echo "CONFIG_PACKAGE_luci-mod-dashboard=y" >> .config

                echo "CONFIG_PACKAGE_less=n" >> .config
                echo "CONFIG_PACKAGE_wpad-mini=n" >> .config
                echo "CONFIG_PACKAGE_wpad-basic-wolfssl=n" >> .config

I would drop banip (this could become a problem depending on your configuration) and dawn for testing, also qos and sqm should not be installed at the same time (sqm is usually a better solution than qos, but I'd probably keep this off for early testing anyways). Some of your advanced optimizations in the first stanza might be better left for later as well.

Thank you!

Ok I’ll try that for the next attempt. Just to note:

I’ll turn off for next go around.

  • SQM and plain QoS were both turned off, as to your point, I wanted to get it up and running first. I’ll not build them in next go around regardless.

  • The optimizations…. Interestingly I got the AX3600 specific ones from makedef when configuring to only compile for AX3600, as opposed to the multi-target. I will remove them for the next go around as well.

Appreciate your response and guidance @slh :slight_smile:

I have no such issues neither on 5.10 nor on 5.15. I would say if what slh recommended does not work, just try 5.15, it is ready enough for testing, I am using it for almost two weeks now. It is generally a good idea to test with the base config first, so no additional qos, sqm, upnp or anything that can alter packet forwarding in any way, shape or form, as we are not testing those. Based on we have not seen this issue of yours, it is likely one of them anyway.

1 Like

Thank you both. Will try over the weekend for sure.

Hi, can you share your .config? I built 5.15 default config version but It soft brick the router (stuck on BLUE led). Lan comes up but without comunication.

My build VM is not accessible atm, but I can assure you that I mostly added irrelevant options to it, besides the default set, which gets enabled when you select ipq807x and the desired device as the target. I am sure that Iperf3 or Luci or DDNS is not relevant from soft-bricking the router. I have not seen a softbrick situation on my side for like a year or so. I am not sure if you can recover it via TFTP, non the less it would be nice to get a serial log of what happens during boot that it fails so badly. Not to mention that my .config is for AX6 (although not that different from AX3600).

Thank you so much.

I recovered it using TFTP method.

I am trying to use 5.15 version because 5.10-backport version is rebooting when PPPoE is actived in Wan Port.

are you using IPv6 with PPPoE?

1 Like

Yes, it is active and I suspect that the problem is really related to that, but I am not sure.

It is. There's a bug in PPPoE offloading.

A temp fix would be find the Makefile of qca-nss-ecm and change ECM_INTERFACE_PPPOE_ENABLE=y to ECM_INTERFACE_PPPOE_ENABLE=N

3 Likes

Excellent! I'll test it. Thanks.

btw: I understand that the bug remains in version 5.15, right?

Yes. Because it's not related to kernel

1 Like

There's no ECM yet in 5.15 so there's also no bugs related to that

3 Likes

Well, I don't know why my 5.15 build doesn't raise the lan ports. It's something like if the network service is not active (no dhcp and all).

Hello i have very weird bug with latest 5.10 build OpenWrt SNAPSHOT r18432-5451abeeab / LuCI Master git-21.343.55550-008bd89

any time my upload is higher than 10mb/s (i have 100/100mb/s line) eth0 will crash (download can go to full 100Mb/s)

dmesg shows following:

[ 3922.985855] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 3925.037930] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 3928.109872] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 3973.166061] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 3976.238049] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 3978.282021] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 3981.358188] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 3984.430036] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 3986.474325] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 4048.942438] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 4052.010445] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 4054.058283] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 4056.110595] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 4059.178299] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 4062.254368] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100
[ 4064.302428] nss-dp 3a001200.dp2 eth0: PHY Link is down
[ 4066.350486] nss-dp 3a001200.dp2 eth0: PHY Link up speed: 100

is there anything i can try to make it stable? It works fine on stock firmware

Thanks

EDIT: when i force set eth0 to half-duplex mode it works without any issue WTF?

Based on what you're describing, I would think it's a build issue.

I know that dchard and robi noted somewhere above that with nss-drv stuff included in 5.15 branch it will fail build currently...

The error would look like:

.2851886Z /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_core.h:116:17: error: implicit declaration of function 'dmac_inv_range' [-Werror=implicit-function-declaration]
.2852580Z   116 |                 dmac_inv_range(start, start + size);
.2853119Z       |                 ^~~~~~~~~~~~~~
.3175637Z /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_core.h:119:17: error: implicit declaration of function 'dmac_clean_range' [-Werror=implicit-function-declaration]
.3176623Z   119 |                 dmac_clean_range(start, start + size);
.3177121Z       |                 ^~~~~~~~~~~~~~~~
.3512276Z /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_core.h:122:17: error: implicit declaration of function 'dmac_flush_range' [-Werror=implicit-function-declaration]
.3513184Z   122 |                 dmac_flush_range(start, start + size);

The 5.10-backport branch's action doesn't have nss-dp (I assume it's pulled in by drv). So that may have to be added...

I haven't tried yet, so others can correct/chime in.

[Edit] Here is the note: Adding OpenWrt support for Xiaomi AX3600 - #5365 by robimarko