I am interested in partitioning my NAND flash memory to store the stage 2 boot loader, the kernel image, and the rootfs.
When I boot my kernel and examine my MTD devices (cat /proc/mtd), partitions already exist (not sure how they were created).
dev size erasesize name
mtd0: 00080000 00010000 "Bootloader"
mtd1: 00180000 00010000 "Kernel"
mtd2: 00200000 00004000 "nand.kernel"
mtd3: 03e00000 00004000 "nand.rootfs"
mtd4: 04000000 00004000 "<NULL>"
mtd5: 04000000 00004000 "<NULL>"
I've replaced mtd3 with my own root fs (rootfs.jffs2) using nandwrite. When the stage 2 bootloader and the kernel image is loaded in RAM and executed, the linux kernel uncompresses and runs without any errors.
I used the same process above and replaced mtd2 with my own linux kernel image, and loaded the stage 2 bootloader to RAM. I get the following error when the linux kernel uncompresses:
MXC_NAND: HWECC uncorrectable 2-bit ECC error
mtd->read (0x400 bytes from 0x1e000000) returned ECC error.
Has anyone partitioned their NAND memory this way and not get the ECC error? Any comments, ideas?
Thanks.