U-Boot-2011.06 migration modification scheme supporting SD3 boot mode of S3C6410 processor

The Universal Bootloader (U-Boot) is the first software to run when a system powers on. It plays a crucial role in initializing the hardware and loading the operating system kernel into memory. Typically, during system installation, U-Boot requires specific tools to write its code into flash memory. The kernel and file system are also programmed using U-Boot commands, which can be time-consuming, error-prone, and not ideal for large-scale deployments.

The S3C6410 is an embedded processor based on the ARM11 architecture, developed by Samsung. It supports booting from an SD card in addition to traditional Flash-based boot modes. This paper explores the process of booting the system from an SD card using the S3C6410 and modifies the U-Boot source code to support this functionality. By doing so, the system can be installed with a single click, significantly simplifying deployment and reducing the complexity of embedded system setup.

1. U-Boot Working Principle

U-Boot's startup process is divided into two stages. The first stage is written in assembly language and is closely tied to the hardware platform. The second stage is implemented in C, offering better readability and portability, and handles most of the core functions of U-Boot. This design allows for easier porting, as the majority of the work involves modifying only the first stage, while the second stage remains largely unchanged.

The main tasks of the first stage include:

(1) Initializing hardware components;

(2) Preparing RAM space for the second stage;

(3) Copying the second stage code into RAM;

(4) Setting up the stack;

(5) Jumping to the C code entry point.

Once the environment is set up, U-Boot jumps to the second stage code. The second stage performs more advanced initialization, such as setting up serial ports, detecting memory mapping, loading the kernel and root file system, and passing boot parameters to the kernel. After that, it waits for user input. If there’s any input via the serial port, U-Boot enters interactive mode; otherwise, it proceeds to boot the operating system automatically.

2. Analysis and Porting of SD Card Boot Mode for S3C6410

2.1 SD Card Boot Principle of S3C6410

The S3C6410 supports multiple boot modes, including NOR Flash, NAND Flash, Modem, and iROM boot. In the iROM boot mode, the internal ROM provides support for SD card booting. When the SD card is selected as the boot device, the system starts by running the firmware stored in the iROM, known as BootLoader0 (BL0). This program performs initial setup and loads the first 8 KB of U-Boot code (BootLoader1 or BL1) from the SD card into internal memory, then executes it.

BL1 then loads the full U-Boot code (BL2) from the SD card into memory and jumps to its execution address, continuing the boot process.

2.2 SD Card Device Space Layout

To boot from an SD card, the BL1 code must be placed at a specific location on the card. Typically, it should be located at the start of the 18th block from the end of the SD card. It is also recommended to place BL2 immediately after BL1 in the data area for efficient loading.

2.3 Adding SD Card Boot Support to U-Boot

To enable SD card booting, the default U-Boot configuration needs modification. Specifically, the `bnand_boot` function in the `arch/arm/cpu/arm1176/start.S` file should be replaced with `mmc_boot_copy`. This function uses the built-in firmware of the S3C6410 to copy the entire U-Boot code from the SD card into memory and then jump to the appropriate entry point to continue execution.

3. Implementation of One-Click Offline System Installation

The version of U-Boot used in this project is U-Boot-2011.06, which supports FAT file system operations. It includes the `fatload` command, which allows loading files from an SD card into memory. The command format is as follows:

fatload [interface] [dev] [addr] [filename]

This command reads the specified file from the SD card and loads it into memory. Once the kernel image is loaded, the `flash` command can be used to program the system onto the target device, enabling a one-click installation process that streamlines deployment in embedded environments.

MT6-Subminiature Sealed Micro Switch

Features

â—† Designed For Water and Dust Tight(IP67)

â—† Small Compact Size
â—† UL&ENEC&CQC Safety Approvals
â—† Long life & high reliability
â—† Variety of Levers
â—† Wide Range of wiring Terminals
â—† Wide used in Automotive Electronics,Appliance and Industrial Control etc.

â—† Customized Designs


Safety Micro Switch,Central Locking Switch,Sealed Waterproof Micro Switch,Subminiature Sealed Micro Switch

Ningbo Jialin Electronics Co.,Ltd , https://www.donghai-switch.com