u-boot-2022.01-rc4启动分析笔记之二(_main与board_init_f)
U-Boot启动流程概要
2022版u-boot启动分析笔记之一(start.S与lowlevel_init.S)
跳转到_main
_main函数在arch/arm/lib/crt0.S中,没有需要移植的。main函数的作用在注释中有详细的说明,可以自己翻译:
/*
* This file handles the target-independent stages of the U-Boot
* start-up where a C runtime environment is needed. Its entry point
* is _main and is branched into from the target's start.S file.
*
* _main execution sequence is:
*
* 1. Set up initial environment for calling board_init_f().
* This environment only provides a stack and a place to store
* the GD ('global data') structure, both located in some readily
* available RAM (SRAM, locked cache...). In this context, VARIABLE
* global data, initialized or not (BSS), are UNAVAILABLE; only
* CONSTANT initialized data are available. GD