redpitaya-puzzlefw/sw/12_build_uboot.sh

29 lines
874 B
Bash
Executable File

#!/bin/bash
set -e
. script_env
setup_toolchain
make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux- distclean
# We need the XSA file from Vivado.
# It contains the init code for the U-Boot SPL image.
if [ ! -f "$XSA_FILE" ]; then
echo "ERROR: $XSA_FILE not found" >&2
echo "Build the FPGA image before building U-Boot."
exit 1
fi
# Create board directory with ps7_init_gpl.c.
rm -rf "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
mkdir "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
unzip $XSA_FILE ps7_init_gpl.c ps7_init_gpl.h -d "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
cp -a devicetree/redpitaya_puzzlefw.dts "$UBOOT_DIR/arch/arm/dts/redpitaya.dts"
cp -a config/uboot_redpitaya_puzzlefw_defconfig "$UBOOT_DIR/configs/redpitaya_puzzlefw_defconfig"
make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux- redpitaya_puzzlefw_defconfig
make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux-