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