mtd: nand: atmel: probe of Spansion S34ML02G1 fails
Hello,
when testing the recent v4.13-rc2 on our at91sam9g20 based platform I discovered one of the NAND flash chips we use can not be setup correctly anymore. I guess this may be due to the reworked atmel nand driver after v4.9, but it may be another problem.
The board layout is similar to the at91sam9g20ek for the NAND flash part and we're using different flash chips. With an hynix HY27UF082G2B everything works, the console output on boot is like this:
nand: Could not find valid ONFI parameter page; aborting
nand: device found, Manufacturer ID: 0xad, Chip ID: 0xda
nand: Hynix NAND 256MiB 3,3V 8-bit
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
The same board with another pin compatible flash chip, the Spansion S34ML02G100TF100 however fails. I added some debug print statements to a otherwise clean 4.13-rc2 kernel and get this:
nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
nand: onfi_version: 10, onfi_params.opt_cmd: 0x001B
nand: chip->onfi_set_features() failed: -22
nand: nand_setup_data_interface() failed: -22 atmel-nand-controller 10000000.ebi:nand-controller: nand_scan_ident()
failed: -22
atmel-nand-controller: probe of 10000000.ebi:nand-controller failed
with error -22
So in the ONFI parameter page of the flash chip the value for "optional commands supported" in the features block is 0x001B which is exactly what the datasheet says. This means this flash chip does not support "Get Features" and "Set Features".
Now nand_onfi_set_features() correctly fails, because the nand chip can not set features. It's called in nand_setup_data_interface() in nand_base.c which fails itself because of the return value of the failed set features call and so the whole chain of fails starts.
The nand chip actually works fine in U-Boot, and with kernels up to v4.9.35, I didn't test v4.10, v4.11, but IIRC the board booted from nand flash with v4.12.
Can anyone help me to fix this?
Greets
Alex
Hi Alexander,
Quoted 36 lines · Alexander Dahl
Hello,
when testing the recent v4.13-rc2 on our at91sam9g20 based platform I discovered one of the NAND flash chips we use can not be setup correctly anymore. I guess this may be due to the reworked atmel nand driver after v4.9, but it may be another problem.
The board layout is similar to the at91sam9g20ek for the NAND flash part and we're using different flash chips. With an hynix HY27UF082G2B everything works, the console output on boot is like this:
nand: Could not find valid ONFI parameter page; aborting
nand: device found, Manufacturer ID:0xad, Chip ID:0xda
nand: Hynix NAND 256MiB 3,3V 8-bit
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64The same board with another pin compatible flash chip, the Spansion S34ML02G100TF100 however fails. I added some debug print statements to a otherwise clean 4.13-rc2 kernel and get this:
nand: device found, Manufacturer ID:
0x01, Chip ID:0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
nand:onfi_version: 10, onfi_params.opt_cmd:0x001B
nand:chip->onfi_set_features()failed: -22
nand:nand_setup_data_interface()failed: -22 atmel-nand-controller 10000000.ebi:nand-controller:nand_scan_ident()
failed: -22
atmel-nand-controller: probe of 10000000.ebi:nand-controller failed
with error -22So in the ONFI parameter page of the flash chip the value for "optional commands supported" in the features block is
0x001Bwhich is exactly what the datasheet says. This means this flash chip does not support "Get Features" and "Set Features".
Quoted 4 lines
Now
nand_onfi_set_features()correctly fails, because the nand chip can not set features. It's called innand_setup_data_interface()innand_base.cwhich fails itself because of the return value of the failed set features call and so the whole chain of fails starts.
Oh crap! We didn't consider ONFI NANDs which are supporting the SET/GET FEATURES operations when working on the timing selection logic.
Quoted 6 lines
The nand chip actually works fine in U-Boot, and with kernels up to v4.9.35, I didn't test v4.10, v4.11, but IIRC the board booted from nand flash with v4.12.
Can anyone help me to fix this?
Can you try with the following fix?
Thanks,
Boris
Quoted 4 lines
Greets
Alex
--->8---
drivers/mtd/nand/nand_base.c +3 -1
@@ -1125,7 +1125,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)* Ensure the timing mode has been changed on the chip side * before changing timings on the controller side. */ -if (chip->onfi_version) { +if (chip->onfi_version && + (le16_to_cpu (chip->onfi_params.opt_cmd) & +ONFI_OPT_CMD_SET_GET_FEATURES )) {u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN ] = { chip->onfi_timing_mode_default, };
Hello,
Am Dienstag, 25. Juli 2017, 20:54:06 schrieb Boris Brezillon:
Quoted 1 line
Can you try with the following fix?
I tried. The initialization seems to be successful now, at least there are no error messages from the nand driver anymore. But later on UBI fails, which is strange because it does not fail with earlier kernels. Kernel command line is this:
console=ttyS0,115200 panic=1 mtdparts=atmel_nand:128k(bootstrap)ro,512k(uboot)ro,256k(env1),256k(env2),3M(kernel_rec)ro,768k(fpga_rec)ro,47M(rootfs_rec)ro,3M(kernel),768k(fpga),200M(filesystem),128k(rootfs_update_script),-(free) ubi.mtd=rootfs_rec ubi.mtd=filesystem root=ubi1:rootfs1 rootfstype=ubifs
UBI/UBIFS kernel config is like this:
CONFIG_MTD_UBI=yCONFIG_MTD_UBI_WL_THRESHOLD=4096CONFIG_MTD_UBI_BEB_LIMIT=50
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
CONFIG_UBIFS_FS=yCONFIG_UBIFS_FS_ADVANCED_COMPR=yCONFIG_UBIFS_FS_LZO=yCONFIG_UBIFS_FS_ZLIB=y
# CONFIG_UBIFS_ATIME_SUPPORT is not set
# CONFIG_UBIFS_FS_ENCRYPTION is not setCONFIG_UBIFS_FS_SECURITY=y
According to the datasheet the NAND flash (Spansion® S34ML02G1) supports 1-bit ECC. According to the SAM9G20 datasheet the SMC supports ECC- enabled NAND flash, but as far as I could see the ECC controller of the SAM9G20 has no driver and is not used, but ECC is computed in software?
The nand node in my dts file is like the one in arch/arm/boot/dts/at91sam9g20ek_common.dtsi (with different partitions).
See the console output:
nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
12 cmdlinepart partitions found on MTD device atmel_nand Creating 12 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap" 0x000000020000-0x0000000a0000 : "uboot" 0x0000000a0000-0x0000000e0000 : "env1" 0x0000000e0000-0x000000120000 : "env2" 0x000000120000-0x000000420000 : "kernel_rec" 0x000000420000-0x0000004e0000 : "fpga_rec" 0x0000004e0000-0x0000033e0000 : "rootfs_rec" 0x0000033e0000-0x0000036e0000 : "kernel" 0x0000036e0000-0x0000037a0000 : "fpga" 0x0000037a0000-0x00000ffa0000 : "filesystem" 0x00000ffa0000-0x00000ffc0000 : "rootfs_update_script" 0x00000ffc0000-0x000010000000 : "free"
NET: Registered protocol family 17
ubi0: attaching mtd6
ubi0: MTD device 6 is write-protected, attach in read-only mode __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 1 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 2
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 2__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 3:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 3
ubi0: fixable bit-flip detected at PEB 3 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 4
ubi0: fixable bit-flip detected at PEB 4
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 4__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 5
ubi0: fixable bit-flip detected at PEB 5
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 5__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 6 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 7
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 7__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 9 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read 129024 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c025f468>] (scan_all.constprop.0+0x298/0xb80)
[<c025f468>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 10
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 10__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 11
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 11__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 12 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 13
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 13__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 14
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 14__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 15
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 15__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 16 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 17
ubi0: fixable bit-flip detected at PEB 17 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 18
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 18__nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 19 __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry __nand_correct_data: uncorrectable ECC error
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)
[<c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24) __nand_correct_data: uncorrectable ECC error __nand_correct_data: uncorrectable ECC error __nand_correct_data: uncorrectable ECC error __nand_correct_data: uncorrectable ECC error __nand_correct_data: uncorrectable ECC error
[…]
This goes on forever until I cut power, just interrupted by messages like this every now and then:
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 19:2048, read only 129024 bytes, retry
Greets
Alex
Hi Alexander,
Quoted 672 lines · Alexander Dahl
Hello,
Am Dienstag, 25. Juli 2017, 20:54:06 schrieb Boris Brezillon:
Quoted 1 line
Can you try with the following fix?
I tried. The initialization seems to be successful now, at least there are no error messages from the nand driver anymore. But later on UBI fails, which is strange because it does not fail with earlier kernels. Kernel command line is this:
console=ttyS0,115200 panic=1 mtdparts=atmel_nand:128k(bootstrap)ro,512k(uboot)ro,256k(env1),256k(env2),3M(kernel_rec)ro,768k(fpga_rec)ro,47M(rootfs_rec)ro,3M(kernel),768k(fpga),200M(filesystem),128k(rootfs_update_script),-(free) ubi.mtd=rootfs_rec ubi.mtd=filesystem root=ubi1:rootfs1 rootfstype=ubifs
UBI/UBIFS kernel config is like this:
CONFIG_MTD_UBI=yCONFIG_MTD_UBI_WL_THRESHOLD=4096CONFIG_MTD_UBI_BEB_LIMIT=50
#CONFIG_MTD_UBI_FASTMAPis not set
#CONFIG_MTD_UBI_GLUEBIis not set
#CONFIG_MTD_UBI_BLOCKis not set
CONFIG_UBIFS_FS=yCONFIG_UBIFS_FS_ADVANCED_COMPR=yCONFIG_UBIFS_FS_LZO=yCONFIG_UBIFS_FS_ZLIB=y
#CONFIG_UBIFS_ATIME_SUPPORTis not set
#CONFIG_UBIFS_FS_ENCRYPTIONis not setCONFIG_UBIFS_FS_SECURITY=yAccording to the datasheet the NAND flash (Spansion® S34ML02G1) supports 1-bit ECC. According to the SAM9G20 datasheet the SMC supports ECC- enabled NAND flash, but as far as I could see the ECC controller of the SAM9G20 has no driver and is not used, but ECC is computed in software?
The nand node in my dts file is like the one in
arch/arm/boot/dts/at91sam9g20ek_common.dtsi(with different partitions).See the console output:
nand: device found, Manufacturer ID:
0x01, Chip ID:0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 Bad block table found at page 131008, version0x01
Bad block table found at page 130944, version0x01
12 cmdlinepart partitions found on MTD deviceatmel_nandCreating 12 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap" 0x000000020000-0x0000000a0000 : "uboot" 0x0000000a0000-0x0000000e0000 : "env1" 0x0000000e0000-0x000000120000 : "env2" 0x000000120000-0x000000420000 : "kernel_rec" 0x000000420000-0x0000004e0000 : "fpga_rec" 0x0000004e0000-0x0000033e0000 : "rootfs_rec" 0x0000033e0000-0x0000036e0000 : "kernel" 0x0000036e0000-0x0000037a0000 : "fpga" 0x0000037a0000-0x00000ffa0000 : "filesystem" 0x00000ffa0000-0x00000ffc0000 : "rootfs_update_script" 0x00000ffc0000-0x000010000000 : "free"
NET: Registered protocol family 17
ubi0: attaching mtd6
ubi0: MTD device 6 is write-protected, attach in read-only mode__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 1__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 2
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 2__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 3:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 3
ubi0: fixable bit-flip detected at PEB 3__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 4
ubi0: fixable bit-flip detected at PEB 4
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 4__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 5:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 5
ubi0: fixable bit-flip detected at PEB 5
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 5__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 6__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 7:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 7
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 7__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 8:512, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 9__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 9:512, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read only 129024 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 9:2048, read 129024 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c025f468>] (scan_all.constprop.0+0x298/0xb80)
[<c025f468>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 10:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 10
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 10__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 11:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 11
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 11__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 12:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 12__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 13:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 13
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 13__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 14:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 14
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 14__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 15:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 15
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 15__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 16:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)
ubi0: fixable bit-flip detected at PEB 16__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 17:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 17
ubi0: fixable bit-flip detected at PEB 17__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:0, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0258ecc>] (ubi_io_read_ec_hdr+0xa4/0x32c)
[<c0258ecc>] (ubi_io_read_ec_hdr) from [<c025f320>] (scan_all.constprop.0+0x150/0xb80)
[<c025f320>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 18:512, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 18
ubi0 warning: scan_all.constprop.0: valid VID header but corrupted EC header at PEB 18__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:0, read only 64 bytes, retry
ubi0: fixable bit-flip detected at PEB 19__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 warning:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read only 64 bytes, retry__nand_correct_data: uncorrectable ECC error
ubi0 error:ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 19:512, read 64 bytesCPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc2+ #13 Hardware name: Atmel AT91SAM9 [<c000f4b8>] (unwind_backtrace) from [<c000d5b4>] (show_stack+0x10/0x14) [<c000d5b4>] (show_stack) from [<c0258b4c>] (ubi_io_read+0x214/0x328)[<
c0258b4c>] (ubi_io_read) from [<c0259200>] (ubi_io_read_vid_hdr+0xac/0x32c)
[<c0259200>] (ubi_io_read_vid_hdr) from [<c025f3d8>] (scan_all.constprop.0+0x208/0xb80)
[<c025f3d8>] (scan_all.constprop.0) from [<c0260084>] (ubi_attach+0xa0/0x194)
[<c0260084>] (ubi_attach) from [<c02524f8>] (ubi_attach_mtd_dev+0x1f4/0x698)
[<c02524f8>] (ubi_attach_mtd_dev) from [<c04d1384>] (ubi_init+0x138/0x1d8)
[<c04d1384>] (ubi_init) from [<c00096d8>] (do_one_initcall+0xa8/0x158) [<c00096d8>] (do_one_initcall) from [<c04b2cf4>] (kernel_init_freeable+0x104/0x1c0)
[<c04b2cf4>] (kernel_init_freeable) from [<c0356a94>] (kernel_init+0x8/0xf0)
[<c0356a94>] (kernel_init) from [<c000a290>] (ret_from_fork+0x14/0x24)__nand_correct_data: uncorrectable ECC error__nand_correct_data: uncorrectable ECC error__nand_correct_data: uncorrectable ECC error__nand_correct_data: uncorrectable ECC error__nand_correct_data: uncorrectable ECC error
Quoted 7 lines
[…]
This goes on forever until I cut power, just interrupted by messages like this every now and then:
ubi0 warning:
ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 19:2048, read only 129024 bytes, retry
Okay, first thing to test: revert f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks"). You may have to revert other commits to compile the driver.
If it works, I'd like you to drop SMC timings in both situations (with and without this commit).
I'd also like to to dump NAND timings (those passed to ->setup_data_interface()).
Thanks,
Boris
Hei Boris,
Quoted 2 lines · Boris Brezillon
If it works, I'd like you to drop SMC timings in both situations (with and without this commit).
What do you mean with drop? For other CS? How?
Quoted 2 lines
I'd also like to to dump NAND timings (those passed to ->setup_data_interface()).
I'll see hat I can do tomorrow.
Greets
Alex
Signature · 4 lines
»With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie) *** GnuPG-FP: C28E E6B9 0263 95CF 8FAF 08FA 34AD CD00 7221 5CC6 ***
Quoted 7 lines · Alexander Dahl
Hei Boris,
Quoted 2 lines · Boris Brezillon
If it works, I'd like you to drop SMC timings in both situations (with and without this commit).
What do you mean with drop? For other CS? How?
Sorry, I meant dump not drop.
Quoted 5 lines
Quoted 3 lines
I'd also like to to dump NAND timings (those passed to ->setup_data_interface()).
I'll see hat I can do tomorrow.
Did you have time to test with f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks") reverted? BTW, it's probably simpler to just comment out this line [1]
Quoted 4 lines
Greets
Alex
Hei hei,
Am Donnerstag, 27. Juli 2017, 21:27:03 schrieb Boris Brezillon:
Quoted 3 lines
Did you have time to test with
f9ce2eddf176("mtd: nand: atmel: Add ->setup_data_interface() hooks") reverted? BTW, it's probably simpler to just comment out this line [1]
This does not revert cleanly.
Quoted 2 lines
[1]http://elixir.free-electrons.com/linux/v4.13-rc2/source/drivers/mtd /nand/atmel/nand-controller.c#L1493
I tried this in atmel_nand_init():
+ /*
if (nc->mck && nc->caps->ops->setup_data_interface)
chip->setup_data_interface = atmel_nand_setup_data_interface;+ */
So this basically skips all those timing init, right? If I do this I get the timings which were applied in U-Boot and the NAND-Flash just works.
Greets
Alex
Hello Boris,
Am Mittwoch, 26. Juli 2017, 20:33:26 schrieb Boris Brezillon:
Quoted 9 lines
Okay, first thing to test: revert
f9ce2eddf176("mtd: nand: atmel: Add ->setup_data_interface() hooks"). You may have to revert other commits to compile the driver.If it works, I'd like you to drop SMC timings in both situations (with and without this commit).
I'd also like to to dump NAND timings (those passed to ->setup_data_interface()).
So based on those three atmel-ebi patches from earlier this week I used the attached patch to dump the nand timings and smc settings before the get applied. clk mck runs at 132096000 Hz (slow_xtal 32768, main_xtal 18432000). Previously clock settings for NAND were set in (very old) U- Boot to this (double checked, Linux didn't touch it):
U-Boot> md.l 0xffffef1c 1 ffffef1c: 0001000a .... U-Boot> md.l 0xffffec30 4 ffffec30: 00010001 03030303 00050005 00020003 ................
So setup, pulse, cycle, tdf all to quite low number of clock cycles, but as far as I can tell this worked with all flash chips we had connected over the years.
Now with the old Hynix flash chip, I get the following:
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 0, tCCS_min: 500000, tPROG_max: 0, tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 20000, tADL_min: 400000, tALS_min: 50000, tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 100000, tCEH_min: 20000, tCH_min: 20000, tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 20000, tCLR_min: 20000, tCLS_min: 50000, tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 70000, tDH_min: 20000, tDS_min: 40000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 10000, tITC_max: 1000000, tRC_min: 100000, tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 30000, tRHOH_min: 0, tRHW_min: 200000, tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 50000, tRR_min: 40000, tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 200000, tWC_min: 100000, tWH_min: 30000, tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 50000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000002, pulse: 0x0f080f08, cycle: 0x000f000f, timings: 0x88060483, mode: 0x001f0003 nand: Could not find valid ONFI parameter page; aborting nand: device found, Manufacturer ID: 0xad, Chip ID: 0xda nand: Hynix NAND 256MiB 3,3V 8-bit nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 $ devmem 0xffffef1c 0x0001000A $ devmem 0xffffec30 0x00000002 $ devmem 0xffffec34 0x0F080F08 $ devmem 0xffffec38 0x000F000F $ devmem 0xffffec3c 0x001F0003
To me those values look like some kind of defaults every nand chip should run with?
The failing Spansion chip here:
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 0, tCCS_min: 500000, tPROG_max: 0, tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 20000, tADL_min: 400000, tALS_min: 50000, tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 100000, tCEH_min: 20000, tCH_min: 20000, tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 20000, tCLR_min: 20000, tCLS_min: 50000, tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 70000, tDH_min: 20000, tDS_min: 40000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 10000, tITC_max: 1000000, tRC_min: 100000, tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 30000, tRHOH_min: 0, tRHW_min: 200000, tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 50000, tRR_min: 40000, tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 200000, tWC_min: 100000, tWH_min: 30000, tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 50000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000002, pulse: 0x0f080f08, cycle: 0x000f000f, timings: 0x88060483, mode: 0x001f0003 nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda nand: AMD/Spansion S34ML02G1 nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: -1, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 30000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 20000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 25000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 5000, tRP_min: 12000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 25000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 12000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000001, pulse: 0x05020502, cycle: 0x00050005, timings: 0x88030282, mode: 0x001b0003 atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 30000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 20000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 25000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 5000, tRP_min: 12000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 25000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 12000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000001, pulse: 0x05020502, cycle: 0x00050005, timings: 0x88030282, mode: 0x001b0003
I could not double check here with devmem, because I got no login prompt anymore, all those errors from the first mail follow. I didn't double check with the S34ML02G1 datasheet here, but those smc timings he wants to set don't look completely bad.
Greets
Alex
Quoted 1 line
From
61e7c97a9035406a86442f7a05218d0938381b1cMon Sep 17 00:00:00 2001
From: Alexander Dahl <[email protected]>
Date: Fri, 28 Jul 2017 14:30:49 +0200
Subject: [PATCH] dump nand and smc timings
--- drivers/mtd/nand/atmel/nand-controller.c | 57 +++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-)
drivers/mtd/nand/atmel/nand-controller.c +56 -1
@@ -1413,9 +1413,64 @@ static int atmel_smc_nand_setup_data_interface(struct atmel_nand *nand, nc =to_nand_controller (nand->base.controller); +dev_info (nc->dev,"atmel_smc_nand_setup_data_interface(csline: %i, type: %i)" , + csline, conf->type); +dev_info (nc->dev,"tBERS_max: %u, tCCS_min: %u, tPROG_max: %u, tR_max: %u" , + conf->timings.sdr.tBERS_max, + conf->timings.sdr.tCCS_min, + conf->timings.sdr.tPROG_max, + conf->timings.sdr.tR_max); +dev_info (nc->dev,"tALH_min: %u, tADL_min: %u, tALS_min: %u, tAR_min: %u" , + conf->timings.sdr.tALH_min, + conf->timings.sdr.tADL_min, + conf->timings.sdr.tALS_min, + conf->timings.sdr.tAR_min); +dev_info (nc->dev,"tCEA_max: %u, tCEH_min: %u, tCH_min: %u, tCHZ_max: %u" , + conf->timings.sdr.tCEA_max, + conf->timings.sdr.tCEH_min, + conf->timings.sdr.tCH_min, + conf->timings.sdr.tCHZ_max); +dev_info (nc->dev,"tCLH_min: %u, tCLR_min: %u, tCLS_min: %u, tCOH_min: %u" , + conf->timings.sdr.tCLH_min, + conf->timings.sdr.tCLR_min, + conf->timings.sdr.tCLS_min, + conf->timings.sdr.tCOH_min); +dev_info (nc->dev,"tCS_min: %u, tDH_min: %u, tDS_min: %u, tFEAT_max: %u" , + conf->timings.sdr.tCS_min, + conf->timings.sdr.tDH_min, + conf->timings.sdr.tDS_min, + conf->timings.sdr.tFEAT_max); +dev_info (nc->dev,"tIR_min: %u, tITC_max: %u, tRC_min: %u, tREA_max: %u" , + conf->timings.sdr.tIR_min, + conf->timings.sdr.tITC_max, + conf->timings.sdr.tRC_min, + conf->timings.sdr.tREA_max); +dev_info (nc->dev,"tREH_min: %u, tRHOH_min: %u, tRHW_min: %u, tRHZ_max: %u" , + conf->timings.sdr.tREH_min, + conf->timings.sdr.tRHOH_min, + conf->timings.sdr.tRHW_min, + conf->timings.sdr.tRHZ_max); +dev_info (nc->dev,"tRLOH_min: %u, tRP_min: %u, tRR_min: %u, tRST_max: %llu" , + conf->timings.sdr.tRLOH_min, + conf->timings.sdr.tRP_min, + conf->timings.sdr.tRR_min, + conf->timings.sdr.tRST_max); +dev_info (nc->dev,"tWB_max: %u, tWC_min: %u, tWH_min: %u, tWHR_min: %u" , + conf->timings.sdr.tWB_max, + conf->timings.sdr.tWC_min, + conf->timings.sdr.tWH_min, + conf->timings.sdr.tWHR_min); +dev_info (nc->dev,"tWP_min: %u, tWW_min: %u" , + conf->timings.sdr.tWP_min, + conf->timings.sdr.tWW_min); + ret =atmel_smc_nand_prepare_smcconf (nand, conf, &smcconf); -if (ret) +if (ret) { +dev_err (nc->dev,"atmel_smc_nand_prepare_smcconf() failed: %i" , ret);return ret; + } +dev_info (nc->dev,"smcconf: setup: 0x%08x, pulse: 0x%08x, cycle: 0x%08x, timings: 0x%08x, mode: 0x%08x" , + smcconf.setup, smcconf.pulse, smcconf.cycle, smcconf.timings, smcconf.mode);if (csline ==NAND_DATA_IFACE_CHECK_ONLY )return 0 ;
Signature · 1 line
2.1.4
Quoted 81 lines · Alexander Dahl
Hello Boris,
Am Mittwoch, 26. Juli 2017, 20:33:26 schrieb Boris Brezillon:
Quoted 9 lines
Okay, first thing to test: revert
f9ce2eddf176("mtd: nand: atmel: Add ->setup_data_interface() hooks"). You may have to revert other commits to compile the driver.If it works, I'd like you to drop SMC timings in both situations (with and without this commit).
I'd also like to to dump NAND timings (those passed to ->setup_data_interface()).
So based on those three atmel-ebi patches from earlier this week I used the attached patch to dump the nand timings and smc settings before the get applied. clk mck runs at 132096000 Hz (
slow_xtal32768,main_xtal18432000). Previously clock settings for NAND were set in (very old) U- Boot to this (double checked, Linux didn't touch it):U-Boot> md.l 0xffffef1c 1 ffffef1c: 0001000a .... U-Boot> md.l 0xffffec30 4 ffffec30: 00010001 03030303 00050005 00020003 ................So setup, pulse, cycle, tdf all to quite low number of clock cycles, but as far as I can tell this worked with all flash chips we had connected over the years.
Now with the old Hynix flash chip, I get the following:
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 0, tCCS_min: 500000, tPROG_max: 0, tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 20000, tADL_min: 400000, tALS_min: 50000, tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 100000, tCEH_min: 20000, tCH_min: 20000, tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 20000, tCLR_min: 20000, tCLS_min: 50000, tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 70000, tDH_min: 20000, tDS_min: 40000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 10000, tITC_max: 1000000, tRC_min: 100000, tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 30000, tRHOH_min: 0, tRHW_min: 200000, tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 50000, tRR_min: 40000, tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 200000, tWC_min: 100000, tWH_min: 30000, tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 50000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000002, pulse: 0x0f080f08, cycle: 0x000f000f, timings: 0x88060483, mode: 0x001f0003 nand: Could not find valid ONFI parameter page; aborting nand: device found, Manufacturer ID: 0xad, Chip ID: 0xda nand: Hynix NAND 256MiB 3,3V 8-bit nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 $ devmem 0xffffef1c 0x0001000A $ devmem 0xffffec30 0x00000002 $ devmem 0xffffec34 0x0F080F08 $ devmem 0xffffec38 0x000F000F $ devmem 0xffffec3c 0x001F0003To me those values look like some kind of defaults every nand chip should run with?
The failing Spansion chip here:
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 0, tCCS_min: 500000, tPROG_max: 0, tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 20000, tADL_min: 400000, tALS_min: 50000, tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 100000, tCEH_min: 20000, tCH_min: 20000, tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 20000, tCLR_min: 20000, tCLS_min: 50000, tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 70000, tDH_min: 20000, tDS_min: 40000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 10000, tITC_max: 1000000, tRC_min: 100000, tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 30000, tRHOH_min: 0, tRHW_min: 200000, tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 50000, tRR_min: 40000, tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 200000, tWC_min: 100000, tWH_min: 30000, tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 50000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000002, pulse: 0x0f080f08, cycle: 0x000f000f, timings: 0x88060483, mode: 0x001f0003 nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda nand: AMD/Spansion S34ML02G1 nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: -1, type: 0) atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 30000
Quoted 8 lines
atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 20000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 25000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 5000, tRP_min: 12000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 25000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 12000, tWW_min: 100000 atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000001, pulse: 0x05020502, cycle: 0x00050005, timings: 0x88030282, mode: 0x001b0003
Hm, ok. It seems that we're accepting mode 4 even though the controller is not supporting EDO mode which mandatory for mode 4 and 5.
Can you try with the following patch? Timings are expressed in picoseconds and this test was testing against a value expressed in nanoseconds.
BTW, did you try to comment the line I pointed out yesterday? I'd like to be sure this is a timing issue.
--->8---
drivers/mtd/nand/atmel/nand-controller.c +1 -1
@@ -1201,7 +1201,7 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand,* tRC < 30ns implies EDO mode. This controller does not support this * mode. */ -if (conf->timings.sdr.tRC_min <30 ) +if (conf->timings.sdr.tRC_min <30000 )return -ENOTSUPP ;atmel_smc_cs_conf_init (smcconf);
Hello Boris,
Am Freitag, 28. Juli 2017, 21:13:01 schrieb Boris Brezillon:
Quoted 6 lines
Can you try with the following patch? Timings are expressed in picoseconds and this test was testing against a value expressed in nanoseconds.
BTW, did you try to comment the line I pointed out yesterday? I'd like to be sure this is a timing issue.
Now I did, see my other mail.
Quoted 10 lines
--->8---
(quoted diff) +0
-0
b/drivers/mtd/nand/atmel/nand-controller.cindexd922a88e407f..2c8baa0c2c4e100644drivers/mtd/nand/atmel/nand-controller.c +0
-0@@ -1201,7 +1201,7 @@ static int atmel_smc_nand_prepare_smcconf(struct
atmel_nand*nand, * tRC < 30ns implies EDO mode. This controller does not support this * mode.*/
drivers/mtd/nand/atmel/nand-controller.c static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, · line 1207
Quoted 5 lines
drivers/mtd/nand/atmel/nand-controller.c +1
-1-if (conf->timings.sdr.tRC_min <30 ) +if (conf->timings.sdr.tRC_min <30000 )return -ENOTSUPP ;atmel_smc_cs_conf_init (smcconf);
This gives me the following debug output (with my own debug messages from the patch in one mail from last week, with an additional dump of the values read from onfi page):
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 0, tCCS_min: 500000, tPROG_max: 0, tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 20000, tADL_min: 400000, tALS_min: 50000, tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 100000, tCEH_min: 20000, tCH_min: 20000, tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 20000, tCLR_min: 20000, tCLS_min: 50000, tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 70000, tDH_min: 20000, tDS_min: 40000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 10000, tITC_max: 1000000, tRC_min: 100000, tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 30000, tRHOH_min: 0, tRHW_min: 200000, tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 50000, tRR_min: 40000, tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 200000, tWC_min: 100000, tWH_min: 30000, tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 50000, tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000002, pulse: 0x0f080f08, cycle: 0x000f000f, timings: 0x88060483, mode: 0x001f0003
nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
onfi timings: t_prog: 0x02BC, t_bers: 0x2710, t_r: 0x0019, t_ccs: 0x0064
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 30000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 20000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 25000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 5000, tRP_min: 12000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 25000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 12000, tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_prepare_smcconf() failed: -524
onfi timings: t_prog: 0x02BC, t_bers: 0x2710, t_r: 0x0019, t_ccs: 0x0064
atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 25000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 30000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 15000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 30000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 15000, tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000001, pulse: 0x06030603, cycle: 0x00060006, timings: 0x88030282, mode: 0x001b0003 atmel-nand-controller 10000000.ebi:nand-controller: atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller: tBERS_max: 1410065408, tCCS_min: 100000, tPROG_max: 700000000, tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller: tALH_min: 5000, tADL_min: 400000, tALS_min: 10000, tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller: tCEA_max: 25000, tCEH_min: 20000, tCH_min: 5000, tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller: tCLH_min: 5000, tCLR_min: 10000, tCLS_min: 10000, tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller: tCS_min: 25000, tDH_min: 5000, tDS_min: 10000, tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller: tIR_min: 0, tITC_max: 1000000, tRC_min: 30000, tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller: tREH_min: 10000, tRHOH_min: 15000, tRHW_min: 100000, tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller: tRLOH_min: 0, tRP_min: 15000, tRR_min: 20000, tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller: tWB_max: 100000, tWC_min: 30000, tWH_min: 10000, tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller: tWP_min: 15000, tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup: 0x00000001, pulse: 0x06030603, cycle: 0x00060006, timings: 0x88030282, mode: 0x001b0003
So, the system boots again, meaning it can successfully read from the ubifs. The resulting timings are the same as in debug output:
$ devmem 0xffffec30 0x00000001 $ devmem 0xffffec34 0x06030603 $ devmem 0xffffec38 0x00060006 $ devmem 0xffffec3c 0x001B0003
One thing I noticed is the tBERS_max value. From the 0x2710 in the onfi page I would assume 10000 µs, so 10.000.000 ns, so 10.000.000.000 ps, which does not fit in an u32 anymore, which gives those 1410065408 due to integer overflow. I didn't check the other timings for possible overflow, maybe you can do this?
Greets
Alex
Hi Alexander,
Quoted 86 lines · On Mon, 31 Jul 2017 08:29:35 +0200 Alexander Dahl <[email protected]> wrote:
Hello Boris,
Am Freitag, 28. Juli 2017, 21:13:01 schrieb Boris Brezillon:
Quoted 6 lines
Can you try with the following patch? Timings are expressed in picoseconds and this test was testing against a value expressed in nanoseconds.
BTW, did you try to comment the line I pointed out yesterday? I'd like to be sure this is a timing issue.
Now I did, see my other mail.
Quoted 10 lines
--->8---
(quoted diff) +0
-0
b/drivers/mtd/nand/atmel/nand-controller.cindexd922a88e407f..2c8baa0c2c4e100644drivers/mtd/nand/atmel/nand-controller.c +0
-0@@ -1201,7 +1201,7 @@ static int atmel_smc_nand_prepare_smcconf(struct
atmel_nand*nand, * tRC < 30ns implies EDO mode. This controller does not support this * mode.*/drivers/mtd/nand/atmel/nand-controller.c static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, · line 1207
Quoted 5 lines
drivers/mtd/nand/atmel/nand-controller.c +1
-1-if (conf->timings.sdr.tRC_min <30 ) +if (conf->timings.sdr.tRC_min <30000 )return -ENOTSUPP ;atmel_smc_cs_conf_init (smcconf);This gives me the following debug output (with my own debug messages from the patch in one mail from last week, with an additional dump of the values read from onfi page):
atmel-nand-controller 10000000.ebi:nand-controller:
atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 0,tCCS_min: 500000,tPROG_max: 0,tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 20000,tADL_min: 400000,tALS_min: 50000,tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 100000,tCEH_min: 20000,tCH_min: 20000,tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 20000,tCLR_min: 20000,tCLS_min: 50000,tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 70000,tDH_min: 20000,tDS_min: 40000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 10000,tITC_max: 1000000,tRC_min: 100000,tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 30000,tRHOH_min: 0,tRHW_min: 200000,tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 50000,tRR_min: 40000,tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 200000,tWC_min: 100000,tWH_min: 30000,tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 50000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000002, pulse:0x0f080f08, cycle:0x000f000f, timings:0x88060483, mode:0x001f0003
nand: device found, Manufacturer ID:0x01, Chip ID:0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
onfi timings:t_prog:0x02BC,t_bers:0x2710,t_r:0x0019,t_ccs:0x0064
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 30000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 20000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 25000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 5000,tRP_min: 12000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 25000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 12000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_prepare_smcconf()failed: -524
onfi timings:t_prog:0x02BC,t_bers:0x2710,t_r:0x0019,t_ccs:0x0064
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 25000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 30000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 15000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 30000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 15000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000001, pulse:0x06030603, cycle:0x00060006, timings:0x88030282, mode:0x001b0003atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 25000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 30000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 15000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 30000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 15000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000001, pulse:0x06030603, cycle:0x00060006, timings:0x88030282, mode:0x001b0003
Quoted 2 lines
So, the system boots again, meaning it can successfully read from the ubifs.
Cool. I'll send a patch to fix that.
Quoted 11 lines
The resulting timings are the same as in debug output:
$ devmem 0xffffec30 0x00000001 $ devmem 0xffffec34 0x06030603 $ devmem 0xffffec38 0x00060006 $ devmem 0xffffec3c 0x001B0003
Quoted 4 lines
One thing I noticed is the
tBERS_maxvalue. From the0x2710in the onfi page I would assume 10000 µs, so 10.000.000 ns, so 10.000.000.000 ps, which does not fit in an u32 anymore, which gives those 1410065408 due to integer overflow.
Indeed, it should be an u64 not an u32.
Quoted 2 lines
I didn't check the other
timings for possible overflow, maybe you can do this?
Yep, we have the same problem with tR_max and tPROG_max.
I'll send a patch to fix that.
Thanks,
Boris
Quoted 112 lines · On Mon, 31 Jul 2017 09:44:43 +0200 Boris Brezillon…
Hi Alexander,
Quoted 86 lines · On Mon, 31 Jul 2017 08:29:35 +0200 Alexander Dahl <[email protected]> wrote:
Hello Boris,
Am Freitag, 28. Juli 2017, 21:13:01 schrieb Boris Brezillon:
Quoted 6 lines
Can you try with the following patch? Timings are expressed in picoseconds and this test was testing against a value expressed in nanoseconds.
BTW, did you try to comment the line I pointed out yesterday? I'd like to be sure this is a timing issue.
Now I did, see my other mail.
Quoted 10 lines
--->8---
(quoted diff) +0
-0
b/drivers/mtd/nand/atmel/nand-controller.cindexd922a88e407f..2c8baa0c2c4e100644drivers/mtd/nand/atmel/nand-controller.c +0
-0@@ -1201,7 +1201,7 @@ static int atmel_smc_nand_prepare_smcconf(struct
atmel_nand*nand, * tRC < 30ns implies EDO mode. This controller does not support this * mode.*/drivers/mtd/nand/atmel/nand-controller.c static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, · line 1207
Quoted 5 lines
drivers/mtd/nand/atmel/nand-controller.c +1
-1-if (conf->timings.sdr.tRC_min <30 ) +if (conf->timings.sdr.tRC_min <30000 )return -ENOTSUPP ;atmel_smc_cs_conf_init (smcconf);This gives me the following debug output (with my own debug messages from the patch in one mail from last week, with an additional dump of the values read from onfi page):
atmel-nand-controller 10000000.ebi:nand-controller:
atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 0,tCCS_min: 500000,tPROG_max: 0,tR_max: 200000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 20000,tADL_min: 400000,tALS_min: 50000,tAR_min: 25000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 100000,tCEH_min: 20000,tCH_min: 20000,tCHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 20000,tCLR_min: 20000,tCLS_min: 50000,tCOH_min: 0 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 70000,tDH_min: 20000,tDS_min: 40000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 10000,tITC_max: 1000000,tRC_min: 100000,tREA_max: 40000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 30000,tRHOH_min: 0,tRHW_min: 200000,tRHZ_max: 200000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 50000,tRR_min: 40000,tRST_max: 250000000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 200000,tWC_min: 100000,tWH_min: 30000,tWHR_min: 120000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 50000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000002, pulse:0x0f080f08, cycle:0x000f000f, timings:0x88060483, mode:0x001f0003
nand: device found, Manufacturer ID:0x01, Chip ID:0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
onfi timings:t_prog:0x02BC,t_bers:0x2710,t_r:0x0019,t_ccs:0x0064
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 30000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 20000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 25000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 5000,tRP_min: 12000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 25000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 12000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_prepare_smcconf()failed: -524
onfi timings:t_prog:0x02BC,t_bers:0x2710,t_r:0x0019,t_ccs:0x0064
atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: -1, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 25000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 30000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 15000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 30000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 15000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000001, pulse:0x06030603, cycle:0x00060006, timings:0x88030282, mode:0x001b0003atmel-nand-controller 10000000.ebi:nand-controller:atmel_smc_nand_setup_data_interface(csline: 0, type: 0)
atmel-nand-controller 10000000.ebi:nand-controller:tBERS_max: 1410065408,tCCS_min: 100000,tPROG_max: 700000000,tR_max: 25000000 atmel-nand-controller 10000000.ebi:nand-controller:tALH_min: 5000,tADL_min: 400000,tALS_min: 10000,tAR_min: 10000 atmel-nand-controller 10000000.ebi:nand-controller:tCEA_max: 25000,tCEH_min: 20000,tCH_min: 5000,tCHZ_max: 50000 atmel-nand-controller 10000000.ebi:nand-controller:tCLH_min: 5000,tCLR_min: 10000,tCLS_min: 10000,tCOH_min: 15000 atmel-nand-controller 10000000.ebi:nand-controller:tCS_min: 25000,tDH_min: 5000,tDS_min: 10000,tFEAT_max: 1000000 atmel-nand-controller 10000000.ebi:nand-controller:tIR_min: 0,tITC_max: 1000000,tRC_min: 30000,tREA_max: 20000 atmel-nand-controller 10000000.ebi:nand-controller:tREH_min: 10000,tRHOH_min: 15000,tRHW_min: 100000,tRHZ_max: 100000 atmel-nand-controller 10000000.ebi:nand-controller:tRLOH_min: 0,tRP_min: 15000,tRR_min: 20000,tRST_max: 500000000 atmel-nand-controller 10000000.ebi:nand-controller:tWB_max: 100000,tWC_min: 30000,tWH_min: 10000,tWHR_min: 80000 atmel-nand-controller 10000000.ebi:nand-controller:tWP_min: 15000,tWW_min: 100000
atmel-nand-controller 10000000.ebi:nand-controller: smcconf: setup:0x00000001, pulse:0x06030603, cycle:0x00060006, timings:0x88030282, mode:0x001b0003Quoted 2 lines
So, the system boots again, meaning it can successfully read from the ubifs.
Cool. I'll send a patch to fix that.
Quoted 11 lines
The resulting timings are the same as in debug output:
$ devmem 0xffffec30 0x00000001 $ devmem 0xffffec34 0x06030603 $ devmem 0xffffec38 0x00060006 $ devmem 0xffffec3c 0x001B0003Quoted 4 lines
One thing I noticed is the
tBERS_maxvalue. From the0x2710in the onfi page I would assume 10000 µs, so 10.000.000 ns, so 10.000.000.000 ps, which does not fit in an u32 anymore, which gives those 1410065408 due to integer overflow.
Quoted 8 lines
Indeed, it should be an u64 not an u32.
Quoted 2 lines
I didn't check the other
timings for possible overflow, maybe you can do this?Yep, we have the same problem with
tR_maxandtPROG_max.I'll send a patch to fix that.
Just sent 3 patches to fix the bugs you reported. Can you test them and add your Reviewed-by/Tested-by? I'll try to prepare a PR this week and ask Brian to queue those fixes for 4.13-rc4.
Thanks,
Boris