Mi Ax6000 (IPQ50XX) - Where to start the compile?

Hey, I have the said mi ax6000 and already got it rooted and ssh enabled using this patcher.
I've got a backup, except for a data partition (24).

Next step, how could I compile, install, setup and debug openwrt for it?

Here is some info provided by the patcher:

MTD partitions:
   0 > addr: 0x00000000  size: 0x00080000  ro:0  name: "0:SBL1"
   1 > addr: 0x00080000  size: 0x00080000  ro:0  name: "0:MIBIB"
   2 > addr: 0x00100000  size: 0x00040000  ro:0  name: "0:BOOTCONFIG"
   3 > addr: 0x00140000  size: 0x00040000  ro:0  name: "0:BOOTCONFIG1"
   4 > addr: 0x00180000  size: 0x00100000  ro:0  name: "0:QSEE"
   5 > addr: 0x00280000  size: 0x00100000  ro:0  name: "0:QSEE_1"
   6 > addr: 0x00380000  size: 0x00040000  ro:0  name: "0:DEVCFG"
   7 > addr: 0x003C0000  size: 0x00040000  ro:0  name: "0:DEVCFG_1"
   8 > addr: 0x00400000  size: 0x00040000  ro:0  name: "0:CDT"
   9 > addr: 0x00440000  size: 0x00040000  ro:0  name: "0:CDT_1"
  10 > addr: 0x00480000  size: 0x00080000  ro:0  name: "0:APPSBLENV"
  11 > addr: 0x00500000  size: 0x00140000  ro:0  name: "0:APPSBL"
  12 > addr: 0x00640000  size: 0x00140000  ro:0  name: "0:APPSBL_1"
  13 > addr: 0x00780000  size: 0x00100000  ro:1  name: "0:ART"
  14 > addr: 0x00880000  size: 0x00080000  ro:0  name: "0:TRAINING"
  15 > addr: 0x00900000  size: 0x00080000  ro:1  name: "bdata"
  16 > addr: 0x00980000  size: 0x00080000  ro:0  name: "crash"
  17 > addr: 0x00A00000  size: 0x00080000  ro:0  name: "crash_syslog"
  18 > addr: 0x00A80000  size: 0x02400000  ro:0  name: "rootfs"
  19 > addr: 0x02E80000  size: 0x02400000  ro:1  name: "rootfs_1"
  20 > addr: 0x05280000  size: 0x01F00000  ro:0  name: "overlay"
  21 > addr: 0x07180000  size: 0x00080000  ro:0  name: "rsvd0"
  22 > addr: 0xFFFFFFFF  size: 0x003C1000  ro:0  name: "kernel"
  23 > addr: 0xFFFFFFFF  size: 0x015CC000  ro:0  name: "ubi_rootfs"
  24 > addr: 0xFFFFFFFF  size: 0x01B20000  ro:1  name: "data"

Download file: "/tmp/kcmdline.log" ....
Kernel command line:
  ubi.mtd=rootfs_1 root=mtd:ubi_rootfs rootfstype=squashfs rootwait uart_en=1 swiotlb=1 coherent_pool=2M
RootFS info:
  num = 1
  mtd_num = 18
  mtd_dev = "None"
  partition = "rootfs_1"

Base info:
Download file: "/tmp/kver.txt" ....
  Kernel version: Linux XiaoQiang 4.4.60 #0 SMP PREEMPT Tue Oct 17 06:54:20 2023 aarch64 GNU/Linux
  Linux version: 4.4.60
  DISTRIB_TARGET = ipq/ipq50xx_64
  DISTRIB_ARCH = aarch64_cortex-a53
  CPU arch: arm64
  CPU name: ipq50xx

Version info:
  UBoot: None
  OpenWrt: unknown
  Firmware: 1.0.122
  Channel: release
  BuildTime: Tue, 17 Oct 2023 07:50:17 +0000
  Hardware: RA72
  UBoot(2): 1.0.2

I could only understand from all it to get note about the hardware/software and attempted to get a UART connection.

What I've got so far is a UART connection:


Top to bottom: _(fixed at 1.8V) _(fixed at 0V) GND Tx (baud 115200)

And sample of the output from booting up stock firmware:

U-Boot 2016.01 (Mar 04 2022 - 07:30:12 +0000), Build: jenkins-common_router_openwrt_ota_publish-2672
...
## Loading kernel from FIT Image at 44000000 ...

   Using 'config@mp03.1' configuration

   Trying 'kernel@1' kernel subimage

     Description:  ARM64 OpenWrt Linux-4.4.60
...
## Loading fdt from FIT Image at 44000000 ...

   Using 'config@mp03.1' configuration

   Trying 'fdt@mp03.1' fdt subimage

     Description:  ARM64 OpenWrt qcom-ipq50xx-mpxx device tree blob
...
[    0.000000] Machine: Qualcomm Technologies, Inc. IPQ5018/AP-MP03.1
....
[    0.000000] Memory: 394880K/421888K available
...
[    0.162125] CPU: IPQ5018, SoC Version: 1.1
...
[    1.850885] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0x11
[    1.855337] nand: GigaDevice F50D1G41LB(2M) SPI NAND 1G 1.8V
[    1.861714] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

From prying it open, also the hardware:

Questions:

  • Considering the UART Rx disabled (couldn't really enter anything to the serial connection), how much risk is to brick the router?
  • I should create an image for plataform IPQ5018, isn't it? I've been through the guide and couldn't get my head around it.

I've got OpenWRT running on rootfs, now attempting to get the NICs working properly. Long way to go, no idea what I'm actually doing besides attempting some existing settings from other similar devices into this one. I'd appreciate some guidance

find the most similar device to your own and look at a previous pr to discover what is needed

look at this pr, you'll need to basically replicate it, but for your own device.

Thanks, this one and the Xiaomi AX3000 are the ones I've taking parts from. I will keep trying but still no results. The only NIC adapter on ifconfig is still the loopback. Am I missing something?

have you started a git repo to prepare the pr so we can take a look ?

have you added entries in 02_network and or 11_ath11k_caldata ? Have you adjusted the dts to openwrt format ? ... have you harvested the board bdfs and added them and entries for them to ipq-wifi ?

Its hard to say when i have no idea of what you've done to this point. As i suggested, go through a successfully merged pr for a similar device. You'll almost certainly have to add/edit the same files with the pertinent info from your device as the mock device. Perhaps look at my thread on adding the gl-b3000, its lengthy but all the info needed to do the port and how to use the certain tools necessary to accomplish it can be found within in somewhat layman terms.

Make the effort, and ask questions when you're stuck and I'll help out when i can .. as will others

Hello @Skalanis , I'm also trying to port the system to the AX6000, has it made any further progress?

I can boot into openwrt that does nothing and switch back to rootfs_1 with the factory image.

I've been flashing it using the patcher with the generated initrams.ubi based on latest openwrt (main branch) just because it has ipq5018 related files.

Currently looking into @hostle changes while also setting up a repo.

Thanks for jumping in, I have almost no idea of what I'm doing or looking for so it is quite hard to ask specifics. Following your topic structure and repo request:

Info: mi_ax6000.zip
Github: openwrt_fork

I've attempted binwal and related with the stock firmware but nothing readable came out :sweat_smile:

1 Like

if you go thru the pr's there is only about 9-12 files that need to be modified or added in most cases. I would recommend you start on the dts. The will be the biggest part of the port, but on the other hand will help fill in the blanks in the other files that need to be modified later on.

Its a lot of work, but its very doable if you take the time read thru the forums and gather the bits of info you need to fill in the blanks as you go.

If you decided to take it on, your work flow should be something like the following ..

1. save boot logs and backup each partition on your device 

2. prepare the openwrt style dts for your device using the original dts to compare against the
 dts of a supported device, most similar to yours

3. determine the proper board bdf's by searching from them being downloaded in the stock boot log

4. locate the board bdf's in the wifi partition of your backups and use the bdf tool to prepare them for use in openwrt

5. add the entry for your device in the ipq-wifi makefile and place the bdfd's in the src folder within the ipq-wifi package

6. add the entry for your device in uboot-envtools

7. add the entries for your device in 02_network and ath11k_caldata

at this point you are ready to start testing firmware ...

1 Like