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.

LINUXSDK-OMAPL138: Nand boot

Part Number: LINUXSDK-OMAPL138
Other Parts Discussed in Thread: OMAP-L138

Hi,

SDK:ti-processor-sdk-linux-omapl138-lcdk-06.01.00.08

Customer want to boot from Nand flash. His nand flash is the same as omapl138LCDK. He made his own ubi filesystem and flash to nand. But always booting failed. Below is kernel booting log:

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.59-g5f8c1c6121 #15
mmc0: host does not support reading read-only switch, assuming write-enable
Hardware name: Generic DA850/OMAP-L138/AM18x
Backtrace:
[<c00147b8>] (dump_backtrace) from [<c0014a30>] (show_stack+0x18/0x1c)
r7:00000000 r6:00000040 r5:ffffffb6 r4:c6024000
mmc0: new high speed SDHC card at address aaaa
[<c0014a18>] (show_stack) from [<c06a4ab4>] (dump_stack+0x20/0x28)
mmcblk0: mmc0:aaaa SS16G 14.8 GiB
[<c06a4a94>] (dump_stack) from [<c0434000>] (ubi_io_read+0x188/0x308)
[<c0433e78>] (ubi_io_read) from [<c04343b8>] (ubi_io_read_ec_hdr+0x4c/0x24c)
random: fast init done
mmcblk0:
r10:c63eb680 r9:00000000 r8:00000040 r7:00000000 r6:c6024000 r5:c63c4580
r4:c63d6c00
[<c043436c>] (ubi_io_read_ec_hdr) from [<c0439c84>] (ubi_attach+0x180/0x1634)
r10:c63eb680 r9:00000000 r8:00000000 r7:00000000 r6:c6024000 r5:c63c4580
r4:c63d6c00
[<c0439b04>] (ubi_attach) from [<c042d88c>] (ubi_attach_mtd_dev+0x484/0xbe0)
r10:00000978 r9:c63da400 r8:c6024040 r7:00000000 r6:c63da400 r5:c6024000
r4:0001f000
[<c042d408>] (ubi_attach_mtd_dev) from [<c0920838>] (ubi_init+0x18c/0x250)
r10:c09be788 r9:c098bd7c r8:c09be784 r7:c09be788 r6:c09be788 r5:c63da400
r4:00000000
[<c09206ac>] (ubi_init) from [<c000a540>] (do_one_initcall+0x74/0x1bc)
r10:00000000 r9:c090055c r8:ffffe000 r7:00000000 r6:c09206ac r5:c0947008
r4:c09a0c40
[<c000a4cc>] (do_one_initcall) from [<c0903ecc>] (kernel_init_freeable+0x120/0x1e0)
r8:c0932834 r7:c09a0c40 r6:c09a0c40 r5:c0932854 r4:c0942b7c
[<c0903dac>] (kernel_init_freeable) from [<c06b9ecc>] (kernel_init+0x10/0xf8)
r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c06b9ebc
r4:00000000
[<c06b9ebc>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)
Exception stack(0xc602dfb0 to 0xc602dff8)
dfa0: 00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
r5:c06b9ebc r4:00000000

ECC calculation:

Uboot:

#ifdef CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
nand->ecc.mode = NAND_ECC_HW_OOB_FIRST;
nand->ecc.size = 512;
nand->ecc.bytes = 10;
nand->ecc.strength = 4;
nand->ecc.calculate = nand_davinci_4bit_calculate_ecc;
nand->ecc.correct = nand_davinci_4bit_correct_data;
nand->ecc.hwctl = nand_davinci_4bit_enable_hwecc;
nand->ecc.layout = &nand_davinci_4bit_layout_oobfirst;

linux kernel:

nand@2000000,0 {
795 compatible = "ti,davinci-nand";
796 #address-cells = <0x1>;
797 #size-cells = <0x1>;
798 reg = <0x0 0x2000000 0x2000000 0x1 0x0 0x8000>;
799 ti,davinci-chipselect = <0x1>;
800 ti,davinci-mask-ale = <0x0>;
801 ti,davinci-mask-cle = <0x0>;
802 ti,davinci-mask-chipsel = <0x0>;
803 ti,davinci-nand-buswidth = <0x10>;i
804 ti,davinci-ecc-mode = "hw";
805 ti,davinci-ecc-bits = <0x4>;
806 ti,davinci-nand-use-bbt;

After booting with nfsroot, he format a nand partition into ubi format and can mount and read/write normally. Is it because of inconsistent ecc calculation?Or could you please help provide a document?