基于ti-processor-sdk-linux-am335x-evm-04.00.00.04的uboot启动流程备忘,重点是要修改下sdram_init(),使之与板上的内存相匹配
-
_start arch/arm/lib/vectors.S
-
b reset
-
reset arch\arm\cpu\armv7\start.S
-
bl _main
-
-
_main arch\arm\lib\crt0.S
-
bl board_init_f
-
bl spl_relocate_stack_gd
-
board_init_f arch\arm\mach-omap2\am33xx\board.c
-
sdram_init();
-
sdram_init() board\ti\am335x\board.c
-
-
board_init_f common\board_f.c
-
-
save_omap_boot_params() arch\arm\mach-omap2\boot-common.c
-
-
-
board_init_r common\spl\spl.c
-
printf(">>spl:board_init_r()\n");
-
-
SPL阶段
-
1=>_start //arch/arm/lib/vectors.S
-
2==>b reset //jump to arch\arm\cpu\armv7\start.S:reset
-
3===>bl _main //jump to arch\arm\lib\crt0.S:_main
-
4====>bl board_init_f //jump to arch\arm\mach-omap2\am33xx\board.c:board_init_f
-
5=====>sdram_init() //jump to board\ti\am335x\board.c:sdram_init()
-
4====>bl spl_relocate_stack_gd //jump to common\board_f.c:spl_relocate_stack_gd
-
4====>ldr pc, =board_init_r //jump to common\spl\spl.c:board_init_r
-
5=====>spl_board_init() //jump to arch\arm\mach-omap2\boot-common.c:spl_board_init()
-
6======>save_omap_boot_params() //jump to arch\arm\mach-omap2\boot-common.c:save_omap_boot_params()
-
5=====>boot_from_devices() //jump to common\spl\spl.c:boot_from_devices()
-
6======>printf("Trying to boot from %s\n", loader->name);
-
6======>spl_load_image()
-
7=======>spl_ymodem_load_image() //ommon\spl\spl_ymodem.c
-
-
save_boot_params arch\arm\mach-omap2\lowlevel_init.S:save_boot_params
-
ENTRY(save_boot_params)
-
ldr r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
-
str r0, [r1]
-
b save_boot_params_ret
-
ENDPROC(save_boot_params)
-
-
save_omap_boot_params() //arch\arm\mach-omap2\boot-common.c:save_omap_boot_params()
-
{
-
u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
-
...
-
omap_boot_params = (struct omap_boot_parameters *)boot_params;
-
boot_device = omap_boot_params->boot_device;
-
}
-
-
SPL_LOAD_IMAGE_METHOD("UART", 0, BOOT_DEVICE_UART, spl_ymodem_load_image);//ommon\spl\spl_ymodem.c
-
-
-
第二阶段:
-
==>board_init_r() //common\board_r.c
-
===>init_fnc_t init_sequence_r[] = {...,initr_net,...} //common\board_r.c
-
===>initr_net() //common\board_r.c
-
====>eth_initialize(); //net\eth_legacy.c
-
=====>board_eth_init() //board\ti\am335x\board.c 置为MII
-
======>cpsw_register() //drivers\net\cpsw.c
-
=======>_cpsw_register() //drivers\net\cpsw.c
-
========>cpsw_mdio_init() //drivers\net\cpsw.c
-
=========>cpsw_mdio_read() //drivers\net\cpsw.c
-
==========>wait_for_user_access //drivers\net\cpsw.c
-
-
//引脚配置
-
==>board_init_f()
-
===>init_fnc_t init_sequence_f[] = {...,board_early_init_f,display_options,...}
-
====>board_early_init_f()
-
=====>set_mux_conf_regs()
-
======>enable_board_pin_mux()
-
=======>configure_module_pin_mux()
阅读(5864) | 评论(0) | 转发(0) |