This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP-L138: Start with NAND flash, encounter "ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read 64 bytes"

Part Number: OMAP-L138
Other Parts Discussed in Thread: AM1808, DA8XX

Hi,

I am using the newest processor SDK(ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106-Linux-x86-Install.bin) in one custom EVM board, so the u-boot version is 2019.01 and the Linux kernel version is 4.19.94. Basically, I followed the config "tisdk_omapl138-lcdk_defconfig" in the Linux kernel. When I started with the SD card, everything was fine. But If I created the UBI image and started from NAND flash, I always got the followings error and finally got the kernel panic: 

edma 1c00000.edma: memcpy is disabled
edma 1c00000.edma: TI EDMA DMA engine driver
davinci_mmc 1c40000.mmc: Got CD GPIO
davinci_mmc 1c40000.mmc: Using DMA, 4-bit mode
nand: device found, Manufacturer ID: 0xad, Chip ID: 0xdc
nand: Hynix H27U4G8F2EKA-BM
nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x00001ffe0000, version 0x01
Bad block table written to 0x00001ffc0000, version 0x01
5 fixed-partitions partitions found on MTD device 62000000.nand
Creating 5 MTD partitions on "62000000.nand":
0x000000000000-0x000000020000 : "env"
0x000000020000-0x000000120000 : "u-boot"
0x000000120000-0x000000140000 : "NAND.u-boot-spl-os"
0x000000140000-0x000000640000 : "NAND.kernel"
0x000000640000-0x000020000000 : "NAND.file-system"
davinci_nand 62000000.nand: controller rev. 2.5
ubi0: attaching mtd4
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.94-gbe5389fd85 #18
Hardware name: Generic DA850/OMAP-L138/AM18x
Backtrace:
[<c0014770>] (dump_backtrace) from [<c00149e8>] (show_stack+0x18/0x1c)
r7:00000000 r6:00000040 r5:ffffffb6 r4:cdc2c000
[<c00149d0>] (show_stack) from [<c0697970>] (dump_stack+0x20/0x28)
[<c0697950>] (dump_stack) from [<c0450918>] (ubi_io_read+0x188/0x308)
[<c0450790>] (ubi_io_read) from [<c0450cd0>] (ubi_io_read_ec_hdr+0x4c/0x24c)
r10:cdfe1520 r9:00000000 r8:00000040 r7:00000000 r6:cdc2c000 r5:cdfc8680
r4:cdfd3600
[<c0450c84>] (ubi_io_read_ec_hdr) from [<c045659c>] (ubi_attach+0x180/0x1634)
r10:cdfe1520 r9:00000000 r8:00000000 r7:00000000 r6:cdc2c000 r5:cdfc8680
r4:cdfd3600
[<c045641c>] (ubi_attach) from [<c044a1a4>] (ubi_attach_mtd_dev+0x484/0xbe0)
r10:66666fe2 r9:cd404000 r8:cdc2c040 r7:00000000 r6:cd404000 r5:cdc2c000
r4:0001f000
[<c0449d20>] (ubi_attach_mtd_dev) from [<c08e48dc>] (ubi_init+0x18c/0x250)
r10:c097180c r9:c0942d8c r8:c0971808 r7:c097180c r6:c097180c r5:cd404000
r4:00000000
[<c08e4750>] (ubi_init) from [<c000a500>] (do_one_initcall+0x74/0x1b8)
r10:00000000 r9:c08c726c r8:ffffe000 r7:00000000 r6:c08e4750 r5:c090b008
r4:c0953ae0
[<c000a48c>] (do_one_initcall) from [<c08c9ec8>] (kernel_init_freeable+0x120/0x1e0)
r8:c08f6834 r7:c0953ae0 r6:c0953ae0 r5:c08f6854 r4:c0905e34
[<c08c9da8>] (kernel_init_freeable) from [<c06ace24>] (kernel_init+0x10/0xf8)
r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c06ace14
r4:00000000
[<c06ace14>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)
Exception stack(0xcdc39fb0 to 0xcdc39ff8)
9fa0: 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
r5:c06ace14 r4:00000000
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read 64 bytes

The rootfs I used is "arago-base-tisdk-image-omapl138-lcdk", and the config file and commands on making UBI image are as below:

ubinize.cfg
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

mkfs.ubifs -r rootfs/ -F -m 2048 -e 126976 -c 4040 -o ubifs.img
ubinize -o ubi.img -O 2048 -m 2048 -p 128KiB -s 512 ubinize.cfg

 

The NAND information from the kernel log:
nand: device found, Manufacturer ID: 0xad, Chip ID: 0xdc
nand: Hynix H27U4G8F2EKA-BM
nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x00001ffe0000, version 0x01
Bad block table written to 0x00001ffc0000, version 0x01
5 fixed-partitions partitions found on MTD device 62000000.nand
Creating 5 MTD partitions on "62000000.nand":
0x000000000000-0x000000020000 : "env"
0x000000020000-0x000000120000 : "u-boot"
0x000000120000-0x000000140000 : "NAND.u-boot-spl-os"
0x000000140000-0x000000640000 : "NAND.kernel"
0x000000640000-0x000020000000 : "NAND.file-system"
davinci_nand 62000000.nand: controller rev. 2.5

The MTD partition from the Linux console:
root@omapl138-lcdk:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00020000 "env"
mtd1: 00100000 00020000 "u-boot"
mtd2: 00020000 00020000 "NAND.u-boot-spl-os"
mtd3: 00500000 00020000 "NAND.kernel"
mtd4: 1f9c0000 00020000 "NAND.file-system"
root@omapl138-lcdk:~# mtd_debug info /dev/mtd4
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 530317312 (505M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 128
regions = 0

Apart from that, if I executed "flash_erase, ubiattach, ubimkvol" as below, I can start from NAND successfully, which is so strange for me:
flash_erase /dev/mtd4 0 0
ubiattach /dev/ubi_ctrl -m 4 -O 2048
ubimkvol /dev/ubi0 -N rootfs -S 450MiB
mount -t ubifs /dev/ubi0_0 /mnt/ubifs
##copy the root file system"arago-base-tisdk-image-omapl138-lcdk" in the "home/filesystem" ahead
cp -a /home/filesystem/* /mnt/ubifs

 

  • Hi Songtao,
    Some useful reference on NAND/MTD/UBI in Linux SDK user guide:
    [1]. software-dl.ti.com/.../Foundational_Components_U-Boot.html
    [2]. software-dl.ti.com/.../NAND.html
    where
    [1] booting kernel/rootfs from NAND
    [2] how to generate UBIFS/UBI rootfs for NAND

    There're also useful reference on MTD/UBI/UBIFS:
    www.linux-mtd.infradead.org/.../ubi.html
    www.linux-mtd.infradead.org/.../ubifs.html

    Best,
    -Hong

  • Hi Hong,

    Thanks for your info on this.  Yes, the documents you mentioned were very useful to build UBI file system, and I have read them many times. But it seems the problem I got is related with sub page or ECC. 

    Just I have mentioned, I can make the NAND flash work fine with Linux NAND utilises. Apart from that, supposing my UBI file is "ubi.img", at first I run "ubiformat -s 2048 -f ubi.img" in Linux command line when I start up my board from SD card. And then I restart the board from NAND flash, all works fine.

    Could you please help me look into why I encountered the errors if I write the same UBI image from u-boot?

    Thanks in advance,
    Songtao

  • Hi Songtao,
    I'm attaching two logs for your reference. I tested on AM335x GP EVM as I currently don't have OMAP-L138 board.
    - am3_nand_linux_flash.txt: the sample log for NAND flashing from SD booting.
    - am3_nand_linux_boot.txt: a sample log for NAND booting after flashing.
    Best,
    -Hong

    => mmc part
    
    Partition Map for MMC device 0  --   Partition Type: DOS
    
    Part	Start Sector	Num Sectors	UUID		Type
      1	2048      	143360    	64f02263-01	0c Boot
      2	145408    	31244288  	64f02263-02	83
    => ls mmc 0:1
       802120   u-boot.img
       110460   MLO
        65952   MLO.byteswap
       375744   u-boot_spi.img
                k2g/
       110460   MLO_ok
                am3_gp_uart/
                System Volume Information/
       802120   u-boot_ok.img
    
    6 file(s), 3 dir(s)
    
    => ls mmc 0:2
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>       4096 lib
    <DIR>       4096 media
    <DIR>       4096 home
    <DIR>       4096 proc
    <DIR>       4096 dev
    <SYM>         19 linuxrc
    <DIR>       4096 tmp
    <DIR>       4096 www
    <DIR>       4096 boot
    <DIR>       4096 include
    <DIR>       4096 var
    <DIR>       4096 sys
    <DIR>       4096 sbin
    <DIR>       4096 mnt
    <DIR>       4096 bin
    <DIR>       4096 usr
    <DIR>       4096 srv
    <DIR>       4096 etc
    <DIR>       4096 run
    <DIR>       4096 opt
    => ls mmc 0:2 boot
    <DIR>       4096 .
    <DIR>       4096 ..
               37965 am335x-boneblack-prusuart.dtb
               37192 am335x-boneblack-pru-adc.dtb
               37566 am335x-icev2-prueth-pps.dtb
               41524 am335x-evm.dtb
               35001 am335x-bone.dtb
               35225 am335x-bonegreen.dtb
               37124 am335x-icev2.dtb
               34055 am335x-pocketbeagle.dtb
               36717 am335x-boneblack.dtb
            15894420 vmlinux-4.19.94-gbe5389fd85
               39511 am335x-icev2-pru-excl-uio.dtb
               40236 am335x-evmsk.dtb
               36352 am335x-boneblue.dtb
               37305 am335x-sancloud-bbe.dtb
               37166 am335x-icev2-prueth.dtb
               37092 am335x-boneblack-iot-cape.dtb
    <SYM>         26 zImage
               37934 am335x-boneblack-wireless.dtb
               36542 am335x-bonegreen-wireless.dtb
             4280832 zImage-4.19.94-gbe5389fd85
               35001 am335x-bone-am335x-evm.dtb
               36717 am335x-boneblack-am335x-evm.dtb
               37092 am335x-boneblack-iot-cape-am335x-evm.dtb
               37192 am335x-boneblack-pru-adc-am335x-evm.dtb
               37965 am335x-boneblack-prusuart-am335x-evm.dtb
               37934 am335x-boneblack-wireless-am335x-evm.dtb
               36352 am335x-boneblue-am335x-evm.dtb
               35225 am335x-bonegreen-am335x-evm.dtb
               36542 am335x-bonegreen-wireless-am335x-evm.dtb
               41524 am335x-evm-am335x-evm.dtb
               40236 am335x-evmsk-am335x-evm.dtb
               37124 am335x-icev2-am335x-evm.dtb
               39511 am335x-icev2-pru-excl-uio-am335x-evm.dtb
               37166 am335x-icev2-prueth-am335x-evm.dtb
               37566 am335x-icev2-prueth-pps-am335x-evm.dtb
               34055 am335x-pocketbeagle-am335x-evm.dtb
               37305 am335x-sancloud-bbe-am335x-evm.dtb
             4280832 zImage-4.19.94-gbe5389fd85_bkup
               41524 am335x-evm_bkup.dtb
               41524 am335x-evm-300MHz-t1.dtb
    => ls mmc 0:2 media
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>       4096 ram
           134086656 arago-base-tisdk-image-am335x-evm.ubi
            10878976 arago-tiny-image-am335x-evm.ubi
    => mtdparts
    
    device nand0 <nand.0>, # parts = 10
     #: name		size		offset		mask_flags
     0: NAND.SPL            0x00020000	0x00000000	0
     1: NAND.SPL.backup1    0x00020000	0x00020000	0
     2: NAND.SPL.backup2    0x00020000	0x00040000	0
     3: NAND.SPL.backup3    0x00020000	0x00060000	0
     4: NAND.u-boot-spl-os  0x00040000	0x00080000	0
     5: NAND.u-boot         0x00100000	0x000c0000	0
     6: NAND.u-boot-env     0x00020000	0x001c0000	0
     7: NAND.u-boot-env.backup10x00020000	0x001e0000	0
     8: NAND.kernel         0x00800000	0x00200000	0
     9: NAND.file-system    0x0f600000	0x00a00000	0
    
    active partition: nand0,0 - (NAND.SPL) 0x00020000 @ 0x00000000
    
    defaults:
    mtdids  : nand0=nand.0
    mtdparts: mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
    => nand erase.chip
    
    NAND erase.chip: device 0 whole chip
    Erasing at 0x0 --   0% complete.Erasing at 0x280000 --   1% complete.Erasing at 0x500000 --   2% complete.Erasing at 0x7a0000 --   3% complete.Erasing at 0xa20000 --   4% complete.Skipping bad block at  0x00c80000                                          
    Skipping bad block at  0x00ca0000                                          
    Erasing at 0xcc0000 --   5% complete.Erasing at 0xf40000 --   6% complete.Erasing at 0x11e0000 --   7% complete.Erasing at 0x1460000 --   8% complete.Erasing at 0x1700000 --   9% complete.Erasing at 0x1980000 --  10% complete.Erasing at 0x1c20000 --  11% complete.Erasing at 0x1ea0000 --  12% complete.Erasing at 0x2140000 --  13% complete.Erasing at 0x23c0000 --  14% complete.Erasing at 0x2660000 --  15% complete.Erasing at 0x28e0000 --  16% complete.Erasing at 0x2b80000 --  17% complete.Erasing at 0x2e00000 --  18% complete.Erasing at 0x30a0000 --  19% complete.Erasing at 0x3320000 --  20% complete.Erasing at 0x35c0000 --  21% complete.Erasing at 0x3840000 --  22% complete.Erasing at 0x3ae0000 --  23% complete.Erasing at 0x3d60000 --  24% complete.Erasing at 0x3fe0000 --  25% complete.Erasing at 0x4280000 --  26% complete.Erasing at 0x4500000 --  27% complete.Erasing at 0x47a0000 --  28% complete.Erasing at 0x4a20000 --  29% complete.Erasing at 0x4cc0000 --  30% complete.Erasing at 0x4f40000 --  31% complete.Erasing at 0x51e0000 --  32% complete.Erasing at 0x5460000 --  33% complete.Erasing at 0x5700000 --  34% complete.Erasing at 0x5980000 --  35% complete.Erasing at 0x5c20000 --  36% complete.Erasing at 0x5ea0000 --  37% complete.Erasing at 0x6140000 --  38% complete.Erasing at 0x63c0000 --  39% complete.Erasing at 0x6660000 --  40% complete.Erasing at 0x68e0000 --  41% complete.Erasing at 0x6b80000 --  42% complete.Erasing at 0x6e00000 --  43% complete.Erasing at 0x70a0000 --  44% complete.Erasing at 0x7320000 --  45% complete.Erasing at 0x75c0000 --  46% complete.Erasing at 0x7840000 --  47% complete.Erasing at 0x7ae0000 --  48% complete.Erasing at 0x7d60000 --  49% complete.Erasing at 0x7fe0000 --  50% complete.Erasing at 0x8280000 --  51% complete.Erasing at 0x8500000 --  52% complete.Erasing at 0x87a0000 --  53% complete.Erasing at 0x8a20000 --  54% complete.Erasing at 0x8cc0000 --  55% complete.Erasing at 0x8f40000 --  56% complete.Erasing at 0x91e0000 --  57% complete.Erasing at 0x9460000 --  58% complete.Erasing at 0x9700000 --  59% complete.Erasing at 0x9980000 --  60% complete.Erasing at 0x9c20000 --  61% complete.Erasing at 0x9ea0000 --  62% complete.Erasing at 0xa140000 --  63% complete.Erasing at 0xa3c0000 --  64% complete.Erasing at 0xa660000 --  65% complete.Erasing at 0xa8e0000 --  66% complete.Erasing at 0xab80000 --  67% complete.Erasing at 0xae00000 --  68% complete.Erasing at 0xb0a0000 --  69% complete.Erasing at 0xb320000 --  70% complete.Erasing at 0xb5c0000 --  71% complete.Erasing at 0xb840000 --  72% complete.Erasing at 0xbae0000 --  73% complete.Erasing at 0xbd60000 --  74% complete.Erasing at 0xbfe0000 --  75% complete.Erasing at 0xc280000 --  76% complete.Erasing at 0xc500000 --  77% complete.Erasing at 0xc7a0000 --  78% complete.Erasing at 0xca20000 --  79% complete.Erasing at 0xccc0000 --  80% complete.Erasing at 0xcf40000 --  81% complete.Erasing at 0xd1e0000 --  82% complete.Erasing at 0xd460000 --  83% complete.Erasing at 0xd700000 --  84% complete.Erasing at 0xd980000 --  85% complete.Erasing at 0xdc20000 --  86% complete.Erasing at 0xdea0000 --  87% complete.Erasing at 0xe140000 --  88% complete.Erasing at 0xe3c0000 --  89% complete.Erasing at 0xe660000 --  90% complete.Erasing at 0xe8e0000 --  91% complete.Erasing at 0xeb80000 --  92% complete.Erasing at 0xee00000 --  93% complete.Erasing at 0xf0a0000 --  94% complete.Erasing at 0xf320000 --  95% complete.Erasing at 0xf5c0000 --  96% complete.Erasing at 0xf840000 --  97% complete.Erasing at 0xfae0000 --  98% complete.Erasing at 0xfd60000 --  99% complete.Erasing at 0xffe0000 -- 100% complete.
    OK
    => load mmc 0:1 ${loadaddr} MLO
    110460 bytes read in 10 ms (10.5 MiB/s)
    => nand write ${loadaddr} NAND.SPL ${filesize}
    
    NAND write: device 0 offset 0x0, size 0x1af7c
     110460 bytes written: OK
    => load mmc 0:1 ${loadaddr} u-boot.img
    802120 bytes read in 55 ms (13.9 MiB/s)
    => nand write ${loadaddr} NAND.u-boot ${filesize}
    
    NAND write: device 0 offset 0xc0000, size 0xc3d48
     802120 bytes written: OK
    => load mmc 0:2 ${loadaddr} boot/am335x-evm.dtb
    41524 bytes read in 6 ms (6.6 MiB/s)
    => nand write ${loadaddr} NAND.u-boot-spl-os ${filesize}
    
    NAND write: device 0 offset 0x80000, size 0xa234
     41524 bytes written: OK
    => load mmc 0:2 ${loadaddr} boot/zImage
    4280832 bytes read in 279 ms (14.6 MiB/s)
    => nand write ${loadaddr} NAND.kernel ${filesize}
    
    NAND write: device 0 offset 0x200000, size 0x415200
     4280832 bytes written: OK
    => load mmc 0:2 ${loadaddr} media/arago-tiny-image-am335x-evm.ubi
    10878976 bytes read in 704 ms (14.7 MiB/s)
    => nand write ${loadaddr} NAND.file-system ${filesize}
    
    NAND write: device 0 offset 0xa00000, size 0xa60000
    Skip bad block 0x00c80000
    Skip bad block 0x00ca0000
     10878976 bytes written: OK
    => 

    => printenv
    arch=arm
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    baudrate=115200
    board=am335x
    board_name=A33515BB
    board_rev=1.6A
    board_serial=05154P160003
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_syslinux_conf=extlinux/extlinux.conf
    boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp 
    bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd
    bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
    bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
    bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
    bootcmd_mmc0=setenv devnum 0; run mmc_boot
    bootcmd_mmc1=setenv devnum 1; run mmc_boot
    bootcmd_nand=run nandboot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcount=1
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootfile=zImage
    bootm_size=0x10000000
    bootpart=0:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    eth1addr=d0:ff:50:56:e6:b3
    ethaddr=d0:ff:50:56:e6:b1
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=bdf387f8
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A335PBGL; then setenv fdtfile am335x-pocketbeagle.dtb; fi; if test $board_name = BBBW; then setenv fdtfile am335x-boneblack-wireless.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = BBGW; then setenv fdtfile am335x-bonegreen-wireless.dtb; fi; if test $board_name = BBBL; then setenv fdtfile am335x-boneblue.dtb; fi; if test $board_name = BBEN; then setenv fdtfile am335x-sancloud-bbe.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE && test $ice_mii = rmii; then setenv fdtfile am335x-icev2.dtb; fi; if test $board_name = A335_ICE && test $ice_mii = mii; then setenv fdtfile am335x-icev2-prueth.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi; 
    finduuid=part uuid mmc ${bootpart} uuid
    fit_bootfile=fitImage
    fit_loadaddr=0x90000000
    get_overlaystring=for overlay in $overlay_files;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
    ice_mii=mii
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyO0,115200n8;fi;
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadfit=run args_mmc; run run_fit;
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
    netloadfdt=tftp ${fdtaddr} ${fdtfile}
    netloadimage=tftp ${loadaddr} ${bootfile}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramdisk_addr_r=0x88080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x88080000
    rootpath=/export/rootfs
    run_fit=bootm ${fit_loadaddr}#${fdtfile}${overlaystring}
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
    scriptaddr=0x80000000
    serial#=05154P160003
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial@44e09000
    stdin=serial@44e09000
    stdout=serial@44e09000
    update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
    usbnet_devaddr=de:ad:be:ef:00:01
    vendor=ti
    ver=U-Boot 2019.01-g175b3522cc-dirty (Apr 22 2021 - 14:19:38 -0500)
    
    Environment size: 10105/131068 bytes
    => run nandboot
    Booting from nand ...
    
    NAND read: device 0 offset 0x80000, size 0x40000
     262144 bytes read: OK
    
    NAND read: device 0 offset 0x200000, size 0x800000
     8388608 bytes read: OK
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff2000, end 8ffff233 ... OK
    
    Starting kernel ...
    
    Switching to zImage entry = 0x82000000
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.19.94-gbe5389fd85 (sitara@sitara-Latitude-E6410) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: TI AM335x EVM
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] cma: Reserved 48 MiB at 0xbd000000
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (sgx neon)
    [    0.000000] random: get_random_bytes called from start_kernel+0xa4/0x434 with crng_init=0
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260416
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 975328K/1048576K available (9216K kernel code, 307K rwdata, 2720K rodata, 1024K init, 252K bss, 24096K reserved, 49152K cma-reserved, 212992K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (10208 kB)
    [    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
    [    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 308 kB)
    [    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 253 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] 	Tasks RCU enabled.
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.000040] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000052] OMAP clocksource: timer1 at 24000000 Hz
    [    0.000226] timer_probe: no matching timers found
    [    0.000415] Console: colour dummy device 80x30
    [    0.000443] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.000449] This ensures that you still see kernel messages. Please
    [    0.000455] update your kernel commandline.
    [    0.000510] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
    [    0.089140] pid_max: default: 32768 minimum: 301
    [    0.089349] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.089370] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.090192] CPU: Testing write buffer coherency: ok
    [    0.090260] CPU0: Spectre v2: using BPIALL workaround
    [    0.091157] Setting up static identity map for 0x80100000 - 0x80100060
    [    0.091313] rcu: Hierarchical SRCU implementation.
    [    0.091641] EFI services will not be available.
    [    0.092972] devtmpfs: initialized
    [    0.101302] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.101695] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.101720] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.105405] pinctrl core: initialized pinctrl subsystem
    [    0.106187] DMI not present or invalid.
    [    0.106642] NET: Registered protocol family 16
    [    0.108920] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.173237] cpuidle: using governor ladder
    [    0.173284] cpuidle: using governor menu
    [    0.178084] OMAP GPIO hardware version 0.1
    [    0.188735] No ATAGs?
    [    0.188749] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.202533] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.204119] v1_8d: supplied by vbat
    [    0.204415] v3_3d: supplied by vbat
    [    0.206887] SCSI subsystem initialized
    [    0.207402] media: Linux media interface: v0.10
    [    0.207445] videodev: Linux video capture interface: v2.00
    [    0.207539] pps_core: LinuxPPS API ver. 1 registered
    [    0.207548] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.207569] PTP clock support registered
    [    0.207603] EDAC MC: Ver: 3.0.0
    [    0.208768] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.209578] Advanced Linux Sound Architecture Driver Initialized.
    [    0.210840] clocksource: Switched to clocksource timer1
    [    0.218718] NET: Registered protocol family 2
    [    0.219814] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
    [    0.219848] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.219917] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.219985] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.220131] UDP hash table entries: 512 (order: 1, 8192 bytes)
    [    0.220157] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
    [    0.220320] NET: Registered protocol family 1
    [    0.221004] RPC: Registered named UNIX socket transport module.
    [    0.221022] RPC: Registered udp transport module.
    [    0.221028] RPC: Registered tcp transport module.
    [    0.221034] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.222046] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [    0.223345] Initialise system trusted keyrings
    [    0.223740] workingset: timestamp_bits=14 max_order=18 bucket_order=4
    [    0.228189] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.228974] NFS: Registering the id_resolver key type
    [    0.229021] Key type id_resolver registered
    [    0.229029] Key type id_legacy registered
    [    0.229072] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.231539] Key type asymmetric registered
    [    0.231561] Asymmetric key parser 'x509' registered
    [    0.231636] bounce: pool size: 64 pages
    [    0.231708] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    [    0.231720] io scheduler noop registered
    [    0.231727] io scheduler deadline registered
    [    0.231979] io scheduler cfq registered (default)
    [    0.231990] io scheduler mq-deadline registered
    [    0.231997] io scheduler kyber registered
    [    0.233861] pinctrl-single 44e10800.pinmux: 142 pins, size 568
    [    0.237629] pwm-backlight backlight: backlight supply power not found, using dummy regulator
    [    0.237744] pwm-backlight backlight: Linked as a consumer to regulator.0
    [    0.284274] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [    0.288106] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
    [    0.930399] console [ttyS0] enabled
    [    0.935116] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a 8250
    [    0.946034] omap_rng 48310000.rng: Random Number Generator ver. 20
    [    0.952479] random: fast init done
    [    0.956117] random: crng init done
    [    0.962167] OF: graph: no port node found in /ocp/lcdc@4830e000
    [    0.968362] OF: graph: no port node found in /ocp/lcdc@4830e000
    [    0.974953] OF: graph: no port node found in /ocp/lcdc@4830e000
    [    0.980961] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    0.987600] [drm] No driver support for vblank timestamp query.
    [    1.002055] Console: switching to colour frame buffer device 100x30
    [    1.012874] tilcdc 4830e000.lcdc: fb0: DRM emulated frame buffer device
    [    1.020116] [drm] Initialized tilcdc 1.0.0 20121205 for 4830e000.lcdc on minor 0
    [    1.039405] brd: module loaded
    [    1.049568] loop: module loaded
    [    1.055956] libphy: Fixed MDIO Bus: probed
    [    1.130929] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [    1.138637] libphy: 4a101000.mdio: probed
    [    1.143865] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Atheros 8031 ethernet
    [    1.154039] cpsw 4a100000.ethernet: Detected MACID = d0:ff:50:56:e6:b1
    [    1.160728] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [    1.167256] cpsw 4a100000.ethernet: ALE Table size 1024
    [    1.172614] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [    1.181381] i2c /dev entries driver
    [    1.186980] cpuidle: enable-method property 'ti,am3352' found operations
    [    1.194345] sdhci: Secure Digital Host Controller Interface driver
    [    1.200559] sdhci: Copyright(c) Pierre Ossman
    [    1.205918] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
    [    1.214724] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.220813] omap_hsmmc 47810000.mmc: Linked as a consumer to regulator.3
    [    1.336441] sdhci-pltfm: SDHCI platform and OF driver helper
    [    1.343132] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.355203] NET: Registered protocol family 10
    [    1.361298] Segment Routing with IPv6
    [    1.365129] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.372043] NET: Registered protocol family 17
    [    1.376910] Key type dns_resolver registered
    [    1.381546] omap_voltage_late_init: Voltage driver support not added
    [    1.388842] Loading compiled-in X.509 certificates
    [    1.403307] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [    1.408497] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [    1.416537] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    [    1.423076] nand: Micron MT29F2G08ABAEAWP
    [    1.427107] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    [    1.434817] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
    [    1.440288] 10 fixed-partitions partitions found on MTD device omap2-nand.0
    [    1.447308] Creating 10 MTD partitions on "omap2-nand.0":
    [    1.452751] 0x000000000000-0x000000020000 : "NAND.SPL"
    [    1.459025] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"
    [    1.465830] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"
    [    1.472580] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"
    [    1.479238] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"
    [    1.486241] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot"
    [    1.492932] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env"
    [    1.499533] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1"
    [    1.506911] 0x000000200000-0x000000a00000 : "NAND.kernel"
    [    1.516894] 0x000000a00000-0x000010000000 : "NAND.file-system"
    [    1.661067] tps65910 0-002d: No interrupt support, no core IRQ
    [    1.668843] vrtc: supplied by vbat
    [    1.675942] vio: supplied by vbat
    [    1.680634] vdd1: supplied by vbat
    [    1.685746] vdd2: supplied by vbat
    [    1.692186] vdig1: supplied by vbat
    [    1.696923] vdig2: supplied by vbat
    [    1.701673] vpll: supplied by vbat
    [    1.706327] vdac: supplied by vbat
    [    1.710969] vaux1: supplied by vbat
    [    1.715701] vaux2: supplied by vbat
    [    1.720417] vaux33: supplied by vbat
    [    1.725265] vmmc: supplied by vbat
    [    1.729921] vbb: supplied by vbat
    [    1.734390] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.742126] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [    1.748135] cpu cpu0: Linked as a consumer to regulator.9
    [    1.753710] cpu cpu0: Dropping the link to regulator.9
    [    1.759067] cpu cpu0: Linked as a consumer to regulator.9
    [    1.764752] core: _opp_supported_by_regulators: OPP minuV: 931000 maxuV: 969000, not supported by regulator
    [    1.774601] cpu cpu0: _opp_add: OPP not supported by regulators (300000000)
    [    1.782031] core: _opp_supported_by_regulators: OPP minuV: 1298500 maxuV: 1351500, not supported by regulator
    [    1.792026] cpu cpu0: _opp_add: OPP not supported by regulators (1000000000)
    [    1.799194] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1000000 KHz
    [    1.806668] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 1000000000 (-34)
    [    1.815760] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 800000 KHz
    [    1.825473] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
    [    1.834315] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.839572] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.18
    [    1.872006] ubi0: attaching mtd9
    [    2.529727] ubi0: scanning is finished
    [    2.574074] ubi0: volume 0 ("rootfs") re-sized from 81 to 1924 LEBs
    [    2.581366] ubi0: attached mtd9 (name "NAND.file-system", size 246 MiB)
    [    2.588052] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    2.595013] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
    [    2.601805] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    2.608798] ubi0: good PEBs: 1966, bad PEBs: 2, corrupted PEBs: 0
    [    2.614937] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    2.622216] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1759344572
    [    2.631423] ubi0: available PEBs: 0, total reserved PEBs: 1966, PEBs reserved for bad PEB handling: 38
    [    2.640791] ubi0: background thread "ubi_bgt0d" started, PID 56
    [    2.647896] input: volume_keys0 as /devices/platform/volume_keys0/input/input0
    [    2.657949] hctosys: unable to open rtc device (rtc0)
    [    2.666831] ALSA device list:
    [    2.669831]   No soundcards found.
    [    2.683872] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 57
    [    2.782518] UBIFS (ubi0:0): start fixing up free space
    [    4.456561] UBIFS (ubi0:0): free space fixup complete
    [    4.511636] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [    4.519091] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [    4.529889] UBIFS (ubi0:0): FS size: 242778112 bytes (231 MiB, 1912 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
    [    4.541465] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [    4.548044] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID AF09DAE9-2295-491F-89F1-DD785CFE4A34, small LPT model
    [    4.566504] VFS: Mounted root (ubifs filesystem) on device 0:15.
    [    4.580509] devtmpfs: mounted
    [    4.587791] Freeing unused kernel memory: 1024K
    [    4.594357] Run /sbin/init as init process
    INIT: version 2.88 booting
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Mon Apr 20 03:50:24 UTC 2020
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Configuring packages on first boot....
     (This may take several minutes. Please do not power off the machine.)
    update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
     Removing any system startup links for run-postinsts ...
      /etc/rcS.d/S99run-postinsts
    INIT: Entering runlevel: 5
    Configuring network interfaces... [    8.125652] net eth0: initializing cpsw version 1.12 (0)
    [    8.232385] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
    [    8.250205] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    udhcpc: started, v1.29.3
    udhcpc: sending discover
    udhcpc: sending discover
    udhcpc: sending discover
    udhcpc: no lease, forking to background
    ifconfig: SIOCGIFFLAGS: No such device
    ifconfig: SIOCSIFADDR: No such device
    done.
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Starting syslogd/klogd: done
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am335x-evm /dev/ttyS0
    
    Arago 2019.11 am335x-evm /dev/ttyS0
    
    am335x-evm login: root
    root@am335x-evm:~# 

  • Hi Hong,

    Sorry, it seems your attachments are NOT related to my problem. My problem is I got the errors as the title while I started up Linux kernel rather than u-boot itself. At the same time, as I mentioned, I can start up Linux kernel if I use the "ubiformat -s 2048 ....". 

    From my current understanding, the problem was probably caused by sub page or ECC mismatch between u-boot and Linux kernel. 

    Best Regards,
    Songtao

  • U-Boot SPL 2019.01-g7c824dc8c1-dirty (Nov 11 2021 - 08:55:09 +0800)
    Trying to boot from NAND


    U-Boot 2019.01-g7c824dc8c1-dirty (Nov 11 2021 - 08:55:09 +0800)

    Model: DA850/AM1808/OMAP-L138 LCDK
    DRAM: 256 MiB
    NAND: 512 MiB
    MMC: da830-mmc: 0
    Loading Environment from NAND... *** Warning - bad CRC, using default environment

    In: serial@10d000
    Out: serial@10d000
    Err: serial@10d000
    Invalid MAC address read.
    Net: DaVinci-EMAC
    Warning: DaVinci-EMAC (eth0) using random MAC address - 66:9e:36:78:36:d4

    Hit any key to stop autoboot: 0
    Booting from nand ...

    NAND read: device 0 offset 0x120000, size 0x20000
    131072 bytes read: OK

    NAND read: device 0 offset 0x140000, size 0x500000
    5242880 bytes read: OK
    ## Flattened Device Tree blob at c0600000
    Booting using the fdt blob at 0xc0600000
    Loading Device Tree to cfe19000, end cfe20f50 ... OK

    Starting kernel ...

    Booting Linux on physical CPU 0x0
    Linux version 4.19.94-gbe5389fd85 (soyu@songtao-ubuntu2004) (gcc version 8.2.0 (GCC)) #18 PREEMPT Tue Nov 9 14:04:15 CST 2021
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    OF: fdt: Machine model: DA850/AM1808/OMAP-L138 LCDK
    Memory policy: Data cache writethrough
    Reserved memory: created CMA memory pool at 0xc3000000, size 16 MiB
    OF: reserved mem: initialized node dsp-memory@c3000000, compatible id shared-dma-pool
    cma: Reserved 24 MiB at 0xce400000
    DaVinci da850/omap-l138/am18x variant 0x1
    random: get_random_bytes called from start_kernel+0x88/0x424 with crng_init=0
    Built 1 zonelists, mobility grouping on. Total pages: 64960
    Kernel command line: console=ttyS2,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 208784K/262144K available (6825K kernel code, 302K rwdata, 2132K rodata, 252K init, 152K bss, 12400K reserved, 40960K cma-reserved)
    Virtual kernel memory layout:
    vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
    lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
    modules : 0xbf000000 - 0xc0000000 ( 16 MB)
    .text : 0x(ptrval) - 0x(ptrval) (6827 kB)
    .init : 0x(ptrval) - 0x(ptrval) ( 252 kB)
    .data : 0x(ptrval) - 0x(ptrval) ( 303 kB)
    .bss : 0x(ptrval) - 0x(ptrval) ( 153 kB)
    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    rcu: Preemptible hierarchical RCU implementation.
    Tasks RCU enabled.
    NR_IRQS: 245
    clocksource: timer0_1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    Console: colour dummy device 80x30
    Calibrating delay loop... 227.32 BogoMIPS (lpj=1136640)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    CPU: Testing write buffer coherency: ok
    Setting up static identity map for 0xc0008400 - 0xc0008458
    rcu: Hierarchical SRCU implementation.
    devtmpfs: initialized
    VFP support v0.3: not present
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    futex hash table entries: 256 (order: -1, 3072 bytes)
    pinctrl core: initialized pinctrl subsystem
    NET: Registered protocol family 16
    DMA: preallocated 256 KiB pool for atomic coherent allocations
    cpuidle: using governor ladder
    cpuidle: using governor menu
    mux: initialized RTC_ALARM
    mux: Setting register RTC_ALARM
    mux: PINMUX0 (0x00000000) = 0x44000000 -> 0x24000000
    gpiochip_add_data_with_key: GPIOs 0..143 (davinci_gpio.0) failed to register, -517
    edma 1e30000.edma: memcpy is disabled
    edma 1e30000.edma: TI EDMA DMA engine driver
    vcc_3v3d: supplied by vcc_5vd
    vcc_1v8d: supplied by vcc_5vd
    SCSI subsystem initialized
    media: Linux media interface: v0.10
    videodev: Linux video capture interface: v2.00
    pps_core: LinuxPPS API ver. 1 registered
    pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    PTP clock support registered
    Advanced Linux Sound Architecture Driver Initialized.
    clocksource: Switched to clocksource timer0_1
    NET: Registered protocol family 2
    tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
    TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered named UNIX socket transport module.
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    workingset: timestamp_bits=14 max_order=16 bucket_order=2
    Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    io scheduler noop registered (default)
    io scheduler mq-deadline registered
    io scheduler kyber registered
    pinctrl-single 1c14120.pinmux: 160 pins, size 80
    Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    console [ttyS2] disabled
    1d0d000.serial: ttyS2 at MMIO 0x1d0d000 (irq = 61, base_baud = 8250000) is a TI DA8xx/66AK2x
    console [ttyS2] enabled
    brd: module loaded
    libphy: Fixed MDIO Bus: probed
    davinci_mdio 1e24000.mdio: davinci mdio revision 1.5, bus freq 2200000
    davinci_mdio 1e24000.mdio: detected phy mask fffffffe
    libphy: 1e24000.mdio: probed
    davinci_mdio 1e24000.mdio: phy[0]: device 1e24000.mdio:00, driver SMSC LAN8710/LAN8720
    i2c /dev entries driver
    davinci-wdt 1c21000.wdt: heartbeat 60 sec
    sdhci: Secure Digital Host Controller Interface driver
    sdhci: Copyright(c) Pierre Ossman
    sdhci-pltfm: SDHCI platform and OF driver helper
    ti-aemif 68000000.aemif: cannot get clock 'aemif'
    NET: Registered protocol family 10
    Segment Routing with IPv6
    sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    NET: Registered protocol family 17
    edma 1c00000.edma: memcpy is disabled
    edma 1c00000.edma: TI EDMA DMA engine driver
    davinci_mmc 1c40000.mmc: Got CD GPIO
    davinci_mmc 1c40000.mmc: Using DMA, 4-bit mode
    nand: device found, Manufacturer ID: 0xad, Chip ID: 0xdc
    nand: Hynix H27U4G8F2EKA-BM
    nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    Bad block table written to 0x00001ffe0000, version 0x01
    Bad block table written to 0x00001ffc0000, version 0x01
    5 fixed-partitions partitions found on MTD device 62000000.nand
    Creating 5 MTD partitions on "62000000.nand":
    0x000000000000-0x000000020000 : "env"
    0x000000020000-0x000000120000 : "u-boot"
    0x000000120000-0x000000140000 : "NAND.u-boot-spl-os"
    0x000000140000-0x000000640000 : "NAND.kernel"
    0x000000640000-0x000020000000 : "NAND.file-system"
    davinci_nand 62000000.nand: controller rev. 2.5
    ubi0: attaching mtd4
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
    CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.94-gbe5389fd85 #18
    Hardware name: Generic DA850/OMAP-L138/AM18x
    Backtrace:
    [<c0014770>] (dump_backtrace) from [<c00149e8>] (show_stack+0x18/0x1c)
    r7:00000000 r6:00000040 r5:ffffffb6 r4:cdc2c000
    [<c00149d0>] (show_stack) from [<c0697970>] (dump_stack+0x20/0x28)
    [<c0697950>] (dump_stack) from [<c0450918>] (ubi_io_read+0x188/0x308)
    [<c0450790>] (ubi_io_read) from [<c0450cd0>] (ubi_io_read_ec_hdr+0x4c/0x24c)
    r10:cdfe1520 r9:00000000 r8:00000040 r7:00000000 r6:cdc2c000 r5:cdfc8680
    r4:cdfd3600
    [<c0450c84>] (ubi_io_read_ec_hdr) from [<c045659c>] (ubi_attach+0x180/0x1634)
    r10:cdfe1520 r9:00000000 r8:00000000 r7:00000000 r6:cdc2c000 r5:cdfc8680
    r4:cdfd3600
    [<c045641c>] (ubi_attach) from [<c044a1a4>] (ubi_attach_mtd_dev+0x484/0xbe0)
    r10:66666fe2 r9:cd404000 r8:cdc2c040 r7:00000000 r6:cd404000 r5:cdc2c000
    r4:0001f000
    [<c0449d20>] (ubi_attach_mtd_dev) from [<c08e48dc>] (ubi_init+0x18c/0x250)
    r10:c097180c r9:c0942d8c r8:c0971808 r7:c097180c r6:c097180c r5:cd404000
    r4:00000000
    [<c08e4750>] (ubi_init) from [<c000a500>] (do_one_initcall+0x74/0x1b8)
    r10:00000000 r9:c08c726c r8:ffffe000 r7:00000000 r6:c08e4750 r5:c090b008
    r4:c0953ae0
    [<c000a48c>] (do_one_initcall) from [<c08c9ec8>] (kernel_init_freeable+0x120/0x1e0)
    r8:c08f6834 r7:c0953ae0 r6:c0953ae0 r5:c08f6854 r4:c0905e34
    [<c08c9da8>] (kernel_init_freeable) from [<c06ace24>] (kernel_init+0x10/0xf8)
    r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c06ace14
    r4:00000000
    [<c06ace14>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)
    Exception stack(0xcdc39fb0 to 0xcdc39ff8)
    9fa0: 00000000 00000000 00000000 00000000
    9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
    r5:c06ace14 r4:00000000
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read only 64 bytes, retry
    ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:2048, read 64 bytes
    CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.94-gbe5389fd85 #18
    Hardware name: Generic DA850/OMAP-L138/AM18x
    Backtrace:
    [<c0014770>] (dump_backtrace) from [<c00149e8>] (show_stack+0x18/0x1c)
    r7:00000000 r6:00000040 r5:ffffffb6 r4:cdc2c000
    [<c00149d0>] (show_stack) from [<c0697970>] (dump_stack+0x20/0x28)
    [<c0697950>] (dump_stack) from [<c0450918>] (ubi_io_read+0x188/0x308)
    [<c0450790>] (ubi_io_read) from [<c0450f24>] (ubi_io_read_vid_hdr+0x54/0x250)
    r10:cdfe1520 r9:00000000 r8:00000000 r7:00000000 r6:cdc2c000 r5:cdfd3800
    r4:cdfd3800
    [<c0450ed0>] (ubi_io_read_vid_hdr) from [<c04566a4>] (ubi_attach+0x288/0x1634)
    r10:cdfe1520 r9:00000000 r8:00000000 r7:00000000 r6:cdc2c000 r5:cdfc8680
    r4:cdfd3600
    [<c045641c>] (ubi_attach) from [<c044a1a4>] (ubi_attach_mtd_dev+0x484/0xbe0)
    r10:66666fe2 r9:cd404000 r8:cdc2c040 r7:00000000 r6:cd404000 r5:cdc2c000
    r4:0001f000
    [<c0449d20>] (ubi_attach_mtd_dev) from [<c08e48dc>] (ubi_init+0x18c/0x250)
    r10:c097180c r9:c0942d8c r8:c0971808 r7:c097180c r6:c097180c r5:cd404000
    r4:00000000
    [<c08e4750>] (ubi_init) from [<c000a500>] (do_one_initcall+0x74/0x1b8)
    r10:00000000 r9:c08c726c r8:ffffe000 r7:00000000 r6:c08e4750 r5:c090b008
    r4:c0953ae0
    [<c000a48c>] (do_one_initcall) from [<c08c9ec8>] (kernel_init_freeable+0x120/0x1e0)
    r8:c08f6834 r7:c0953ae0 r6:c0953ae0 r5:c08f6854 r4:c0905e34
    [<c08c9da8>] (kernel_init_freeable) from [<c06ace24>] (kernel_init+0x10/0xf8)
    r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c06ace14
    r4:00000000
    [<c06ace14>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)
    Exception stack(0xcdc39fb0 to 0xcdc39ff8)
    9fa0: 00000000 00000000 00000000 00000000
    9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
    r5:c06ace14 r4:00000000
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry
    ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry
    ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read 64 bytes
    CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.94-gbe5389fd85 #18
    Hardware name: Generic DA850/OMAP-L138/AM18x

  • Hi Hong,

    I have attached the full log for your reference.

    Thanks,
    Songtao

  • Hi Songtao,
    I'm attaching a draft note I wrote for flashing/booting MTD-OSPI on AM64x.
    The same process would apply to MTD-NAND for your case on OMAP-L138.
    I'd recommend to flash rootfs UBI file @kernel instead of @u-boot.
    In fact, I was running into some issue when kernel attaching/mounting rootfs UBI from MTD partition when rootfs UBI is flashed @u-boot.
    Also refer to "3.7.2. UBIFS/UBI rootfs files generation" of the attached on how to setup the parameters used in the two commands
    (mkfs.ubifs/ubinize) to match the MTD partition allocated for rootfs.
    Best,
    -Hong

    Flash MTD OSPI on AM64x.pdf

  • Hi Hong,

    Thanks for your sharing. Unfortunately, I have to flash rootfs UBI file in u-boot. And it works fine if I used the u-boot 2012+Linux kernel3.3.  Could you please forward this issue to the ones who are working on OMAP-L138?

    Best Regards,
    Songtao 

  • Hi Songtao,
    I don't think there's a strict requirement to keep the same BCH scheme for SPL/u-boot and kernel/rootfs.
    Please refer to the BCH layout for NAND booting specified by OMAP-L138 onchip bootrom.
    www.ti.com/.../sprab41f.pdf
    I'd think to flash rootfs UBI to NAND @kernel level such that the BCH is calculated and written to NAND OOB area by kernel NAND driver,
    and then the same BCH scheme is used when kernel attaching/mounting rootfs from NAND MTD partition.
    Best,
    -Hong

  • Hi Hong,

    If the BCH scheme is different between SPL/u-boot and Linux kernel,  I run "nand erase ...; nand write..." from u-boot  to update UBI rootfs. Do you think it will work?

    Thanks,
    Songtao

  • Hi Songtao,
    I'd recommend to use MTD utility after kernel up running to flash rootfs UBI file to MTD partition. This is specially true in case a different BCH scheme are configured for SPL/u-boot (need to match bootrom requirments) vs kernel. As being said in my last reply, when flashing rootfs UBI to NAND using MTD utility @kernel level, the BCH is calculated and written to NAND OOB area by kernel NAND driver, and then the same BCH scheme is used when kernel attaching/mounting rootfs from NAND MTD partition.

    In my previous attached PDF for UBI rootfs OSPI flashing, for testing purpose, I used the following commands for attaching mtd7 (ospi.rootfs) after flashing rootfs using MTD utility "root@am64xx-evm:/boot# ubiformat /dev/mtd7 -f am6-sdk-tiny-fs.ubi":

    root@am64xx-evm:/boot# ubiattach -m 7
    root@am64xx-evm:/boot# ubinfo -a
    root@am64xx-evm:/boot# mkdir /mnt/fs_test
    root@am64xx-evm:/boot# mount -t ubifs ubi0 /mnt/fs_test
    root@am64xx-evm:/boot# cd /mnt/fs_test
    root@am64xx-evm:/boot# ls -lrt

    Best,

    -Hong

  • Hi Hong,

    I have resolved the problem through changing ECC/OOB scheme in the file "davinic_nand.c" of  the new Linux kernel(4.19.94) to make it comply with the one in u-boot. From my personal view, we need probably provide the bug to our end user in case somebody has the same requirement with me.

    Thanks,
    Songtao