This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5718: AM571x omap2-nand probe is KO with NAND device of 8K pagesize

Part Number: AM5718


Tool/software: Linux

Hi,

On a custom board with a AM5718, I have a Micron NAND device (MT29F32G08ABAAAWP) connected to the GPMC bus.
I don't need to boot on this NAND device but I have to setup a UBI filesystem on it for an application to save data.

The NAND device has the following properties:
- 4GiB capacity
- Page size is 8KiB
- Erase size is 1MiB (1024K)
- OOB size is 448

My device tree config (DTS) is as follows:
ti,nand-ecc-opt = "bch16";
ti,elm-id = <&elm>;
nand-bus-width = <8>;
gpmc,device-width = <1>;
so I would like to use the hardware ELM feature of the Sitara to locate and correct ECC errors, meaning I'm using the nand_elm driver part.

When I boot the kernel I get the following message:
[    8.936778] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x68
[    8.942911] nand: Micron MT29F32G08ABAAAWP
[    8.956753] nand: 4096 MiB, SLC, erase size: 1024 KiB, page size: 8192, OOB size: 448
[    8.991076] using OMAP_ECC_BCH16_CODE_HW ECC scheme
[    8.995781] omap-elm 48078000.elm: unsupported config ecc-step=16
[    9.016878] omap2-nand: probe of 8000000.nand failed with error -22

My kernel is a 4.1.6 coming from the 02.00.00.00 TI SDK that I've ported on my custom board.
I have digged a bit into this issue and if I'm right it means the ONFI device protocol works well but the ELM driver cannot work with devices of pagesize > 4K.

So my questions are:
- is the Sitara's ELM engine able to handle NAND devices with pagesize=8K ?
- if yes, could you provide some patches to apply on the Linux OMAP NAND driver to deal with this hardware config ?
- if the hardware BCH16 support is not possible with my NAND device, can I get some patches to work with a software ECC management ?

Thanks for your help

  • Hi A Ma,

    I suggest you to make revision of your NAND configuration as consider description in linked Linux Core NAND User's Guide at:
    processors.wiki.ti.com/.../Linux_Core_NAND_User's_Guide
    Also when using BCH16_HW ECC is recommended to use NAND page size 4 KB.

    BR
    Tsvetolin Shulev
  • Hi,

    Thanks for your answer. I have read this wiki carefully.

    You're right in the fact it is advised to select a BCH16 HW ECC for NAND pagesize=4K only.

    But concerning the omap2 driver it is also said:

    OMAP NAND driver supports:

    • NAND devices having:
    • bus-width = x8 | x16
    • page-size = 2048 | 4096
    • block-size = 128k | 256k

    So my question is still: are the Sitara's GPMC and ELM able to manage NAND devices having pagesize=8K ?

    According to the driver's content (nand_elm.c) the ELM is able to manage 8 ECC steps max at the same time.

    It means 8 x 512bytes of data = 4K max.

    That's why I would like to confirm with you that NAND devices having pagesize=8K are not supported by the AM5718.

    In that case it would mean that we need to manage ECC entirely by software (1-bit hamming):

    - NAND driver would need to be modified because our OOB size (448) is not supported by the current NAND driver's software ECC

    - data integrity strength would be far less than expected (BCH is more powerful than Hamming to locate and correct errors)

  • Sitara AM57x does not support NAND page size 8KB. As it is described in the AM571x TRM section 33.3.7.4 NAND at:
    www.ti.com/.../spruhz7d.pdf
    Support for large page size (2048 bytes + 64 spare bytes) or very large page size (4096 bytes + 128/218 spare bytes)

    BR
    Tsvetolin Shulev