AnsweredAssumed Answered

iMX6ULL - 4k NAND flash boot issue

Question asked by Arkadiusz Karas on Mar 3, 2018
Latest reply on Mar 6, 2018 by Arkadiusz Karas

Hello,

 

I have a board based on imx6ULL processor which boots from NAND flash.

Up to now I was using 1G NAND flash and everything is working fine with this memory.

Recently, I have changed memory to 4G device (Micron MT29F4G08ABAEAWP) - and with this memory I am not able to boot.

I can flash it properly with kobs-ng if I load u-boot via USB.

Here is flashing log:

kobs-ng init -x u-boot.imx.nand --search_exponent=1 -v
MTD CONFIG:
  chip_0_device_path = "/dev/mtd0"
  chip_1_device_path = "(null)"
  search_exponent = 1
  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: Linux 4.1
mtd: use new bch layout raw access mode
mtd: opening: "/dev/mtd0"
Cannot open BCH geometry node: "/sys/kernel/debug/gpmi-nand/bch_geometry"
NFC geometry :
        ECC Strength       : 16
        Page Size in Bytes : 4320
        Metadata size      : 10
        ECC Chunk Size in byte : 512
        ECC Chunk count        : 8
        Block Mark Byte Offset : 3904
        Block Mark Bit Offset  : 0
====================================================
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 1572864
mtd: boot_stream_size_in_bytes = 528384
mtd: boot_stream_size_in_pages = 129
mtd: #1 0x00100000 - 0x00280000 (0x00181000)
mtd: #2 0x00280000 - 0x00400000 (0x00301000)
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 = 4096
  m_u32TotalPageSize = 4320
  m_u32SectorsPerBlock = 64
  m_u32NumberOfNANDs = 0
  m_u32TotalInternalDie = 0
  m_u32CellType = 0
  m_u32EccBlockNEccType = 8
  m_u32EccBlock0Size = 512
  m_u32EccBlockNSize = 512
  m_u32EccBlock0EccType = 8
  m_u32MetadataBytes = 10
  m_u32NumEccBlocksPerPage = 7
  m_u32EccBlockNEccLevelSDK = 0
  m_u32EccBlock0SizeSDK = 0
  m_u32EccBlockNSizeSDK = 0
  m_u32EccBlock0EccLevelSDK = 0
  m_u32NumEccBlocksPerPageSDK = 0
  m_u32MetadataBytesSDK = 0
  m_u32EraseThreshold = 0
  m_u32Firmware1_startingPage = 256
  m_u32Firmware2_startingPage = 640
  m_u32PagesInFirmware1 = 129
  m_u32PagesInFirmware2 = 129
  m_u32DBBTSearchAreaStartAddress = 128
  m_u32BadBlockMarkerByte = 3904
  m_u32BadBlockMarkerStartBit = 0
  m_u32BBMarkerPhysicalOffset = 4096
  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 = 0
Firmware: image #0 @ 0x100000 size 0x81000 - available 0x180000
Firmware: image #1 @ 0x280000 size 0x81000 - available 0x180000
-------------- Start to write the [ FCB ] -----
mtd: erasing @0:0x0-0x40000
mtd: Writing FCB0 [ @0:0x0 ] (10e0) *
mtd: erasing @0:0x40000-0x80000
mtd: Writing FCB1 [ @0:0x40000 ] (10e0) *
mtd_commit_bcb(FCB): status 0

 

-------------- Start to write the [ DBBT ] -----
mtd: erasing @0:0x80000-0xc0000
mtd: Writing DBBT0 [ @0:0x80000 ] (1000) *
mtd: erasing @0:0xc0000-0x100000
mtd: Writing DBBT1 [ @0:0xc0000 ] (1000) *
mtd_commit_bcb(DBBT): status 0

 

---------- Start to write the [ .tmp_kobs_ng ]----
mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x00181000
mtd: erasing @0:0x100000-0x140000
mtd: erasing @0:0x140000-0x180000
mtd: erasing @0:0x180000-0x1c0000
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ng: #1 @0: 0x00280000 - 0x00301000
mtd: erasing @0:0x280000-0x2c0000
mtd: erasing @0:0x2c0000-0x300000
mtd: erasing @0:0x300000-0x340000
mtd: We write one page for save guard. *

 

I have followed description found in topics i.MX6Q NAND boot issues and NAND BOOT fail on iMX6UL  but still no success.

Here is boot room log buffer content:

J-Link>mem32 0x000001e0 1
Memory access: CPU temp. halted: https://wiki.segger.com/Memory_accesses#Legacy_stop_mode
000001E0 = 00901CF4
J-Link>mem8 0x00901CF4 0x100
00901CF4 = 02 00 01 00 F0 00 02 00 00 00 03 00 00 00 04 00
00901D04 = 00 00 05 00 00 00 06 00 00 00 07 00 F0 00 07 00
00901D14 = 00 00 08 00 00 01 00 00 33 00 08 00 01 00 05 00
00901D24 = 00 00 06 00 00 00 07 00 F0 00 07 00 00 00 08 00
00901D34 = 80 02 00 00 33 00 08 00 FF 1F 06 00 01 20 06 00
00901D44 = 00 00 07 00 33 00 07 00 00 00 0C 00 00 00 00 00
00901D54 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901D64 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901D74 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901D84 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901D94 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901DA4 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901DB4 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901DC4 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901DD4 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00901DE4 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

And boot memory content:

mem8 0x907400 0x100
00907400 = 00 00 00 00 00 00 00 F0 7F 87 00 10 08 00 00 00
00907410 = 00 00 D2 01 E8 40 CC 01 E4 04 02 0C 40 68 FF FF
00907420 = FF FF 02 0C 40 6C FF FF FF FF 02 0C 40 70 FF FF
00907430 = FF FF 02 0C 40 74 FF FF FF FF 02 0C 40 78 FF FF
00907440 = FF FF 02 0C 40 7C FF FF FF FF 02 0C 40 80 FF FF
00907450 = FF FF 02 0E 04 B4 00 0C 00 00 02 0E 04 AC 00 00
00907460 = 00 00 02 0E 02 7C 00 00 00 30 02 0E 02 50 00 00
00907470 = 00 30 02 0E 02 4C 00 00 00 30 02 0E 04 90 00 00
00907480 = 00 30 02 0E 02 88 00 00 00 30 02 0E 02 70 00 00
00907490 = 00 00 02 0E 02 60 00 00 00 30 02 0E 02 64 00 00
009074A0 = 00 30 02 0E 04 A0 00 00 00 30 02 0E 04 94 00 02
009074B0 = 00 00 02 0E 02 80 00 00 00 30 02 0E 02 84 00 00
009074C0 = 00 30 02 0E 04 B0 00 02 00 00 02 0E 04 98 00 00
009074D0 = 00 30 02 0E 04 A4 00 00 00 30 02 0E 02 44 00 00
009074E0 = 00 30 02 0E 02 48 00 00 00 30 02 1B 00 1C 00 00
009074F0 = 80 00 02 1B 08 00 A1 39 00 03 02 1B 08 0C 00 00

 

Attached are files with NAND dumps from page 0 and page 128 (first u-boot page).

 

WHat I have found is that this NAND memory has non-standard OOB area size - 224 bytes.

Could this be an issue for boot rom ?

 

Regards

Arek Karaś

Outcomes