NandFlash BCH ECC value incorrect (i.MX6-DualLite)

cancel
Showing results for 
Search instead for 
Did you mean: 

NandFlash BCH ECC value incorrect (i.MX6-DualLite)

520 Views
yunyangsihai
Contributor I

Hi guys:

   Sorry to disturb you.    
   We need to  produce a DataIO bin file with all the BSP images, and it contains ECC value.
   (Total images: uboot, zimage,    zimage.dtb, rootfs.tar.bz) We will burn the bare NandFlash chip with this DataIO bin file.
   I produce the DataIO bin file refer to the Nand chip which taken out of the mother board after burn the MFGTools and         before the first time power on. We could treat this nand chip as a bare chip.

   1. i.MX6 DualLite, NandFlash (Micron MT29F8G08ABABAWP)
   2. Nand size:1 GiB ,  Page size: 4 KiB,  Sub-page size: 4 KiB,  OOB size: 224 bytes
       Eraseblock size: 512 KiB,  128 pages per block
   3. Nand patitions:
        uboot    | uboot_env |  kernel | kernel_dtb | kernel_backup | kernel_dtb_backup | rootfs     ......
        8           |    2             |     8      |     1           |  8                      |        1                       |           ......    (MiB)
   4. Nand config and Page Layout: gf_len: 13, MetaData: 10 Byte
        Block0 size:         512 + 10 = 522Byte        Block0EccType = 16
        BlockN(1~7) size:     512Byte                    BlockNEccType = 16
        Ecc0~ECC7 size:     26Byte
   5. calculate ECC refer to kobs-ng-3.10.53-1.1.0
        init_bch();
        encode_bch();
        for () {
            ecc_buf[i] = reverse_bit(ecc_buf[i]);
        }
    Question:
        All pages in Uboot and Kernel partitions:
            data Block0(10 + 512) ECC does not match value in the bare chip from the mother board.
            data BlockN(1~7) are correct and match the bare chip taken out of the mother board.
            But there was one exception, the first page of Uboot partition are correct. (because the 1K padding?)   

Thanks in anyway.

Labels (2)
Tags (3)
0 Kudos
3 Replies

140 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi yang

reason may be that first block contains fcb and iROM uses own software

ecc algorithm for it, as described in sect.8.5.2.2 NAND Flash Boot Flow and

Boot Control Blocks (BCB)i.MX6DQ Reference Manual

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf

The FCB data structure is also protected using ECC. Driver reads raw 2112 bytes of first sector

and runs through software ECC engine that determines whether FCB data is valid or not.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

140 Views
yunyangsihai
Contributor I

Hi igorpadykov:

Thanks a lot.

1. Put simply, my question is whether or not could I produce a image(contains: ECC value, FCB, DBBT, uboot, kernel,    rootfs ......)  with the api in imx-kobs (bch.c), if not, is there one software ecc algorithm to produce this image.

2. This final image is used for factory production and we burn the bare nand chip directly with this image.

3. I have read all contents in the Chapter 8. System Boot && Chapter 17. 40-BIT Correcting ECC Accelerator (BCH) in detail. But it doesn't help me much.

0 Kudos

140 Views
igorpadykov
NXP TechSupport
NXP TechSupport

software ecc algorithm is not available, sorry. So seems one can

copy necessary block from good flash and use it.

~igor

0 Kudos