[U-Boot-Users] Loading from NAND using 'nboot' Periodically Fails Where 'nand read' Succeeds

Marian Balakowicz m8 at semihalf.com
Fri Jun 6 09:38:51 CEST 2008


Hi Grant,

Grant Erickson wrote:
> On 6/5/08 3:30 PM, Grant Erickson wrote:
>> I'm following up with you on this since 'git blame cmd_nand.c' seems to
>> indicate you added the CONFIG_FIT support to this file.
>>
>> Based on stepping through with the debugger, my initial guess about hardware
>> issues may have been incorrect. Is there an implicit assumption in the
>> following snippet from nand_load_image() in cmd_nand.c:
>>
>> [ code omitted ]
>>
>> that casting 'addr' to 'fit_hdr' represents more than 512 bytes of valid data
>> to be accessed by fit_check_format()? If so, should not 'cnt = nand->oobblock'
>> be explicitly set to match that assumption?
>>
>> I am guessing that my observation that NFS booting and nand read.i addressed
>> the issue strictly had to do with the fact that the 8 MiB address to which
>> those operate were not getting used or otherwise updated between resets after
>> the boot of the kernel allowing subsequent runs of 'nboot' to "leverage" the
>> stale data.
> 
> The boot.itb image I have in NAND is 0x13CB98 bytes in size. Running a
> series of 'nand read.i ${bootaddr} 0 <...>':
>
...
> 
> So, it would appear that the answer, at least for this trivial boot.itb of a
> kernel and DTB, for how large must the initial value of 'cnt' be is "as
> large as the image being nboot'ed is". That said, it looks like nboot and
> FIT images may not work together at present with today's code.
> 
> Any thoughts?

Doing a FIT format check on a first sector data is obviously wrong.
This was a good spot for such check with the initial implementation of
the routine, but it should have been corrected after that changed,
stupid me. As you'll note fit_print_contents() call is deferred, and
that is for the same reason, it needs the whole image data to operate
on. Same, for format check, it cannot be done earlier than that.

I'll post a patch later today that fixes it, please give it a try on
your system.

Cheers,
m.




More information about the U-Boot mailing list