uboot startup process-involving s_init assembly function

1. Functions involved in uboot startup

This article briefly analyzes the assembly functions involved in the uboot startup process:

Functions called by the lowlevel_init function: s_init function

Function called by save_boot_params_ret function: _main function

This article follows the study of the previous article, the address is as follows:

uboot startup process-involving lowlevel_init assembly function_Ling Xiaozhan's blog-CSDN blog

2. Assembly functions involved in uboot startup process

1. s_init function

In the previous article study, we already know that the s_init function will be called after the lowlevel_init function . The s_init function is defined in the file
arch/arm/cpu/armv7/mx6/soc.c , as shown below:
808 void s_init(void)
809 {
810 struct anatop_regs *anatop = (struct anatop_regs 
*)ANATOP_BASE_ADDR;
811 struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
812 u32 mask480;
813 u32 mask528;
814 u32 reg, periph1, periph2;
815
816 if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL) ||
817 is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6SLL))
818 return;
.......
850 writel(mask528, &anatop->pfd_528_clr);
851 }

In line 816 , the current CPU type will be determined . If the CPU is any one of MX6SX , MX6UL , MX6ULL or MX6SLL , it will be returned directly, which is equivalent to the s_init function doing nothing. So for I.MX6UL/I.MX6ULL , s_init is an empty function.

After exiting from the s_init function, the function lowlevel_init is entered . However, the lowlevel_init function is also executed and returns to the function cpu_init_crit . The function cpu_init_crit is also executed and finally returns to the save_boot_params_ret function. The calling relationship of the save_boot_params_ret function is as follows:

The s_init function here, for I.MX6UL/I.MX6ULL, s_init is an empty function, which means nothing is returned directly.

The calling relationship can be seen:

The next thing to be executed is the _main function in save_boot_params_ret.

Next article analysis: _main assembly function.

Guess you like

Origin blog.csdn.net/wojiaxiaohuang2014/article/details/133432453