Overview
U-Boot is the bootloader used to boot Linux on the DAT Zynq development platforms. This currently includes the Zedboard, Xilinx ZC702, and the SLAC RCE.
When configured to do so, the Xilinx FSBL will launch the U-Boot elf image located on the first FAT partition on the SD media.
Updates have been made to the default Xilinx U-Boot distribution to support the DAT bootstrap interface (BSI) and the RCE hardware.
Installation
The distribution of U-Boot comes directly from the Xilinx open source repository. The current tag is v14.5, but the head of the repository is current being used.
U-Boot is downloaded from the Xilinx GIT repository. The development implementation resides in /afs/slac/g/cci/package/u-boot-xlnx
git clone git://git.xilinx.com/u-boot-xlnx.git
The the current tag v14.5 does not support the MMC FAT write functionality so the head must be used.
When Xilinx creates a tag that has this required functionality, one would check it out this way:
cd u-boot-xlnx git checkout xilinx-v14.5
To build the default Zedboard configuration:
cd u-boot-xlnx make zynq_zed_config make all
or
cd u-boot-xlnx make ARCH=arm zynq_zed
The current U-Boot installation is located at /u1/reg/dat/u-boot-xlnx.
Modifications
The default U-Boot code and board configuration requires several changes to support the following features:
- Storage of U-Boot environment variables to the MMC FAT partition in a binary file named uboot.env
- Loading of the zynq fpga fabric.
- Configuration of the in memory BSI structure.
- Configuration of the network switch (DTM only)
- Booting RTEMS images using the elf loader.
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.
Source Additions
The following files were updates to support reading of the mac address from the BSI structure:
- board/xilinx/zynq/rce.c/.h: Contains routines for BSI and switch initialization.
Source Changes
The following changes to U-Boot source code were required:
- include/configs/zynq_common.h: Added configuration defines. Updated default configuration.
- sdhci.c: Modification of MMC controller driver timeout values
- env_fat.c: Update to FAT driver file buffer alignment
- board/xilinx/zynq/Makefile: Updated to support usage of DAT shareables.
- board/xilinx/zynq/board.c: Updated board_late_init() to get environment variables, load the fpga fabric, and execute RCE initialization.
Configuration Additions
The following additions are required to the default zedboard and zc702 board configuration files:
- CONFIG_ZYNQ_BSI
- CONFIG_ENV_IS_IN_FAT
- CONFIG_SYS_MMC_ENV_DEV 0
- CONFIG_FAT_WRITE
- FAT_ENV_INTERFACE "mmc"
- FAT_ENV_DEVICE 0
- FAT_ENV_PART 1
- FAT_ENV_FILE "uboot.env"
- FPGA_BIT_FILE "fpga.bit"
- FPGA_LOAD_ADDR 0x1000000
- FPGA_LOAD_ADDR_STR "0x1000000"
The following additions are required to the default zynq_common board configuration files:
- to update detection of CONFIG_ENV_IS_NOWHERE to allow for CONFIG_ENV_IS_IN_FAT.
- CONFIG_CMD_ELF to support the bootelf command set.
A new configuration zynq_rce was created for the DAT RCE board.
Limitations
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.
Running U-Boot
Each SD card is distributed with boot.bin which contains the U-Boot image. U-Boot is execute immediately after a reset or power on.
At U-Boot startup, usage of the BSI sourced mac address 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>
Booting Linux
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:
- Linux kernel
- Device tree
- Ramdisk
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_ext3 run sdboot_ramdisk
Setting the default SD boot mode by updating the modeboot environment variable is currently TBD.
Booting RTEMS
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.
/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