Adding OpenWrt support for Xiaomi AX6000

Started from scratch with initramfs-factory

[    0.000000] Linux version 6.6.89 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 14.2.0 r29349+1-5c8301e80032) 14.2.0, GNU ld (GNU Binutils) 2.42) #0 SMP Tue May  6 11:09:57 2025
[    0.084785] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.

[    1.004053] spi-nand spi0.0: unknown raw ID c8117f7f00
[    1.004129] spi-nand: probe of spi0.0 failed with error -524

No 5G ...

see also [PATCH v1] mtd: spinand: Add support for 5-byte IDs - Linux-stable-mirror - lists.linaro.org

Could it be that this nand reports a 4 byte id (c8117f7f) instead of expected 5 byte (c8117f7f + 00)

[PATCH v2 5/5] mtd: spinand: esmt: OTP access for F50{L,D}1G41LB

Seems in Kernel 6.6.89 many changes applied to this area:

2024-02-05 mtd: spinand: esmt: Extend IDs to 5 bytes
2024-02-05 mtd: spinand: Add support for 5-byte IDs
2023-04-03 mtd: spinand: add support for ESMT F50x1G41LB

I am sure that a loaded a version before where 5G worked. Could it be that a older Kernel was provided once ...

I'm by no means an expert, but I do wonder if the info shown in the bootlog (wherever it's getting that information) is actually correct. Comparing datasheets it doesn't seem anything over 1 bit is possible.
F50D1G41LB(2M):

From a different NAND with 4-bit support:
Serial NAND device Manufature:GD5F2GQ5REYIH
Device Size:256 MiB, Page size:2048, Spare Size:64, ECC:4-bit

Hopefully georgem83's patch for less than 4 bits will work

on this firmware, same

[    0.423817] spi-nand spi0.0: unknown raw ID c8117f7f00
[    0.616191] qcom-pcie 80000000.pcie: iATU: unroll T, 8 ob, 8 ib, align 4K, limit 1024G
[    0.622258] spi-nand: probe of spi0.0 failed with error -524
[    0.775586] qcom-pcie a0000000.pcie: iATU: unroll T, 8 ob, 8 ib, align 4K, limit 1024G
[    1.090399] qcom-pcie a0000000.pcie: PCIe Gen.2 x2 link up
[    1.091077] qcom-pcie a0000000.pcie: PCI host bridge to bus 0001:00
[    1.094901] pci_bus 0001:00: root bus resource [bus 00-ff]

This version i downloaded <= 25.04.2025 somewhere in this thread, and i saved it because NAND was working.

[    0.000000] Linux version 6.6.87 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r28819+50-78b78a426834) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Tue Apr 22 07:43:08 2025

[    0.605949] spi-nand spi0.0: ESMT SPI NAND was found.
[    0.636804] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64


root@OpenWrt:~# nandtest /dev/mtd19
ECC corrections: 0
ECC failures   : 0
Bad blocks     : 0
BBT blocks     : 0
05160000: checking...of 4)...
Finished pass 1 successfully

root@OpenWrt:~# hexdump -C -n 12 /dev/mtd13
00000000  a4 a9 30 b0 e7 08 a4 a9  30 xx yy zz         

wan       Link encap:Ethernet  HWaddr A4:A9:30:xx:yy:zz

Do you think it’ll be possible to add an official open wet support to it?

the first thing I tried was to flash this firmware. then, at my own risk, the one above

after several dangerous attempts, I got a brick and restored xiaomi soft

if I can help with the development with some dumps, tell me where and what to enter into the console.

after installation, I had a warning that only initramfs was installed and there no wi-fi adapters.

This reposted version

Filebin | qn9ytzkjuiiupkvy

works fine (NAND topic), also squashfs works

It is a 6.6.87 Linux Kernel

5G works, but with very less "power" (but driver reports 30dB). 2.4G works

As far as I remember also the first version of XIAOMI X6000 in this post works also fine (2.5GMbit worked) but problem with 5G driver.

Later the files where updated and then my system got problem (squashfs did not work), NAND problem

I've baked a new image with ECC strength set to 4 bits in the DTS:

		/* This device is known to come with the following NAND chips:
		 * - ESMT F50D1G41LB with 1-bit ECC req (but also supports 4-bits)
		 * - Gigadevice GD5F2GQ5REYIH with 4-bits ECC req.
		 * The spi-qpic-snand driver supports 4 and 8 bits only, so set
		 * the ECC strength to 4 in user config.
		 */
		nand-ecc-strength = <4>;
		nand-ecc-step-size = <512>;

let's see if this works for both nand chips. The problem with this is that if a board surfaces with another nand chip with 8-bits required, it may cause problems..

1 Like
root@OpenWrt:~# dmesg | grep Linux
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x51af8014]
[    0.000000] Linux version 6.6.89 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 14.2.0 r29349+1-5c8301e80032) 14.2.0, GNU ld (GNU Binutils) 2.42) #0 SMP Tue May  6 11:09:57 2025
[   13.728920] Loading modules backported from Linux version v6.12.6-0-ge9d65b48ce1a
root@OpenWrt:~# dmesg | grep nand
[    0.304399] spi-nand spi0.0: unknown raw ID c8117f7f00
[    0.508943] spi-nand: probe of spi0.0 failed with error -524
r

I can boot with the new initramfs image. My nand chip type is GD5F1GQ4RE9IG. However, WIFI does not work. The link speed of 2.5G WAN is correct, but it cannot get a DHCP IP address. From the ifconfig output, I can see RX errors and dropped packets.

ifconfig wan
wan       Link encap:Ethernet  HWaddr CE:5A:0D:XX:XX:XX
          inet6 addr: fe80::cc5a:dff:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:424 dropped:424 overruns:0 frame:424
          TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:32852 (32.0 KiB)
          Interrupt:36

Here is the boot log. Please help check. Thanks.

EDIT: I was able to boot the first build from two days ago. It didn’t have WIFI, but the 2.5G WAN worked fine. For the second build from the same day, I was able to boot with WIFI working, but the 2.5G WAN is still having the same issue— it shows the correct link status but no RX activity. By the way, the sysupgrade image still doesn't work in any of the builds.

Add syslog.txt to Filebin | wynx2opgdry51ydx

Different NANDs:

  1. GD5F1GQ4RE9IG -> boot-log-20250507.txt
    nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xc1
    nand: GigaDevice GD5F1GQ4RE9IG SPI NAND 1G 1.8V

  2. F50D1G41LB(2M). -> syslog.txt
    nand: device found, Manufacturer ID: 0xc8, Chip ID: 0x11
    nand: GigaDevice F50D1G41LB(2M) SPI NAND 1G 1.8V

Found: This patch adds support for ESMT F50L1G41LB and F50D1G41LB. It seems that ESMT likes to use random JEDEC ID from other vendors. Their 1G chips uses 0xc8 from GigaDevice ...

F50D1G41LB JEDEC ID: 0xc8 0x11

0xc8 is the JEDEC ID of GigaDevice.

According to the datasheets, the ESMT chips in question will return a 5
byte long identification code where the last 3 bytes are the JEDEC
continuation codes (7Fh).

According to syslog we get c8117f7f00, would we expect c8117f7f7f ???

SPINAND_INFO("F50D1G41LB",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x11, 0x7f,0x7f, 0x7f),

spi-nand spi0.0: unknown raw ID c8117f7f00 (would expect c8117f7f7f)

Are only 4 bytes for READID requested? Could the "workaround" be

SPINAND_INFO("F50D1G41LB",
		  SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x11, 0x7f,0x7f, 0x00)

Is this patch applied in this kernel:

diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index badb4c1ac079..5c19ead60499 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -169,7 +169,7 @@ 
 struct spinand_op;
 struct spinand_device;
 
-#define SPINAND_MAX_ID_LEN	4
+#define SPINAND_MAX_ID_LEN	5
 /*
  * For erase, write and read operation, we got the following timings :
  * tBERS (erase) 1ms to 4ms

Guys, before performing the installation, check with the command below:

root@XiaoQiang:~# dmesg | grep -i nand
[ 0.211244] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 1.835270] QPIC controller support serial nand.
[ 1.840654] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xc1
[ 1.845082] nand: GigaDevice GD5F1GQ4RE9IG SPI NAND 1G 1.8V
[ 1.851494] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[ 1.857326] 22 ofpart partitions found on MTD device qcom_nand.0
[ 1.864395] Creating 22 MTD partitions on "qcom_nand.0":
root@XiaoQiang:~#

A question that might be hard to quantify, but how close are we to having proper full support for the AX6000?
The reason I'm asking is because I need another mesh unit, ideally, I'd hope I would be able to create this mesh with openwrt, but currently I have to create a mesh with xiaomi routers, if I could get any openwrt supported router then it's a lot easier, but if I have to stick with xiaomi the options are a bit more limited, so I basically trying to wonder how long I might expect a working release.
Probably an annoying question, so sorry about that.

root@XiaoQiang:~# dmesg | grep -i nand
[    0.211286] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.905619] QPIC controller support serial nand.
[    1.910923] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0x11
[    1.915433] nand: GigaDevice F50D1G41LB(2M) SPI NAND 1G 1.8V
[    1.921807] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.927792] 22 ofpart partitions found on MTD device qcom_nand.0
[    1.934832] Creating 22 MTD partitions on "qcom_nand.0":

After updating the latest version available

BusyBox v1.37.0 (2025-05-06 06:41:01 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r29480+7-2d6f0275f894
 -----------------------------------------------------

 OpenWrt recently switched to the "apk" package manager!

 OPKG Command           APK Equivalent      Description
 ------------------------------------------------------------------
 opkg install <pkg>     apk add <pkg>       Install a package
 opkg remove <pkg>      apk del <pkg>       Remove a package
 opkg upgrade           apk upgrade         Upgrade all packages
 opkg files <pkg>       apk info -L <pkg>   List package contents
 opkg list-installed    apk info            List installed packages
 opkg update            apk update          Update package lists
 opkg search <pkg>      apk search <pkg>    Search for packages
 ------------------------------------------------------------------

For more https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet

root@OpenWrt:~# dmesg | grep -i nand
[    0.086286] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.480077] spi-nand spi0.0: GigaDevice SPI NAND was found with ID: 0xc1.
[    0.697827] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[    0.859492] nand: WARNING: (null): the ECC used on your system is too weak compared to the one required by the NAND chip
root@OpenWrt:~#

After update openwrt-qualcommax-ipq50xx-xiaomi_ax6000-squashfs-sysupgrade.bin I didn't get network

can you try this one? This one is for the one with GigaDevice GD5F1GQ4RExxG

this should have network (incl. 2.5G WAN) enabled.
I set ecc-strength to 4 in this build, let me know if it works. If it doesn't, I'll set it to 8 as per datasheet.

NOTE: this will not work for devices with ESMT F50D1G41LB nand chips.

2 Likes

i also flashed today (11.05.2025) initramfs with xmpatcher then uploaded the sysupgrade with LuCi web interface and there is always the same warning "system running with initramfs image"
RA72 - AX6000 no revision on the barcode on anywhere on the sticker.

I just flashed this new initramfs image. My nand chip type is GD5F1GQ4RE9IG. The 2.5G WAN is now working, but there is no WIFI. There are many repeating ECC errors in the log, and the boot process is quite slow.

[   42.545385] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 178:0, read only 64 bytes, retry
[   42.549138] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 178:0, read only 64 bytes, retry
[   42.560385] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 178:0, read only 64 bytes, retry
[   42.571669] ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 178:0, read 64 bytes
[   42.582429] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.89 #0
[   42.592288] Hardware name: Xiaomi AX6000 (DT)
[   42.598189] Call trace:
[   42.602700]  dump_backtrace+0xa0/0xd8
[   42.604959]  show_stack+0x18/0x24
[   42.608777]  dump_stack_lvl+0x48/0x60
[   42.612076]  dump_stack+0x18/0x24
[   42.615722]  ubi_io_read+0x11c/0x330
[   42.619021]  ubi_io_read_ec_hdr+0x50/0x208
[   42.622667]  ubi_attach+0x348/0x1340
[   42.626572]  ubi_attach_mtd_dev+0x454/0xabc
[   42.630307]  ubi_init_attach+0xac/0x2e4
[   42.634212]  do_one_initcall+0x6c/0x1f8
[   42.638032]  kernel_init_freeable+0x214/0x2f4
[   42.641852]  kernel_init+0x28/0x1f4
[   42.646364]  ret_from_fork+0x10/0x20

Please see the boot log below. Thanks.

1 Like

ok, now we know we can't go for one recipe, unfortunately. At least for now..

I've just uploaded another image (same url as above) which should pick up the ECC requirements automatically (8-bits), again for GD5F1GQ4RE9IG only.
If nand works properly, wifi should also work as it tries to load the BDF files from nand.
Let me know how it goes..

EDIT: please upload the entire boot log (in any case), thanks!

Both WIFI and 2.5 WAN are working with the latest initramfs image. Great Job! Thanks!

Below is the boot log for the new image. The previous log is incomplete, likely due to the excessive number of error entries.