I programmed my iMX25 board Flash memories with zImage and rootfs provided on Freescale CD/ROM. When I boot the board, here is what happens:
JFFS2 doesn't use OOB.
Empty flash at 0x033c81f4 ends at 0x033c8800
Empty flash at 0x033dd0e4 ends at 0x033dd800
Empty flash at 0x033e2828 ends at 0x033e3000
Empty flash at 0x033e8a1c ends at 0x033e9000
Empty flash at 0x033ef1c4 ends at 0x033ef800
Empty flash at 0x033f3138 ends at 0x033f3800
Empty flash at 0x033f5168 ends at 0x033f5800
Empty flash at 0x033f8004 ends at 0x033f8800
jffs2_scan_inode_node(): CRC failed on node at 0x03bc5ff4: Read 0xffffffff, calculated 0x1490a44b
Empty flash at 0x03bc62c0 ends at 0x03bc6800
Empty flash at 0x03bcca60 ends at 0x03bcd000
Empty flash at 0x03bd50ac ends at 0x03bd5800
Empty flash at 0x03bd924c ends at 0x03bd9800
Empty flash at 0x03bdc9d8 ends at 0x03bdd000
VFS: Mounted root (jffs2 filesystem).
Another information: There seems to be as if the rootfs.jffs2 file has not been taken into account when programming the flash because I can find old files previously created in the Flash when I log on the board.
Furthermore, the kernel reports many CRC errors:
freescale login: JFFS2 notice: (1668) check_node_data: wrong data CRC in data node at 0x03bcc738: read 0xa178a97.
JFFS2 notice: (1668) check_node_data: wrong data CRC in data node at 0x033c7f80: read 0x142a2a46, calculated 0x4.
JFFS2 warning: (1668) jffs2_do_read_inode_internal: Truncating ino #6724 to 10499 bytes failed because it only h!
JFFS2 warning: (1668) jffs2_do_read_inode_internal: Truncating ino #7199 to 35679 bytes failed because it only h!
JFFS2 notice: (1668) check_node_data: wrong data CRC in data node at 0x033ff4fc: read 0x83a92d71, calculated 0x3.
I performed a fis init before importing the images and programming the flash. Do I have to perform an erase operation?
Does someone know what "JFFS2 doesn't use OOB" mean?
Regards
I found this, Which might help to explain what OOB is. It must stand for out of band. I got it from this web page.
http://www.linux-mtd.infradead.org/archive/tech/faq.html
Must my bootloader be aware of NAND FLASH ?
Yes, if you use your bootloader to erase the FLASH chip and copy a filesystem image to it. For erase make sure, that you don't erase factory-marked bad blocks. They are marked in the 6th byte (offset 0x5) in the out of band area of the first page of a block. The block is bad, if any bit in this byte is zero. If you erase such a block, the bad block information is erased too and lost. Further use of this block will lead to erroneous results
For JFFS2 filesystems it's recommended to programm the JFFS2 erased marker into the out of band area of the first page in each erased block after erasing the block. Do not program it into the data area of the page !
For 256 byte pagesize devices program the following data into the out of band area:
Offset | 0x06 | 0x07 |
Data | 0x85 | 0x19 |
For 512 byte pagesize devices program the following data into the out of band area:
Offset | 0x08 | 0x09 | 0x0a | 0x0b | 0x0c | 0x0d | 0x0e | 0x0f |
Data | 0x85 | 0x19 | 0x03 | 0x20 | 0x08 | 0x00 | 0x00 | 0x00 |
If you copy a filesystem image to the chip, it's recommended to write it with ECC. You can use the ECC code in the nand driver to do this. If you have a bad block on your chip, just skip this block and copy the data to the next block. JFFS2 and other NAND flash aware filesystems handle this gap.