U-Boot is the bootloader used to boot RTEMS and Linux on the DAT Zynq development platforms. This currently includes the Zedboard, Xilinx ZC702, and the SLAC RCE.
Updates have been made to the default Xilinx U-Boot distribution to support the DAT bootstrap interface (BSI) and the RCE hardware.
The distribution of U-Boot used as the base for the DAT RCE specific modifications comes directly from the Xilinx open source repository.
The development implementation resides in /afs/slac/g/cci/package/u-boot-xlnx and is based on the xilinx-v14.6.01 tag.
To build the default Zedboard configuration:
setenv CROSS_COMPILE arm-xilinx-eabi- cd u-boot-xlnx make zynq_zed_config make all |
or
cd u-boot-xlnx setenv CROSS_COMPILE arm-xilinx-eabi- make ARCH=arm zynq_zed |
The current production U-Boot installation is located at /afs/slac/g/cci/package/u-boot-xlnx
The default U-Boot code and board configuration requires several changes to support the following features:
The uboot.env file is distributed with each SD card image.
The mac address stored in the U-Boot environment will be used for booting RTEMS and Linux.
The following files were updates to support reading of the mac address from the BSI structure:
The following initial changes to U-Boot source code were required:
Additional modifications to the SD driver source were made to optimize performance:
U-Boot includes several header files and libraries built from a workspace.
U-Boot writes values to the BSI space to report completion of stages in the boot process.
When compiling U-Boot, the DAT_ROOT environment variable must be set to a production workspace.
The two archive libraries listed above must be built prior to compiling U-Boot.
The following additions are required to the default zedboard and zc702 board configuration files:
The following additions are required to the default zynq_common board configuration files:
A new configuration zynq_rce was created specifically for the DAT RCE board.
Once all modifications have been made, build the DAT RCE U-Boot image:
cd u-boot-xlnx make zynq_rce_config - for DAT DTM/DPM hardware make zynq_zed_config - for Zedboard make zynq_zc70x_config - for Xilinx eval zc702 make all |
or
cd u-boot-xlnx make ARCH=arm zynq_rce - for DAT DTM/DPM hardware make ARCH=arm zynq_zed - for Zedboard make ARCH=arm zynq_zc70x - for Xilinx eval zc702 |
The output elf file produced by U-Boot is called u-boot. For use with the DAT build system, the output file needs to be renamed appropriately, based on the build target:
for zynq_rce cp u-boot u-boot_rce.elf for zynq_zed cp u-boot u-boot_zed.elf for zynq_zc70x cp u-boot u-boot_zc70x.elf |
The file uboot.env on the FAT partition, which stores the U-Boot environment variables, can only be located in the root directory.
This is a limitation of the U-Boot FAT file driver which does not support writing to or creation of files that are not located in the root directory.
Consequently, the file must reside along side the FSBL boot.bin and its configuration files.
Each SD card is distributed with boot.bin in the boot partition. This file contains the first stage bootloader (fsbl) and the U-Boot image. The fsbl is executed immediately after a reset or power on, followed by the U-Boot elf image.
At U-Boot startup, the mac address written to the BSI is output as follows:
DRAM: 512 MiB WARNING: Caches not enabled MMC: zynq_sdhci: 0 reading uboot.env In: serial Out: serial Err: serial Net: bsi mac 08:00:56:00:43:10 Net: Gem.e000b000 Hit any key to stop autoboot: 0 zynq-uboot> |
Updates to any environment variables environment can be saved to the SD media using the saveenv command.
zynq-uboot> saveenv Saving Environment to FAT... writing uboot.env done zynq-uboot> |
The Xilinx open source Linux kernel is used along with either a ramdisk image or an ext3 filesystem image.
U-Boot must be configured to locate up to three required files on the SD media. These files include:
Configuration of the Xilinx Linux kernel, device tree, and file systems will be discussed in the Linux on Zynq Confluence page (TBD)
To boot Linux from an SD card formatted and configured for use with the DAT Xilinx FSBL:
devicetree_image=devicetree.dtb kernel_image=uImage ramdisk_image=uramdisk.image.gz |
Boot Linux using the appropriate arguments to the run command
run sdboot_linux run sdboot_ramdisk |
Setting the default SD boot mode by updating the modeboot environment variable is currently TBD.
The default RTEMS elf image urtems.elf is located on partition 5 of the SD media.
All RTEMS elf images must first be wrapped in a U-Boot header.
The DAT build system produces a U-Boot header wrapped RTEMS kernel image during compilation:
udbi.2.3.prod.elf
udbi.2.3.devel.elf
udbi.2.3.rescue.elf
When updating urtems.elf, one of these images should be copied to the SD card as urtems.elf.
Use the following command to manually create the wrapped RTEMS image.
/u1/reg/package/u-boot-xlnx/tools/mkimage -a 0x3000040 -e 0x104200 -C None -A arm -T kernel -O rtems -n dbi.2.3.devel -d ${DAT_ROOT}/build/platform/bin/arm-rtems-rceCA9-opt/dbi.2.3.rescue urtems.elf |
The RTEMS elf image can be booted via U-Boot by executing:
run sdboot_rtems |
It is possible to convince U-boot to load the system image from NFS on a zedBoard or a zc702. To do so, reset the board (using xmd or something else) and when the U-boot console says to "hit any key to stop autoboot", do so.
Set the following variables at the U-boot prompt:
setenv nfsboot_rtems echo Copying RTEMS from NFS to RAM... && nfs 0x3000000 /nfsexport/<wherever> && bootelf -p 0x3000000 setenv serverip <ip_of_rdsrv101_on_network> setenv modeboot nfsboot_rtems setenv ipaddr <your_board's_ip> saveenv |