Dear Forum Members,
We are trying to setup u-boot and Linux for a custom board based on Sitara am1808 processor. We are using u-boot from arago-project (version v2009.11_DAVINCIPSP_03.20.00.14) and Linux kernel from arago project (version v2.6.37_DAVINCIPSP_03.21.00.04).
We are using a NAND flash from Micron - MT29F2G16ABAEAWP-IT, which is a 16 bit NAND chip
Initially we faced some issues in u-boot to work with the 16bit NAND flash. We made some modifications in u-boot NAND driver (davinci_nand.c) to set nand->option as NAND_BUSWIDTH_16 and also modified the ECC layout structure in NAND driver.
initial ECC layout structure was:
24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63,
And we modified to
6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63,
Now u-boot is working fine with this NAND driver and it copies and extracts the kernel from NAND to RAM and boots up the kernel.
Currently we are facing some issues in mounting jffs2 filesystem from NAND flash. The detailed error report is shown below. From the error it seems the magic bitmask 1985 is not found in some locations where it is expected, that is there are some miss alignment of data stored in NAND.
The ECC layout structure change we have done for u-boot is also done in Linux NAND driver.
Does anyone have an idea what the root cause could be?
Thank you in advance.
Best regards
Christoph
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0xffff in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xe001 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x4af8 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000038: 0xab3e in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000003c: 0xd070 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000040: 0x7264 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000044: 0xffff in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000048: 0xe002 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000050: 0x98f7 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000088: 0x4993 in
stead
Further such events for this erase block will not be printed
mtd->read(0x1ff08 bytes from 0xf8) returned ECC error
mtd->read(0x1e7fc bytes from 0x1804) returned ECC error
Empty flash at 0x00001800 ends at 0x00001818
mtd->read(0x1dffc bytes from 0x2004) returned ECC error
Empty flash at 0x00002000 ends at 0x00002014
mtd->read(0x1affc bytes from 0x5004) returned ECC error
Empty flash at 0x00005000 ends at 0x00005014
mtd->read(0x1a7fc bytes from 0x5804) returned ECC error
Empty flash at 0x00005800 ends at 0x00005814
mtd->read(0x17ffc bytes from 0x8004) returned ECC error
Empty flash at 0x00008000 ends at 0x00008014
mtd->read(0x177fc bytes from 0x8804) returned ECC error
Empty flash at 0x00008800 ends at 0x00008814
mtd->read(0xc7fc bytes from 0x13804) returned ECC error
Empty flash at 0x00013800 ends at 0x00013814
mtd->read(0xbffc bytes from 0x14004) returned ECC error
Empty flash at 0x00014000 ends at 0x00014014
mtd->read(0xa7fc bytes from 0x15804) returned ECC error
Empty flash at 0x00015800 ends at 0x00015814
mtd->read(0x87fc bytes from 0x17804) returned ECC error
Empty flash at 0x00017800 ends at 0x00017810
mtd->read(0x4ffc bytes from 0x1b004) returned ECC error
Empty flash at 0x0001b000 ends at 0x0001b014
mtd->read(0x3ffc bytes from 0x1c004) returned ECC error
Empty flash at 0x0001c000 ends at 0x0001c014
jffs2_scan_inode_node(): CRC failed on node at 0x0001c7f4: Read 0x00000006, calc
ulated 0xaf335bbf
mtd->read(0x27fc bytes from 0x1d804) returned ECC error
Empty flash at 0x0001d800 ends at 0x0001d814
Node at 0x0001fd04 with length 0x00000317 would run over the end of the erase bl
ock
Perhaps the file system was created with the wrong erase size?
mtd->read(0x100 bytes from 0x20000) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020014: 0xffff in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020018: 0xe002 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020020: 0x67a8 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020054: 0xc645 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020058: 0x5d76 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002005c: 0x56a4 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020060: 0xd71c in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020064: 0xf773 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020068: 0x6ad6 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002006c: 0x1084 in
stead
Further such events for this erase block will not be printed
mtd->read(0x1ff08 bytes from 0x200f8) returned ECC error
mtd->read(0x1d7ec bytes from 0x22814) returned ECC error
Empty flash at 0x00022810 ends at 0x00022818
mtd->read(0x197fc bytes from 0x26804) returned ECC error
Empty flash at 0x00026800 ends at 0x00026814
mtd->read(0x15ffc bytes from 0x2a004) returned ECC error
Empty flash at 0x0002a000 ends at 0x0002a014
mtd->read(0x147fc bytes from 0x2b804) returned ECC error
Empty flash at 0x0002b800 ends at 0x0002b814
mtd->read(0x13ffc bytes from 0x2c004) returned ECC error
Empty flash at 0x0002c000 ends at 0x0002c014
mtd->read(0x137fc bytes from 0x2c804) returned ECC error
Empty flash at 0x0002c800 ends at 0x0002c814
jffs2_scan_inode_node(): CRC failed on node at 0x00031fe0: Read 0x5a41998d, calc
ulated 0xa5e78104
mtd->read(0x27fc bytes from 0x3d804) returned ECC error
Empty flash at 0x0003d800 ends at 0x0003d814
mtd->read(0x1ffc bytes from 0x3e004) returned ECC error
Empty flash at 0x0003e000 ends at 0x0003e018
mtd->read(0x17fc bytes from 0x3e804) returned ECC error
Empty flash at 0x0003e800 ends at 0x0003e814
Node at 0x0003f6b4 with length 0x00000962 would run over the end of the erase bl
ock
Perhaps the file system was created with the wrong erase size?
mtd->read(0x7fc bytes from 0x3f804) returned ECC error
Empty flash at 0x0003f800 ends at 0x0003f814
mtd->read(0x100 bytes from 0x40000) returned ECC error
mtd->read(0x1fc20 bytes from 0x403e0) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000403e0: 0xffff in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000403e4: 0xe002 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000403ec: 0xfd6f in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040400: 0x0001 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040420: 0x9364 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040424: 0x2b2c in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040428: 0x5784 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004042c: 0x5753 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040430: 0x242f in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040434: 0x0100 in
stead
Further such events for this erase block will not be printed
mtd->read(0x1f7fc bytes from 0x40804) returned ECC error
Empty flash at 0x00040800 ends at 0x00040814
mtd->read(0x1effc bytes from 0x41004) returned ECC error
Empty flash at 0x00041000 ends at 0x00041014
mtd->read(0x1cffc bytes from 0x43004) returned ECC error
Empty flash at 0x00043000 ends at 0x00043014
mtd->read(0x1bffc bytes from 0x44004) returned ECC error
Empty flash at 0x00044000 ends at 0x00044014
mtd->read(0x1b7fc bytes from 0x44804) returned ECC error
Empty flash at 0x00044800 ends at 0x00044814
mtd->read(0x187fc bytes from 0x47804) returned ECC error
Empty flash at 0x00047800 ends at 0x00047814
mtd->read(0x167fc bytes from 0x49804) returned ECC error
Empty flash at 0x00049800 ends at 0x00049814
mtd->read(0x15ffc bytes from 0x4a004) returned ECC error
Empty flash at 0x0004a000 ends at 0x0004a014
Node at 0x0005fc58 with length 0x000003bf would run over the end of the erase bl
ock
Perhaps the file system was created with the wrong erase size?
mtd->read(0x100 bytes from 0x60000) returned ECC error
mtd->read(0x1f858 bytes from 0x607a8) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00061234: 0x5a00 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00061238: 0xff03 in
stead
jffs2_scan_inode_node(): CRC failed on node at 0x0006f7f4: Read 0x228e2f1c, calc
ulated 0x9bf726f2
mtd->read(0x67f0 bytes from 0x79810) returned ECC error
Empty flash at 0x0007980c ends at 0x00079814
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079814: 0x0045 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079818: 0x81ed in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079820: 0xf910 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079830: 0x3000 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079834: 0x03c3 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079838: 0x1000 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007983c: 0x0006 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00079840: 0x1d05 in
stead
Further such events for this erase block will not be printed
mtd->read(0x37fc bytes from 0x7c804) returned ECC error
Empty flash at 0x0007c800 ends at 0x0007c814
mtd->read(0x2ffc bytes from 0x7d004) returned ECC error
Empty flash at 0x0007d000 ends at 0x0007d014
Node at 0x0007f788 with length 0x0000088e would run over the end of the erase bl
ock
Perhaps the file system was created with the wrong erase size?
mtd->read(0x7fc bytes from 0x7f804) returned ECC error
Empty flash at 0x0007f800 ends at 0x0007f814
mtd->read(0x100 bytes from 0x80000) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080014: 0xffff in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080018: 0xe002 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080020: 0x5107 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080034: 0x0004 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080044: 0x0004 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080054: 0xe7a7 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080058: 0x2d9d in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0008005c: 0xd02c in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080060: 0x5143 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080064: 0x6bf0 in
stead
Further such events for this erase block will not be printed
mtd->read(0x1ff08 bytes from 0x800f8) returned ECC error
mtd->read(0x1a7fc bytes from 0x85804) returned ECC error
Empty flash at 0x00085800 ends at 0x00085814
mtd->read(0x19ffc bytes from 0x86004) returned ECC error
Empty flash at 0x00086000 ends at 0x00086014
mtd->read(0x177fc bytes from 0x88804) returned ECC error
Empty flash at 0x00088800 ends at 0x00088814
mtd->read(0x16ffc bytes from 0x89004) returned ECC error
Empty flash at 0x00089000 ends at 0x00089014
mtd->read(0x10ffc bytes from 0x8f004) returned ECC error
Empty flash at 0x0008f000 ends at 0x0008f014
mtd->read(0x107fc bytes from 0x8f804) returned ECC error
Empty flash at 0x0008f800 ends at 0x0008f814
mtd->read(0x7ffc bytes from 0x98004) returned ECC error
Empty flash at 0x00098000 ends at 0x00098014
Node at 0x0009fcb8 with length 0x00000360 would run over the end of the erase bl
ock
Perhaps the file system was created with the wrong erase size?
mtd->read(0x100 bytes from 0xa0000) returned ECC error
mtd->read(0x1f898 bytes from 0xa0768) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a0768: 0xff53 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a1bd8: 0xffe2 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a42c8: 0xe002 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a42d0: 0x670d in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a4304: 0x2717 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a4308: 0x4f1c in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a430c: 0x57cc in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a4310: 0xe753 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a4314: 0xbe76 in
stead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000a4318: 0x64f2 in
stead
Further such events for this erase block will not be printed
mtd->read(0x1b7fc bytes from 0xa4804) returned ECC error
Empty flash at 0x000a4800 ends at 0x000a4814
mtd->read(0x1a7fc bytes from 0xa5804) returned ECC error
Empty flash at 0x000a5800 ends at 0x000a5814
mtd->read(0x19ffc bytes from 0xa6004) returned ECC error
Empty flash at 0x000a6000 ends at 0x000a6014
mtd->read(0x177fc bytes from 0xa8804) returned ECC error
Empty flash at 0x000a8800 ends at 0x000a8814
mtd->read(0x14ffc bytes from 0xab004) returned ECC error
Empty flash at 0x000ab000 ends at 0x000ab014