nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
523 stars 293 forks source link

iMX6UL Fail Bulk(W): LIBUSB_ERROR_TIMEOUT (-7) with big rootfs #423

Open swechencheng opened 2 months ago

swechencheng commented 2 months ago

Hi, I am trying uuu (1.5.181) on a custom board based on iMX6UL and flash rootfs on NAND. I build both core-image-minimal and core-image-full-cmdline with Yocto. I am based on the example nand script:

uuu_version 1.4.193

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f skyline410/u-boot-skyline410.imx-nand

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f skyline410/u-boot-skyline410.imx-nand -skipspl
SDPV: jump
# }

FB: ucmd printenv

FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f skyline410/zImage-skyline410.bin
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f skyline410/imx6ul-14x14-evk-gpmi-weim-skyline410.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f skyline410/skyline-mfgtool-initramfs-skyline410.cpio.zst.u-boot
FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
#FB: ucmd setenv bootargs console=ttymxc3,115200  ${mtdparts}
FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}

FBK: ucmd cat /proc/mtd
FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;

FBK: ucmd chmod 777 /tmp/mtd.sh
FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug

# burn rootfs
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
FBK: ucmd source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd
FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
#FBK: ucp skyline410/core-image-minimal-skyline410.tar.gz t:-
FBK: ucp skyline410/core-image-full-cmdline-skyline410.tar.gz t:-
#FBK: ucp skyline410/test-benchmark-skyline410.tar.gz t:-
FBK: sync
FBK: ucmd umount /mnt/mtd

FBK: done

Flashing core-image-minimal is fine, however, FBK: ucmd umount /mnt/mtd is very slow.

But when flashing core-image-full-cmdline, it fails:

~/mfgtool/binaries/kirkstone $ sudo uuu -s nand.rootfs.skyline410.uuu
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.181-0-gd362f4a

Build in config:
    Pctl     Chip        Vid     Pid     BcdVersion  Serial_No
    ==================================================
    SDPS:    MX8QXP      0x1fc9  0x012f  [0x0002..0xffff]
    SDPS:    MX8QM       0x1fc9  0x0129  [0x0002..0xffff]
    SDPS:    MX8DXL      0x1fc9  0x0147
    SDPS:    MX28        0x15a2  0x004f
    SDPS:    MX815       0x1fc9  0x013e
    SDPS:    MX865       0x1fc9  0x0146
    SDPS:    MX8ULP      0x1fc9  0x014a
    SDPS:    MX8ULP      0x1fc9  0x014b
    SDPS:    MX93        0x1fc9  0x014e
    SDPS:    MX93        0x1fc9  0x0159
    SDPS:    MX95        0x1fc9  0x015d
    SDPS:    MX95        0x1fc9  0x015c
    SDP:     MX7D        0x15a2  0x0076
    SDP:     MX6Q        0x15a2  0x0054
    SDP:     MX6D        0x15a2  0x0061
    SDP:     MX6SL       0x15a2  0x0063
    SDP:     MX6SX       0x15a2  0x0071
    SDP:     MX6UL       0x15a2  0x007d
    SDP:     MX6ULL      0x15a2  0x0080
    SDP:     MX6SLL      0x1fc9  0x0128
    SDP:     MX7ULP      0x1fc9  0x0126
    SDP:     MXRT106X    0x1fc9  0x0135
    SDP:     MX8MM       0x1fc9  0x0134
    SDP:     MX8MQ       0x1fc9  0x012b
    SDPU:    SPL         0x0525  0xb4a4  [0x0000..0x04ff]
    SDPV:    SPL1        0x0525  0xb4a4  [0x0500..0x9998]
    SDPV:    SPL1        0x1fc9  0x0151  [0x0500..0x9998]
    SDPU:    SPL         0x0525  0xb4a4  [0x9999..0x9999]
    SDPU:    SPL         0x3016  0x1001  [0x0000..0x04ff]
    SDPV:    SPL1        0x3016  0x1001  [0x0500..0x9998]
    FBK:             0x066f  0x9afe
    FBK:             0x066f  0x9bff
    FBK:             0x1fc9  0x0153
    FB:          0x0525  0xa4a5
    FB:          0x18d1  0x0d02
    FB:          0x3016  0x0001
    FB:          0x1fc9  0x0152
    FB:          0x0483  0x0afb

New USB Device Attached at 1:11-
1:11->Start Cmd:SDP: boot -f skyline410/u-boot-skyline410.imx-nand
100%1:11->Okay (0.56s)
New USB Device Attached at 1:11-D9642301232F21D4
1:11-D9642301232F21D4>Start Cmd:FB: ucmd printenv
1:11-D9642301232F21D4>Okay (0.095s)
1:11-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${loadaddr}
1:11-D9642301232F21D4>Okay (0.001s)
1:11-D9642301232F21D4>Start Cmd:FB: download -f skyline410/zImage-skyline410.bin
1:11-D9642301232F21D4>Okay (0.25s)
1:11-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${fdt_addr}
1:11-D9642301232F21D4>Okay (0s)
1:11-D9642301232F21D4>Start Cmd:FB: download -f skyline410/imx6ul-14x14-evk-gpmi-weim-skyline410.dtb
1:11-D9642301232F21D4>Okay (0.008s)
1:11-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${initrd_addr}
1:11-D9642301232F21D4>Okay (0.001s)
1:11-D9642301232F21D4>Start Cmd:FB: download -f skyline410/skyline-mfgtool-initramfs-skyline410.cpio.zst.u-boot
1:11-D9642301232F21D4>Okay (0.225s)
1:11-D9642301232F21D4>Start Cmd:FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
1:11-D9642301232F21D4>Okay (0.001s)
1:11-D9642301232F21D4>Start Cmd:FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}
1:11-D9642301232F21D4>Okay (0s)
New USB Device Attached at 1:11-0000000000000000
1:11-0000000000000000>Start Cmd:FBK: ucmd cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "nandboot"
mtd1: 01000000 00020000 "nandkernel"
mtd2: 00400000 00020000 "nanddtb"
mtd3: 14000000 00020000 "nandrootfs"
mtd4: 0a800000 00020000 "nanddata"
1:11-0000000000000000>Okay (0.041s)
1:11-0000000000000000>Start Cmd:FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
1:11-0000000000000000>Okay (0.038s)
1:11-0000000000000000>Start Cmd:FBK: ucmd chmod 777 /tmp/mtd.sh
1:11-0000000000000000>Okay (0.023s)
1:11-0000000000000000>Start Cmd:FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug
1:11-0000000000000000>Okay (0.028s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
Erasing 327680 Kibyte @ 0 -- 100 % complete
1:11-0000000000000000>Okay (4s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
ubiformat: mtd3 (nand), size 335544320 bytes (320.0 MiB), 2560 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 2559 -- 100 % complete
ubiformat: 2560 eraseblocks are supposedly empty
ubiformat: formatting eraseblock 2559 -- 100 % complete
1:11-0000000000000000>Okay (6.644s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
UBI device number 0, total 2560 LEBs (325058560 bytes, 310.0 MiB), available 2474 LEBs (314138624 bytes, 299.5 MiB), LEB size 126976 bytes (124.0 KiB)
1:11-0000000000000000>Okay (1.032s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
Set volume size to 314138624
Volume ID 0, size 2474 LEBs (314138624 bytes, 299.5 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "nandrootfs", alignment 1
1:11-0000000000000000>Okay (0.047s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd
1:11-0000000000000000>Okay (0.027s)
1:11-0000000000000000>Start Cmd:FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
1:11-0000000000000000>Okay (0.158s)
1:11-0000000000000000>Start Cmd:FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
1:11-0000000000000000>Okay (0.051s)
1:11-0000000000000000>Start Cmd:FBK: ucp skyline410/core-image-full-cmdline-skyline410.tar.gz t:-
55%1:11-0000000000000000>Fail Bulk(W): LIBUSB_ERROR_TIMEOUT (-7)(67.43s)
Please input command:
U>

From the target serial log:

U-Boot 2022.04+g181859317b+p0 (Nov 15 2022 - 06:28:05 +0000)

CPU:   i.MX6UL rev1.2 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 41C
Reset cause: POR
Model: Freescale i.MX6 UltraLite 14x14 EVK Board
Board: SML MX6UL 14x14 EVK
DRAM:  512 MiB
Core:  60 devices, 17 uclasses, devicetree: separate
NAND:  512 MiB
MMC:   FSL_SDHC: 0
Loading Environment from NAND... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated
Net:   SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for                mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot:  0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
baudrate=115200
bootargs=console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused
bootcmd=echo SML Booting from NAND ...; nand read ${loadaddr} 0x400000 0x1000000;nand read ${fdt_addr} 0x1400000 0x400000;if test ${tee} = yes; then nand read ${tee_addr} 0x6000000 0x400000;bootm ${tee_addr} - ${fdt_addr};else bootz ${loadaddr} - ${fdt_addr};fi
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootdelay=3
console=ttymxc0
emmc_ack=1
emmc_dev=1
ethprime=eth1
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mtdparts=mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
sd_dev=1
splashimage=0x8c000000
tee=no
tee_addr=0x84000000

Environment size: 1014/131068 bytes
Starting download of 7201168 bytes
......................................................
downloading of 7201168 bytes finished
Starting download of 36161 bytes

downloading of 36161 bytes finished
Starting download of 6447409 bytes
.................................................
downloading of 6447409 bytes finished
Kernel image @ 0x80800000 [ 0x000000 - 0x6de190 ]
## Loading init Ramdisk from Legacy Image at 86800000 ...
   Image Name:   skyline-mfgtool-initramfs-skylin
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    6447345 Bytes = 6.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300bd40
Modify /soc/bus@2000000/tsc@2040000 disabled
Modify /soc/bus@2000000/can@2094000 disabled
Modify /soc/bus@2100000/lcdif@21c8000 disabled
Modify /soc/bus@2100000/csi@21c4000 disabled
Modify /soc/bus@2000000/ethernet@20b4000 disabled
gpio@209c000: set_value: error: gpio GPIO1_8 not reserved
gpio@20ac000: set_value: error: gpio GPIO5_9 not reserved

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 (oe-user@oe-host) (arm-sml-linux-gnueabi-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Tue Nov 15 10:35:06 UTC 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x96000000, size 160 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] percpu: Embedded 12 pages/cpu s16844 r8192 d24116 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 332680K/524288K available (10240K kernel code, 1205K rwdata, 2768K rodata, 1024K init, 383K bss, 27768K reserved, 163840K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000055] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.002679] Console: colour dummy device 80x30
[    0.002788] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.002840] pid_max: default: 32768 minimum: 301
[    0.003327] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003389] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.005247] CPU: Testing write buffer coherency: ok
[    0.005924] CPU0: update cpu_capacity 1024
[    0.005977] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.008457] Setting up static identity map for 0x80100000 - 0x80100060
[    0.008866] rcu: Hierarchical SRCU implementation.
[    0.009968] smp: Bringing up secondary CPUs ...
[    0.010013] smp: Brought up 1 node, 1 CPU
[    0.010047] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.010079] CPU: All CPU(s) started in SVC mode.
[    0.011215] devtmpfs: initialized
[    0.027510] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.028113] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.028190] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.040648] pinctrl core: initialized pinctrl subsystem
[    0.044252] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.062047] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.064644] thermal_sys: Registered thermal governor 'step_wise'
[    0.065048] cpuidle: using governor menu
[    0.065352] CPU identified as i.MX6UL, silicon rev 1.2
[    0.090324] vdd3p0: supplied by regulator-dummy
[    0.091484] cpu: supplied by regulator-dummy
[    0.092957] vddsoc: supplied by regulator-dummy
[    0.123071] No ATAGs?
[    0.123229] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.123271] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.125463] imx6ul-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver
[    0.127802] imx mu driver is registered.
[    0.128715] imx rpmsg driver is registered.
[    0.148735] Kprobes globally optimized
[    0.185914] usbcore: registered new interface driver usbfs
[    0.186073] usbcore: registered new interface driver hub
[    0.186204] usbcore: registered new device driver usb
[    0.186793] mc: Linux media interface: v0.10
[    0.187044] pps_core: LinuxPPS API ver. 1 registered
[    0.187074] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.187142] PTP clock support registered
[    0.190844] clocksource: Switched to clocksource mxc_timer1
[    0.191295] VFS: Disk quotas dquot_6.6.0
[    0.191489] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212581] NET: Registered PF_INET protocol family
[    0.213100] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.215238] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.215349] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.215398] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.215516] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.215687] TCP: Hash tables configured (established 4096 bind 4096)
[    0.215888] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.215991] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.216409] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.218032] RPC: Registered named UNIX socket transport module.
[    0.218093] RPC: Registered udp transport module.
[    0.218117] RPC: Registered tcp transport module.
[    0.218139] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.221431] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.223897] Trying to unpack rootfs image as initramfs...
[    0.234628] Bus freq driver module loaded
[    0.236918] Initialise system trusted keyrings
[    0.241241] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.272340] NFS: Registering the id_resolver key type
[    0.272491] Key type id_resolver registered
[    0.272522] Key type id_legacy registered
[    0.272763] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.272798] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.272896] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.274160] fuse: init (API version 7.34)
[    0.282118] async_tx: api initialized (async)
[    0.282181] Key type asymmetric registered
[    0.282209] Asymmetric key parser 'x509' registered
[    0.282365] io scheduler mq-deadline registered
[    0.282401] io scheduler kyber registered
[    0.310670] mxs-dma 1804000.dma-apbh: initialized
[    0.326553] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 29, base_baud = 5000000) is a IMX
[    1.701064] printk: console [ttymxc0] enabled
[    1.712816] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 67, base_baud = 5000000) is a IMX
[    1.742225] imx sema4 driver is registered.
[    1.802255] brd: module loaded
[    1.832311] loop: module loaded
[    1.851541] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
[    1.857959] nand: AMD/Spansion S34ML04G2
[    1.871067] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    1.892448] Bad block table found at page 262080, version 0x01
[    1.911768] Bad block table found at page 262016, version 0x01
[    1.921309] 5 cmdlinepart partitions found on MTD device gpmi-nand
[    1.927552] Creating 5 MTD partitions on "gpmi-nand":
[    1.951053] 0x000000000000-0x000000400000 : "nandboot"
[    1.962831] 0x000000400000-0x000001400000 : "nandkernel"
[    1.984130] 0x000001400000-0x000001800000 : "nanddtb"
[    2.003592] 0x000001800000-0x000015800000 : "nandrootfs"
[    2.025318] 0x000015800000-0x000020000000 : "nanddata"
[    2.045761] gpmi-nand 1806000.nand-controller: driver registered.
[    2.066602] gpio-505 (eth0-phy): hogged as output/high
[    2.081318] gpio-506 (eth1-phy): hogged as output/high
[    2.089205] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.111043] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.134246] tun: Universal TUN/TAP device driver, 1.6
[    2.154274] pps pps0: new PPS source ptp0
[    2.161927] fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    2.168767] fec 2188000.ethernet: Using random MAC address: ba:9f:6a:4e:96:01
[    2.717879] Freeing initrd memory: 6300K
[    2.731428] imx-sdma 20ec000.sdma: firmware found.
[    2.736954] imx-sdma 20ec000.sdma: loaded firmware 3.5
[    3.090257] fec 2188000.ethernet eth0: registered PHC device 0
[    3.097292] usbcore: registered new interface driver r8152
[    3.103275] usbcore: registered new interface driver lan78xx
[    3.109086] usbcore: registered new interface driver asix
[    3.114794] usbcore: registered new interface driver ax88179_178a
[    3.121141] usbcore: registered new interface driver cdc_ether
[    3.127126] usbcore: registered new interface driver smsc95xx
[    3.133183] usbcore: registered new interface driver net1080
[    3.138957] usbcore: registered new interface driver cdc_subset
[    3.145048] usbcore: registered new interface driver zaurus
[    3.150732] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    3.158402] usbcore: registered new interface driver cdc_ncm
[    3.164235] usbcore: registered new interface driver r8153_ecm
[    3.170097] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.184995] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[    3.191293] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)
[    3.207680] sdhci: Secure Digital Host Controller Interface driver
[    3.214148] sdhci: Copyright(c) Pierre Ossman
[    3.218539] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.227643] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    3.236232] caam-dma caam-dma: Defer probing after JR driver probing
[    3.245594] caam 2140000.crypto: device ID = 0x0a16030000000000 (Era 8)
[    3.252424] caam 2140000.crypto: job rings = 3, qi = 0
[    3.284353] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    3.299983] caam algorithms registered in /proc/crypto
[    3.310626] caam 2140000.crypto: caam pkc algorithms registered in /proc/crypto
[    3.319075] caam 2140000.crypto: rng crypto API alg registered prng-caam
[    3.326385] caam 2140000.crypto: registering rng-caam
[    3.333859] Device caam-keygen registered
[    3.347465] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[    3.357693] usbcore: registered new interface driver usbhid
[    3.363497] usbhid: USB HID core driver
[    3.369330] random: crng init done
[    3.378514] NET: Registered PF_LLC protocol family
[    3.384950] NET: Registered PF_INET6 protocol family
[    3.392773] Segment Routing with IPv6
[    3.396550] In-situ OAM (IOAM) with IPv6
[    3.400708] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.408468] NET: Registered PF_PACKET protocol family
[    3.414478] Key type dns_resolver registered
[    3.444644] Registering SWP/SWPB emulation handler
[    3.449956] Loading compiled-in X.509 certificates
[    3.496183] imx_usb 2184000.usb: No over current polarity defined
[    3.513139] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    3.518135] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    3.551133] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    3.557714] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.566203] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.574040] usb usb1: Product: EHCI Host Controller
[    3.579366] usb usb1: Manufacturer: Linux 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 ehci_hcd
[    3.588828] usb usb1: SerialNumber: ci_hdrc.1
[    3.594445] hub 1-0:1.0: USB hub found
[    3.598374] hub 1-0:1.0: 1 port detected
[    3.605690] imx_thermal 20c8000.anatop:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[    3.618040] caam-dma caam-dma: caam dma support with 3 job rings
[    3.625582] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.652932] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.659786] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    3.668797] clk: Not disabling unused clocks
[    3.676059] Freeing unused kernel image (initmem) memory: 1024K
[    3.682192] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    3.712028] Run /linuxrc as init process
Found New UDC: ci_hdrc.0
ci_hdrc.0 0
ffs.utp0
[    3.895935] file system registered
run utp at /dev/usb-utp0/ep0
.
uuu fastboot client 1.0.0 [built [    3.958977] read descriptors
Aug 17 2022 19:49:14]
Start init[    3.965427] read strings
 usb
write string
Start handle command
run shell cmd: cat /proc/mtd
run shell cmd: cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
run shell cmd: chmod 777 /tmp/mtd.sh
run shell cmd: mount -t debugfs debugfs /sys/kernel/debug
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
run shell cmd: source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
run shell cmd: source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
[   16.460062] ubi0: default fastmap pool size: 125
[   16.465203] ubi0: default fastmap WL pool size: 62
[   16.470034] ubi0: attaching mtd3
[   17.358832] ubi0: scanning is finished
[   17.388305] ubi0: attached mtd3 (name "nandrootfs", size 320 MiB)
[   17.394945] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   17.402305] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   17.409216] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[   17.416703] ubi0: good PEBs: 2560, bad PEBs: 0, corrupted PEBs: 0
[   17.423192] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[   17.430602] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 713225854
[   17.440071] ubi0: available PEBs: 2474, total reserved PEBs: 86, PEBs reserved for bad PEB handling: 80
[   17.449717] ubi0: background thread "ubi_bgt0d" started, PID 224
run shell cmd: source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
run shell cmd: source /tmp/mtd.sh; mkdir -p /mnt/mtd
run shell cmd: source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
[   17.585897] UBIFS (ubi0:0): default file-system created
[   17.592219] UBIFS (ubi0:0): Mounting in unauthenticated mode
[   17.603871] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 228
[   17.646041] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "nandrootfs"
[   17.654242] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   17.664615] UBIFS (ubi0:0): FS size: 312487936 bytes (298 MiB, 2461 LEBs), max 2474 LEBs, journal size 15618048 bytes (14 MiB, 123 LEBs)
[   17.677334] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[   17.684341] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 628F74BD-9F15-441F-BDB5-3B5BBB15CDB0, small LPT model
run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
WOpen:-
[   64.498032] cfg80211: failed to load regulatory.db

This is a very steady failure which fails exactly at the same 55%. Thanks in advance if anyone could help to look at this.

nxpfrankli commented 2 months ago

we recent meet similar problem at small me mory devices.

try patch linux kernel driver

Changed the page alignment check within the prepare_td_for_sg() function
since the first buffer could not be page size aligned, so the check is
only performed for the following buffers.

Signed-off-by: Han Xu <[han.xu@nxp.com](mailto:han.xu@nxp.com)>
---
 drivers/usb/chipidea/udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0b7bd3c643c3..13cbf2e2aeae 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -517,7 +517,8 @@ static int prepare_td_for_sg(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
    }

    while (i++ < req->num_mapped_sgs) {
-       if (sg_dma_address(s) % PAGE_SIZE) {
+       /* The first buffer could be not page size aligned. */
+       if ((sg_dma_address(s) % PAGE_SIZE) && (i > 1)) {
            dev_err(hwep->ci->dev, "not page aligned sg buffer\n");
            return -EINVAL;
        }
swechencheng commented 2 months ago

@nxpfrankli Thanks for your quick reply. I patched linux-imx-mfgtool which is used by initramfs with your suggestion. However, I got same uuu failure and on the target I got:

free(): invalid pointer
[  575.424621] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[  575.433966] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 ]---

But this kernel crash seems to be not consistent...

I tried the same kernel patch back and forth between 1.4.243 and 1.5.181. Seems 1.5.181 can progress a bit more percentage with the same big rootfs rather than 1.4.243.

nxpfrankli commented 2 months ago

Can you put all kernel log, which show what kernel panic?

swechencheng commented 2 months ago

@nxpfrankli I had two kernel crash in a row. But after power cycle I could not re-produce them any more.

U-Boot 2022.04+g181859317b+p0 (Nov 15 2022 - 06:28:05 +0000)

CPU:   i.MX6UL rev1.2 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 40C
Reset cause: POR
Model: Freescale i.MX6 UltraLite 14x14 EVK Board
Board: SML MX6UL 14x14 EVK
DRAM:  512 MiB
Core:  60 devices, 17 uclasses, devicetree: separate
NAND:  512 MiB
MMC:   FSL_SDHC: 0
Loading Environment from NAND... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated
Net:   SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for                                mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot:  0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
baudrate=115200
bootargs=console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused
bootcmd=echo SML Booting from NAND ...; nand read ${loadaddr} 0x400000 0x1000000;nand read ${fdt_addr} 0x1400000 0x400000;if test ${tee} = yes; then nand read ${tee_addr} 0x6000000 0x400000;bootm ${tee_addr} - ${fdt_addr};else bootz ${loadaddr} - ${fdt_addr};fi
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootdelay=3
console=ttymxc0
emmc_ack=1
emmc_dev=1
ethprime=eth1
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mtdparts=mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
sd_dev=1
splashimage=0x8c000000
tee=no
tee_addr=0x84000000

Environment size: 1014/131068 bytes
Starting download of 7201184 bytes
......................................................
downloading of 7201184 bytes finished
Starting download of 36161 bytes

downloading of 36161 bytes finished
Starting download of 6447409 bytes
.................................................
downloading of 6447409 bytes finished
Kernel image @ 0x80800000 [ 0x000000 - 0x6de1a0 ]
## Loading init Ramdisk from Legacy Image at 86800000 ...
   Image Name:   skyline-mfgtool-initramfs-skylin
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    6447345 Bytes = 6.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300bd40
Modify /soc/bus@2000000/tsc@2040000 disabled
Modify /soc/bus@2000000/can@2094000 disabled
Modify /soc/bus@2100000/lcdif@21c8000 disabled
Modify /soc/bus@2100000/csi@21c4000 disabled
Modify /soc/bus@2000000/ethernet@20b4000 disabled
gpio@209c000: set_value: error: gpio GPIO1_8 not reserved
gpio@20ac000: set_value: error: gpio GPIO5_9 not reserved

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p1 (oe-user@oe-host) (arm-sml-linux-gnueabi-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Tue Nov 15 10:35:06 UTC 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x96000000, size 160 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] percpu: Embedded 12 pages/cpu s16844 r8192 d24116 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 332680K/524288K available (10240K kernel code, 1205K rwdata, 2768K rodata, 1024K init, 383K bss, 27768K reserved, 163840K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000055] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.002678] Console: colour dummy device 80x30
[    0.002788] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.002840] pid_max: default: 32768 minimum: 301
[    0.003327] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003388] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.005235] CPU: Testing write buffer coherency: ok
[    0.005912] CPU0: update cpu_capacity 1024
[    0.005963] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.008444] Setting up static identity map for 0x80100000 - 0x80100060
[    0.008850] rcu: Hierarchical SRCU implementation.
[    0.009959] smp: Bringing up secondary CPUs ...
[    0.010004] smp: Brought up 1 node, 1 CPU
[    0.010039] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.010071] CPU: All CPU(s) started in SVC mode.
[    0.011204] devtmpfs: initialized
[    0.027552] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.028155] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.028229] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.040660] pinctrl core: initialized pinctrl subsystem
[    0.044258] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.061990] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.064607] thermal_sys: Registered thermal governor 'step_wise'
[    0.065016] cpuidle: using governor menu
[    0.065317] CPU identified as i.MX6UL, silicon rev 1.2
[    0.090279] vdd3p0: supplied by regulator-dummy
[    0.091421] cpu: supplied by regulator-dummy
[    0.092899] vddsoc: supplied by regulator-dummy
[    0.123030] No ATAGs?
[    0.123187] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.123229] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.125407] imx6ul-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver
[    0.127737] imx mu driver is registered.
[    0.128654] imx rpmsg driver is registered.
[    0.148617] Kprobes globally optimized
[    0.185772] usbcore: registered new interface driver usbfs
[    0.185935] usbcore: registered new interface driver hub
[    0.186062] usbcore: registered new device driver usb
[    0.186646] mc: Linux media interface: v0.10
[    0.186896] pps_core: LinuxPPS API ver. 1 registered
[    0.186927] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.186991] PTP clock support registered
[    0.190700] clocksource: Switched to clocksource mxc_timer1
[    0.191157] VFS: Disk quotas dquot_6.6.0
[    0.191351] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212492] NET: Registered PF_INET protocol family
[    0.213013] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.215138] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.215252] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.215303] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.215421] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.215591] TCP: Hash tables configured (established 4096 bind 4096)
[    0.215792] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.215894] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.216313] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.217941] RPC: Registered named UNIX socket transport module.
[    0.218002] RPC: Registered udp transport module.
[    0.218026] RPC: Registered tcp transport module.
[    0.218047] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.221334] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.223784] Trying to unpack rootfs image as initramfs...
[    0.234488] Bus freq driver module loaded
[    0.236762] Initialise system trusted keyrings
[    0.241090] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.272200] NFS: Registering the id_resolver key type
[    0.272472] Key type id_resolver registered
[    0.272502] Key type id_legacy registered
[    0.272749] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.272789] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.272889] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.274151] fuse: init (API version 7.34)
[    0.281989] async_tx: api initialized (async)
[    0.282053] Key type asymmetric registered
[    0.282080] Asymmetric key parser 'x509' registered
[    0.282233] io scheduler mq-deadline registered
[    0.282268] io scheduler kyber registered
[    0.310558] mxs-dma 1804000.dma-apbh: initialized
[    0.326435] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 29, base_baud = 5000000) is a IMX
[    1.700925] printk: console [ttymxc0] enabled
[    1.712667] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 67, base_baud = 5000000) is a IMX
[    1.742075] imx sema4 driver is registered.
[    1.802108] brd: module loaded
[    1.836113] loop: module loaded
[    1.854799] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
[    1.870929] nand: AMD/Spansion S34ML04G2
[    1.874918] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    1.901422] Bad block table found at page 262080, version 0x01
[    1.921687] Bad block table found at page 262016, version 0x01
[    1.931055] 5 cmdlinepart partitions found on MTD device gpmi-nand
[    1.937294] Creating 5 MTD partitions on "gpmi-nand":
[    1.960998] 0x000000000000-0x000000400000 : "nandboot"
[    1.969714] 0x000000400000-0x000001400000 : "nandkernel"
[    1.994556] 0x000001400000-0x000001800000 : "nanddtb"
[    2.013441] 0x000001800000-0x000015800000 : "nandrootfs"
[    2.035188] 0x000015800000-0x000020000000 : "nanddata"
[    2.055572] gpmi-nand 1806000.nand-controller: driver registered.
[    2.076460] gpio-505 (eth0-phy): hogged as output/high
[    2.091502] gpio-506 (eth1-phy): hogged as output/high
[    2.099575] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.120906] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.144140] tun: Universal TUN/TAP device driver, 1.6
[    2.164135] pps pps0: new PPS source ptp0
[    2.171840] fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    2.178676] fec 2188000.ethernet: Using random MAC address: 0e:36:e7:ef:a7:44
[    2.719433] Freeing initrd memory: 6300K
[    2.731235] imx-sdma 20ec000.sdma: firmware found.
[    2.736753] imx-sdma 20ec000.sdma: loaded firmware 3.5
[    3.091958] fec 2188000.ethernet eth0: registered PHC device 0
[    3.098598] usbcore: registered new interface driver r8152
[    3.104632] usbcore: registered new interface driver lan78xx
[    3.110450] usbcore: registered new interface driver asix
[    3.116140] usbcore: registered new interface driver ax88179_178a
[    3.122486] usbcore: registered new interface driver cdc_ether
[    3.128473] usbcore: registered new interface driver smsc95xx
[    3.134558] usbcore: registered new interface driver net1080
[    3.140334] usbcore: registered new interface driver cdc_subset
[    3.146507] usbcore: registered new interface driver zaurus
[    3.152314] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    3.159928] usbcore: registered new interface driver cdc_ncm
[    3.165792] usbcore: registered new interface driver r8153_ecm
[    3.171704] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.186589] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[    3.192885] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)
[    3.209218] sdhci: Secure Digital Host Controller Interface driver
[    3.215689] sdhci: Copyright(c) Pierre Ossman
[    3.220077] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.229194] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    3.237820] caam-dma caam-dma: Defer probing after JR driver probing
[    3.247213] caam 2140000.crypto: device ID = 0x0a16030000000000 (Era 8)
[    3.254052] caam 2140000.crypto: job rings = 3, qi = 0
[    3.284141] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    3.299823] caam algorithms registered in /proc/crypto
[    3.310460] caam 2140000.crypto: caam pkc algorithms registered in /proc/crypto
[    3.318921] caam 2140000.crypto: rng crypto API alg registered prng-caam
[    3.326230] caam 2140000.crypto: registering rng-caam
[    3.333712] Device caam-keygen registered
[    3.347335] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[    3.357543] usbcore: registered new interface driver usbhid
[    3.363349] usbhid: USB HID core driver
[    3.369178] random: crng init done
[    3.378370] NET: Registered PF_LLC protocol family
[    3.384793] NET: Registered PF_INET6 protocol family
[    3.392605] Segment Routing with IPv6
[    3.396383] In-situ OAM (IOAM) with IPv6
[    3.400539] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.408306] NET: Registered PF_PACKET protocol family
[    3.414328] Key type dns_resolver registered
[    3.444495] Registering SWP/SWPB emulation handler
[    3.449806] Loading compiled-in X.509 certificates
[    3.495985] imx_usb 2184000.usb: No over current polarity defined
[    3.512964] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    3.517955] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    3.550978] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    3.557564] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.566054] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.573909] usb usb1: Product: EHCI Host Controller
[    3.579245] usb usb1: Manufacturer: Linux 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p1 ehci_hcd
[    3.588710] usb usb1: SerialNumber: ci_hdrc.1
[    3.594391] hub 1-0:1.0: USB hub found
[    3.598263] hub 1-0:1.0: 1 port detected
[    3.605575] imx_thermal 20c8000.anatop:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[    3.618030] caam-dma caam-dma: caam dma support with 3 job rings
[    3.625500] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.652636] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.659490] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    3.668519] clk: Not disabling unused clocks
[    3.675742] Freeing unused kernel image (initmem) memory: 1024K
[    3.681866] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    3.711965] Run /linuxrc as init process
Found New UDC: ci_hdrc.0
ci_hdrc.0 0
ffs.utp0
[    3.894488] file system registered
run utp at /dev/usb-utp0/ep0
.
uuu fastboot client 1.0.0 [built [    3.957811] read descriptors
Aug 17 2022 19:49:14]
Start init[    3.963876] read strings
 usb
write string
Start handle command
run shell cmd: cat /proc/mtd
run shell cmd: cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
run shell cmd: chmod 777 /tmp/mtd.sh
run shell cmd: mount -t debugfs debugfs /sys/kernel/debug
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
run shell cmd: source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
run shell cmd: source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
[   16.460356] ubi0: default fastmap pool size: 125
[   16.465416] ubi0: default fastmap WL pool size: 62
[   16.470246] ubi0: attaching mtd3
[   17.344259] ubi0: scanning is finished
[   17.372504] ubi0: attached mtd3 (name "nandrootfs", size 320 MiB)
[   17.378906] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   17.386267] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   17.393387] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[   17.400493] ubi0: good PEBs: 2560, bad PEBs: 0, corrupted PEBs: 0
[   17.406786] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[   17.414339] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 11681182
[   17.423533] ubi0: available PEBs: 2474, total reserved PEBs: 86, PEBs reserved for bad PEB handling: 80
[   17.433277] ubi0: background thread "ubi_bgt0d" started, PID 224
run shell cmd: source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
run shell cmd: source /tmp/mtd.sh; mkdir -p /mnt/mtd
run shell cmd: source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
[   17.568585] UBIFS (ubi0:0): default file-system created
[   17.574922] UBIFS (ubi0:0): Mounting in unauthenticated mode
[   17.583928] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 228
[   17.628345] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "nandrootfs"
[   17.636670] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   17.646962] UBIFS (ubi0:0): FS size: 312487936 bytes (298 MiB, 2461 LEBs), max 2474 LEBs, journal size 15618048 bytes (14 MiB, 123 LEBs)
[   17.659674] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[   17.666696] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 8C195607-E45F-4A7F-BA9F-2C2A6C67A8CF, small LPT model
run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
WOpen:-
[   64.499908] cfg80211: failed to load regulatory.db
No udc Available!
malloc(): unaligned fastbin chunk detected 3
[   86.183562] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[   86.192927] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 ]---

U-Boot 2022.04+g181859317b+p0 (Nov 15 2022 - 06:28:05 +0000)

CPU:   i.MX6UL rev1.2 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 41C
Reset cause: POR
Model: Freescale i.MX6 UltraLite 14x14 EVK Board
Board: SML MX6UL 14x14 EVK
DRAM:  512 MiB
Core:  60 devices, 17 uclasses, devicetree: separate
NAND:  512 MiB
MMC:   FSL_SDHC: 0
Loading Environment from NAND... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated
Net:   SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for                                mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot:  0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
baudrate=115200
bootargs=console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused
bootcmd=echo SML Booting from NAND ...; nand read ${loadaddr} 0x400000 0x1000000;nand read ${fdt_addr} 0x1400000 0x400000;if test ${tee} = yes; then nand read ${tee_addr} 0x6000000 0x400000;bootm ${tee_addr} - ${fdt_addr};else bootz ${loadaddr} - ${fdt_addr};fi
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootdelay=3
console=ttymxc0
emmc_ack=1
emmc_dev=1
ethprime=eth1
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mtdparts=mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
sd_dev=1
splashimage=0x8c000000
tee=no
tee_addr=0x84000000

Environment size: 1014/131068 bytes
Starting download of 7201272 bytes
......................................................
downloading of 7201272 bytes finished
Starting download of 36161 bytes

downloading of 36161 bytes finished
Starting download of 6447409 bytes
.................................................
downloading of 6447409 bytes finished
Kernel image @ 0x80800000 [ 0x000000 - 0x6de1f8 ]
## Loading init Ramdisk from Legacy Image at 86800000 ...
   Image Name:   skyline-mfgtool-initramfs-skylin
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    6447345 Bytes = 6.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300bd40
Modify /soc/bus@2000000/tsc@2040000 disabled
Modify /soc/bus@2000000/can@2094000 disabled
Modify /soc/bus@2100000/lcdif@21c8000 disabled
Modify /soc/bus@2100000/csi@21c4000 disabled
Modify /soc/bus@2000000/ethernet@20b4000 disabled
gpio@209c000: set_value: error: gpio GPIO1_8 not reserved
gpio@20ac000: set_value: error: gpio GPIO5_9 not reserved

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 (oe-user@oe-host) (arm-sml-linux-gnueabi-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Tue Nov 15 10:35:06 UTC 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x96000000, size 160 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] percpu: Embedded 12 pages/cpu s16844 r8192 d24116 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),320m(nandrootfs),-(nanddata)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 332680K/524288K available (10240K kernel code, 1205K rwdata, 2768K rodata, 1024K init, 383K bss, 27768K reserved, 163840K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000055] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.002663] Console: colour dummy device 80x30
[    0.002775] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.002828] pid_max: default: 32768 minimum: 301
[    0.003313] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003376] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.005225] CPU: Testing write buffer coherency: ok
[    0.005892] CPU0: update cpu_capacity 1024
[    0.005946] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.008410] Setting up static identity map for 0x80100000 - 0x80100060
[    0.008819] rcu: Hierarchical SRCU implementation.
[    0.009929] smp: Bringing up secondary CPUs ...
[    0.009973] smp: Brought up 1 node, 1 CPU
[    0.010006] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.010036] CPU: All CPU(s) started in SVC mode.
[    0.011164] devtmpfs: initialized
[    0.027416] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.028011] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.028090] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.040511] pinctrl core: initialized pinctrl subsystem
[    0.044108] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.061818] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.064404] thermal_sys: Registered thermal governor 'step_wise'
[    0.064803] cpuidle: using governor menu
[    0.065110] CPU identified as i.MX6UL, silicon rev 1.2
[    0.090076] vdd3p0: supplied by regulator-dummy
[    0.091217] cpu: supplied by regulator-dummy
[    0.092697] vddsoc: supplied by regulator-dummy
[    0.122796] No ATAGs?
[    0.122955] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.122996] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.125173] imx6ul-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver
[    0.127489] imx mu driver is registered.
[    0.128402] imx rpmsg driver is registered.
[    0.148483] Kprobes globally optimized
[    0.185446] usbcore: registered new interface driver usbfs
[    0.185605] usbcore: registered new interface driver hub
[    0.185736] usbcore: registered new device driver usb
[    0.186314] mc: Linux media interface: v0.10
[    0.186570] pps_core: LinuxPPS API ver. 1 registered
[    0.186602] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.186669] PTP clock support registered
[    0.190353] clocksource: Switched to clocksource mxc_timer1
[    0.190811] VFS: Disk quotas dquot_6.6.0
[    0.191004] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212035] NET: Registered PF_INET protocol family
[    0.212553] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.214670] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.214783] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.214834] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.214951] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.215124] TCP: Hash tables configured (established 4096 bind 4096)
[    0.215318] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.215418] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.215827] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.217432] RPC: Registered named UNIX socket transport module.
[    0.217493] RPC: Registered udp transport module.
[    0.217516] RPC: Registered tcp transport module.
[    0.217538] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.220815] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.223292] Trying to unpack rootfs image as initramfs...
[    0.234126] Bus freq driver module loaded
[    0.236409] Initialise system trusted keyrings
[    0.240745] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.271850] NFS: Registering the id_resolver key type
[    0.272033] Key type id_resolver registered
[    0.272063] Key type id_legacy registered
[    0.272305] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.272343] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.272442] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.273706] fuse: init (API version 7.34)
[    0.281629] async_tx: api initialized (async)
[    0.281690] Key type asymmetric registered
[    0.281719] Asymmetric key parser 'x509' registered
[    0.281870] io scheduler mq-deadline registered
[    0.281902] io scheduler kyber registered
[    0.310158] mxs-dma 1804000.dma-apbh: initialized
[    0.325994] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 29, base_baud = 5000000) is a IMX
[    1.700539] printk: console [ttymxc0] enabled
[    1.712325] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 67, base_baud = 5000000) is a IMX
[    1.741712] imx sema4 driver is registered.
[    1.801729] brd: module loaded
[    1.831604] loop: module loaded
[    1.851060] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
[    1.857479] nand: AMD/Spansion S34ML04G2
[    1.870596] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    1.891947] Bad block table found at page 262080, version 0x01
[    1.911284] Bad block table found at page 262016, version 0x01
[    1.920838] 5 cmdlinepart partitions found on MTD device gpmi-nand
[    1.927084] Creating 5 MTD partitions on "gpmi-nand":
[    1.950644] 0x000000000000-0x000000400000 : "nandboot"
[    1.962222] 0x000000400000-0x000001400000 : "nandkernel"
[    1.983587] 0x000001400000-0x000001800000 : "nanddtb"
[    2.002284] 0x000001800000-0x000015800000 : "nandrootfs"
[    2.023982] 0x000015800000-0x000020000000 : "nanddata"
[    2.044363] gpmi-nand 1806000.nand-controller: driver registered.
[    2.066058] gpio-505 (eth0-phy): hogged as output/high
[    2.080824] gpio-506 (eth1-phy): hogged as output/high
[    2.088706] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.110627] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.133844] tun: Universal TUN/TAP device driver, 1.6
[    2.153680] pps pps0: new PPS source ptp0
[    2.161474] fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    2.168307] fec 2188000.ethernet: Using random MAC address: 42:4c:0b:a1:4b:6d
[    2.713544] Freeing initrd memory: 6300K
[    2.720819] imx-sdma 20ec000.sdma: firmware found.
[    2.730931] imx-sdma 20ec000.sdma: loaded firmware 3.5
[    3.084784] fec 2188000.ethernet eth0: registered PHC device 0
[    3.091864] usbcore: registered new interface driver r8152
[    3.097492] usbcore: registered new interface driver lan78xx
[    3.103519] usbcore: registered new interface driver asix
[    3.109034] usbcore: registered new interface driver ax88179_178a
[    3.115395] usbcore: registered new interface driver cdc_ether
[    3.121476] usbcore: registered new interface driver smsc95xx
[    3.127351] usbcore: registered new interface driver net1080
[    3.133340] usbcore: registered new interface driver cdc_subset
[    3.139372] usbcore: registered new interface driver zaurus
[    3.145183] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    3.152888] usbcore: registered new interface driver cdc_ncm
[    3.158664] usbcore: registered new interface driver r8153_ecm
[    3.164585] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.179270] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[    3.185587] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)
[    3.202081] sdhci: Secure Digital Host Controller Interface driver
[    3.208311] sdhci: Copyright(c) Pierre Ossman
[    3.212968] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.222075] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    3.231542] caam-dma caam-dma: Defer probing after JR driver probing
[    3.238111] caam 2140000.crypto: device ID = 0x0a16030000000000 (Era 8)
[    3.246727] caam 2140000.crypto: job rings = 3, qi = 0
[    3.277947] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    3.293956] caam algorithms registered in /proc/crypto
[    3.304314] caam 2140000.crypto: caam pkc algorithms registered in /proc/crypto
[    3.312796] caam 2140000.crypto: rng crypto API alg registered prng-caam
[    3.319571] caam 2140000.crypto: registering rng-caam
[    3.327344] Device caam-keygen registered
[    3.341158] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[    3.351304] usbcore: registered new interface driver usbhid
[    3.356924] usbhid: USB HID core driver
[    3.362814] random: crng init done
[    3.372209] NET: Registered PF_LLC protocol family
[    3.378405] NET: Registered PF_INET6 protocol family
[    3.386189] Segment Routing with IPv6
[    3.389967] In-situ OAM (IOAM) with IPv6
[    3.394332] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.401947] NET: Registered PF_PACKET protocol family
[    3.407868] Key type dns_resolver registered
[    3.444162] Registering SWP/SWPB emulation handler
[    3.449472] Loading compiled-in X.509 certificates
[    3.495439] imx_usb 2184000.usb: No over current polarity defined
[    3.512382] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    3.517378] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    3.550647] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    3.557228] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.565720] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.573559] usb usb1: Product: EHCI Host Controller
[    3.578890] usb usb1: Manufacturer: Linux 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 ehci_hcd
[    3.588354] usb usb1: SerialNumber: ci_hdrc.1
[    3.594026] hub 1-0:1.0: USB hub found
[    3.597897] hub 1-0:1.0: 1 port detected
[    3.605230] imx_thermal 20c8000.anatop:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[    3.617654] caam-dma caam-dma: caam dma support with 3 job rings
[    3.625138] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.652194] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.659047] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    3.668076] clk: Not disabling unused clocks
[    3.675306] Freeing unused kernel image (initmem) memory: 1024K
[    3.681434] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    3.711620] Run /linuxrc as init process
Found New UDC: ci_hdrc.0
ci_hdrc.0 0
ffs.utp0
[    3.895175] file system registered
run utp at /dev/usb-utp0/ep0
.
uuu fastboot client 1.0.0 [built [    3.958532] read descriptors
Aug 17 2022 19:49:14]
Start init[    3.964672] read strings
 usb
write string
Start handle command
run shell cmd: cat /proc/mtd
run shell cmd: cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
run shell cmd: chmod 777 /tmp/mtd.sh
run shell cmd: mount -t debugfs debugfs /sys/kernel/debug
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nandboot} 0 0
WOpen:/tmp/boot
run shell cmd: source /tmp/mtd.sh; cd /tmp; if ! [[ `cat /sys/devices/soc0/soc_id` =~ .*MX8(Q|DXL|MN|MP).* ]]; then pad="-x"; fi; kobs-ng init $pad -v --chip_0_device_path=/dev/mtd${nandboot} /tmp/boot
run shell cmd: if [[ `cat /tmp/mtd.sh` = *"nandfit"* ]]; then source /tmp/mtd.sh; flash_erase /dev/mtd${nandfit} 0 0; dd if=/tmp/boot of=/tmp/fit; nandwrite -p /dev/mtd${nandfit} -p /tmp/fit; fi
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nandkernel} 0 0
WOpen:/tmp/img
run shell cmd: source /tmp/mtd.sh; nandwrite -p /dev/mtd${nandkernel} -p /tmp/img
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nanddtb} 0 0
WOpen:/tmp/dtb
run shell cmd: source /tmp/mtd.sh; nandwrite -p /dev/mtd${nanddtb} -p /tmp/dtb
run shell cmd: source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
run shell cmd: source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
run shell cmd: source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
[   20.053258] ubi0: default fastmap pool size: 125
[   20.057926] ubi0: default fastmap WL pool size: 62
[   20.063177] ubi0: attaching mtd3
[   20.932454] ubi0: scanning is finished
[   20.961234] ubi0: attached mtd3 (name "nandrootfs", size 320 MiB)
[   20.967595] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   20.974865] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   20.981986] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[   20.989221] ubi0: good PEBs: 2560, bad PEBs: 0, corrupted PEBs: 0
[   20.995826] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[   21.006200] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 1714816355
[   21.037712] ubi0: available PEBs: 2474, total reserved PEBs: 86, PEBs reserved for bad PEB handling: 80
[   21.059782] ubi0: background thread "ubi_bgt0d" started, PID 239
run shell cmd: source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
run shell cmd: source /tmp/mtd.sh; mkdir -p /mnt/mtd
run shell cmd: source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
[   21.196856] UBIFS (ubi0:0): default file-system created
[   21.203175] UBIFS (ubi0:0): Mounting in unauthenticated mode
[   21.215200] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 245
[   21.256474] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "nandrootfs"
[   21.264812] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   21.275173] UBIFS (ubi0:0): FS size: 312487936 bytes (298 MiB, 2461 LEBs), max 2474 LEBs, journal size 15618048 bytes (14 MiB, 123 LEBs)
[   21.287884] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[   21.294816] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 43843945-1FC5-46FB-BC06-253DD50602BA, small LPT model
run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
WOpen:-
[   64.497800] cfg80211: failed to load regulatory.db
free(): invalid pointer
[  575.424621] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[  575.433966] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 ]---
nxpfrankli commented 2 months ago

It looks like out-of memory and kill init process. Can you try use ubiformat ? which have not decompress data and file sytem will not cache it. when you write data into ubifs by tar, all files will be in file system buffer. it was only commit to nand flash only when some condition happens, such as, timeout or kernel need some page, have to free page to other application.

swechencheng commented 2 months ago

Thank you @nxpfrankli Could you help me and elaborate more where can I change to ubiformat? I have already ubiformat in uuu script:

# burn rootfs
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
FBK: ucmd source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd
FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd
FBK: ucp skyline410/core-image-full-cmdline-skyline410.tar.gz t:-
swechencheng commented 1 month ago

On initramfs I completely turn off swap by CONFIG_SWAP=n, but no luck and still Fail Bulk(W): LIBUSB_ERROR_TIMEOUT (-7).

nxpfrankli commented 1 month ago

linux chipidea usb driver have issues. can you try https://github.com/nxp-imx/imx-uuc/commit/d4c6ce886c4c392bc2ab70efe5229d6ea805cf1e

swechencheng commented 1 month ago

@nxpfrankli Thanks for the suggestion. Unfortunately, I tried adding both uuc update and kernel patch:

Changed the page alignment check within the prepare_td_for_sg() function
since the first buffer could not be page size aligned, so the check is
only performed for the following buffers.

Signed-off-by: Han Xu <[han.xu@nxp.com](mailto:han.xu@nxp.com)>
---
 drivers/usb/chipidea/udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0b7bd3c643c3..13cbf2e2aeae 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -517,7 +517,8 @@ static int prepare_td_for_sg(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
    }

    while (i++ < req->num_mapped_sgs) {
-       if (sg_dma_address(s) % PAGE_SIZE) {
+       /* The first buffer could be not page size aligned. */
+       if ((sg_dma_address(s) % PAGE_SIZE) && (i > 1)) {
            dev_err(hwep->ci->dev, "not page aligned sg buffer\n");
            return -EINVAL;
        }

to initramfs, but still have the same problem.

swechencheng commented 1 month ago

Just FYI I did an experiment by changing the tar extraction to a temp fs first instead of directly writing to mtd partition:

adminrd@rpi-hms-nkg001:~/mfgtool/binaries/kirkstone $ cat nand.rootfs.skyline410.uuu
uuu_version 1.3.191

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f skyline410/u-boot-skyline410.imx-nand

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f skyline410/u-boot-skyline410.imx-nand -skipspl
SDPV: jump
# }

FB: ucmd printenv

FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f skyline410/zImage-skyline410.bin
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f skyline410/imx6ul-14x14-evk-gpmi-weim-skyline410.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f skyline410/skyline-mfgtool-initramfs-skyline410.cpio.zst.u-boot
FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
#FB: ucmd setenv bootargs console=ttymxc3,115200  ${mtdparts}
FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}

FBK: ucmd cat /proc/mtd
FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;

FBK: ucmd chmod 777 /tmp/mtd.sh
#FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug

# burn rootfs
#FBK: ucmd rm -rf /tmp/*
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z
FBK: ucp skyline410/test-benchmark-skyline410.tar.gz t:/tmp/rootfs
FBK: sync

FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
FBK: ucmd source /tmp/mtd.sh; ubiformat /dev/mtd${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd
FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z -C /mnt/mtd

FBK: ucmd source /tmp/mtd.sh; nandwrite -p /dev/mtd${nandrootfs} -p /tmp/rootfs
FBK: sync
FBK: ucmd umount /mnt/mtd

FBK: done

The uuu log:

adminrd@rpi-hms-nkg001:~/mfgtool/binaries/kirkstone $ sudo uuu -s nand.rootfs.skyline410.uuu
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.181-0-gd362f4a

Build in config:
    Pctl     Chip        Vid     Pid     BcdVersion  Serial_No
    ==================================================
    SDPS:    MX8QXP      0x1fc9  0x012f  [0x0002..0xffff]
    SDPS:    MX8QM       0x1fc9  0x0129  [0x0002..0xffff]
    SDPS:    MX8DXL      0x1fc9  0x0147
    SDPS:    MX28        0x15a2  0x004f
    SDPS:    MX815       0x1fc9  0x013e
    SDPS:    MX865       0x1fc9  0x0146
    SDPS:    MX8ULP      0x1fc9  0x014a
    SDPS:    MX8ULP      0x1fc9  0x014b
    SDPS:    MX93        0x1fc9  0x014e
    SDPS:    MX93        0x1fc9  0x0159
    SDPS:    MX95        0x1fc9  0x015d
    SDPS:    MX95        0x1fc9  0x015c
    SDP:     MX7D        0x15a2  0x0076
    SDP:     MX6Q        0x15a2  0x0054
    SDP:     MX6D        0x15a2  0x0061
    SDP:     MX6SL       0x15a2  0x0063
    SDP:     MX6SX       0x15a2  0x0071
    SDP:     MX6UL       0x15a2  0x007d
    SDP:     MX6ULL      0x15a2  0x0080
    SDP:     MX6SLL      0x1fc9  0x0128
    SDP:     MX7ULP      0x1fc9  0x0126
    SDP:     MXRT106X    0x1fc9  0x0135
    SDP:     MX8MM       0x1fc9  0x0134
    SDP:     MX8MQ       0x1fc9  0x012b
    SDPU:    SPL         0x0525  0xb4a4  [0x0000..0x04ff]
    SDPV:    SPL1        0x0525  0xb4a4  [0x0500..0x9998]
    SDPV:    SPL1        0x1fc9  0x0151  [0x0500..0x9998]
    SDPU:    SPL         0x0525  0xb4a4  [0x9999..0x9999]
    SDPU:    SPL         0x3016  0x1001  [0x0000..0x04ff]
    SDPV:    SPL1        0x3016  0x1001  [0x0500..0x9998]
    FBK:             0x066f  0x9afe
    FBK:             0x066f  0x9bff
    FBK:             0x1fc9  0x0153
    FB:          0x0525  0xa4a5
    FB:          0x18d1  0x0d02
    FB:          0x3016  0x0001
    FB:          0x1fc9  0x0152
    FB:          0x0483  0x0afb

New USB Device Attached at 1:13-
1:13->Start Cmd:SDP: boot -f skyline410/u-boot-skyline410.imx-nand
100%1:13->Okay (0.562s)
New USB Device Attached at 1:13-D9642301232F21D4
1:13-D9642301232F21D4>Start Cmd:FB: ucmd printenv
1:13-D9642301232F21D4>Okay (0.094s)
1:13-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${loadaddr}
1:13-D9642301232F21D4>Okay (0.001s)
1:13-D9642301232F21D4>Start Cmd:FB: download -f skyline410/zImage-skyline410.bin
1:13-D9642301232F21D4>Okay (0.25s)
1:13-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${fdt_addr}
1:13-D9642301232F21D4>Okay (0s)
1:13-D9642301232F21D4>Start Cmd:FB: download -f skyline410/imx6ul-14x14-evk-gpmi-weim-skyline410.dtb
1:13-D9642301232F21D4>Okay (0.008s)
1:13-D9642301232F21D4>Start Cmd:FB: ucmd setenv fastboot_buffer ${initrd_addr}
1:13-D9642301232F21D4>Okay (0s)
1:13-D9642301232F21D4>Start Cmd:FB: download -f skyline410/skyline-mfgtool-initramfs-skyline410.cpio.zst.u-boot
1:13-D9642301232F21D4>Okay (0.222s)
1:13-D9642301232F21D4>Start Cmd:FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
1:13-D9642301232F21D4>Okay (0s)
1:13-D9642301232F21D4>Start Cmd:FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}
1:13-D9642301232F21D4>Okay (0s)
New USB Device Attached at 1:13-0000000000000000
1:13-0000000000000000>Start Cmd:FBK: ucmd cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "nandboot"
mtd1: 01000000 00020000 "nandkernel"
mtd2: 00400000 00020000 "nanddtb"
mtd3: 0c000000 00020000 "nandrootfs"
mtd4: 12800000 00020000 "nanddata"
1:13-0000000000000000>Okay (0.038s)
1:13-0000000000000000>Start Cmd:FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
1:13-0000000000000000>Okay (0.039s)
1:13-0000000000000000>Start Cmd:FBK: ucmd chmod 777 /tmp/mtd.sh
1:13-0000000000000000>Okay (0.022s)
1:13-0000000000000000>Start Cmd:FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z
1:13-0000000000000000>Okay (0.051s)
1:13-0000000000000000>Start Cmd:FBK: ucp skyline410/test-benchmark-skyline410.tar.gz t:/tmp/rootfs
62%1:13-0000000000000000>Fail Bulk(W): LIBUSB_ERROR_TIMEOUT (-7)(9.514s)
Please input command:
U>

I got a better result that now is 62% instead of 21% on mtd writing.

The serial log:

U-Boot 2022.04+g181859317b+p0 (Nov 15 2022 - 06:28:05 +0000)

CPU:   i.MX6UL rev1.2 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 34C
Reset cause: POR
Model: Freescale i.MX6 UltraLite 14x14 EVK Board
Board: SML MX6UL 14x14 EVK
DRAM:  512 MiB
Core:  60 devices, 17 uclasses, devicetree: separate
NAND:  512 MiB
MMC:   FSL_SDHC: 0
Loading Environment from NAND... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated
Net:   SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
SoC fuse indicates Ethernet@0x20b4000 is unavailable.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for                mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot:  0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
baudrate=115200
bootargs=console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused
bootcmd=echo SML Booting from NAND ...; nand read ${loadaddr} 0x400000 0x1000000;nand read ${fdt_addr} 0x1400000 0x400000;if test ${tee} = yes; then nand read ${tee_addr} 0x6000000 0x400000;bootm ${tee_addr} - ${fdt_addr};else bootz ${loadaddr} - ${fdt_addr};fi
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootdelay=3
console=ttymxc0
emmc_ack=1
emmc_dev=1
ethprime=eth1
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mtdparts=mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),192m(nandrootfs),-(nanddata)
sd_dev=1
splashimage=0x8c000000
tee=no
tee_addr=0x84000000

Environment size: 1014/131068 bytes
Starting download of 7281608 bytes
.......................................................
downloading of 7281608 bytes finished
Starting download of 36161 bytes

downloading of 36161 bytes finished
Starting download of 6447477 bytes
.................................................
downloading of 6447477 bytes finished
Kernel image @ 0x80800000 [ 0x000000 - 0x6f1bc8 ]
## Loading init Ramdisk from Legacy Image at 86800000 ...
   Image Name:   skyline-mfgtool-initramfs-skylin
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    6447413 Bytes = 6.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300bd40
Modify /soc/bus@2000000/tsc@2040000 disabled
Modify /soc/bus@2000000/can@2094000 disabled
Modify /soc/bus@2100000/lcdif@21c8000 disabled
Modify /soc/bus@2100000/csi@21c4000 disabled
Modify /soc/bus@2000000/ethernet@20b4000 disabled
gpio@209c000: set_value: error: gpio GPIO1_8 not reserved
gpio@20ac000: set_value: error: gpio GPIO5_9 not reserved

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 (oe-user@oe-host) (arm-sml-linux-gnueabi-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Tue Nov 15 10:35:06 UTC 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x96000000, size 160 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff]
[    0.000000] percpu: Embedded 12 pages/cpu s16844 r8192 d24116 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mtdparts=gpmi-nand:4m(nandboot),16m(nandkernel),4m(nanddtb),192m(nandrootfs),-(nanddata)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 332680K/524288K available (10240K kernel code, 1207K rwdata, 2816K rodata, 1024K init, 382K bss, 27768K reserved, 163840K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000004] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000058] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.002671] Console: colour dummy device 80x30
[    0.002784] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.002839] pid_max: default: 32768 minimum: 301
[    0.003327] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003387] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.005238] CPU: Testing write buffer coherency: ok
[    0.005907] CPU0: update cpu_capacity 1024
[    0.005959] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.008481] Setting up static identity map for 0x80100000 - 0x80100060
[    0.008885] rcu: Hierarchical SRCU implementation.
[    0.010032] smp: Bringing up secondary CPUs ...
[    0.010077] smp: Brought up 1 node, 1 CPU
[    0.010108] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.010223] CPU: All CPU(s) started in SVC mode.
[    0.011275] devtmpfs: initialized
[    0.027323] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.027913] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.027990] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.040373] pinctrl core: initialized pinctrl subsystem
[    0.044082] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.061913] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.064504] thermal_sys: Registered thermal governor 'step_wise'
[    0.064910] cpuidle: using governor menu
[    0.065220] CPU identified as i.MX6UL, silicon rev 1.2
[    0.090165] vdd3p0: supplied by regulator-dummy
[    0.091305] cpu: supplied by regulator-dummy
[    0.092770] vddsoc: supplied by regulator-dummy
[    0.122684] No ATAGs?
[    0.122840] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.122883] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.125051] imx6ul-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver
[    0.127385] imx mu driver is registered.
[    0.128290] imx rpmsg driver is registered.
[    0.148671] Kprobes globally optimized
[    0.185950] usbcore: registered new interface driver usbfs
[    0.186109] usbcore: registered new interface driver hub
[    0.186236] usbcore: registered new device driver usb
[    0.186845] mc: Linux media interface: v0.10
[    0.187060] pps_core: LinuxPPS API ver. 1 registered
[    0.187089] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.187153] PTP clock support registered
[    0.190862] clocksource: Switched to clocksource mxc_timer1
[    0.191338] VFS: Disk quotas dquot_6.6.0
[    0.191532] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212410] NET: Registered PF_INET protocol family
[    0.212926] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.215076] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.215190] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.215239] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.215354] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.215524] TCP: Hash tables configured (established 4096 bind 4096)
[    0.215722] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.215807] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.216218] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.217872] RPC: Registered named UNIX socket transport module.
[    0.217935] RPC: Registered udp transport module.
[    0.217957] RPC: Registered tcp transport module.
[    0.217977] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.221266] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.223758] Trying to unpack rootfs image as initramfs...
[    0.234652] Bus freq driver module loaded
[    0.236864] Initialise system trusted keyrings
[    0.241255] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.272360] NFS: Registering the id_resolver key type
[    0.272546] Key type id_resolver registered
[    0.272578] Key type id_legacy registered
[    0.272837] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.272879] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.272976] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.274219] fuse: init (API version 7.34)
[    0.282154] async_tx: api initialized (async)
[    0.282218] Key type asymmetric registered
[    0.282246] Asymmetric key parser 'x509' registered
[    0.282404] io scheduler mq-deadline registered
[    0.282438] io scheduler kyber registered
[    0.310678] mxs-dma 1804000.dma-apbh: initialized
[    0.326547] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 29, base_baud = 5000000) is a IMX
[    1.701086] printk: console [ttymxc0] enabled
[    1.712822] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 67, base_baud = 5000000) is a IMX
[    1.742266] imx sema4 driver is registered.
[    1.802281] brd: module loaded
[    1.834370] loop: module loaded
[    1.852875] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
[    1.859292] nand: AMD/Spansion S34ML04G2
[    1.881168] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    1.892335] Bad block table found at page 262080, version 0x01
[    1.911840] Bad block table found at page 262016, version 0x01
[    1.921288] 5 cmdlinepart partitions found on MTD device gpmi-nand
[    1.927539] Creating 5 MTD partitions on "gpmi-nand":
[    1.951082] 0x000000000000-0x000000400000 : "nandboot"
[    1.962809] 0x000000400000-0x000001400000 : "nandkernel"
[    1.984215] 0x000001400000-0x000001800000 : "nanddtb"
[    2.003551] 0x000001800000-0x00000d800000 : "nandrootfs"
[    2.024129] 0x00000d800000-0x000020000000 : "nanddata"
[    2.045612] gpmi-nand 1806000.nand-controller: driver registered.
[    2.066581] gpio-505 (eth0-phy): hogged as output/high
[    2.081266] gpio-506 (eth1-phy): hogged as output/high
[    2.089176] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.111053] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.134289] tun: Universal TUN/TAP device driver, 1.6
[    2.154206] pps pps0: new PPS source ptp0
[    2.162034] fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    2.168872] fec 2188000.ethernet: Using random MAC address: 86:ce:56:b1:18:ec
[    2.719559] Freeing initrd memory: 6300K
[    2.731373] imx-sdma 20ec000.sdma: firmware found.
[    2.736918] imx-sdma 20ec000.sdma: loaded firmware 3.5
[    3.092201] fec 2188000.ethernet eth0: registered PHC device 0
[    3.099052] usbcore: registered new interface driver r8152
[    3.104929] usbcore: registered new interface driver lan78xx
[    3.110735] usbcore: registered new interface driver asix
[    3.116457] usbcore: registered new interface driver ax88179_178a
[    3.122996] usbcore: registered new interface driver cdc_ether
[    3.128975] usbcore: registered new interface driver smsc95xx
[    3.135081] usbcore: registered new interface driver net1080
[    3.141003] usbcore: registered new interface driver cdc_subset
[    3.147041] usbcore: registered new interface driver zaurus
[    3.152801] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    3.160426] usbcore: registered new interface driver cdc_ncm
[    3.166267] usbcore: registered new interface driver r8153_ecm
[    3.172174] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.186984] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[    3.193280] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)
[    3.209627] sdhci: Secure Digital Host Controller Interface driver
[    3.216100] sdhci: Copyright(c) Pierre Ossman
[    3.220492] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.229596] sdhci-esdhc-imx 2190000.mmc: Got CD GPIO
[    3.238206] caam-dma caam-dma: Defer probing after JR driver probing
[    3.247616] caam 2140000.crypto: device ID = 0x0a16030000000000 (Era 8)
[    3.254453] caam 2140000.crypto: job rings = 3, qi = 0
[    3.284968] mmc0: SDHCI controller on 2190000.mmc [2190000.mmc] using ADMA
[    3.300341] caam algorithms registered in /proc/crypto
[    3.311608] caam 2140000.crypto: caam pkc algorithms registered in /proc/crypto
[    3.319513] caam 2140000.crypto: rng crypto API alg registered prng-caam
[    3.326679] caam 2140000.crypto: registering rng-caam
[    3.334195] Device caam-keygen registered
[    3.347851] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[    3.358036] usbcore: registered new interface driver usbhid
[    3.363833] usbhid: USB HID core driver
[    3.369681] random: crng init done
[    3.378872] NET: Registered PF_LLC protocol family
[    3.385255] NET: Registered PF_INET6 protocol family
[    3.393001] Segment Routing with IPv6
[    3.396777] In-situ OAM (IOAM) with IPv6
[    3.401170] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.408730] NET: Registered PF_PACKET protocol family
[    3.414404] lib80211: common routines for IEEE802.11 drivers
[    3.420518] Key type dns_resolver registered
[    3.454667] Registering SWP/SWPB emulation handler
[    3.459957] Loading compiled-in X.509 certificates
[    3.505682] imx_usb 2184000.usb: No over current polarity defined
[    3.522622] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    3.527606] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    3.561144] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    3.567743] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.576230] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.584074] usb usb1: Product: EHCI Host Controller
[    3.589410] usb usb1: Manufacturer: Linux 5.15.71-5.15.71-2.2.0-5.15.71-2.2.0+g3313732e9984+p0 ehci_hcd
[    3.598870] usb usb1: SerialNumber: ci_hdrc.1
[    3.604610] hub 1-0:1.0: USB hub found
[    3.608491] hub 1-0:1.0: 1 port detected
[    3.615855] imx_thermal 20c8000.anatop:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[    3.628342] caam-dma caam-dma: caam dma support with 3 job rings
[    3.635814] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.663467] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.670323] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    3.679357] clk: Not disabling unused clocks
[    3.686650] Freeing unused kernel image (initmem) memory: 1024K
[    3.692733] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    3.722164] Run /linuxrc as init process
Found New UDC: ci_hdrc.0
ci_hdrc.0 0
ffs.utp0
[    3.905992] file system registered
run utp at /dev/usb-utp0/ep0
.
uuu fastboot client 1.0.0 [built [    3.969001] read descriptors
May  9 2024 18:50:12]
Start init[    3.975842] read strings
 usb
write string
Start handle command
run shell cmd: cat /proc/mtd
run shell cmd: cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;
run shell cmd: chmod 777 /tmp/mtd.sh
run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar x -z
WOpen:/tmp/rootfs
swechencheng commented 4 days ago

Hi again, I found a way to avoid LIBUSB_ERROR_TIMEOUT (-7). However, the performance is very poor and it makes it unusable in production.

What I did is to add cma=96M mem=256M to ucmd command for u-boot in the uuu script:

FB: ucmd setenv bootargs ${bootargs} ${mtdparts} cma=96M mem=256M 

And I use the latest imx-uuc d4c6ce886c4c392bc2ab70efe5229d6ea805cf1e.

For a 23MB rootfs tar ball, it took 45 minutes:

2:412>Start Cmd:FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar -zx -C /mnt/mtd
2:412>Okay (0.155s)
2:412>Start Cmd:FBK: ucp _rootfs t:-
100%2:412>Okay (1938s)
2:412>Start Cmd:FBK: sync
2:412>Okay (110.4s)
2:412>Start Cmd:FBK: ucmd umount /mnt/mtd
2:412>Okay (611.1s)
2:412>Start Cmd:FBK: done
2:412>Okay (0.001s)

If I repeat the process, it becomes over 1h.