Get straight to the point
1. Set up the stack
1 skip_hw_init:
2 /* Set up the stack */
3 stack_setup:
4 ldr r0, =CONFIG_SYS_UBOOT_BASE /* base of copy in DRAM */
//0x57e0_0000
5 sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */
//#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 1024 * 1024)
//#define CONFIG_ENV_SIZE 0x4000
// Subtract the size of the environment variable storage area
6 sub r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo */
//#define CONFIG_SYS_GBL_DATA_SIZE 128
// Subtract the size of the global variable storage area
7 sub sp, r0, #12 /* leave 3 words for abort-stack */
//Leave 12 bytes (3 words) of stack space
8
I personally do not trust this code, because I have also referred to the code of s3c-uboot1.1.6.
In the code of s3c-uboot1.1.6, #ifdef considers more comprehensive and more logical basis.
Therefore, this time we only analyze and produce a set of codes that can successfully run various basic functions, but in later practical use, this set of codes will not be used as long-term support code to avoid encountering unknown bugs.
2. Clear the BSS (Block Started by Symbol) segment
9 clear_bss:
10 ldr r0, _bss_start /* find start of bss segment */
11 ldr r1, _bss_end /* stop here */
12 mov r2, #0 /* clear */
//The comments are very clear... I won't explain them anymore
13
14 clbss_l:
15 str r2, [r0] /* clear loop... */
16 add r0, r0, #4 // loop to clear bss
17 cmp r0, r1
18 ble clbss_l
19
20 #ifndef CONFIG_NAND_SPL
21 ldr pc, _start_armboot // C entry function, selected after the IRQ interrupt processing code analysis
twenty two
23 _start_armboot:
24.word start_armboot
25 #else
26 b nand_boot
27 /* .word nand_boot*/
28 #endif
At this point, the analysis of the assembly interface code is complete, and the next step is the analysis of start_armboot in C language.
To summarize the structure in start.S, I personally think that the original code structure is clearer.
In uboot2010, the code structure tends to place several addressing operations in start.S, and other operations in lowlevel_init.
However, uboot1.1.6 pays more attention to the use of #ifdef, which separates more setting items.
Personally, I think 2010 has better logic and 1.1.6 is easier to debug.
Previous article:S3C6410 uboot re-engineering (6) abnormal interrupt handling
Next article:S3C6410 uboot re-engineering (4) enabling MMU
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- How to select a display detector
- [Zero-knowledge ESP8266 Tutorial] Zero-knowledge WIFI Tutorial - http WEB Server Example
- 【TI recommended course】#TI millimeter wave radar technology introduction#
- Several basic knowledge of MCU, must-read for beginners
- There are two problems when using the ST motor library
- MSP430 interrupt mechanism
- Current sensing resistors in lithium-ion battery formation and capacity test equipment
- Driving WS2812 with only 2 wires
- Problems with the Linux development board
- 【GD32L233C-START Review】 Second Development Board Function Review