u-boot-2016.09 transplantation (2)-uboot startup simple analysis

Publisher:美好回忆Latest update time:2022-07-12 Source: csdnKeywords:u-boot Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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:


Write the picture description here

_start first executes reset, then defines the exception vector table, reset is implemented in arch/arm/cpu/armv7/start.S


Write the picture description here

Only one jump instruction is executed in reset, the function of save_boot_params is to jump to the save_boot_params_ret function


Write the picture description here

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.

Write the picture description here

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

Write the picture description here

Here, relocate_code is called to relocate and move u-boot.bin into DRAM. Continue to execute

Write the picture description here

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:

Write the picture description here

Write the picture description here

Write the picture description here

Write the picture description here

run_main_loop finally executes to main_loop, which is implemented in common/board_r.c

Write the picture description here

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.

Keywords:u-boot Reference address:u-boot-2016.09 transplantation (2)-uboot startup simple analysis

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

A method for embedding gigabit network function in U-BOOT
       Introduction  U-BOOT is a boot loader        developed by the German DENX team for a variety of embedded microprocessors. It is the first program code that runs after the system is powered on. It is used to initialize the target board hardware, provide the target board hardware configuration information for th
[Microcontroller]
A method for embedding gigabit network function in U-BOOT
U-Boot移植(15)TFTP installation and setting(tftp-hpa and tftpd-hpa)
Today i installed and set the tftp,because i may use this tool to download your kernel and filesystem image to my target board. process: sudo -i 1、Install tftpd and related packages.       # apt-get install  xinetd tftpd-hpa tftp-hpa 2、modify    etc/default/tftpd-hpa #Defaults for tftpd-hpa RUN_DAEMON="yes"  /
[Microcontroller]
TQ2440 Study Notes—— 28. Porting U-Boot [U-Boot configuration process]
1. Introduction to U-Boot Project U-Boot, the full name is Universal Boot loader, which is the universal bootloader. Its name has two meanings: it can boot a variety of operating systems: Linux, NetBSD, VxWorks0, QNX, RTEMS, ARTOS, Lynx, etc.; Supports CPUs of multiple architectures: PowerPC, MIPS, x86, ARM, NIO
[Microcontroller]
TQ2440 Study Notes—— 28. Porting U-Boot [U-Boot configuration process]
u-boot-1.1.6 transplanted to dm9000
The execution process of network card dm9000 (u-boot version: u-boot-1.1.6): There is eth_initialize(gd- bd) in board.c; The implementation of eth_initialize is in eth.c, but there is no initialization eth_init of dm9000 in the eth_initialize function.   Commonly used network devices are nfs, tftp, and ping commands.
[Microcontroller]
Chapter 11: Tiny4412 U-BOOT transplantation 11 DDR3 brief introduction
Since the chip used by Tiny4412 is DDR3, I found a blog post on the Internet that introduces the principles of DDR3. Although many of the principles are the same, I still think that such information is difficult to collect, and I can't think of any other disadvantages except wasting time to read it again, so I will re
[Microcontroller]
Chapter 11: Tiny4412 U-BOOT transplantation 11 DDR3 brief introduction
TQ2440 transplant u-boot-2010.06-rc1---6usb download
I have done some USB downloading stuff before, and now I have put it on u-boot-2010.06-rc1. There is a USB download code on the Internet, which can be downloaded here: http://blogimg.chinaunix.net/blog/upfile2/100109001526.bz2 1. Compile first 1. After downloading, unzip it to the u-boot-2010.06-rc1/drivers/usb/slav
[Microcontroller]
u-boot-2011.06 supports NandFlash reading and writing in the transplantation based on s3c2440 development board
Since the NandFlash controllers of s3c2410 and s3c2440 are different, the s3c2440_nand.c file cannot be directly applied and needs to be modified appropriately. The main modification is the related registers of s3c2440. First, redefine the registers to be used, remove the macro definitions between lines 27 to 3
[Microcontroller]
U-Boot transplantation method on S3C44B0
Bootloader provides the embedded operating system with on-board hardware resource information, and further loads and boots the embedded operating system. Since the function of Bootloader is directly related to the CPU and microprocessor system, different CPU systems will require different Bootloaders. In addition to
[Microcontroller]
U-Boot transplantation method on S3C44B0
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号