Building u-Boot and Preloader

These instructions are valid for Quartus 14.1 tools and SOC EDS.

Project Locations

On the Virtual Machine On the Support git Server
5CSX-H6-42A /home/user/projects/mitysom_5csx_dev_board/dev_5csx_h6_42a;a=summary
5CSX-H6-4YA /home/user/projects/mitysom_5csx_dev_board/dev_5csx_h6_4ya;a=summary
5CSX-H5-4YA /home/user/projects/mitysom_5csx_dev_board/dev_5csx_h5_4ya;a=summary
5CSX-H6-53B /home/user/projects/mitysom_5csx_dev_board/dev_5csx_h6_53b;a=summary
5CSE-L2-3Y8 /home/user/projects/mitysom_5cse_dev_board/dev_5cse_l2_3y8;a=summary
5CSE-H4-3YA /home/user/projects/mitysom_5cse_dev_board/dev_5cse_h4_3ya;a=summary

Building a "stock" Preloader and u-Boot for the MitySOM-5CSX module

Because of the sensitivity of the Preloader to the HPS peripheral pin multiplexing and boot options, you need to follow the basic flow for generating the auto-generated files used by both the preloader and the u-Boot application prior to being able to build a working copy of either application. The auto-generated files are not included in the git repository, so you won't be able to build a preloader or a u-Boot image unless you follow the steps:

  1. Compile your FPGA project. This generates the necessary HPS software handoff files.
  2. Launch an altera embedded command shell

    Press start button and enter *SoC EDS 14.1 Command Shell* 
  3. Launch the bsp-editor application.
    bsp-editor &
  4. Select File > New BSP... [In newer versions of bsp-editor, it's File>New HPS BSP...]
  5. Set the Preloader settings directory to /hps_isw_handoff/{qsys_inst_name}_hps_0
  6. Click OK
  7. In the bsp-editor, change the name of the PRELOADER_TGZ file for uboot to just "uboot-socfpga.tar.gz" (remove the paths). This will tell the bsp-editor to use a local copy of the tarball that we will download in subsequent steps.
  8. If you are building a preloader for a 5CSX module with ECC then in the bsp-editor, Click Advanced and Check the checkbox for SDRAM_SCRUBBING
  9. Make any additional settings needed, and hit generate.
  10. Change your working directory to the software/spl_bsp folder which is located in the project directory for your specific SoM (see "Project Locations" above).
  11. Modify 2 lines in the Makefile to use the mitysom-5csx board configuration instead of the stock Altera DevKit configuration using the 2 commands below:
    sed 's/socfpga_\$(DEVICE_FAMILY)/mitysom-5csx/' Makefile >
    sed 's/altera\/socfpga/cl\/mitysom-5csx/' > Makefile
  12. If you are compiling under windows in cygwin, run the following command to pick up needed compatibility patches for minggw during the build process. This command is expecting the SOC EDS to be installed to C:/altera/14.1
    cp /cygdrive/c/altera/14.1/embedded/host_tools/altera/preloader/uboot-socfpga.patch/cygwin/* .
  13. If you are using windows run the following to fix a permissions issue with the generated code
    sed -i '/update-src:/a\\t@$(CHMOD) -R 755 $(PRELOADER_SRC_DIR)' Makefile
  14. Download a tarball of the u-boot archive from our server.
    git archive --format=tar.gz --prefix=uboot-socfpga/ --remote=git:// socfpga_v2013.01.01 > uboot-socfpga.tar.gz
  15. Build the Preloader
  16. Build u-Boot
    make uboot

Creating the u-Boot environment for the MitySOM-5CSX Dev Kit

With u-Boot built, now the environment needs to be created. This environment will be stored on the SD card and it used to tell u-Boot where to load the kernel/fpga image/device tree/root filesystem from. These instruction will show how to build this environment for our dev kit, which boots off of SD card.

NOTE: These steps assume that Building a "stock" Preloader and u-Boot for the MitySOM-5CSX module was already run


  1. Change your working directory to the software/spl_bsp folder. This directory is in the root of your Quartus project.
  2. Download the uBootMMCEnv.txt file and store it in the software/spl_bsp.
    The uBootMMCEnv.txt is a human readable file that has all the u-Boot environment variables to boot linux from the SD card.
  3. Run the following in the terminal
    uboot-socfpga/tools/mkenvimage -s 4096 -o ubootenv.bin uBootMMCEnv.txt

    This step will convert uBootMMCEnv.txt to ubootenv.bin, which is a binary blob that u-Boot will read on startup to populate its environment variables.
  4. Now this ubootenv.bin will be used in the Building SD Card Image to create the SD card image.

Updating the SD Card

See the ARM Software FAQs for details on updating the SD card with the new u-Boot and Preloader.

Go to top
Add picture from clipboard (Maximum size: 600 MB)