Unable to boot u-boot image from nand storage imx6ull.

Navin Sankar navin at linumiz.com
Mon May 17 15:16:31 CEST 2021


On 04/05/21 10:01 pm, Tim Harvey wrote:
> On Tue, May 4, 2021 at 9:28 AM Navin Sankar <navin at linumiz.com> wrote:
>> On 04/05/21 8:49 pm, Tim Harvey wrote:
>>
>> On Sat, May 1, 2021 at 2:32 AM Navin Sankar <navin at linumiz.com> wrote:
>>
>> Hello all,
>>
>> Ported uboot to seeed studio based imx6ull board.
>>
>>          NAND Part Number - mt29f4g08abaeawp
>>
>>          NAND Size - 512 MBytes
>>
>> Both the SPL and U-BOOT image boot successfully from SD card.
>>
>> While with nand flash, SPL boot's fine. But SPL didn't boot the u-boot from nand flash.
>>
>>
>> => mtdparts
>>
>> device nand0 <gpmi-nand>, # parts = 4
>>   #: name                size            offset          mask_flags
>>   0: spl                 0x00080000      0x00000000      0
>>   1: uboot               0x00100000      0x00080000      0
>>   2: uboot-dup           0x00100000      0x00180000      0
>>   3: ubi                 0x1fd80000      0x00280000      0
>>
>> active partition: nand0,0 - (spl) 0x00080000 @ 0x00000000
>>
>> defaults:
>> mtdids  : nand0=gpmi-nand
>> mtdparts: gpmi-nand:512k(spl),1m(uboot),1m(uboot-dup),-(ubi)
>>
>>
>> And I flashed the SPL and u-boot image from SD card.
>>
>> Here is flashing result,
>>
>> Initially erased the nand chip
>>
>>
>> => nand erase.chip
>>
>> NAND erase.chip: device 0 whole chip
>> Skipping bad block at  0x1ff00000
>> Skipping bad block at  0x1ff40000
>> Skipping bad block at  0x1ff80000
>> Skipping bad block at  0x1ffc0000
>>
>> OK
>>
>>
>> Then flashed the SPL
>>
>> => ext4load mmc 0:1 $loadaddr SPL
>> 35840 bytes read in 4 ms (8.5 MiB/s)
>> => nand erase.part spl
>>
>> NAND erase.part: device 0 offset 0x0, size 0x80000
>> Erasing at 0x40000 -- 100% complete.
>> OK
>> => nandbcb init $loadaddr 0x0 $filesize
>> device 0 offset 0x0, size 0x8c00
>> Skipping bad block at  0x1ff00000
>> Skipping bad block at  0x1ff40000
>> Skipping bad block at  0x1ff80000
>> Skipping bad block at  0x1ffc0000
>>
>> Write firmware0 @0x200000 offset, 0x9000 bytes written: OK
>> Write firmware1 @0x10100000 offset, 0x9000 bytes written: OK
>> NAND FCB write to 0x400 offset 0x0 written: OK
>> NAND FCB write to 0x400 offset 0x40000 written: OK
>> NAND FCB write to 0x400 offset 0x80000 written: OK
>> NAND FCB write to 0x400 offset 0xc0000 written: OK
>> NAND DBBT write to 0x100000 offset 0x1000 written: OK
>> DBBT data write to 0x104000 offset 0x1000 written: OK
>> NAND DBBT write to 0x140000 offset 0x1000 written: OK
>> DBBT data write to 0x144000 offset 0x1000 written: OK
>> NAND DBBT write to 0x180000 offset 0x1000 written: OK
>> DBBT data write to 0x184000 offset 0x1000 written: OK
>> NAND DBBT write to 0x1c0000 offset 0x1000 written: OK
>> DBBT data write to 0x1c4000 offset 0x1000 written: OK
>>
>>
>> Afterwards flashed the uboot image,
>>
>> => ext4load mmc 0:1 $loadaddr u-boot-dtb.img
>> 624580 bytes read in 29 ms (20.5 MiB/s)
>> => nand erase.part uboot
>>
>> NAND erase.part: device 0 offset 0x80000, size 0x100000
>> Erasing at 0x140000 -- 100% complete.
>> OK
>> => nand erase.part uboot-dup
>>
>> NAND erase.part: device 0 offset 0x180000, size 0x100000
>> Erasing at 0x240000 -- 100% complete.
>> OK
>> => nand write $loadaddr uboot $filesize
>>
>> NAND write: device 0 offset 0x80000, size 0x987c4
>>   624580 bytes written: OK
>>
>>
>> Everything work's fine, but it didn't boot the u-boot image from nand storage.
>>
>> U-Boot SPL 2021.07-rc1-02889-gf6058bbb94-dirty (May 01 2021 - 14:12:55 +0530)
>> Trying to boot from NAND
>>
>>
>> Any hint?
>>
>> Navin,
>>
>> Everything above makes sense but the important thing is what you set
>> CONFIG_SYS_SPL_ARGS_ADDR as that is where the SPL will attempt to load
>> U-Boot from. Check that value and make sure its 0x80000 and if it is
>> correct add some debug prints around the loading of the U-Boot image
>> to make sure everything goes as planned.
>>
>> Best regards,
>>
>> Tim
>>
>> Hi Tim,
>>
>> Assigned CONFIG_SYS_SPL_ARGS_ADDR to 0x80000 and added some debug prints
>>
>> SPL loads the uboot the image successfully in RAM (crossed checked by printing the image header and flashed image)
>>
>> and SPL also reaches the image entry point.
>>
>> image entry point: 0x87800000
>>
>> But still the uboot image is not booting.
>>
> Navin,
>
> Maybe use hexdump to dump what was loaded to RAM to verify contents
> and ensure there isn't a raw nand/ECC issue?
>
> Because you say this boots from microSD we can assume your dram setup
> and everything is good so it must be the content of what's getting
> loaded to RAM?
>
> Tim

Tim,

yes, the issue is related to nand/ECC.

I checked it by comparing the nand u-boot-dtb.img flashed to nand and
file stored in the SD card. Thanks for your inputs.

Regards,
Navin Sankar




More information about the U-Boot mailing list