GPMI interface not working on imx6SoloX with kernel 3.14.52

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPMI interface not working on imx6SoloX with kernel 3.14.52

4,833 Views
arkadiuszkaras
Contributor I

Hello,

I have custom board with imx6soloX processor. Design is based on sabreauto.

I have tested it successfully with Linux kernel 3.24.28 - branch imx_3.14.28_1.0.0_ga from git.freescale.com

Now I am trying to switch to Linux version 3.14.52 - branch imx_3.14.52_1.1.0_ga and I have a problem with NAND flash controller. It does not initialize properly.

On console output I've got:

[1.130823] gpmi_reset_block(908ec000): module reset timeout
[1.136518] gpmi-nand 1806000.gpmi-nand: driver registration failed: -110
[1.143374] gpmi-nand: probe of 1806000.gpmi-nand failed with error -110

NAND flash is correctly recognized by u-boot and also it works properly with older kernel:

[1.326701] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
[1.333087] nand: Winbond W29N01HV
[1.336498] nand: 128MiB, SLC, page size: 2048, OOB size: 64
[1.342310] gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.
[1.348954] Scanning device for bad blocks
[1.356986] Bad eraseblock 42 at 0x000000540000
[1.415232] Bad eraseblock 632 at 0x000004f00000
[1.455462] 5 cmdlinepart partitions found on MTD device gpmi-nand
[1.461668] Creating 5 MTD partitions on "gpmi-nand":
[1.466730] 0x000000000000-0x000000100000 : "fdt"
[1.472156] 0x000000100000-0x000000900000 : "kernel"
[1.477770] 0x000000900000-0x000002900000 : "rootfs"
[1.483442] 0x000002900000-0x000004900000 : "logs"
[1.488945] 0x000004900000-0x000008000000 : "app"
[1.494353] gpmi-nand 1806000.gpmi-nand: driver registered.

Could you please give me some advice how to solve this issue ?

Best Regards

Arkadiusz Karaś

Labels (2)
0 Kudos
14 Replies

2,917 Views
hengyewlim
Contributor III

I have patched the code and still do not see much improvement. I am still getting random read error with DMA.

I have change the PAD settings for the NAND pins and are getting better stability with the NAND flash. But I still need to test for a few days.

I still need to try flashing a blank board with the new pad setting to see whether I am still getting the bad blocks on block0.

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

May lower clock freq mitigate the issue?

0 Kudos

2,917 Views
hengyewlim
Contributor III

I checked the code and need some clarification before lowering the clock freq of the gpmi module.

u-boot set the clock as 100MHz but the linux source code(gpmi-nand.c) is setting to 22MHz.

....

if (GPMI_IS_MX6(this) || GPMI_IS_MX7(this))

/*

* Set the default value for the gpmi clock.

*

* If you want to use the ONFI nand which is in the

* Synchronous Mode, you should change the clock as you need.

*/

clk_set_rate(r->clock[0], 22000000);

....


root@viper ~$ memtool 20c4000 10I have checked the register and did not find it to 22Mhz.

Reading 0x10 count starting at address 0x020C4000


0x020C4000:  0401107F 00020000 00000038 00000104

0x020C4010:  00000000 00018900 00A69114 4510A9C0

0x020C4020:  13212C06 00490B00 0EC302C3 0014B6C3

0x020C4030:  32474792 00021148 00011150 00011041

PLL2/6  = 528/6 =88MHZ

So what should be the correct clock rate to run NAND read @50MHz?

pastedImage_4.png

Also how do we change the drive strength for the pins?

I did not encounter DMA errors from NAND after changing the pad settings just need to understand the clock requirement of the gpmi interface.

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

22MHz is the clock rate for initial stage, the clock might be changed according to EDO async mode according to ONFI parameters. Refer to  gpmi_extra_init in gpmi-lib.c

To change the kernel pin drive strength were defined in device tree file.

Do you mind to show me which pad setting works stable for this NAND chip? Thanks.

0 Kudos

2,917 Views
hengyewlim
Contributor III

Then I do not think I need to change the clock because 100Mhz or 88Mhz works fine for us.

I will check the Nand timing registers in both bootloader and kernel.

We have decided to use Micron Nand as it is not giving the bad block error.

Here is the PAD settings for GPMI.

pinctrl_gpmi_nand_1: gpmi-nand-1 {

fsl,pins = <

MX6SX_PAD_NAND_ALE__RAWNAND_ALE         0xb0a1

MX6SX_PAD_NAND_CLE__RAWNAND_CLE         0xb0a1

MX6SX_PAD_NAND_WP_B__RAWNAND_WP_B       0xb0a1

MX6SX_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000

MX6SX_PAD_NAND_CE0_B__RAWNAND_CE0_B     0xb0a1

MX6SX_PAD_NAND_RE_B__RAWNAND_RE_B       0xb0a1

MX6SX_PAD_NAND_WE_B__RAWNAND_WE_B       0xb0a1

MX6SX_PAD_NAND_DATA00__RAWNAND_DATA00   0xf0b9

MX6SX_PAD_NAND_DATA01__RAWNAND_DATA01   0xf0b9

MX6SX_PAD_NAND_DATA02__RAWNAND_DATA02   0xf0b9

MX6SX_PAD_NAND_DATA03__RAWNAND_DATA03   0xf0b9

MX6SX_PAD_NAND_DATA04__RAWNAND_DATA04   0xf0b9

MX6SX_PAD_NAND_DATA05__RAWNAND_DATA05   0xf0b9

MX6SX_PAD_NAND_DATA06__RAWNAND_DATA06   0xf0b9

MX6SX_PAD_NAND_DATA07__RAWNAND_DATA07   0xf0b9

>;

};

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

I tested the 3.14.52 with Micron NAND and seems it works fine, so do you have any chance to try with other NAND chips to identify it's a driver issue or compatibility issue? I will check if the Winbond W29N01HV need any special config, but I really doubt since 3.14.28 could support it.

Starting kernel ...

Booting Linux on physical CPU 0x0

Linux version 3.14.52-02808-gcec2a2e (b45815@chopperman) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #141 SMP PREEMPT Wed Jan 13 18:04:14 CST 2016

CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Truncating memory at 0x80000000 to fit in 32-bit physical address space

Machine model: Freescale i.MX6 SoloX Sabre Auto Board

......

fsl-quadspi 21e0000.qspi: n25q256a (32768 Kbytes)

fsl-quadspi 21e0000.qspi: n25q256a (32768 Kbytes)

fsl-quadspi 21e0000.qspi: QuadSPI SPI NOR flash driver

nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x68

nand: Micron MT29F64G08AFAAAWP

nand: 4096MiB, SLC, page size: 8192, OOB size: 448

nand: 2 chips detected

gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5

Bad block table found at page 524160, version 0x01

Bad block table found at page 1048448, version 0x01

Bad block table found at page 524032, version 0x01

Bad block table found at page 1048320, version 0x01

nand_read_bbt: bad block at 0x000005a00000

nand_read_bbt: bad block at 0x000005b00000

nand_read_bbt: bad block at 0x000105a00000

nand_read_bbt: bad block at 0x000105b00000

nand_read_bbt: bad block at 0x000119000000

nand_read_bbt: bad block at 0x000172400000

nand_read_bbt: bad block at 0x00017ea00000

nand_read_bbt: bad block at 0x0001c1000000

nand_read_bbt: bad block at 0x0001c6800000

1 cmdlinepart partitions found on MTD device gpmi-nand

Creating 1 MTD partitions on "gpmi-nand":

0x000000000000-0x000200000000 : "boot"

......

0 Kudos

2,917 Views
hengyewlim
Contributor III

Hi Xu Han,

I was trying to boot up from NAND for a custom MX6SoloX board with reference from MX6SX.

It seems like u-boot is not flashed properly.

The kobs-ng dump is returning ERROR. (see logs below captured from mfgtools2)

Can you provide some ideas what might be wrong for me to debug further?

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1

nand: Winbond W29N01GV

nand: 128MiB, SLC, page size: 2048, OOB size: 64

gpmi-nand 1806000.gpmi-nand: set feature 1 mode 4

gpmi-nand 1806000.gpmi-nand: geet feature 1 mode 0

gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.

Bad block table found at page 65472, version 0x01

Bad block table found at page 65408, version 0x01

nand_read_bbt: bad block at 0x000000000000

nand_read_bbt: bad block at 0x000000020000

nand_read_bbt: bad block at 0x000000080000

nand_read_bbt: bad block at 0x0000000a0000

nand_read_bbt: bad block at 0x0000000c0000

nand_read_bbt: bad block at 0x0000000e0000

nand_read_bbt: bad block at 0x000000100000

nand_read_bbt: bad block at 0x000000120000

nand_read_bbt: bad block at 0x000000140000

nand_read_bbt: bad block at 0x000000160000

nand_read_bbt: bad block at 0x000000180000

nand_read_bbt: bad block at 0x0000001a0000

nand_read_bbt: bad block at 0x0000001c0000

nand_read_bbt: bad block at 0x0000001e0000

nand_read_bbt: bad block at 0x000000200000

nand_read_bbt: bad block at 0x000000220000

nand_read_bbt: bad block at 0x000000240000

nand_read_bbt: bad block at 0x000000260000

4 cmdlinepart partitions found on MTD device gpmi-nand

Creating 4 MTD partitions on "gpmi-nand":

0x000000000000-0x000004000000 : "boot"

0x000004000000-0x000005000000 : "kernel"

0x000005000000-0x000006000000 : "dtb"

0x000006000000-0x000008000000 : "rootfs"

gpmi-nand 1806000.gpmi-nand: driver registered.

2188000.ethernet supply phy not found, using dummy regulator

pps pps0: new PPS source ptp0

...

UTP: sending Success to kernel for command $ mount -t debugfs debugfs /sys/kernel/debug.

utp_poll: pass returned.

UTP: received command '$ mtdinfo'

UTP: executing "mtdinfo"

Count of MTD devices:           4

Present MTD devices:            mtd0, mtd1, mtd2, mtd3

Sysfs interface supported:      yes

UTP: sending Success to kernel for command $ mtdinfo.

utp_poll: pass returned.

UTP: received command '$ flash_erase /dev/mtd0 0 0'

UTP: executing "flash_erase /dev/mtd0 0 0"

flash_erase: Skipping bad block at 00000000

flash_erase: Skipping bad block at 00020000

Erasing 128 Kibyte @ 60000 --  0 % complete flash_erase: Skipping bad block at 00080000

flash_erase: Skipping bad block at 000a0000

flash_erase: Skipping bad block at 000c0000

flash_erase: Skipping bad block at 000e0000

flash_erase: Skipping bad block at 00100000

flash_erase: Skipping bad block at 00120000

flash_erase: Skipping bad block at 00140000

flash_erase: Skipping bad block at 00160000

flash_erase: Skipping bad block at 00180000

flash_erase: Skipping bad block at 001a0000

flash_erase: Skipping bad block at 001c0000

flash_erase: Skipping bad block at 001e0000

flash_erase: Skipping bad block at 00200000

flash_erase: Skipping bad block at 00220000

flash_erase: Skipping bad block at 00240000

flash_erase: Skipping bad block at 00260000

Erasing 128 Kibyte @ 3fe0000 -- 100 % complete

UTP: sending Success to kernel for command $ flash_erase /dev/mtd0 0 0.

utp_poll: pass returned.

UTP: received command 'send'

UTP: sending Success to kernel for command send.

UTP: received command '$ kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE'

UTP: executing "kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE"

MTD CONFIG:

  chip_0_device_path = "/dev/mtd0"

  chip_1_device_path = "(null)"

  search_exponent = 2

  data_setup_time = 80

  data_hold_time = 60

  address_setup_time = 25

  data_sample_time = 6

  row_address_size = 3

  column_address_size = 2

  read_command_code1 = 0

  read_command_code2 = 48

  boot_stream_major_version = 1

  boot_stream_minor_version = 0

  boot_stream_sub_version = 0

  ncb_version = 3

  boot_stream_1_address = 0

  boot_stream_2_address = 0

         -- We add the 1k-padding to the uboot.

.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'

.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'

mtd: opening: "/dev/mtd0"

mtd: '/dev/mtd0' bad block @ 0x100000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x120000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x140000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x160000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x180000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1a0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1c0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1e0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x200000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x220000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x240000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x260000 (MTD)

NFC geometry :

        ECC Strength       : 2

        Page Size in Bytes : 2071

        Metadata size      : 10

        ECC Chunk Size in byte : 512

        ECC Chunk count        : 4

        Block Mark Byte Offset : 2028

        Block Mark Bit Offset  : 2

====================================================

mtd: opened '/dev/mtd0' - '(null)'

mtd: max_boot_stream_size_in_bytes = 33030144

mtd: boot_stream_size_in_bytes = 319488

mtd: boot_stream_size_in_pages = 156

mtd: #1 0x00100000 - 0x02080000 (0x0014e000)

mtd: #2 0x02080000 - 0x04000000 (0x020ce000)

FCB

  m_u32Checksum = 0x00000000

  m_u32FingerPrint = 0x20424346

  m_u32Version = 0x01000000

  m_NANDTiming.m_u8DataSetup = 80

  m_NANDTiming.m_u8DataHold = 60

  m_NANDTiming.m_u8AddressSetup = 25

  m_NANDTiming.m_u8DSAMPLE_TIME = 6

  m_u32PageDataSize = 2048

  m_u32TotalPageSize = 2112

  m_u32SectorsPerBlock = 64

  m_u32NumberOfNANDs = 0

  m_u32TotalInternalDie = 0

  m_u32CellType = 0

  m_u32EccBlockNEccType = 1

  m_u32EccBlock0Size = 512

  m_u32EccBlockNSize = 512

  m_u32EccBlock0EccType = 1

  m_u32MetadataBytes = 10

  m_u32NumEccBlocksPerPage = 3

  m_u32EccBlockNEccLevelSDK = 0

  m_u32EccBlock0SizeSDK = 0

  m_u32EccBlockNSizeSDK = 0

  m_u32EccBlock0EccLevelSDK = 0

  m_u32NumEccBlocksPerPageSDK = 0

  m_u32MetadataBytesSDK = 0

  m_u32EraseThreshold = 0

  m_u32Firmware1_startingPage = 512

  m_u32Firmware2_startingPage = 16640

  m_u32PagesInFirmware1 = 156

  m_u32PagesInFirmware2 = 156

  m_u32DBBTSearchAreaStartAddress = 256

  m_u32BadBlockMarkerByte = 2028

  m_u32BadBlockMarkerStartBit = 2

  m_u32BBMarkerPhysicalOffset = 2048

  m_u32BCHType = 0

  m_NANDTMTiming.m_u32TMTiming2_ReadLatency = 0

  m_NANDTMTiming.m_u32TMTiming2_PreambleDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_CEDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_PostambleDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_CmdAddPause = 0

  m_NANDTMTiming.m_u32TMTiming2_DataPause = 0

  m_NANDTMTiming.m_u32TMSpeed = 0

  m_NANDTMTiming.m_u32TMTiming1_BusyTimeout = 0

  m_u32DISBBM = 0

  m_u32BBMarkerPhysicalOffsetInSpareData = 0

  m_u32OnfiSyncEnable = 0

  m_NANDONFITiming.m_u32ONFISpeed = 0

  m_NANDONFITiming.m_u32ONFITiming_ReadLatency = 0

  m_NANDONFITiming.m_u32ONFITiming_CEDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_PreambleDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_PostambleDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_CmdAddPause = 0

  m_NANDONFITiming.m_u32ONFITiming_DataPause = 0

  m_NANDONFITiming.m_u32ONFITiming_BusyTimeout = 0

  m_u32DISBBSearch = 0

  m_u32RandomizerEnable = 0

  m_u32ReadRetryEnable = 0

  m_u32ReadRetrySeqLength = 0

DBBT

  m_u32Checksum = 0x00000000

  m_u32FingerPrint = 0x54424244

  m_u32Version = 0x01000000

  m_u32DBBTNumOfPages = 1

BBTN#0

  uNAND = 0

  uNumberBB = 12

  BADBLOCKS:

     0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13

Firmware: image #0 @ 0x100000 size 0x4e000 - available 0x1f80000

Firmware: image #1 @ 0x2080000 size 0x4e000 - available 0x1f80000

-------------- Start to write thenand: nand_erase_nand: attempt to erase a bad block at page 0x00000000

[ FCB ] -----

mtd: erasing @0:0nand: nand_erase_nand: attempt to erase a bad block at page 0x00000040

x0-0x20000

mtd: device 0 fails MEMERASE (0x0 - 0x20000)

mtd: Fanand: nand_erase_nand: attempt to erase a bad block at page 0x00000100

iled to erase block @0x0

mtd: ernand: nand_erase_nand: attempt to erase a bad block at page 0x00000140

asing @0:0x20000-0x40000

mtd: denand: nand_erase_nand: attempt to erase a bad block at page 0x00000180

vice 0 fails MEMERASE (0x20000 - nand: nand_erase_nand: attempt to erase a bad block at page 0x000001c0

0x20000)

mtd: Failed to erase block @0x20000

mtd: erasing @0:0x40000-0x60000

mtd: Writing FCB2 [ @0:0x40000 ] (840) *

mtd: erasing @0:0x60000-0x80000

mtd: Writing FCB3 [ @0:0x60000 ] (840) *

mtd_commit_bcb(FCB): status 2

-------------- Start to write the [ DBBT ] -----

mtd: erasing @0:0x80000-0xa0000

mtd: device 0 fails MEMERASE (0x80000 - 0x20000)

mtd: Failed to erase block @0x80000

mtd: erasing @0:0xa0000-0xc0000

mtd: device 0 fails MEMERASE (0xa0000 - 0x20000)

mtd: Failed to erase block @0xa0000

mtd: erasing @0:0xc0000-0xe0000

mtd: device 0 fails MEMERASE (0xc0000 - 0x20000)

mtd: Failed to erase block @0xc0000

mtd: erasing @0:0xe0000-0x100000

mtd: device 0 fails MEMERASE (0xe0000 - 0x20000)

mtd: Failed to erase block @0xe0000

mtd_commit_bcb(DBBT): status 4

mtd: PUTTING down DBBT0 BBTN0 @0x82000 (0x800)

mtd: PUTTING down DBBT1 BBTN0 @0xa2000 (0x800)

mtd: PUTTING down DBBT2 BBTN0 @0xc2000 (0x800)

mtd: PUTTING down DBBT3 BBTN0 @0xe2000 (0x800)

---------- Start to write the [ .tmp_kobs_ng ]----

mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x0014e000

mtd: Skipping bad block at 0x100000

mtd: Skipping bad block at 0x120000

mtd: Skipping bad block at 0x140000

mtd: Skipping bad block at 0x160000

mtd: Skipping bad block at 0x180000

mtd: Skipping bad block at 0x1a0000

mtd: Skipping bad block at 0x1c0000

mtd: Skipping bad block at 0x1e0000

mtd: Skipping bad block at 0x200000

mtd: Skipping bad block at 0x220000

mtd: Skipping bad block at 0x240000

mtd: Skipping bad block at 0x260000

mtd: erasing @0:0x280000-0x2a0000

mtd: erasing @0:0x2a0000-0x2c0000

mtd: erasing @0:0x2c0000-0x2e0000

mtd: We write one page for save guard. *

mtd: Writting .tmp_kobs_ng: #1 @0: 0x02080000 - 0x020ce000

mtd: erasing @0:0x2080000-0x20a0000

mtd: erasing @0:0x20a0000-0x20c0000

mtd: erasing @0:0x20c0000-0x20e0000

mtd: We write one page for save gutp_poll: pass returned.

uard. *

UTP: sending Success to kernel for command $ kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE.

UTP: received command '$ kobs-ng dump -v'

UTP: executing "kobs-ng dump -v"

MTD CONFIG:

  chip_0_device_path = "/dev/mtd0"

  chip_1_device_path = "(null)"

  search_exponent = 2

  data_setup_time = 80

  data_hold_time = 60

  address_setup_time = 25

  data_sample_time = 6

  row_address_size = 3

  column_address_size = 2

  read_command_code1 = 0

  read_command_code2 = 48

  boot_stream_major_version = 1

  boot_stream_minor_version = 0

  boot_stream_sub_version = 0

  ncb_version = 3

  boot_stream_1_address = 0

  boot_stream_2_address = 0

mtd: opening: "/dev/mtd0"

mtd: '/dev/mtd0' bad block @ 0x100000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x120000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x140000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x160000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x180000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1a0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1c0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1e0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x200000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x220000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x240000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x260000 (MTD)

NFC geometry :

        ECC Strength       : 2

        Page Size in Bytes : 2071

        Metadata size      : 10

        ECC Chunk Size in byte : 512

        ECC Chunk count        : 4

        Block Mark Byte Offset : 2028

        Block Mark Bit Offset  : 2

====================================================

mtd: opened '/dev/mtd0' - '(null)'

mtd: partition #0

  type = 4

  flags = 1024

  size = 67108864

  erasesize = 131072

  writesize = 2048

  oobsize = 64

  blocks = 512

  BAD: 0x100000 0x120000 0x140000 0x160000 0x180000 0x1a0000 0x1c0000 0x1e0000 0x200000 0x220000 0x240000 0x260000

mtd: fingerprints mismatch @0:0x0

mtd: fingerprints mismatch @0:0x20000

mtd: fingerprints mismatch @0:0x40000

mtd: fingerprints mismatch @0:0x60000

mtd: NCB0 not found

mtd: fingerprints mismatch @0:0x80000

mtd: fingerprints mismatch @0:0xa0000

mtd: fingerprints mismatch @0:0xc0000

mtd: fingerprints mismatch @0:0xe0000

mtd: NCB1 not found

mtd: neither NCB1 or NCB2 found ERROR

Unable to load boot structures

UTP: sending Non-success to kernel for command $ kobs-ng dump -v.

utp_poll: exit with status 1280

random: nonblocking pool is initialized

Regards,

HengYew

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

Why almost all blocks in the beginning are bad ones. It seems something wrong have done before. If you don't mind, could you please scrub the first partition and retry.

Another wired data is the page size.

NFC geometry :

        ECC Strength      : 2

        Page Size in Bytes : 2071 <-- Odd number? This should be 2048+64 = 2112

        Metadata size      : 10

        ECC Chunk Size in byte : 512

        ECC Chunk count        : 4

        Block Mark Byte Offset : 2028

        Block Mark Bit Offset  : 2

0 Kudos

2,917 Views
hengyewlim
Contributor III

Hi Xu Han,

I got a board with Micron NAND working with s/w modification.

The NFC geometry is also different and not 2112.

Is the kobs-ng working correctly in mfgtool2?

nand: Micron MT29F1G08ABADAWP

nand: 128MiB, SLC, page size: 2048, OOB size: 64

gpmi-nand 1806000.gpmi-nand: set feature 1 mode 5

gpmi-nand 1806000.gpmi-nand: geet feature 1 mode 5

gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5

Bad block table found at page 65472, version 0x01

Bad block table found at page 65408, version 0x01

4 cmdlinepart partitions found on MTD device gpmi-nand

Creating 4 MTD partitions on "gpmi-nand":

0x000000000000-0x000004000000 : "boot"

0x000004000000-0x000005000000 : "kernel"

0x000005000000-0x000006000000 : "dtb"

0x000006000000-0x000008000000 : "rootfs"

gpmi-nand 1806000.gpmi-nand: driver registered.

...

.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'

.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'

mtd: opening: "/dev/mtd0"

NFC geometry :

        ECC Strength       : 4

        Page Size in Bytes : 2084

        Metadata size      : 10

        ECC Chunk Size in byte : 512

        ECC Chunk count        : 4

        Block Mark Byte Offset : 2018

        Block Mark Bit Offset  : 4

====================================================

I am also able to get the WinBond NAND working after scrubbing the 1st 2MB of the NAND flash.

But I am afraid that I have erase genuine bad blocks marked by the manufacturer.

I suspect the gpmi-nand kernel driver do not support Winbond Nand properly, any areas to look out for when debugging the driver?

Do you know which NAND manufacturer was qualified for MX6?

Regards,

HengYew

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

I checked the NAND driver and found the page size is correct. 3.14 Kernel start using new BCH layout algorithm which store all BCH geometry info in debug information. If driver could get ONFI parameter from NAND chip, it may use recommend ecc strength and ecc step, page size equals the size of meta + data chunk + ecc, 2048+10+13*2*4/8 = 2071. So that's not an issue.

I don't know what they have been done to WinBond NAND, but GPMI driver should never touch BBM if use it correctly. We have done most test on Micron NAND chip, but driver should support most common NAND chips.

Please try more times to see if you could reproduce the issue on your board. Thanks.

0 Kudos

2,917 Views
hengyewlim
Contributor III

I have tried 8 boards with Winbond chips, all of them have the same bad blocks at the same locations.

After I scrub 1st 2MB, I got the following from kernel during bootup:

nand: Winbond W29N01GV

nand: 128MiB, SLC, page size: 2048, OOB size: 64

gpmi-nand 1806000.gpmi-nand: set feature 1 mode

gpmi-nand 1806000.gpmi-nand: geet feature 1 mode

gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in s

Bad block table found at page 65472, version 0x0

Bad block table found at page 65408, version 0x0

nand_read_bbt: bad block at 0x000000200000

nand_read_bbt: bad block at 0x000000220000

nand_read_bbt: bad block at 0x000000240000

nand_read_bbt: bad block at 0x000000260000

nand_read_bbt: bad block at 0x000004360000

4 cmdlinepart partitions found on MTD device gpm

Creating 4 MTD partitions on "gpmi-nand":

0x000000000000-0x000001000000 : "boot"

0x000001000000-0x000002000000 : "kernel"

0x000002000000-0x000003000000 : "dtb"

0x000003000000-0x000008000000 : "rootfs"

gpmi-nand 1806000.gpmi-nand: driver registered.

...

I will look into init sequence and the functionality reading the bad blocks in the gpmi-nand driver.

HengYew

0 Kudos

2,917 Views
hengyewlim
Contributor III

Hi Xu Han,

I did some more investigation and got the following debug logs from u-boot.

It seems to me the NAND driver is not very stable during reading using SDMA.

Have you encounter it before?

U-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jun 27 2016 - 10:26:26)

CPU:   Freescale i.MX6SX rev1.2 at 792 MHz

CPU:   Temperature 43 C

Reset cause: WDOG

Board: MX6SX VIPER

I2C:   ready

DRAM:  512 MiB

PMIC: PFUZE300 DEV_ID=0x30 REV_ID=0x11

NAND:  128 MiB

Using default environment

In:    serial

Out:   serial

Err:   serial

Net:   FEC0

Error: FEC0 address not set.

Normal Boot

Hit any key to stop autoboot:  0

=> nand read 80080000 1000000 60000

NAND read: device 0 offset 0x1000000, size 0x60000

393216 bytes read: OK

=> nand read 80080000 1000000 80000

NAND read: device 0 offset 0x1000000, size 0x80000

524288 bytes read: OK

=> nand read 80080000 1000000 100000

NAND read: device 0 offset 0x1000000, size 0x100000

1048576 bytes read: OK

=> nand read 80080000 1000000 120000

NAND read: device 0 offset 0x1000000, size 0x120000

1179648 bytes read: OK

=> nand read 80080000 1000000 200000

NAND read: device 0 offset 0x1000000, size 0x200000

MXS NAND: DMA read error

NAND read from offset 1000000 failed -110

0 bytes read: ERROR

=> nand read 80080000 1000000 20000

NAND read: device 0 offset 0x1000000, size 0x20000

131072 bytes read: OK

=> nand read 80080000 1000000 140000

NAND read: device 0 offset 0x1000000, size 0x140000

MXS NAND: DMA read error

NAND read from offset 1000000 failed -110

0 bytes read: ERROR

HengYew

0 Kudos

2,917 Views
han_xu
NXP Employee
NXP Employee

I tried several time on my i.MX6SX board with Micron NAND but didn't reproduce this issue, while I assume this issue might related to bitflip. Please try apply the follow patches which has already integrated in our latest u-boot code and let me know if it can fix the issue.

0 Kudos

2,917 Views
art
NXP Employee
NXP Employee

Actually, this L3.14.52 BSP is just released and may still contain some bugs. I'll try to escalate it to some software guys to check and fix the problem.


Have a great day,
Artur

0 Kudos