Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Glad to see you can sort it out.

I am gonna rebase the tree with CI on the OpenWrt PR, got sysupgrade improved to always clean UBI properly if running from initramfs and other small tweaks, it adds GCC12 as well

2 Likes

Wonder if we can see some slight improvement due to that. Maybe better ARM optimizations or something...

Doubt its anything measurable since these are A53 cores that have been around for like a decade

Concerning wpad not reliably shutting down.

If somebody wrote a wpadKillerWrapper shell script with a

  1. "kill -15" to the parent process and if any wpad processes were still left after let's say 5 sec
  2. "kill -9" to all wpad processes
  3. and "exit 1" if any were still alive after let's say 30 sec total, and
  4. "exit 0" if there are no wpad processes left that can be detected with "ps"
    Question:
  5. has this been tried and didn't work reliably
  6. is this a hack to gruesome to contemplate

Its not wpads fault, ath11k is not shutting down when it should, that is why SIGKILL fails.

If it was userspace then nothing could inhibit SIGKILL.

1 Like

Hi guys, I want to test ipq807x-5.15-pr-final on my AX6, and according to instruction, it requires an additional step with initramfs.
I built the image with my own config with some preinstalled packages and redmi_ax6-initramfs-factory.ubi compiled for 33Mb in my case. When I flash and try to boot, u-boot says:

Image too large: increase CONFIG_SYS_BOOTM_LEN

Is this problem related only to initramfs and I should build a smaller version, and than sysupgrade to my preferred config? Or my entire config is not suited now?
Previously it worked fine on previous robimarko's branches.

Forget about booting any initramfs larger than 16MB, it cannot fit in the 64MB limit in U-boot

I'm just curious that manual kills seem to sometimes do the job. Is it just confirmation bias? Does the kernel thread eventually actually shut down, just ... taking ... a ... lot of time?
:wink:

Yes, its just taking time as sysupgrade expects SIGTERM and SIGKILL to finish pretty much instantly and ath11k is taking time for its flush attempt to timeout.

We tried figuring out the root cause, and its looking like ath11k is probably not counting the packets correctly so when you want to shut it down its trying to flush the packets which have already left

2 Likes

Thanks for explaining.

I had your previous image from your repo 2023-01-08-1438 working well and something is or went wrong when I flashed your last image 2023-01-09-2026-openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin from today.

After flash the router gets into a boot loop, with orange led on for a period of time, then off briefly, then repeats.
This what I capture from UART:

resetting ...


Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00147
S - IMAGE_VARIANT_STRING=HAACANAAA
S - OEM_IMAGE_VERSION_STRING=xiaoyang-gv
S - Boot Config, 0x000002e5
B -       201 - PBL, Start
B -      2736 - bootable_media_detect_entry, Start
B -      3444 - bootable_media_detect_success, Start
B -      3448 - elf_loader_entry, Start
B -      6116 - auth_hash_seg_entry, Start
B -      6359 - auth_hash_seg_exit, Start
B -     68593 - elf_segs_hash_verify_entry, Start
B -    131293 - PBL, End
B -    207095 - SBL1, Start
B -    283467 - GCC [RstStat:0x10, RstDbg:0x600000] WDog Stat : 0x4
B -    292861 - pm_device_init, Start
B -    466436 - PM_SET_VAL:Skip
D -    171593 - pm_device_init, Delta
B -    468724 - pm_driver_init, Start
D -      5368 - pm_driver_init, Delta
B -    475159 - clock_init, Start
D -      2135 - clock_init, Delta
B -    479216 - boot_flash_init, Start
D -     11864 - boot_flash_init, Delta
B -    494771 - boot_config_data_table_init, Start
D -      3202 - boot_config_data_table_init, Delta - (575 Bytes)
B -    502274 - Boot Setting :  0x00000600
B -    506208 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:16
B -    513132 - sbl1_ddr_set_params, Start
B -    516975 - CPR configuration: 0x300
B -    520452 - cpr_init, Start
B -    523227 - Rail:0 Mode: 5 Voltage: 784000
B -    528382 - CL CPR settled at 736000mV
B -    531218 - Rail:1 Mode: 5 Voltage: 880000
B -    535397 - Rail:1 Mode: 7 Voltage: 888000
D -     16470 - cpr_init, Delta
B -    542259 - Pre_DDR_clock_init, Start
B -    546285 - Pre_DDR_clock_init, End
B -    549671 - DDR Type : PCDDR3
B -    555374 - do ddr sanity test, Start
D -      1067 - do ddr sanity test, Delta
B -    560132 - DDR: Start of HAL DDR Boot Training
B -    564890 - DDR: End of HAL DDR Boot Training
B -    570563 - DDR: Checksum to be stored on flash is 1155630626
B -    580964 - Image Load, Start
D -    224144 - QSEE Image Loaded, Delta - (1373936 Bytes)
B -    805200 - Image Load, Start
D -        61 - SEC Image Loaded, Delta - (0 Bytes)
B -    812855 - Image Load, Start
D -     10706 - DEVCFG Image Loaded, Delta - (26004 Bytes)
B -    823652 - Image Load, Start
D -     25254 - RPM Image Loaded, Delta - (105964 Bytes)
B -    848967 - Image Load, Start
D -     96563 - APPSBL Image Loaded, Delta - (589900 Bytes)
B -    945652 - QSEE Execution, Start
D -        61 - QSEE Execution, Delta
B -    951447 - USB D+ check, Start
D -         0 - USB D+ check, Delta
B -    957852 - SBL1, End
D -    753075 - SBL1, Delta
S - Flash Throughput, 6749 KB/s  (2096379 Bytes,  310607 us)
S - DDR Frequency, 466 MHz
S - Core 0 Frequency, 800 MHz




U-Boot 2016.01 (Sep 28 2020 - 09:05:55 +0000), Build: jenkins-common_router_openwrt_ota_publish-383



DRAM:  smem ram ptable found: ver: 1 len: 4

512 MiB

NAND:  ONFI device found

ID = 1590aac8

Vendor = c8

Device = aa

qpic_nand: changing oobsize to 64 from 128 bytes

SF: Unsupported flash IDs: manuf ff, jedec ffff, ext_jedec ffff

ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)

256 MiB

MMC:   sdhci: Node Not found, skipping initialization



PCI Link Intialized

PCI1 is not defined in the device tree

In:    serial@78B3000

Out:   serial@78B3000

Err:   serial@78B3000

Boot failure detected on both systems

machid: 8010010

MMC Device 0 not found

eth5 MAC Address from ART is not valid

write phy_id=1, reg(0x8074):0x0670

write phy_id=2, reg(0x8074):0x0670

write phy_id=3, reg(0x8074):0x0670

write phy_id=4, reg(0x8074):0x0670

bootwait is on, bootdelay=5

Hit any key to stop autoboot:  5  4  3  2  1  0 

 trigger button release!

Boot failure detected on both systems

boot from rootfs 1

  miwifi: check crash in rmem !  

ubi0: attaching mtd1

ubi0: scanning is finished

UBI init error 22

Erasing NAND...


Erasing at 0x680000 --  25% complete.
Erasing at 0x6a0000 --  50% complete.
Erasing at 0x6c0000 --  75% complete.
Erasing at 0x6e0000 -- 100% complete.

Writing to NAND... OK

resetting ...

IPQ807x# smeminfo
flash_type:             0x2
flash_index:            0x0
flash_chip_select:      0x0
flash_block_size:       0x20000
flash_density:          0x100000
partition table offset  0x0
No.: Name             Attributes            Start             Size
  0: 0:SBL1           0x0000ffff              0x0         0x100000
  1: 0:MIBIB          0x0000ffff         0x100000         0x100000
  2: 0:QSEE           0x0000ffff         0x200000         0x300000
  3: 0:DEVCFG         0x0000ffff         0x500000          0x80000
  4: 0:RPM            0x0000ffff         0x580000          0x80000
  5: 0:CDT            0x0000ffff         0x600000          0x80000
  6: 0:APPSBLENV      0x0000ffff         0x680000          0x80000
  7: 0:APPSBL         0x0000ffff         0x700000         0x100000
  8: 0:ART            0x0000ffff         0x800000          0x80000
  9: bdata            0x0000ffff         0x880000          0x80000
 10: crash            0x0000ffff         0x900000          0x80000
 11: crash_syslog     0x0000ffff         0x980000          0x80000
 12: rootfs           0x0000ffff         0xa00000        0x23c0000
 13: rootfs_1         0x0000ffff        0x2dc0000        0x23c0000
 14: overlay          0x0000ffff        0x5180000        0x1ec0000
 15: rsvd0            0x0000ffff        0x7040000          0x80000

I don't understand why I got the old partitions back, with rootfs and rootfs_1.
I'm 100% sure, I had the expanded rootfs before, I did confirmed it.

smeminfo will just give you the stock partition table, which is overridden by DTS.

Honestly, no idea what could have went wrong, I tried sysupgrading from the PR code to the out of tree one and it worked.

1 Like

Do you have any advise on how to proceed from here?

Easiest is to just boot initramfs and sysupgrade from it

2 Likes

The last version from today?

Yeah, there is nothing breaking in it, its just the PR code+compat versions

1 Like

Recovered, sysupgraded to today version from initramfs and restored my config backup and all is working well. Don't know what went wrong before.
Thank you for your help.

1 Like

Sysupgrade failures are always misterious, I would just love to be able to reproduce them

I confirm this was a random issue and I can't replicate it.
Now, I just sysupgrade back to yesterday build (confirmed the version) and sysupgraded again to the today release. All went well and is working fine.

2 Likes

Get error after latest build.