Building U-Boot 18.1

This guide covers the creation of the Critical Link provided preloader and U-Boot images. Because of the sensitivity of the preloader to the HPS peripheral pin multiplexing and boot options, you must follow the basic flow for generating the auto-generated files used by both the preloader and the U-Boot applications prior to being able to build a working copy of either one. 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 these steps.

Note: The file names and some commands are designed specifically for use with the sample FPGA projects provided by Critical Link.

Building the preloader and U-Boot

  1. Launch the Intel Embedded Command Shell.

    Press start button and enter SoC EDS 18.1 Command Shell
  2. Launch the BSP Editor application.
    bsp-editor &
  3. Select File->New HPS BSP....
  4. Set the Preloader settings directory to <project>/hps_isw_handoff/{qsys_inst_name}_hps_0.
  5. Uncheck Use default locations.
  6. Set the BSP target directory to <project>/software/preloader. Note: The BSP Settings file name will update automatically.
  7. Click OK.
  8. In the BSP Editor, change the name of the PRELOADER_TGZ file for U-Boot to just uboot-socfpga.tar.gz (remove the path). This will tell the BSP Editor to use a local copy of the tarball that we will download in subsequent steps.
  9. Make any additional changes as needed. 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.
  10. Click Generate.
  11. Change to <project>/software/preloader.
  12. Modify <project>/software/preloader/Makefile to use the MitySOM-5CSx board configuration instead of the stock Altera DevKit configuration.
    sed -i 's/socfpga_\$(DEVICE_FAMILY)/mitysom-5csx/' Makefile
    sed -i 's/altera\/socfpga/cl\/mitysom-5csx/' Makefile

    1. If you are compiling in Cygwin, run the following command to pick up needed compatibility patches for MinGW during the build process. This command assumes the SoC EDS is installed to C:/intelFPGA/18.1.
      cp /cygdrive/c/intelFPGA/18.1/embedded/host_tools/altera/preloader/uboot-socfpga.patch/cygwin/* .
    2. Fix a permission issue with the generated code.
      sed -i '/update-src:/a\\t@$(CHMOD) -R 755 $(PRELOADER_SRC_DIR)' Makefile
      sed -i '/@$(CP) -v $< $@/a\\t@$(CHMOD) -R 755 $(PRELOADER_SRC_DIR)' Makefile
  13. 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
  14. Build the preloader. The image will be found at <project>/software/preloader/preloader-mkpimage.bin.
  15. Build U-Boot. The image will be found at <project>/software/preloader/uboot-socfpga/u-boot.img.
    /usr/bin/make uboot

Building the U-Boot environment

After building U-Boot, the environment must be created. This environment will be stored on the SD card and is used to tell U-Boot where to load the kernel, FPGA image, device tree, and root filesystem from.

  1. Change to <project>/software/preloader.
  2. Build the U-Boot environment image. uBootMMCEnv.txt is a human-readable file which has all the U-Boot environment variables required to boot Linux from the SD card. ubootenv.bin is a binary blob that U-Boot will read on startup to populate its environment variables. The image will be found at <project>/software/preloader/ubootenv.bin.
    uboot-socfpga/tools/mkenvimage -s 4096 -o ubootenv.bin uBootMMCEnv.txt

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