U-Boot help:
IPQ5018# help
? - alias for 'help'
ar8xxx_dump- Dump ar8xxx registers
base - print or set address offset
bdinfo - print Board Info structure
bootelf - Boot from an ELF image in memory
bootm - boot application image from memory
bootmiwifi- bootmiwifi from flash device
bootp - boot image via network using BOOTP/TFTP protocol
bootvx - Boot vxWorks from an ELF image
bootz - boot Linux zImage image from memory
btnc - check reset button if pressed to 5s - if so ret 1
btni - init gpios for button
canary - test stack canary
chpart - change active partition
cmp - memory compare
coninfo - print console devices and information
cp - memory copy
crc32 - checksum calculation
dhcp - boot image via network using DHCP/TFTP protocol
dm - Driver model low level access
echo - echo args to console
editenv - edit environment variable
env - environment handling commands
erase - erase FLASH memory
exectzt - execute TZT
exit - exit script
false - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls - list files in a directory (default /)
fatsize - determine a file's size
fatwrite- write file into a dos filesystem
fdt - flattened device tree utility commands
flash - flash part_name
flash part_name load_addr file_size
flasherase- flerase part_name
flinfo - print FLASH memory information
fuseipq - fuse QFPROM registers from memory
go - start application at address 'addr'
help - print command description/usage
i2c - I2C sub-system
imxtract- extract a part of a multi-image
ipq5018_mdio- IPQ5018 mdio utility commands
ipq_mdio- IPQ mdio utility commands
is_sec_boot_enabled- check secure boot fuse is enabled or not
itest - return true/false on integer compare
loop - infinite loop on address range
md - memory display
mii - MII utility commands
mm - memory modify (auto-incrementing address)
mmc - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest - simple RAM read/write test
mw - memory write (fill)
nand - NAND sub-system
nboot - boot from NAND device
nfs - boot image via network using NFS protocol
nm - memory modify (constant address)
part - disk partition related commands
pci - list and access PCI Configuration Space
ping - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
reset - Perform RESET of the CPU
rmemcrash- miwifi check and save crash buff to mtd
run - run commands in an environment variable
runmulticore- Enable and schedule secondary cores
saveenv - save environment variables to persistent storage
secboot_image_check- check image signature. usage: tftpboot 0x44000000 miwifi_*_ full_all.bin && secboot_image_check
secure_authenticate- authenticate the signed image
setenv - set environment variables
setexpr - set environment variable as the result of eval expression
sf - SPI flash sub-system
showvar - print local hushshell variables
sleep - delay execution for some time
smeminfo- print SMEM FLASH information
source - run script from memory
test - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
tftpput - TFTP put command, for uploading files to a server
true - do nothing, successfully
tzt - load and run tzt
uart - UART sub-system
ubi - ubi commands
usb - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
xqup - load image and upgrade to flash
zip - zip a memory region
NAND layout:
root@XiaoQiang:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "0:SBL1"
mtd1: 00080000 00020000 "0:MIBIB"
mtd2: 00040000 00020000 "0:BOOTCONFIG"
mtd3: 00040000 00020000 "0:BOOTCONFIG1"
mtd4: 00100000 00020000 "0:QSEE"
mtd5: 00100000 00020000 "0:QSEE_1"
mtd6: 00040000 00020000 "0:DEVCFG"
mtd7: 00040000 00020000 "0:DEVCFG_1"
mtd8: 00040000 00020000 "0:CDT"
mtd9: 00040000 00020000 "0:CDT_1"
mtd10: 00080000 00020000 "0:APPSBLENV"
mtd11: 00140000 00020000 "0:APPSBL"
mtd12: 00140000 00020000 "0:APPSBL_1"
mtd13: 00100000 00020000 "0:ART"
mtd14: 00080000 00020000 "0:TRAINING"
mtd15: 00080000 00020000 "bdata"
mtd16: 00080000 00020000 "crash"
mtd17: 00080000 00020000 "crash_syslog"
mtd18: 02400000 00020000 "rootfs"
mtd19: 02400000 00020000 "rootfs_1"
mtd20: 02b00000 00020000 "overlay"
mtd21: 00383000 0001f000 "kernel"
mtd22: 01550000 0001f000 "ubi_rootfs"
mtd23: 026c0000 0001f000 "data"
nvram show
root@XiaoQiang:~# nvram show
CountryCode=DE
SN=xxx
boot_wait=on
bootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs cnss2.bdf_integrated=0x24 cnss2.bdf_pci0=0xa0 rootwait
bootcmd=bootmiwifi
bootdelay=3
bootmenu_delay=5
color=101
eth1addr=xxx
ethaddr=xxx
fdt_high=0x4A400000
fdtcontroladdr=4a9d4004
flag_boot_rootfs=0
flag_boot_success=1
flag_boot_type=2
flag_last_success=0
flag_ota_reboot=0
flag_try_sys1_failed=0
flag_try_sys2_failed=0
flash_type=11
fsbootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs cnss2.bdf_integrated=0x24 cnss2.bdf_pci0=0xa0
ipaddr=192.168.31.1
machid=8040003
mode=Router
model=CB0401
mtdids=nand0=nand0
no_wifi_dev_times=0
rand_key=xxx
rand_nonce=xxx
restore_defaults=0
serverip=192.168.31.100
soc_hw_version=20180101
soc_version_major=1
soc_version_minor=1
ssh_en=1
stderr=serial@78AF000
stdin=serial@78AF000
stdout=serial@78AF000
subModel=AT
telnet_en=0
uart_en=1
wl0_radio=1
wl0_ssid=Magenta_cb0401_xxx
wl1_radio=1
wl1_ssid=Magenta_cb0401_xxx
Active partition
root@XiaoQiang:~# nvram get flag_boot_rootfs
0
( mtd18: 02400000 00020000 "rootfs" )
DTS decompiled from DTB with some errors, and too big to post here.
What would be next step?
Xiaomi AX6000 got very similar hardware:
Both IPQ5018, same switch QCA8337, same 5GHz radio QCN9024.
cb0401 - 1GB RAM, ax6000 - 512MB
Both have 128MB NAND, but layout is different after mtd 19 rootfs_1
I found flashing instructions for AX6000 which I believe will be similar if not the same for cb0401
Also made full backup of NAND and have programmer, so no problem if I need to restore it.




