Note: This article and the following about the transplantation of uboot refer to "Embedded Linux Learning Notes (Based on S5PV210, TQ210)"
No matter what version of uboot, the entry function ENTRY(_start) is defined in arch/arm/cpu/u-boot-spl.lds and arch/arm/cpu/u-boot.lds. u-boot-2016.09 is no exception. The search found that _start is implemented in arch/arm/lib/vectors.S:
_start first executes reset, then defines the exception vector table, reset is implemented in arch/arm/cpu/armv7/start.S
Only one jump instruction is executed in reset, the function of save_boot_params is to jump to the save_boot_params_ret function
In this program, there is a macro CONFIG_SKIP_LOWLEVEL_INIT to determine whether to perform some low-level initialization (skip if necessary, and perform initialization if not). cpu_init_cp15 is used to implement the initialization of cp15. You can refer to the "ARM Architecture Reference Manual". We don't need to know too much about this. cpu_init_crit calls the lowlevel_init function, which is implemented in board/samsung/tq210/lowlevel_init.S. It can perform low-level initialization of clocks, memory, etc. Then jump to _main, which is implemented in arch/arm/lib/crt0.S.
Here we mainly focus on board_init_f, which is implemented in common/board_f.c. It performs some basic hardware initialization to prepare for entering DRAM memory. After the initialization is completed, continue to execute
Here, relocate_code is called to relocate and move u-boot.bin into DRAM. Continue to execute
Here, the BSS clearing operation is performed, and then the link address of the function board_init_r is assigned to the PC pointer, and the execution is directly jumped to the DRAM memory. In board_init_r, some hardware initialization is continued, and the init_sequence_r function array is called in board_init_r, and finally the execution is executed to run_main_loop:
run_main_loop finally executes to main_loop, which is implemented in common/board_r.c
In main_loop, the user input will be detected. If no user presses the button within the specified delay time, the kernel image will be copied from the SD card or FLASH to DRAM according to the environment variables, and then jump to the OS starting address to execute the OS. At this point, the uboot startup is completed.
Previous article:u-boot-2016.09 transplant (5)-uart
Next article:u-boot-2016.09 transplant (3)-u-boot-spl.bin
Recommended ReadingLatest update time:2024-11-16 14:32
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Siemens 230RC opens for 3 seconds and closes for 3 seconds
- Stack Overflow Technology from Entry to Mastery
- Design of Automatic AC Voltage Stabilizer
- Competition control competition materials and excellent works sharing
- NUCLEO_G431RB Review (1) Compilation Environment Settings
- EEWORLD University - Practical Application of IoT in Vehicles
- Memory Compression Technology in Embedded Systems
- Porting shttpd Web
- Why are all the packets captured by USB Dongle empty?
- Share and discuss: About the VDDIO and VLDO pins of the LP8863ADCPRQ1 chip