Hi,
We have an imx53-based custom platform that we are attempting to boot from NAND. NAND device is a Spansion S34ML02G1, 2048 page size, 64 byte OOB, 4bit ECC. Boot Cfg jumpers are set appropriately.
We have version T0 2 of iMX53 and so my understanding is that we do not ignore bad blocks or disable bi-swap.
It is not booting.
I've included some information below. Your help would be appreciated.
Here is the relevant mfg ucl.xml, this just programs the bootloader.
<LIST name="MX53-RCOM5-Android(NAND)" desc="Choose NAND as media with Android System">
<CMD type="boot" body="BootStrap" file ="u-boot-mx53-rcom5-rev3.bin" >Read from DDR script from U-Boot to init DDR Memory.</CMD>
<CMD type="load" file="uImage" address="0x70800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Kernel.</CMD>
<CMD type="load" file="initramfs.cpio.gz.uboot" address="0x70D00000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Initramfs.</CMD>
<CMD type="jump" > Jumping to OS image. </CMD>
<CMD type="find" body="Updater" timeout="180"/>
<CMD type="push" body="mknod class/mtd,mtd0,/dev/mtd0"/>
<CMD type="push" body="mknod class/mtd,mtd1,/dev/mtd1"/>
<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2"/>
<CMD type="push" body="mknod class/mtd,mtd3,/dev/mtd3"/>
<CMD type="push" body="mknod class/mtd,mtd4,/dev/mtd4"/>
<CMD type="push" body="mknod block,mtdblock0,/dev/mtdblock0,block"/>
<CMD type="push" body="mknod block,mtdblock1,/dev/mtdblock1,block"/>
<CMD type="push" body="mknod block,mtdblock2,/dev/mtdblock2,block"/>
<CMD type="push" body="mknod block,mtdblock3,/dev/mtdblock3,block"/>
<CMD type="push" body="mknod block,mtdblock4,/dev/mtdblock4,block"/>
<CMD type="push" body="$ flash_eraseall /dev/mtd0">Erasing boot partition</CMD>
<CMD type="push" body="send" file="files/android/kobs-ng">New kobs-ng</CMD>
<CMD type="push" body="$ cp $FILE /usr/bin/kobs-ng">Erasing boot partition</CMD>
<CMD type="push" body="$ chmod +x /usr/bin/kobs-ng">Erasing boot partition</CMD>
<CMD type="push" body="send" file="files/android/u-boot.bin">Sending Android uboot Image</CMD>
<CMD type="push" body="$ kobs-ng init -v --chip_0_device_path=/dev/mtd0 $FILE">Flashing Bootloader</CMD>
<CMD type="push" body="$ nanddump -l 10000 -n -p /dev/mtd0">Dump boot partition</CMD>
<CMD type="push" body="$ echo Update Complete!">Done</CMD>
</LIST>
I got a version of kobs-ng from here https://community.freescale.com/thread/304760 and overwrote the original kobs-ng that came with the RAM file system
Here's the relevant output when kobs-ng executes
UTP: received command '$ kobs-ng init -v --chip_0_device_path=/dev/mtd0 $FILE'
UTP: sending Busy
UTP: executing "kobs-ng init -v --chip_0_device_path=/dev/mtd0 $FILE"
mx53 TO 2.x
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
/tmp/file.utp: verifying using key '00000000000000000000000000000000'
/tmp/file.utp: is a valid bootstream for key '00000000000000000000000000000000'
mtd: opening: "/dev/mtd0"
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 7864320
mtd: boot_stream_size_in_bytes = 368944
mtd: #1 0x00100000 - 0x00880000 (0x0015a130)
mtd: #2 0x00880000 - 0x01000000 (0x008da130)
FCB
m_u32Checksum = 0
m_u32FingerPrint = 541213510
m_u32Version = 1
m_NANDTiming.m_u8DataSetup = 0
m_NANDTiming.m_u8DataHold = 0
m_NANDTiming.m_u8AddressSetup = 0
m_NANDTiming.m_u8DSAMPLE_TIME = 0
m_u32PageDataSize = 0
m_u32TotalPageSize = 0
m_u32SectorsPerBlock = 0
m_u32NumberOfNANDs = 0
m_u32TotalInternalDie = 0
m_u32CellType = 0
m_u32EccBlockNEccType = 0
m_u32EccBlock0Size = 0
m_u32EccBlockNSize = 0
m_u32EccBlock0EccType = 0
m_u32MetadataBytes = 0
m_u32NumEccBlocksPerPage = 0
m_u32EccBlockNEccLevelSDK = 0
m_u32EccBlock0SizeSDK = 0
m_u32EccBlockNSizeSDK = 0
m_u32EccBlock0EccLevelSDK = 0
m_u32NumEccBlocksPerPageSDK = 0
m_u32MetadataBytesSDK = 0
m_u32EraseThreshold = 0
m_u32BootPatch = 0
m_u32PatchSectors = 0
m_u32Firmware1_startingPage = 512
m_u32Firmware2_startingPage = 4352
m_u32PagesInFirmware1 = 181
m_u32PagesInFirmware2 = 181
m_u32DBBTSearchAreaStartAddress = 256
m_u32BadBlockMarkerByte = 2000
m_u32BadBlockMarkerStartBit = 0
m_u32BBMarkerPhysicalOffset = 0
DBBT
m_u32Checksum = 0
m_u32FingerPrint = 1145193044
m_u32Version = 1
m_u32NumberBB = 0
m_u32Number2KPagesBB = 0
Firmware: image #0 @ 0x0 size 0x0 - available 0x0
Firmware: image #1 @ 0x0 size 0x0 - available 0x1000000
NCB versions differ, 3 is used.
-------------- Start to write the [ FCB ] -----
mtd: erasing @0:0x0-0x20000
mtd: Writing FCB0 [ @0:0x0 ] (800) *
mtd: erasing @0:0x20000-0x40000
mtd: Writing FCB1 [ @0:0x20000 ] (800) *
mtd: erasing @0:0x40000-0x60000
mtd: Writing FCB2 [ @0:0x40000 ] (800) *
mtd: erasing @0:0x60000-0x80000
mtd: Writing FCB3 [ @0:0x60000 ] (800) *
mtd_commit_bcb(FCB): status 0utp_poll: pass returned.
-------------- Start to write the [ DBBT ] -----
mtd: erasing @0:0x80000-0xa0000
mtd: Writing DBBT0 [ @0:0x80000 ] (800) *
mtd: erasing @0:0xa0000-0xc0000
mtd: Writing DBBT1 [ @0:0xa0000 ] (800) *
mtd: erasing @0:0xc0000-0xe0000
mtd: Writing DBBT2 [ @0:0xc0000 ] (800) *
mtd: erasing @0:0xe0000-0x100000
mtd: Writing DBBT3 [ @0:0xe0000 ] (800) *
mtd_commit_bcb(DBBT): status 0
mtd: Writting firmware image #0 @0: 0x00100000 - 0x0015a800
mtd: erasing @0:0x100000-0x120000
mtd: erasing @0:0x120000-0x140000
mtd: erasing @0:0x140000-0x160000
mtd: Writting firmware image #1 @0: 0x00880000 - 0x008da800
mtd: erasing @0:0x880000-0x8a0000
mtd: erasing @0:0x8a0000-0x8c0000
mtd: erasing @0:0x8c0000-0x8e0000
UTP: sending Success
Here's a dump of the initial bit of NAND
0x00000000: 00 00 00 00 46 43 42 20 01 00 00 00 00 00 00 00
0x00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000060: 00 00 00 00 00 00 00 00 00 02 00 00 00 11 00 00
0x00000070: b5 00 00 00 b5 00 00 00 00 01 00 00 d0 07 00 00
0x00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
0x000000b0: 31 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000003f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000004f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000005f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000006f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00000790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000007f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A few points to note:
Firmware: image #0 @ 0x0 size 0x0 - available 0x0
Firmware: image #1 @ 0x0 size 0x0 - available 0x1000000
Can anyone see anything obviously wrong? Any suggestions as to how to debug this further?
Thanks,
Bruno
Hi Bruno,
Please note that S34ML02G1 only requires 1-bit ECC, but using 4-bit ECC should not cause a problem. As you noted, the FCB parameters have a lot of zeros, which looks suspicious. I suspect the ASCII sequence "FCB" (0x464342) should be located at offset 0x10, not at 0x4, so maybe you have the wrong FCB image. I'm glad to hear you are working with Freescale support. Please let us know the result.
Hi Gary,
I only saw your reply today. Why do you say the Ascii "FCB" should be located at offset 0x10. The iMX53 Reference manual states it's at offset 0x4?
Bruno
We had problems with their hardware too using STM32. They have sometimes strange behavior of flash device and errors in datasheets. It is a try and error most of the time. Try adopting their example code.
would you send your u-boot here for further investigation?
I am in touch with Freescale support locally about this issue and so it's probably best to continue with them.
Thanks,
Bruno