Hi,
Please follow the below link to build the bootloader for Cyclone V.
https://www.rocketboards.org/foswiki/Documentation/BuildingBootloaderCycloneVAndArria10#Cyclone_V_SoC_45_Boot_from_SD_Card
1.Get hwlibs, install toolchain
cd $TOP_FOLDER
git clone https://github.com/altera-opensource/intel-socfpga-hwlib
cd intel-socfpga-hwlib/tools
./install_linaro.sh
./generate_doxygen.sh
export PATH=`pwd`/gcc/bin:$PATH
2.Build uboot from above shared link for Sd card.
3.Build 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
# cleanmak
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
4.Build Image
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 \
> final-image.bin
5.create Sd card image
cd $TOP_FOLDER/sd_card
cp ../cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/final-image.bin .
cd $TOP_FOLDER/sd_card
sudo python3 ./make_sdimage_p3.py -f \
-P final-image.bin,num=3,format=raw,size=10M,type=A2 -s 80M -n sdimage.img
6.Creating SD Card on Windows-
https://www.rocketboards.org/foswiki/Documentation/CycloneVSoCGSRD#Creating_SD_Card
Let me know if you have any other query on this.
Regards
Tiwari