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.

Booting from NOR flash

Hi All,

I was  doing ramboot, copying images(kernel, uramdisk, dtb) to RAM over uart and running from RAM.

Now I want to put these images onto NOR and boot from it. My NOR is 32MB.

On NOR, uboot is placed at 0x08000000, kernel at 0x080c0000,

What is the address to place my filesystem, dtb images? Should I modify any of uboot files to mention these addresses? As my NOR is only 32MB, can I use my uramdisk which is around 6MB?

Regards,

Gangadhar

  • Hi,

    Gangadhar Gangu said:
    What is the address to place my filesystem, dtb images? Should I modify any of uboot files to mention these addresses? As my NOR is only 32MB, can I use my uramdisk which is around 6MB?

    Check the spl_nor_load_image() function inside <u-boot>/common/spl/spl_nor.c. There is a CONFIG_SYS_FDT_BASE value, that needs to be defined (preferably inside <u-boot>/include/configs/am335x_evm.h). The offset is up to you.

    The file system offset is also up to you. You need to define a file system partition for your NOR device in the device tree and use this partition's offset as a kernel argument when booting.

    Best regards,
    Miroslav

  • Hi All,

    1. I'm using below cmds as part of bootcmd,

                     "cp.b ${fdtaddr} NOR_FDT_ADDR FDT_SIZE; " \
                     "cp.b ${loadaddr} NOR_KERNEL_ADDR KERNEL_IMAGE_SIZE; " \
                     "cp.b ${rdaddr} NOR_RAMDISK_ADDR RAMDISK_SIZE; " \
                     "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \

    How to tell uboot to use exact size instead of using hardcoded values - FDT_SIZE, KERNEL_IMAGE_SIZE, RAMDISK_SIZE?

    2. There is an initial delay of ~20 seconds before uboot(present on NOR) comes up. I think  boot devices are scanned in order. Which is the file which contains the code to scan the boot devices? Or is there something else that makes uboot to comeup with a delay?

    Regards,

    Gangadhar

  • Gangadhar Gangu said:
    How to tell uboot to use exact size instead of using hardcoded values - FDT_SIZE, KERNEL_IMAGE_SIZE, RAMDISK_SIZE?

    What exactly do you mean? You can always pass different size argument to the command, but U-Boot has no means to detect the exact size or where is the beginning or the end of the binaries located on your flash. It just sees the flash as a continuous memory space. This is why the start address and size are mandatory arguments to these commands.

    Gangadhar Gangu said:
    2. There is an initial delay of ~20 seconds before uboot(present on NOR) comes up. I think  boot devices are scanned in order. Which is the file which contains the code to scan the boot devices? Or is there something else that makes uboot to comeup with a delay?

    The boot device order can be selected via the SYSBOOT pins of the processor (read section 26.1.5.2.1 SYSBOOT Configuration Pins of the AM335x TRM). This is done by the ROM code. However, it usually doesn't take more than a few seconds to scan through the devices. Where exactly does the delay happen? Any serial prints before/after?

    Best regards,
    Miroslav

  • Thanks Miroslav.  Using SYSBOOT pins I've selected NOR flash. I get first print from uboot 20 seconds after i switch on the board.

    Regards,

    Gangadhar

  • What about any prints from the SPL (MLO) ?

    Best regards,
    Miroslav

  • as you know for NOR memory only u-boot.bin is used.

    Regards,

    Gangadhar

  • Ah, yes, sorry about that.

    In that case I can suggest toggling some GPIOs (connected to LEDs) inside the initial part of the U-Boot code and see where the delay occurs.

    Best regards,
    Miroslav