hi
on MCIMX7D SABRE board. to use NAND , i reworked the board with Macronix MX30LF4G28AC
kernel is 5.4.2 and U-boot is 2020.04
kernel config is imx_v6_v7_defconfig , wiht imx7d-sdb-gpmi-weim.dtb , i just added nand-ecc-mode="hw" n and fsl,use-mininum-ecc
a board booted well and i can see messages which show nand (see below)
but in linux when i mount nand with jffs or ubi i got ecc error
i don't know the Error cause is sw or hw issue ,
any idea and advice will be of great help
thank you in advance ,
1) on mounting jffs2
mount -t jffs2 /dev/mtdblock2 /mnt and copy some data ,i got ecc error
[ 244.169534] jffs2: notice: (291) jffs2_get_inode_nodes: Node header CRC failed at 0x11cc20. {655a,ca3a,b4db27fc,afbcb3ed}
[ 244.249511] jffs2: mtd->read(0x320 bytes from 0x11fce0) returned ECC error
[ 244.249541] jffs2: notice: (291) jffs2_get_inode_nodes: Node header CRC failed at 0x11fce0. {3a84,023e,249e0aee,81482350}
[ 244.329488] jffs2: mtd->read(0x184 bytes from 0xf2e7c) returned ECC error
[ 244.329518] jffs2: notice: (291) jffs2_get_inode_nodes: Node header CRC failed at 0x0f2e7c. {ec8d,815f,4fe6e50f,b00bf645}
[ 244.399514] jffs2: mtd->read(0x6a0 bytes from 0xfa160) returned ECC error
[ 244.399542] jffs2: notice: (291) jffs2_get_inode_nodes: Node header CRC failed at 0x0fa160. {0f08,25fa,115ee681,e1446179}
root@192:~#
2) on mount ubi, i got below kernel message
i just use ubiformat /ubiattach/mount .
[ 291.254076] ubi0: background thread "ubi_bgt0d" started, PID 298
[ 314.548421] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 2:4096, read only 4096 bytes, retry
[ 314.549722] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 314.551010] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 302
[ 314.594967] UBIFS error (ubi0:0 pid 300): ubifs_read_node: bad node type (255 but expected 9)
[ 314.594999] UBIFS error (ubi0:0 pid 300): ubifs_read_node: bad node at LEB 12:264, LEB mapping status 0
[ 314.595017] Not a node, first 24 bytes:
[ 314.595032] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........................
[ 314.595056] CPU: 0 PID: 300 Comm: mount Not tainted 5.4.161-39915-g0021a0c8a58f-dirty #18
[ 314.595071] Hardware name: Freescale i.MX7 Dual (Device Tree)
[ 314.595107] [<c01122a0>] (unwind_backtrace) from [<c010cbc8>] (show_stack+0x10/0x14)
[ 314.595133] [<c010cbc8>] (show_stack) from [<c0def3c4>] (dump_stack+0xd0/0x104)
[ 314.595159] [<c0def3c4>] (dump_stack) from [<c04664c8>] (ubifs_read_node+0x228/0x260)
[ 314.595187] [<c04664c8>] (ubifs_read_node) from [<c046f6ac>] (dbg_old_index_check_init+0x64/0x94)
[ 314.595213] [<c046f6ac>] (dbg_old_index_check_init) from [<c0462b24>] (ubifs_mount+0xf98/0x15ec)
[ 314.595241] [<c0462b24>] (ubifs_mount) from [<c02e7670>] (legacy_get_tree+0x24/0x4c)
[ 314.595268] [<c02e7670>] (legacy_get_tree) from [<c02a778c>] (vfs_get_tree+0x24/0xe8)
[ 314.595293] [<c02a778c>] (vfs_get_tree) from [<c02d1b28>] (do_mount+0x8a8/0xbcc)
[ 314.595316] [<c02d1b28>] (do_mount) from [<c02d2260>] (ksys_mount+0x88/0xb4)
[ 314.595339] [<c02d2260>] (ksys_mount) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
[ 314.595355] Exception stack(0xd842ffa8 to 0xd842fff0)
[ 314.595376] ffa0: 00000000 b6eed90c 01049318 01049328 01049308 00000000
[ 314.595398] ffc0: 00000000 b6eed90c b6eee114 00000015 01049318 01049308 01049258 00000000
[ 314.595415] ffe0: b6eedfc4 beb68a18 b6ebe833 b6e49c7a
kernel boot message
[ 2.835671] imx ahci driver is registered.
[ 2.851340] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
[ 2.857722] nand: Macronix MX30LF4G28AC
[ 2.861691] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 112
[ 2.873112] Bad block table not found for chip 0
[ 2.878023] Bad block table found at page 262016, version 0x01
[ 2.884215] nand_read_bbt: bad block at 0x0000011e0000
[ 2.889468] nand_read_bbt: bad block at 0x00000b0a0000
[ 2.894638] nand_read_bbt: bad block at 0x000015a60000
[ 2.901535] Bad block table written to 0x00001ffe0000, version 0x01