U-Boot , short for (Universal Boot Loader-loader), developed by Denx Software Engineering, is an open-source bootloader commonly used in embedded systems and development boards. It serves as the initial program that loads the operating system, notably the Linux kernel, into memory DRAM and prepares the system for execution. U-Boot is highly configurable and supports a wide range of architectures and hardware platforms. Moreover, it is licensed as free software under the GNU General Public License, fostering collaborative development and widespread adoption.
Refer to:
The U-Boot Official Web: U-Boot
The U-Boot Documentation: The U-Boot Documentation
U-Boot 2024.07 is downloaded from: u-boot-2024.07.tar.bz2
Table of Contents
Table of Contents | ||
---|---|---|
|
Features of U-Boot
Key features and characteristics of U-Boot include:
Versatility: U-Boot is designed to be versatile and can be adapted to various architectures, including ARM, MIPS, x86, PowerPC, and more. This adaptability makes it a popular choice for a wide range of embedded systems and development boards.
Open Source: U-Boot is released under the GNU General Public License (GPL), providing users with the freedom to view, modify, and distribute the source code. This open-source nature encourages collaboration and allows developers to tailor the bootloader to specific requirements.
Boot Sequence Control: U-Boot handles the initialization and configuration of the hardware during the boot process. It allows users to interact with the bootloader through a command-line interface, enabling them to control the boot sequence, load kernel images, and set various parameters.
Support for Various Storage Devices: U-Boot supports loading firmware and kernel images from a variety of storage devices, including NAND and NOR flash memory, SD cards, USB storage, TFTP (Trivial File Transfer Protocol) servers, and more.
Environment Variables: U-Boot allows the configuration of environment variables that store important settings, such as boot parameters and memory addresses. These variables provide flexibility and ease of customization for different hardware setups.
Network Booting: U-Boot supports network booting, allowing systems to load kernel images and other files over the network using protocols like TFTP or NFS (Network File System). This is particularly useful in embedded systems where storage may be limited or unnecessary.
Development and Debugging Tools: U-Boot includes tools for debugging and development, such as memory and register inspection, script execution, and support for common debugging interfaces like JTAG (Joint Test Action Group).
Community Support: U-Boot has an active community of developers and users. The community provides documentation, forums, and support, making it easier for users to troubleshoot issues, share knowledge, and stay updated on the latest developments.
U-Boot is widely used in embedded systems, development boards, and various open-source projects due to its flexibility, open-source nature, and broad hardware support. It plays a crucial role in the boot process of many embedded devices, enabling the loading and execution of operating systems on diverse hardware platforms.
...
.
Features of U-Boot of SP7350 Platform
U-Boot serves as the second-stage boot-loader in this system. U-Boot is widely used in embedded systems, supporting various computer architectures. It is free software under the GNU General Public Licensebootloader in SP7350 platform. After initializing itself, U-Boot then loads Linux kernel image from external storage devices into DRAM and executes it. As it runs in DRAM, its size is no longer limited by SRAM of SP7350 (only limited by the system's DRAM size), ranging from hundreds of kilobytes to several megabytes.
Apart from being its role as a bootloader for loading the Linux kernel, U-Boot supports access to reading images from external storage devices like such as USB flash drives , or SD cards , hard disks, reads and burns and writing images into NOR flash, NAND flash, and eMMC , and supports file systems such as FAT, ext2, ext3, ext4, nfs, ubifs. It also supports network protocols and functions like Ethernet, DHCP, BOOTP, TFTP, NFS, among many others. After initializing itself and external devices, U-Boot then loads Linux from external storage into DRAM and executes it.
General features
devices in system. Key features of U-Boot for SP7350 are as follows:
Support console at UART0 (@ 115,200 bps).
Support booting Linux from SPI-NOR flash
...
, SPI-NAND
...
flash, 8-bit NAND
...
Support booting Linux from eMMC device.
...
flash or eMMC device.
Support in-system program (ISP) for SPI-NOR flash
...
, SPI-NAND
...
flash, 8-bit NAND
...
flash or eMMC device.
Support read
...
images
...
from USB flash drives or SD cards for in-system program (ISP).
Support secure-boot (check hash value of Linux image).
Support fastboot function for eMMC device.
Support fastboot function for SPI-NAND and 8-bit NAND flashes (only for updating Linux kernel or rootfs partition).
...
Supported Drivers for SP7350 Platform
The source files of U-Boot are conveniently located within the "boot/uboot/" directory under the project's top directory. For the SP7350 platform, a wide array of device drivers is supported. These drivers are within the "drivers" directory. Below is a reference table detailing the drivers along with their corresponding feature descriptions:
Drivers | Folders or files | Features Feature descriptions | |
8-bit NAND | drivers/mtd/nand/raw/sp_paranand/ |
| |
Clock | drivers/clk/sunplus/ |
| |
eMMC | drivers/mmc/sp_mmc*.* Support U-Boot |
| |
Giga Ethernet | drivers/net/designware.c* |
| |
fastboot | fastboot/ |
| |
I2C | drivers/i2c/spdesignware_i2c_mas.c Support* |
| |
NVNEM (OTP) | drivers/soc/sunplus/ |
| |
Reset | drivers/reset/reset-sunplus.c |
| |
Pinctrl | drivers/pinctrl/sunplus/ Support |
| |
SD card | drivers/mmc/sp_sd*.* |
| |
SPI | drivers/spi/designware_spi.c |
| |
SPI-NAND | drivers/mtd/nand/raw/sp_*_q645.* |
| |
SPI-NOR | drivers/mtd/spi/spi-nor-ids.c spi/sp_spi_nor.c |
| |
UART | drivers/serial/serial_sunplus.c |
| |
USB2.0 EHCI | drivers/usb/host/ehci-sunplus.c |
| |
USB2.0 OHCI |
| Support usb/host/ohci-sunplus.c |
|
USB2.0 UDC | usb/gadget/sp_udc.c |
| |
USB3.0 DRD driver | drivers/usb/host/xhci-spdwc3.c drivers/usb/gadget/spdwc3_udc.c |
| |
Video (MIPI/DSI-TX) | drivers/video/sunplus/sp7350/disp/ |
|
Other files
...
Type
SP7350 Platform-specific Files or Folders
Board-specific Files
...
...
board
...
board/sunplus/sp7350/
...
...
machine
...
arch/arm/mach-pentagram/
...
scripts
...
include/configs/
Board-specific files for the SP7350 platform can be found in the “board/sunplus/” directory. Below is a breakdown of the folders and their descriptions:
Folders | Descriptions |
common/secure_sp7350/ | Contains files related to secure boot functionality. |
sp7350/ | Houses SP7350 platform-specific or hardware-specific files. |
Architecture-specific Files
Architecture-specific files for the SP7350 platform are situated at “arch/arm/” within the U-Boot directory. Here's a summary of the files and folders:
Files or folders | Descriptions |
cpu/armv8/ | Contains ARMv8 CPU (ex: Cortex A55) related files. |
mach-pentagram/include/mach | Contains platform or hardware-related header files. |
mach-pentagram/cpu.c | Encompasses subroutines responsible for CPU reset, memory mapping, DRAM configuration, and more. |
Configuration Header File
The configuration header file comprises board-specific configuration options, hardware parameters, and initialization settings tailored to the target platform. For the SP7350 platform, the configuration header file is “include/configs/pentagram_common_sp7350_c.h
...
defconfig files
...
configs/
...
.”
Default Configuration Files
Default configuration files of U-Boot are stored in the “configs” directory. Specifically for the SP7350 platform, default configuration files are prefixed with “sp7350_”.
Device-tree Source Files
U-Boot and Linux share device-tree source files, situated in the directory:
'linux/kernel/arch/arm64/boot/dts/sunplus/'
For usage guidance, please consult:
https://sunplus.atlassian.net/wiki/x/HwB8dg
U-Boot Log and Explanation
Line 1: The banner (version) of U-Boot.
Line 3: The size of the CPU cache-line is 64 bytes.
Line 4: Model name is ‘Sunplus SP7350 EVB’.
Line 5: The DRAM size is 3.8 GiB.
Line 6: PLLA (Audio PLL) is set to 147,456,000 Hz.
Line 7: PLLC (CPU frequency) is set to 1,500,000,000 Hz.
Line 8: PLLL3 (L3 cache frequency) is set to 1,200,000,000 Hz.
Line 9: PLLD (SDRAM PLL) is set to 800,000,000 Hz.
Line 10: PLLH (Peripheral PLL) is set to 2,150,000,000 Hz.
Line 11: PLLN (NPU PLL) is set to 500,000,000 Hz.
Line 12: PLLS (System PLL) is set to 2,000,000,000 Hz.
Line 17: The U-Boot environment variable is successfully loaded.
Line 18-21: The display is successfully probed.
Line 22-24: Standard input, output and error are directed to the serial (UART0)
Line 27-39: Initializing and scanning USB devices.
Line 41: Starting to run the default script command.
Line 42: Boot-device is 0x1F (MX[6..2]), indicating eMMC boot.
Line 43: “[scr] emmc boot” indicates that U-Boot is executing the default 'eMMC boot' script.
Line 45: Loading the header of the Linux kernel image.
Line 47: Loading the Linux kernel image.
Line 48-49: Unzipping the Linux kernel image.
Line 50-57: Preparing to run Linux kernel.
Code Block |
---|
U-Boot 2024.07-gc1f79898b (Sep 26 2024 - 18:41:04 +0800)
CONFIG_SYS_CACHELINE_SIZE: 64
Model: Sunplus SP7350 EVB
DRAM: 3.8 GiB (effective 4 GiB)
PLLA : 147456000 Hz
PLLC : 1500000000 Hz
PLLL3 : 1200000000 Hz
PLLD : 800000000 Hz
PLLH : 2150000000 Hz
PLLN : 500000000 Hz
PLLS : 2000000000 Hz
reset: reset@f8800004
Core: 338 devices, 21 uclasses, devicetree: separate
SPI: Manufacturer id = 0x00, Device id = 0x0000
MMC: emmc: 0, sd: 1
Loading Environment from MMC... Reading from MMC(0)... OK
Disp: probe ...
Disp: init 1920x1080 settings
Disp: init lt8912b bridge ic
Disp: probe done
In: usbkbd,serial
Out: vidconsole,serial
Err: vidconsole,serial
Net: eth0: stmmac@f8103000
starting USB...
Bus usb@f8102100: ehci_sunplus_probe.164, dev_name:usb@f8102100,port_num:0
after write usbruncmd,usbcmd:80b01,retry_times:0
USB EHCI 1.10
Bus usb@f8102080: ohci_sunplus_probe.51, dev_name:usb@f8102080,port_num:1
USB OHCI 1.0
Bus dwc3@f80a1000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@f8102100 for devices... 1 USB Device(s) found
scanning bus usb@f8102080 for devices... 1 USB Device(s) found
scanning bus dwc3@f80a1000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
[scr] bootcmd started
fa218008: 0000001f ....
[scr] emmc boot
MMC read: dev # 0, block # 8738, count 1 ... 1 blocks read: OK
MMC read: dev # 0, block # 8738, count 18262 ... 18262 blocks read: OK
unzip 10000000 2000000
Uncompressed size: 22896648 = 0x15D6008
booti 2000000 - ef8db4b0
## Flattened Device Tree blob at ef8db4b0
Booting using the fdt blob at 0xef8db4b0
Working FDT set to ef8db4b0
Loading Device Tree to 00000000ee8b1000, end 00000000ee8c28bb ... OK
Working FDT set to ee8b1000
Starting kernel ... |