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.

AM335x boot process

Hello,

I would like to understand the boot process of AM335x. There is ROM code which will be loading SPL and SPL will load the U-boot. I wanted to know the code work flow of SPL/U-boot. In SPL as per my understanding the code work flow is as follows

s_init()  ---> board_init_f() -->board_init_r(). In this s_init() is calling from lowlevel_init.S and board_init_f() calling from crt0.S. But I am not able to find how the function board_init_r() is getting called up. In crt0.S, there is a section in which board_init_r() is calling but is under the macro #if !defined(CONFIG_SPL_BUILD). In our case CONFIG_SPL_BUILD is defined. So how it is getting called up ?


Whether this code work flow is same for U-boot also ?

  • I will forward this to the SW team.

  • Hi Tomy,

    The <>/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2013.10-ti2013.12.01/common/spl/spl.c -> void board_init_r(gd_t *dummy1, ulong dummy2) is calling from <>/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2013.10-ti2013.12.01/arch/arm/lib/spl.c -> void __weak board_init_f(ulong dummy). In crt0.S from line (about 74) bl board_init_f is calling board_init_f(ulong dummy).
    The macro CONFIG_SPL_BUILD is defined in <>/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2013.10-ti2013.12.01/config.mk with:
    ifeq ($(CONFIG_SPL_BUILD),y)
    CPPFLAGS += -DCONFIG_SPL_BUILD
    Because this macros is defined in crt0.S file the code after #if ! defined(CONFIG_SPL_BUILD) is not executed. You can check this with removing all code and will see that the system will work in the same way.

    BR
    Ivan
  • hi Ivan,
    Thanks for your detailed reply. So in case of U-boot, how the function board_init_r() will get called.  Also for U-boot whether the the code workflow is the same as that of  SPL like s_init() ---> board_init_f() -->board_init_r() or only board_init_f() will be calling ?... If so from where it is calling


    Regards,
    Tomy

  • Also as per my understanding for u-boot also the same function s_init() is calling first, so the set of initialization done in this function will get executed twice (one during SPL and second during U-boot). But board_init_f() and board_init_r() is different for SPL and U-boot. Please correct me if I am wrong. In case of U-boot, the board_init_r() function is not getting called from board_init_f(), so how board_init_r() is getting called up in case of U-boot.