Adding OpenWrt support for Xiaomi AX3600 (Part 1)

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

Did you select NSS-DP in the menuconfig as it's needed.

So, for the ax6 should the build for ax3600 be used ?

or other recommendation ?

No. For AX6 the AX6 build should be used :slight_smile:

Robi's repo already has a proper entry for AX6 as well as for AX3600, AX9000 and the QNAP 301W.

Ok, all right now. Version 5.15 running and under testing...

1 Like

Thanks for your replay,

I am pretty new here, can you share a link to Robi's repo or some link to a guide ?

So "interestingly" I haven't been able to compile the ipq807x-5.15 branch through git actions. As tests, I tried with the 5.10-backports yml file (knowing it would fail based on this thread as I mentioned above), but it also failed with only the nss-drv ones removed, and nss-dp added


on:
    workflow_dispatch:
        branches:
            - ipq807x-5.15

jobs:
    build:
        name: Prepare and build IPQ807x images - Xiaomi AX3600
        runs-on: ubuntu-latest

        steps:
            - name: Checkout
              uses: actions/checkout@v2
              with: 
                repository: edrikk/openwrt-IPQ807x
                ref: ipq807x-5.15

            - name: Update and install feeds
              run: |
                ./scripts/feeds update -a
                ./scripts/feeds install -a
            - 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-ecm=y" >> .config
                echo "CONFIG_PACKAGE_kmod-qca-nss-dp=y" >> .config

. . . . . . rest removed . . . . . . 

The compile error tells me that nss-dp is still pulling in nss-drv, which fails with undefined functions dmac_inv_range, dmac_clean_range, and dmac_flush_range

2022-01-19T06:33:48.2262515Z echo "kmod-qca-nss-dp" >> /home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/qca-nss-dp.default.install
2022-01-19T06:33:48.2282559Z make[3]: Leaving directory '/home/runner/work/openwrt/openwrt/feeds/nss_packages/qca/qca-nss-dp'
2022-01-19T06:33:48.2291893Z time: package/feeds/nss_packages/qca-nss-dp/compile#0.18#0.04#0.20
2022-01-19T06:33:48.2408973Z make[3]: Entering directory '/home/runner/work/openwrt/openwrt/feeds/nss_packages/qca/qca-nss-drv'
2022-01-19T06:33:48.4130993Z rm -f /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/.built
2022-01-19T06:33:48.4159195Z touch /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/.built_check
2022-01-19T06:33:48.4184714Z make -C "/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.15.13" NSS_DRV_C2C_ENABLE=n NSS_DRV_CAPWAP_ENABLE=n NSS_DRV_CLMAP_ENABLE=n NSS_DRV_CRYPTO_ENABLE=n NSS_DRV_DTLS_ENABLE=n NSS_DRV_GRE_ENABLE=n NSS_DRV_GRE_REDIR_ENABLE=n NSS_DRV_GRE_TUNNEL_ENABLE=n NSS_DRV_IGS_ENABLE=n NSS_DRV_IPSEC_ENABLE=n NSS_DRV_LAG_ENABLE=n NSS_DRV_L2TP_ENABLE=n NSS_DRV_MAPT_ENABLE=n NSS_DRV_OAM_ENABLE=n NSS_DRV_PPTP_ENABLE=n NSS_DRV_PORTID_ENABLE=n NSS_DRV_PVXLAN_ENABLE=n NSS_DRV_QRFS_ENABLE=n NSS_DRV_QVPN_ENABLE=n NSS_DRV_RMNET_ENABLE=n NSS_DRV_SHAPER_ENABLE=n NSS_DRV_SJACK_ENABLE=n NSS_DRV_TLS_ENABLE=n NSS_DRV_TRUSTSEC_ENABLE=n NSS_DRV_TSTAMP_ENABLE=n NSS_DRV_TUN6RD_ENABLE=n NSS_DRV_TUNIPIP6_ENABLE=n NSS_DRV_VXLAN_ENABLE=n NSS_DRV_MATCH_ENABLE=n NSS_DRV_MIRROR_ENABLE=n CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" M="/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81" EXTRA_CFLAGS="-I/home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/qca-nss-gmac -I/home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/qca-nss-dp -I/home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/qca-ssdk -DNSS_MEM_PROFILE_MEDIUM" SoC="ipq807x_64" KCFLAGS="-fmacro-prefix-map=/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl=target-aarch64_cortex-a53_musl" HOSTCFLAGS="-O2 -I/home/runner/work/openwrt/openwrt/staging_dir/host/include -I/home/runner/work/openwrt/openwrt/staging_dir/hostpkg/include -I/home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Mon Jan 17 20:57:20 2022" KBUILD_BUILD_VERSION="0" HOST_LOADLIBES="-L/home/runner/work/openwrt/openwrt/staging_dir/host/lib" KBUILD_HOSTLDLIBS="-L/home/runner/work/openwrt/openwrt/staging_dir/host/lib" CONFIG_SHELL="bash" V=''  cmd_syscalls= KBUILD_EXTRA_SYMBOLS="/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/symvers/gpio-button-hotplug.symvers /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/symvers/qca-nss-dp.symvers /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/symvers/qca-ssdk.symvers" KERNELRELEASE=5.15.13  modules
2022-01-19T06:33:48.4218393Z make[4]: Entering directory '/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.15.13'
2022-01-19T06:33:48.7769262Z   CC [M]  /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_bridge.o
2022-01-19T06:33:49.3937815Z In file included from /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_hal/include/nss_hal.h:26,
2022-01-19T06:33:49.3939070Z                  from /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_tx_rx_common.h:25,
2022-01-19T06:33:49.3940288Z                  from /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_bridge.c:17:
2022-01-19T06:33:49.3941342Z /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: In function 'nss_core_dma_cache_maint':
2022-01-19T06:33:49.3942567Z /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]
2022-01-19T06:33:49.3944225Z   116 |                 dmac_inv_range(start, start + size);
2022-01-19T06:33:49.3944577Z       |                 ^~~~~~~~~~~~~~
2022-01-19T06:33:49.4254297Z /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]
2022-01-19T06:33:49.4255474Z   119 |                 dmac_clean_range(start, start + size);
2022-01-19T06:33:49.4255980Z       |                 ^~~~~~~~~~~~~~~~
2022-01-19T06:33:49.4578526Z /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]
2022-01-19T06:33:49.4579645Z   122 |                 dmac_flush_range(start, start + size);
2022-01-19T06:33:49.4580203Z       |                 ^~~~~~~~~~~~~~~~
2022-01-19T06:33:49.5805746Z cc1: all warnings being treated as errors
2022-01-19T06:33:49.5861512Z make[5]: *** [scripts/Makefile.build:277: /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/nss_bridge.o] Error 1
2022-01-19T06:33:49.5864743Z make[4]: *** [Makefile:1868: /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81] Error 2
2022-01-19T06:33:49.5865685Z make[3]: *** [Makefile:122: /home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/qca-nss-drv-2021-04-26-1cf4bf81/.built] Error 2
2022-01-19T06:33:49.5866384Z make[4]: Leaving directory '/home/runner/work/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.15.13'
2022-01-19T06:33:49.5869110Z make[3]: Leaving directory '/home/runner/work/openwrt/openwrt/feeds/nss_packages/qca/qca-nss-drv'
2022-01-19T06:33:49.5870011Z time: package/feeds/nss_packages/qca-nss-drv/compile#1.14#0.22#1.35
2022-01-19T06:33:49.5878848Z     ERROR: package/feeds/nss_packages/qca-nss-drv failed to build.
2022-01-19T06:33:49.5898760Z make[2]: *** [package/Makefile:116: package/feeds/nss_packages/qca-nss-drv/compile] Error 1
2022-01-19T06:33:49.5899278Z make[2]: Leaving directory '/home/runner/work/openwrt/openwrt'
2022-01-19T06:33:49.5933748Z make[1]: *** [package/Makefile:110: /home/runner/work/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
2022-01-19T06:33:49.5934288Z make[1]: Leaving directory '/home/runner/work/openwrt/openwrt'
2022-01-19T06:33:49.5954545Z make: *** [/home/runner/work/openwrt/openwrt/include/toplevel.mk:230: world] Error 2
2022-01-19T06:33:49.6010740Z ##[error]Process completed with exit code 2.

Given that others have compiled successfully, it's likely a user error, but thought to post.

EDIT - Sorry this reply wasn't intended to be directed at Gingernut directly.

NSS DRV is pulled in by the ECM you have selected.

Only thing that is supported in 5.15 is NSS-DP, nothing else

Ah! Thank you! I didn't realize that based on the readings.
Appreciate it.

@robimarko have you seen this? link

We might need to test this I guess. Want to do a rebase by any chance? :slight_smile:

Yeah, saw it in the morning.
I was planning to do a rebase, but I dont know if its gonna be done today.

Its been a busy day, just finished working for today

2 Likes

You can test this already, all fw4 packages are already available in the feeds, just update packages.

This is just the switch for the fw default.

Has anyone a working 5.15 build? I tried it many times but always after flashing i'm not able to connect to the router anymore. With 5.10 it was working

Did you initially flash both mtd 12 and 13 when installing 5.10?