2020-03-04 18:39:12 +00:00
|
|
|
#!/bin/bash
|
2021-01-20 12:30:12 +00:00
|
|
|
|
2021-02-03 14:46:25 +00:00
|
|
|
# Author: Xianjun Jiao
|
|
|
|
# SPDX-FileCopyrightText: 2019 UGent
|
2021-01-20 12:30:12 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
if [ "$#" -ne 3 ]; then
|
2023-01-17 13:20:41 +00:00
|
|
|
echo "You must enter exactly 3 arguments: \$XILINX_DIR \$BOARD_NAME DIR_TO_system_top.xsa"
|
2020-03-04 18:39:12 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
XILINX_DIR=$1
|
|
|
|
BOARD_NAME=$2
|
|
|
|
XSA_FILE=$3
|
2020-03-04 18:39:12 +00:00
|
|
|
|
2021-10-20 20:50:30 +00:00
|
|
|
OPENWIFI_DIR=$(pwd)/../
|
|
|
|
|
|
|
|
echo OPENWIFI_DIR $OPENWIFI_DIR
|
2023-01-17 13:20:41 +00:00
|
|
|
echo XSA_FILE $XSA_FILE
|
2021-10-20 20:50:30 +00:00
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
|
|
|
|
echo "\$OPENWIFI_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$OPENWIFI_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
if [ -d "$XILINX_DIR/Vitis" ]; then
|
2020-03-04 18:39:12 +00:00
|
|
|
echo "\$XILINX_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$XILINX_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
# if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ]; then
|
|
|
|
# echo "\$BOARD_NAME is not correct. Please check!"
|
|
|
|
# exit 1
|
|
|
|
# else
|
|
|
|
# echo "\$BOARD_NAME is found!"
|
|
|
|
# fi
|
2020-03-04 18:39:12 +00:00
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
if [ -f "$XSA_FILE" ]; then
|
|
|
|
echo "\$XSA_FILE is found!"
|
2021-10-20 20:50:30 +00:00
|
|
|
else
|
2023-01-17 13:20:41 +00:00
|
|
|
echo "\$XSA_FILE is not found. Please check!"
|
2021-10-20 20:50:30 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
home_dir=$(pwd)
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
source $XILINX_DIR/Vitis/2021.1/settings64.sh
|
2022-05-13 15:01:41 +00:00
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
cd $OPENWIFI_DIR/kernel_boot
|
2020-03-04 18:39:12 +00:00
|
|
|
|
2023-01-17 13:20:41 +00:00
|
|
|
if [ "$BOARD_NAME" == "zcu102_fmcs2" ] || [ "$BOARD_NAME" == "zcu102_9371" ]; then
|
|
|
|
./build_zynqmp_boot_bin.sh $XSA_FILE boards/$BOARD_NAME/u-boot_xilinx_zynqmp_zcu102_revA.elf boards/$BOARD_NAME/bl31.elf
|
2023-01-26 16:07:30 +00:00
|
|
|
elif [ "$BOARD_NAME" == "antsdr" ] || [ "$BOARD_NAME" == "antsdr_e200" ] || [ "$BOARD_NAME" == "sdrpi" ] || [ "$BOARD_NAME" == "neptunesdr" ] || [ "$BOARD_NAME" == "zc706_fmcs2" ] || [ "$BOARD_NAME" == "zc702_fmcs2" ] || [ "$BOARD_NAME" == "zed_fmcs2" ] || [ "$BOARD_NAME" == "adrv9361z7035" ] || [ "$BOARD_NAME" == "adrv9364z7020" ]; then
|
2023-01-17 13:20:41 +00:00
|
|
|
./build_boot_bin.sh $XSA_FILE boards/$BOARD_NAME/u-boot.elf
|
|
|
|
else
|
|
|
|
echo "\$BOARD_NAME is not correct. Please check!"
|
|
|
|
cd $home_dir
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf build_boot_bin
|
|
|
|
rm -rf boards/$BOARD_NAME/output_boot_bin
|
|
|
|
mv output_boot_bin boards/$BOARD_NAME/
|
2020-03-04 18:39:12 +00:00
|
|
|
|
|
|
|
cd $home_dir
|