U-Boot Boot-up Process

The following diagrams show the U-Boot boot-up process.
Figure 1. U-Boot Boot-up Process 1

The following list provides a description of each procedure mentioned in the above diagram.

  • _start: Each board with the same arch has the same start.s file. The file is located under the arch directory. The _start as the first instruction the system will use when the core powers on.
  • CPU init: The CPU initialization step, which will set up all the CPU-related and specific registers. The step will also set up the RISC-V core-specific registers as illustrated in the above figure.
Note: U-Boot will only use one core for boot-up, all the other cores are set to idle mode. Most of the time U-boot does not use a secondary core until the Linux is up.
  • board_init_f_alloc_reserve: Reserve early malloc arena and global data struct arena.
  • harts_early_init: Configure proprietary settings and customized CSRs of harts.
  • board_init_f_init_reserve: Initialize reserved space.
  • board_init_f: Initialize the basic hardware and running environment before relocate symbols, such as CPU, timer, console, device tree etc.
  • jump_to_copy:Copy the global data struct to high address space and relocate the monitor code.
After the relocate symbols and the monitor code, the system will start the following boot-up process.
Figure 2. U-Boot Boot-up Process 2

The following list provides a description of each procedure mentioned in the above diagram.

  • board_init_r: The board initialization file. All the board-related initialization processes as illustrated in the above diagram will be performed one by one.
  • init_dm: Scan the device nodes and keep associated with the appropriate driver.
  • initr_net: The Ethernet initialization file. The file will initialize all the Ethernet interfaces you expect to include on your board.
  • main_loop: The final initialization step before the U-Boot pops up on your screen.

Result: After all of the entire processes, U-boot is up and ready for use.

In the initr_net process, a function named phy_init which is located under the drivers/net/phy/phy.c folder will be called to initialize the Ethernet PHY. See PHY Device Initialization for more information.