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.

SPI flash U-boot



Based on the MCSDK UG Chapter Tools(http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Tools#Loading_U-Boot_with_CCS.), under section Programming SPI NOR flash with U-BOOT GPH image. It stated that

"Two stage SPI boot consists of booting first the U-Boot SPL binary from SPI NOR flash (located at offset 0) which will then load and run the second level boot loader (Full version of U-Boot) image from SPI NOR flash located at offset 0x10000...."

May I know where the offset of Full version of U-Boot image 0x10000 being defined? What if I would like to change the Full version of U-boot image to another offset address such as 0x20000 ?

By the way, I am using ti-processor-sdk-linux-k2l-evm-02.00.02.11.

Regards

Khor

  • Hi,

    Khor said:
    May I know where the offset of Full version of U-Boot image 0x10000 being defined?

    In u-boot entry points are defined in board config headers, located in include/configs/. Lets suppose you use k2e board, then the files you need to look at are include/configs/k2e_evm.h  & ti_armv7_keystone2.h. The entry points for u-boot are *_TEXT_BASE.

    Khor said:
    What if I would like to change the Full version of U-boot image to another offset address such as 0x20000 ?

    You could do that, BUT you need to be careful, because u-boot code relocates to a higher address, thus changing the entry point could cause overlapping with the kernel start address (again defined in the board config heade). 

    Hope this helps. 

    Best Regards, 
    Yordan

  • Hi Yordan,

    You are correct, the entry points for u-boot are *_TEXT_BASE.
    However what I interested is how U-Boot SPL know where to copy the uboot which is offset of 0x10000 in SPI NOR flash.

    I found this config CONFIG_SYS_SPI_U_BOOT_OFFS in ti_arm7_keystone2.h. I suspect this config determine where the uboot offset in SPI NOR flash. Correct me if I am wrong.

    #define CONFIG_SPL_PAD_TO 65536
    #define CONFIG_SYS_SPI_U_BOOT_OFFS CONFIG_SPL_PAD_TO

    Thanks.
    Khor
  • Hi,

    Have a look at <path/to/u-boot/sources>/README:
    - SPL framework:
    .......
    CONFIG_SPL_PAD_TO
    Image offset to which the SPL should be padded before appending
    the SPL payload. By default, this is defined as
    CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined.
    CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL
    payload without any padding, or >= CONFIG_SPL_MAX_SIZE.

    U-boot is loaded in DRAM, the start address is CONFIG_SPL_TEXT_BASE

    Best Regards,
    Yordan