- Table of contents
- Building u-Boot and Preloader
Building u-Boot and Preloader¶
These instructions are valid for Quartus 14.1 tools and SOC EDS.
Project Locations¶
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:
- Compile your FPGA project. This generates the necessary HPS software handoff files.
- Launch an altera embedded command shell
Linux:{install_directory}/altera/14.1/embedded/embedded_command_shell.sh
Windows:Press start button and enter *SoC EDS 14.1 Command Shell*
- Launch the bsp-editor application.
bsp-editor &
- Select File
> New BSP...[In newer versions of bsp-editor, it's File>New HPS BSP...] - Set the Preloader settings directory to /hps_isw_handoff/{qsys_inst_name}_hps_0
- Click OK
- 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.
- 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
- Make any additional settings needed, and hit generate.
- 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).
- 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 > Makefile.new sed 's/altera\/socfpga/cl\/mitysom-5csx/' Makefile.new > Makefile
- 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/* .
- 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
- Download a tarball of the u-boot archive from our server.
git archive --format=tar.gz --prefix=uboot-socfpga/ --remote=git://support.criticallink.com/home/git/u-boot-socfpga.git socfpga_v2013.01.01 > uboot-socfpga.tar.gz
- Build the Preloader
make
- 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
Steps:
- Change your working directory to the software/spl_bsp folder. This directory is in the root of your Quartus project.
- 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. - 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. - 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