1. Transplanting u-boot-2012.04.01 refers to analyzing the boot process
a. Get the source code:
Download u-boot-2012.04.01.tar.bz2 from ftp://ftp.denx.de/pub/u-boot/ and download the cross-compilation chain arm-linux-gcc-4.3.2.tar.bz2.
b. Unzip u-boot-2012.04.01.tar.bz2 to your PC and create a Source Insight project.
Put u-boot-2012.04.01.tar.bz2 on Ubuntu and decompress it, and install arm-linux-gcc-4.3.2.tar.bz2 at the same time.
c. After building the Source Insight project, add the corresponding files to analyze the startup process of u-boot-2012.04.01:
According to the linking process, open start.S for code analysis:
1. Set the CPU to management mode set the cpu to SVC32 mode
2. Turn off the watchdog
3. Mask all IRQs by setting all bits in the INTMR
4. Set the frequency division clock ratio
5. Set up the memory control controller (CPU bottom layer initialization)
6. Set up the stack and call the C function board_init_f
7. Call each function in the function array init_sequence
7.1 board_early_init_f: Set system clock, set GPIO
... ...
8. Relocation code
8.1 Copy code from NOR FLASH to SDRAM
8.2 The link address of the program is 0. When accessing global variables, static variables, and calling functions, the "address compiled based on address 0" is used.
Now copy the program to SDRAM
The code needs to be modified to change the "address compiled based on address 0" to the new address
8.3 Some addresses in the program cannot be determined at link time and can only be determined before running: fixabs
9. clear_bss
10. Calling C function board_init_r: Stage 2 code
Previous article:[Linux porting] —— 3. Porting the modified code of u-boot-2012.04.01 (clock, SDRAM, UART)
Next article:【Linux transplant】——1. Software and hardware platform and target
Recommended ReadingLatest update time:2024-11-15 17:55
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Design and Implementation of Digital Video Conversion Interface Based on FPGA
- [AT-START-F403A Evaluation] VI. FreeRTOS system based on IAR security library (sLib) secondary development mode practice
- About the 2021 E-Sports Championship
- [ST NUCLEO-G071RB Review]——First Look at the Kit
- FPGA Advanced Timing Synthesis Tutorial
- How reliable is Dupont wire???
- Classic Books on Signal Integrity Design
- How to avoid copper between the pins of AD18 chip
- [ST waterproof pressure sensor LPS27HHW evaluation 1] Hardware preparation and data collection
- Live broadcast at 10 am today [Design considerations for the precision acquisition signal chain of ADI vibration signals]