U-Boot Platform/Board Initialisation
TracNav menu
-
User Guide
- Copyright Information
- Acknowledgements
- Terminology
- Introduction
-
PetaLinux Overview...
-
Working with PetaLinux - The Basics...
-
Customising PetaLinux...
-
Advanced Topics...
-
Debugging...
-
PetaLinux Bootloader Solutions
-
First Stage Boot (FS-Boot)...
-
U-Boot
- Overview
- Adding U-Boot
- Building U-Boot
- Customizing U-Boot
-
Using U-Boot
- Booting U-Boot
- Downloading Files
- Programming Flash
- Platform Initialisation
- Erase U-Boot Environment
- Updating Ethernet MAC Address in U-Boot
-
Supported Reference Designs...
- PetaLinux Tools Reference
- Getting Help
After an embedded system platform is manufactured, it needs to be configured and setup with the appropriate software and configurations before it is of any use. This process entails a whole series of sequential steps to give the board its identity and functionality.
In a conventional product development scenario, engineers would design procedures for bringing the board to live and also run automated testing routines to reduce the handling time during production.
PetaLinux provides a framework for embedded platform initialisation and testing, while ensuring maximium flexibility so that the user is able to incooperate vendor specific routines into this framework.
Concept
As part of the PetaLinux build process, a U-Boot pre-configuration script is automatically generated. This script will perform the common operations required in the early board-bringup phase, and prepare the board for ongoing development, and eventually deployment.
The script, called ub.config.img, is downloaded via serial port to U-boot on the first board boot. Details of this procedure are shown below.
The purpose of ub.config is to configure a sensible default environment for U-Boot.
By default, the ub.config.img file will be located in the /tftpboot directory on the development workstation (this may be changed in the PetaLinux System Configuration Menu), and also in petalinux-dist/images. The following text assumes the file is located in /tftpboot.
After this configuration script is run, then U-Boot and kernel images must be written into flash. These steps are also described below.
Platform Initialisation Procedures
Start Kermit
Ensure that the 'kermit' program is set up and started as per the Setting Up Kermit? chapter.
Boot up U-Boot on target platform
Boot up U-Boot, via FS-Boot as per the instructions outlined in the Booting U-Boot chapter.
Be sure to interrupt U-Boot's auto-boot sequence by pressing a key when requested.
Download the ub.config.img image script
Use the loadb command to download ub.config.img into the system's memory (see the U-Boot Serial File Download? section for details). Download the file to the start address of system memory.
Run the ub.config.img script
Once the image is downloaded, run the script with the U-Boot autoscr command:
U-Boot> autoscr $(fileaddr)
The $(fileaddr) string will be automatically expanded by U-Boot to match the download address, and should be entered literally.
Below is an example of the output messages for the platform initialisation process.
U-Boot> autoscr $(fileaddr) ## Executing script at 10000000 PetaLogix MicroBlaze-Auto Board Configuration --------------------------------------------- Network Configuration: MTD Configuration: Clobber DRAM Configuration: Bootloader Configuration: Kernel Configuration: Boot Configuration: Saving Configurations... Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... . done Erased 1 sectors Writing to Flash... done Protected 1 sectors Configuration Completed U-Boot>
Writing U-Boot into Flash Memory
The next step is to write the U-Boot binary image into the boot partition of the Flash memory. The image may be downloaded either by serial port or ethernet.
Serial download
Refer to the U-Boot Serial File Download? for details of the serial download procedure. The basic sequence is:
- In U-Boot, prepare for the download:
U-Boot> loadb $(clobstart)
- Start Kermit on the host, select and download the u-boot-s.bin file (located in /tftpboot or petalinux-dist/images)
Network download
Refer to the U-Boot Network File Download? for details of the network download procedure. The basic action is:
U-Boot> tftp $(clobstart) u-boot-s.bin
Write U-Boot image into Flash
After the U-Boot image is succesfully downloaded (either via serial or network as described above), the boot sector of the flash device can be erased, and the image written into it, using the commands shown below:
U-Boot> protect off $(bootstart) +$(bootsize) U-Boot> erase $(bootstart) +$(bootsize) U-Boot> cp.b $(fileaddr) $(bootstart) $(filesize)
Initialisation Completed
Once the initialisation is successfully completed, the target platform can be restarted and it should boot up with all the configured parameters.
