This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1808 - using u-boot to update itself in nand

Hi,


I'm trying to run ubl and u-boot and boot kernel from the nand.
I have to generate valid ubl and u-boot image files to be written in nand flash using nand erase/write methods available within u-boot.
Firstly, I verified that nand programming through Serial Flash Programming tool (SFH) works good, now I would like to replicate this process without SFH.
However I do not understand how SFH operates over the original u-boot.bin file.
Using nand dump I see what sfh does to make it work:

a short header is generated and stored at address c0000,

c0000: bb 4c 42 55 00 00 08 c1 cd 00 00 00 06 00 00 00 01 00 00 00 00 00 08 c1

then, the rest of the page is blank (0xff) and u-boot.bin image is stored starting at c0800,

c0800: 13 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ..

Finally a unknown chunk of data is appended at the end of u-image till the end of sector

.. 20 01 04 04 02 08 02 40 12 90 02 00 20 40 28 02

Please, does anyone know the details of this algorithm?

Regards,

Gabriele

  • Hi,

    I think that you want to update the u-boot in NAND flash without using the SFH tool & wo affecting UBL,

    Try "nand erase "u-boot start add"  "u-boot end add"

    Load u-boot.bin to C0700000 and

    nand write 0xC0700000 "u-boot start add"  "u-boot end add"

  • Hi,

    In the case of SPI flash the task was relatively straightforward because the only piece of data to be added was a short header on top of u-boot image.

    With the NAND flash it is more difficult to solve the enigma.

    The problem is not the write operation from u-boot, nor ECC calculation, etc.
    The problem is the misterious extra chunk of data that sfh adds to the u-boot.bin tail up to page completion.
    Where this data came from ? Does ubl need this data ? If yes, please do you know how to generate it ?

    Regards,
    Gabriele