[Xilinx] MPSOC startup process (5) - Uboot

This series of blogs only introduces the development of the PS side (ARM part) of the Xilinx platform, and does not introduce too much about PL (FPGA).

Table of contents

五. run_main_loop

5.1 main_loop

6. Automatically execute the boot kernel

​​​​​​​6.1 autoboot_command

​​​​​​6.2 Script startup

6.2.1 ​​​​​​​QSPI

​​​​​​6.2.2 EMMC/SD startup


五. run_main_loop

This function will enter the countdown after uboot starts. If you press the Enter key before the countdown ends, it will enter the uboot command mode. If you do not press the Enter key after the countdown ends, it will automatically start Linux. kernel.

5.1 main_loop

       1.autoboot_command: Check whether the countdown is over

       2.cli_loop: command line processing function of uboot

​​​​​​​​​​​​​​

6. Automatically execute the boot kernel

​​​​​​​6.1 autoboot_command

When no key is pressed during the countdown, autoboot_command will be executed

       Here the value of S is run distro_bootcmd

​​​​​​6.2  Script startup

       The value of Distro_bootcmd is a script, looking for the environment variable value of the corresponding startup method

       Finally, the boot.scr script will be found to perform image, device tree, etc., and start work

6.2.1 ​​​​​​​QSPI

If it is the QSPI startup mode, execute the contents of the bootcmd_qspi0 environment variable

sf probe 0 0 0: load qspi driver

sf read $scriptaddr $script_offset_f $script_size_f : read script from qspi flash into memory

source ${scriptaddr}: execute script boot.scr

​​​​​​6.2.2  EMMC/SD startup

If it is EMMC/SD startup mode, execute the contents of the bootcmd_mmc0/1 environment variable: devnum=0/1; run mmc_boot

run mmc_boot -> run scan_dev_for_boot_part -> run scan_dev_for_boot ->

run scan_dev_for_scripts

The content of scan_dev_for_scripts is: Find out if there is a boot.scr script in the MMC partition

If there is a script, execute run boot_a_script

The value of boot_a_script: load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr} loads the script in the partition and source executes the script

Guess you like

Origin blog.csdn.net/qq_37755518/article/details/130193387