Hi,
For Cyclone V SoC Baremetal, hwlib + QSPI with U-boot SPL, the files required are:
- U-boot-spl.sfp
- application.img
We use the latest building bootloader to get the U-boot file all the way from Quartus up to Configure and build U-Boot:
https://www.rocketboards.org/foswiki/Documentation/BuildingBootloaderCycloneVAndArria10#Cyclone_V_SoC_45_Boot_from_QSPI
Then, get HWLib and install the toolchain:
cd $TOP_FOLDER
git clone https://github.com/altera-opensource/intel-socfpga-hwlib
cd intel-socfpga-hwlib/tools
./install_linaro.sh
export PATH=`pwd`/gcc/bin:$PATH
#Reference:
https://www.rocketboards.org/foswiki/Documentation/HWLib#Installation
Build the application:
cd $TOP_FOLDER
cd intel-socfpga-hwlib/examples/CVAV/Altera-SoCFPGA-HardwareLib-Timer-CV-GNU/
# build once to bring hwlibs code
make SEMIHOSTED=0 MEMORY=ddr
# cleanmake
make clean
# change hwlibs link address to match what U-Boot wants
sed -i 's/0x00100040/0x01000040/g' hwlib/src/linkerscripts/cvav-ddr.ld
# move stack out of the way just in case
sed -i 's/0x80000/0x00200000/g' hwlib/src/linkerscripts/cvav-ddr.ld
# build again with the new address
make SEMIHOSTED=0 MEMORY=ddr
# create binary file
arm-eabi-objcopy -O binary application.elf application.bin
# create img file
$TOP_FOLDER/cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/tools/
mkimage -A arm -T standalone -C none -a 0x01000040 -e 0x01000040 -n "bare-metal image" -d application.bin application.img
Build the QSPI image to be flash:
cd $TOP_FOLDER
cat cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/spl/u-boot-splx4.sfp \
intel-socfpga-hwlib/examples/CVAV/Altera-SoCFPGA-HardwareLib-Timer-CV-GNU/application.img \
> qspi-image.bin