AnsweredAssumed Answered

i.MX6Q NAND Flash in Linux

Question asked by mahi on Apr 26, 2018
Latest reply on Apr 26, 2018 by mahi

Hi Community,

 

I have problems bringing up our custom board with NAND Flash using release-bsp 4.1.15-2.0.0.

In u-boot, I can access the flash without issues, so I think board and assembly are OK. In Linux, the NAND device is detected, but as soon as I try to access it in any way, I get the lollowing Error:

 

gpmi-nand 112000.gpmi-nand: DMA timeout, last DMA :2
gpmi-nand 112000.gpmi-nand: Show GPMI registers :
gpmi-nand 112000.gpmi-nand: offset 0x000 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x010 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x020 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x030 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x040 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x050 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x060 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x070 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x080 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x090 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x0a0 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x0b0 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x0c0 : 0xffffffff
gpmi-nand 112000.gpmi-nand: offset 0x0d0 : 0xffffffff
gpmi-nand 112000.gpmi-nand: Show BCH registers :
gpmi-nand 112000.gpmi-nand: offset 0x000 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x010 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x020 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x030 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x040 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x050 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x060 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x070 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x080 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x090 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0a0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0b0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0c0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0d0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0e0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x0f0 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x100 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x110 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x120 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x130 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x140 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x150 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x160 : 0x00000000
gpmi-nand 112000.gpmi-nand: offset 0x170 : 0x00000000
gpmi-nand 112000.gpmi-nand: BCH Geometry :
GF length              : 13
ECC Strength           : 8
Page Size in Bytes     : 2110
Metadata Size in Bytes : 10
ECC Chunk0 Size in Bytes: 512
ECC Chunkn Size in Bytes: 512
ECC Chunk Count        : 4
Payload Size in Bytes  : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 1999
Block Mark Bit Offset  : 0
gpmi-nand 112000.gpmi-nand: Chip: 0, Error -110
libmtd: error!: MEMERASE64 ioctl gpmi-nand 112000.gpmi-nand: Chip: 0, Error -22
failed for eraseblock 0 (mtd0)
 gpmi-nand 112000.gpmi-nand: Chip: 0, Error -22
       error 5 (Input/output errogpmi-nand 112000.gpmi-nand: Chip: 0, Error -22
r)
flash_erase: error!: /dev/mtdgpmi-nand 112000.gpmi-nand: Chip: 0, Error -22
0: MTD Erase failure

 

Kernel-Logs:

nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xaa
nand: Micron MT29F2G08ABBGAH4
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
Scanning device for bad blocks
1 cmdlinepart partitions found on MTD device gpmi-nand
Creating 1 MTD partitions on "gpmi-nand":
0x000000000000-0x000010000000 : "nand"
gpmi-nand 112000.gpmi-nand: driver registered.

 

mtdinfo:

bash-4.3# mtdinfo -a
Count of MTD devices:           1
Present MTD devices:            mtd0
Sysfs interface supported:      yes

mtd0
Name:                           nand
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          2048 (268435456 bytes, 256.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       128 bytes
Character device major/minor:   90:0
Bad blocks are allowed:         true
Device is writable:             true

 

Device Tree:

#include "imx6q.dtsi"

...

&iomuxc {

        pinctrl_gpmi: gmpigrp {
            fsl,pins = <
                MX6QDL_PAD_NANDF_ALE__NAND_ALE             0x0000B0B1
                MX6QDL_PAD_NANDF_CLE__NAND_CLE             0x0000B0B1
                MX6QDL_PAD_NANDF_CS0__NAND_CE0_B           0x0000B0B1
                MX6QDL_PAD_NANDF_D0__NAND_DATA00           0x0000B0B1
                MX6QDL_PAD_NANDF_D1__NAND_DATA01           0x0000B0B1
                MX6QDL_PAD_NANDF_D2__NAND_DATA02           0x0000B0B1
                MX6QDL_PAD_NANDF_D3__NAND_DATA03           0x0000B0B1
                MX6QDL_PAD_NANDF_D4__NAND_DATA04           0x0000B0B1
                MX6QDL_PAD_NANDF_D5__NAND_DATA05           0x0000B0B1
                MX6QDL_PAD_NANDF_D6__NAND_DATA06           0x0000B0B1
                MX6QDL_PAD_NANDF_D7__NAND_DATA07           0x0000B0B1
                MX6QDL_PAD_NANDF_RB0__NAND_READY_B         0x0000B000
                MX6QDL_PAD_NANDF_WP_B__NAND_WP_B           0x0000B0B1
                MX6QDL_PAD_SD4_CLK__NAND_WE_B              0x0000B0B1
                MX6QDL_PAD_SD4_CMD__NAND_RE_B              0x0000B0B1
                MX6QDL_PAD_SD4_DAT0__NAND_DQS              0x000000B1
            >;
        };

...

};

 

&gpmi {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_gpmi>;
   status = "okay";
};

 

 

Any ideas, what could be wrong?

Outcomes