Flashing an SD Image

Overview

The directory /afs/slac/g/cci/sdimages contains the necessary files for flashing an SD card with an RCE image.

Most folks should just contact Sergio Maldonado (smaldona@slac.stanford.edu) to obtain an SD card that is suitable for your board.

Otherwise, the following page describes the SD content and how to create one on your own.

Board Specific Files

Board specific files in /afs/slac/g/cci/sdimages/current are contained in subdirectories dtm, dpm, zc70x, and zed.  These files include the bootloader image, firmware image, and devicetree.

These files are unique to the type of board and must reside in the appropriate SD partition.

Device Specific Files

Device specific files are the U-boot environment files (uboot.env).  These files are unique to a physical device and must reside in the boot partition of the SD (partition 1).

Imaging instructions

RCE SD cards may only be formatted using an SD card reader attached to the SLAC machine rddev109.

Insert an SD card in one of the SD readers attached to rddev109 and note the device label (i.e. sd[d|f|h|j|l|n|p|r|t|v]).

Log into rddev109 and execute mkrcesd with the appropriate arguments.

The script will format the SD card and populate it with software to support booting RTEMS and Linux.

The first argument must be the SD device as noted on the label on the SD card reader.

The second argument must be the target platform the SD is being generated for: dpm, dtm, zed, or zc70x.

If not specifying a mac address, one will be allocated from the hardware database.  See HWDB Python software for details on the hwdb.

sudo /afs/slac/g/cci/bin/mkrcesd

Usage: sudo mkrcesd <sd[d|f|h|j|l|n|p|r|t|v]> <dpm|dtm|zed|zc70x>
Format and populate an RCE SD card (must be run as sudo).
Options:
    [--mac mac-address] [--workspace path-to-workspace]
    [--bsigroup bsi-group-id] [--bootos <rtems|linux|ramdisk>]
Examples:
    sudo mkrcesd sdd dpm (format SD at /dev/sdd for dpm, query hwdb for mac, use default workspace, default boot OS)
    sudo mkrcesd sdf dtm --mac 08:00:56:00:ff:ff (set mac - no hwdb query)
    sudo mkrcesd sdd dpm --workspace $DAT_ROOT (override default workspace)
    sudo mkrcesd sdd zed --bsigroup zed7 (set bsigroup - only valid for zed and zc70x)
    sudo mkrcesd sdd dpm --bootos linux (set boot OS linux)
 

Batch Imaging

All 9 cards needed to fully populate a COB can be created using the batch script mkcobsdbatch

You must be sudo to run mkcobsdbatch!

Usage: sudo mkcobsdbatch


Formats 9 SD cards to fully populate a COB (must be run as sudo on rddev109).
The DTM card is always located in the SD reader slot with label 'sdd'.
All 9 SD reader slots must be populated with 32Gb cards.
Formatting for all 9 cards is executed in parallel.
Expect 3-4 minutes total time for all cards to finish.


This script will result in allocation of 9 MAC addresses from the hwdb.
Utilizes released software from /afs/slac/g/cci/sdimages/current
 

Manually Generating U-Boot Environment Files

The U-boot environment files may be generated manually using /afs/slac/g/cci/sdimages/workspaces/current/bin/mkubootenv.  

Usage: mkubootenv <outfile> <mac> <phy> <boot_mode>

outfile - name of the output environment file, i.e. uboot.env

mac - mac address formatted as 00:11:22:33:44:55

phy - the PHY configuration for rce.  Specify 0x1 as the default.

boot_mode - The default auto-boot source.  Choose one of sdboot_linux, sdboot_ramdisk, sdboot_rtems.

For example:

mkubootenv uboot_ramdisk.env 08:00:56:00:88:99 0x1 sdboot_ramdisk

mkubootenv uboot_linux.env 08:00:56:00:88:99 0x1 sdboot_linux

mkubootenv uboot_rtems.env 08:00:56:00:88:99 0x1 sdboot_rtems

The default U-boot environment file, uboot.env, must be a copy of one of the above generated files.

Partition Layout

Partition 1

This is the boot partition.  It contains the bootloader (fsbl + u-boot), environment settings, and the device firmware image.

This partition contains a README which describes the full partition layout of the SD card.

boot.bin - Bootloader image containing the first stage bootloader (fsbl) and the DAT specific version of U-boot. This file is generated when building /bootstrap/bootLoader from the DAT repository.

Target HardwareLocation of boot.bin
zedboardbuild/bootstrap/bin/arm-eabi-zedCA9-opt
zc70xbuild/bootstrap/bin/arm-eabi-zcCA9-opt
dpmbuild/bootstrap/bin/arm-eabi-rceCA9-opt
dtmbuild/bootstrap/bin/arm-eabi-cmCA9-opt

fpga.bit - The device firmware image auto-loaded by U-boot

uboot.env - The default U-boot environment settings file.  This file should be a copy of one of the available selections.  Contains mac address, PHY configuration, boot mode, etc.

uboot_linux.env - U-boot environment file with Arch Linux boot enabled.

uboot_ramdisk.env - U-boot environment file with Linux ramdisk boot enabled.

uboot_rtems.env - U-boot environment file with RTEMS boot enabled.

Partition 2

This partition for user storage.  Its contents are not under any configuration control.

Partition 3

This partition contains the Arch Linux ARM filesystem.  May contain RCE specific configuration, libraries, and executables.

Partition 4

This is the extended partition and is not accessible.

Partition 5

This is the RTEMS system partition.  It contains the RTEMS kernel image and any additional required files.

Partition 6

 

This is the RTEMS application specific partition.  It contains configuration files used by the RTEMS system startup.

Partition 7

This is the Xilinx Linux kernel partition.  It contains the linux kernel image and any additional required files.

uImage - The Xilinx Linux kernel with U-boot header.  May contain DAT specific configuration and kernel drivers.

devicetree.dtb - The device specific configuration tree for use with the Arch Linux ARM ext3 partition.

devicetree_ramdisk.dtb - The device specific configuration tree for use with a ramdisk.

uramdisk.image.gz - The Xilinx Linux ramdisk filesystem.


  • No labels