mirror of
https://github.com/open-sdr/openwifi.git
synced 2024-12-18 21:28:07 +00:00
Update BOOT.BIN scripts according to ADI kuiper release
This commit is contained in:
parent
0802e503a4
commit
6ffca2ac8f
@ -1,60 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Author: Xianjun Jiao
|
||||
# SPDX-FileCopyrightText: 2019 UGent
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/linux/zynq_2014r2
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "You must enter the \$OPENWIFI_HW_DIR \$BOARD_NAME as argument"
|
||||
echo "BOARD_NAME Like: sdrpi antsdr_e200 antsdr adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPENWIFI_HW_DIR=$1
|
||||
BOARD_NAME=$2
|
||||
|
||||
if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "antsdr_e200" ] && [ "$BOARD_NAME" != "sdrpi" ] && [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ] && [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then
|
||||
echo "\$BOARD_NAME is not correct. Please check!"
|
||||
exit 1
|
||||
else
|
||||
echo "\$BOARD_NAME is found!"
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
HDF_FILE=$OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf
|
||||
UBOOT_FILE=./boards/$BOARD_NAME/u-boot.elf
|
||||
BUILD_DIR=./boards/$BOARD_NAME/build_boot_bin
|
||||
OUTPUT_DIR=./boards/$BOARD_NAME/output_boot_bin
|
||||
HDF_FILE=$1
|
||||
UBOOT_FILE=$2
|
||||
BUILD_DIR=build_boot_bin
|
||||
OUTPUT_DIR=output_boot_bin
|
||||
|
||||
# usage () {
|
||||
# echo usage: $0 system_top.hdf u-boot.elf [output-archive]
|
||||
# exit 1
|
||||
# }
|
||||
usage () {
|
||||
echo "usage: $0 system_top.<hdf/xsa> u-boot.elf [output-archive]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# depends () {
|
||||
# echo Xilinx $1 must be installed and in your PATH
|
||||
# echo try: source /opt/Xilinx/Vivado/201x.x/settings64.sh
|
||||
# exit 1
|
||||
# }
|
||||
depends () {
|
||||
echo Xilinx $1 must be installed and in your PATH
|
||||
echo try: source /opt/Xilinx/Vivado/201x.x/settings64.sh
|
||||
exit 1
|
||||
}
|
||||
|
||||
### Check command line parameters
|
||||
echo $HDF_FILE | grep -q ".hdf" || usage
|
||||
echo $UBOOT_FILE | grep -q -e ".elf" -e "uboot" || usage
|
||||
echo $HDF_FILE | grep -q ".hdf\|.xsa" || usage
|
||||
echo $UBOOT_FILE | grep -q -e ".elf" -e "uboot" -e "u-boot"|| usage
|
||||
|
||||
if [ ! -f $HDF_FILE ]; then
|
||||
echo $HDF_FILE: File not found!
|
||||
usage
|
||||
echo $HDF_FILE: File not found!
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ ! -f $UBOOT_FILE ]; then
|
||||
echo $UBOOT_FILE: File not found!
|
||||
usage
|
||||
echo $UBOOT_FILE: File not found!
|
||||
usage
|
||||
fi
|
||||
|
||||
### Check for required Xilinx tools
|
||||
command -v xsdk >/dev/null 2>&1 || depends xsdk
|
||||
### Check for required Xilinx tools (xcst is equivalent with 'xsdk -batch')
|
||||
command -v xsct >/dev/null 2>&1 || depends xsct
|
||||
command -v bootgen >/dev/null 2>&1 || depends bootgen
|
||||
|
||||
rm -Rf $BUILD_DIR $OUTPUT_DIR
|
||||
@ -65,14 +43,26 @@ cp $HDF_FILE $BUILD_DIR/
|
||||
cp $UBOOT_FILE $OUTPUT_DIR/u-boot.elf
|
||||
cp $HDF_FILE $OUTPUT_DIR/
|
||||
|
||||
### Create create_fsbl_project.tcl file used by xsdk to create the fsbl
|
||||
### Create create_fsbl_project.tcl file used by xsct to create the fsbl.
|
||||
echo "hsi open_hw_design `basename $HDF_FILE`" > $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'set cpu_name [lindex [hsi get_cells -filter {IP_TYPE==PROCESSOR}] 0]' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk setws ./build/sdk' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "sdk createhw -name hw_0 -hwspec `basename $HDF_FILE`" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq FSBL}' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'configapp -app fsbl build-config release' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk projects -build -type all' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
### The fsbl creating flow is different starting with 2019.2 Xilinx version
|
||||
if [[ "$HDF_FILE" =~ ".hdf" ]];then
|
||||
echo 'sdk setws ./build/sdk' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "sdk createhw -name hw_0 -hwspec `basename $HDF_FILE`" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq FSBL}' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'configapp -app fsbl build-config release' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk projects -build -type all' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
|
||||
FSBL_PATH="$BUILD_DIR/build/sdk/fsbl/Release/fsbl.elf"
|
||||
SYSTEM_TOP_BIT_PATH="$BUILD_DIR/build/sdk/hw_0/system_top.bit"
|
||||
else
|
||||
echo 'platform create -name hw0 -hw system_top.xsa -os standalone -out ./build/sdk -proc $cpu_name' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'platform generate' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
|
||||
FSBL_PATH="$BUILD_DIR/build/sdk/hw0/export/hw0/sw/hw0/boot/fsbl.elf"
|
||||
SYSTEM_TOP_BIT_PATH="$BUILD_DIR/build/sdk/hw0/hw/system_top.bit"
|
||||
fi
|
||||
|
||||
### Create zynq.bif file used by bootgen
|
||||
echo 'the_ROM_image:' > $OUTPUT_DIR/zynq.bif
|
||||
@ -85,12 +75,12 @@ echo '}' >> $OUTPUT_DIR/zynq.bif
|
||||
### Build fsbl.elf
|
||||
(
|
||||
cd $BUILD_DIR
|
||||
xsdk -batch -source create_fsbl_project.tcl
|
||||
xsct create_fsbl_project.tcl
|
||||
)
|
||||
|
||||
### Copy fsbl and system_top.bit into the output folder
|
||||
cp $BUILD_DIR/build/sdk/fsbl/Release/fsbl.elf $OUTPUT_DIR/fsbl.elf
|
||||
cp $BUILD_DIR/build/sdk/hw_0/system_top.bit $OUTPUT_DIR/system_top.bit
|
||||
cp $FSBL_PATH $OUTPUT_DIR/fsbl.elf
|
||||
cp $SYSTEM_TOP_BIT_PATH $OUTPUT_DIR/system_top.bit
|
||||
|
||||
### Build BOOT.BIN
|
||||
(
|
||||
@ -98,12 +88,7 @@ cp $BUILD_DIR/build/sdk/hw_0/system_top.bit $OUTPUT_DIR/system_top.bit
|
||||
bootgen -arch zynq -image zynq.bif -o BOOT.BIN -w
|
||||
)
|
||||
|
||||
### clean up BUILD_DIR and copy ILA definition together with .bit into OUTPUT_DIR
|
||||
(
|
||||
rm $BUILD_DIR -rf
|
||||
)
|
||||
|
||||
# ### Optionally tar.gz the entire output folder with the name given in argument 3
|
||||
# if [ ${#3} -ne 0 ]; then
|
||||
# tar czvf $3.tar.gz $OUTPUT_DIR
|
||||
# fi
|
||||
### Optionally tar.gz the entire output folder with the name given in argument 3
|
||||
if [ ${#3} -ne 0 ]; then
|
||||
tar czvf $3.tar.gz $OUTPUT_DIR
|
||||
fi
|
||||
|
@ -1,10 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Author: Xianjun Jiao
|
||||
# SPDX-FileCopyrightText: 2019 UGent
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/linux/zynqmp
|
||||
|
||||
set -ex
|
||||
|
||||
HDF_FILE=$1
|
||||
@ -14,7 +8,7 @@ BUILD_DIR=build_boot_bin
|
||||
OUTPUT_DIR=output_boot_bin
|
||||
|
||||
usage () {
|
||||
echo "usage: $0 system_top.hdf u-boot.elf (download | bl31.elf | <path-to-arm-trusted-firmware-source>) [output-archive]"
|
||||
echo "usage: $0 system_top.<hdf/xsa> u-boot.elf (download | bl31.elf | <path-to-arm-trusted-firmware-source>) [output-archive]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -25,12 +19,14 @@ depends () {
|
||||
}
|
||||
|
||||
### Check command line parameters
|
||||
echo $HDF_FILE | grep -q ".hdf" || usage
|
||||
echo $UBOOT_FILE | grep -q -e ".elf" -e "uboot" || usage
|
||||
echo $HDF_FILE | grep -q ".hdf\|.xsa" || usage
|
||||
echo $UBOOT_FILE | grep -q -e ".elf" -e "uboot" -e "u-boot" || usage
|
||||
|
||||
if [ ! -f $HDF_FILE ]; then
|
||||
echo $HDF_FILE: File not found!
|
||||
usage
|
||||
echo $HDF_FILE: File not found!
|
||||
usage
|
||||
else
|
||||
if [[ "$HDF_FILE" =~ ".hdf" ]]; then TOOL="xsdk";else TOOL="vitis";fi
|
||||
fi
|
||||
|
||||
if [ ! -f $UBOOT_FILE ]; then
|
||||
@ -38,10 +34,10 @@ if [ ! -f $UBOOT_FILE ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
### Check for required Xilinx tools
|
||||
command -v xsdk >/dev/null 2>&1 || depends xsdk
|
||||
### Check for required Xilinx tools (starting with 2019.2 there is no hsi anymore)
|
||||
command -v xsct >/dev/null 2>&1 || depends xsct
|
||||
command -v bootgen >/dev/null 2>&1 || depends bootgen
|
||||
command -v hsi >/dev/null 2>&1 || depends hsi
|
||||
if [[ "$HDF_FILE" =~ ".hdf" ]];then (command -v hsi >/dev/null 2>&1 || depends hsi);fi
|
||||
|
||||
rm -Rf $BUILD_DIR $OUTPUT_DIR
|
||||
mkdir -p $OUTPUT_DIR
|
||||
@ -51,13 +47,22 @@ mkdir -p $BUILD_DIR
|
||||
# 2018.1 use df4a7e97d57494c7d79de51b1e0e450d982cea98
|
||||
# 2018.2 use 93a69a5a3bc318027da4af5911124537f4907642
|
||||
# 2018.3 use 08560c36ea5b6f48b962cb4bd9a79b35bb3d95ce
|
||||
# 2019.3 use 713dace94b259845fd8eede11061fbd8f039011e
|
||||
# 2020.1 use bf72e4d494f3be10665b94c0e88766eb2096ef71
|
||||
# 2021.2 use 799131a3b063f6f24f87baa74e46906c076aebcd
|
||||
|
||||
hsi_ver=$(hsi -version | head -1 | cut -d' ' -f2)
|
||||
if [ -z "$hsi_ver" ] ; then
|
||||
tool_version=$($TOOL -version | sed -n '3p' | cut -d' ' -f 3)
|
||||
if [ -z "$tool_version" ] ; then
|
||||
echo "Could not determine Vivado version"
|
||||
exit 1
|
||||
fi
|
||||
atf_version=xilinx-$hsi_ver
|
||||
atf_version=xilinx-$tool_version
|
||||
|
||||
if [[ "$atf_version" == "xilinx-v2021.1" ]];then atf_version="xlnx_rebase_v2.4_2021.1";fi
|
||||
if [[ "$atf_version" == "xilinx-v2021.1.1" ]];then atf_version="xlnx_rebase_v2.4_2021.1_update1";fi
|
||||
if [[ "$atf_version" == "xilinx-v2021.2" ]];then atf_version="xlnx-v2021.2";fi
|
||||
|
||||
if [[ "$4" == "uart1" ]];then console="cadence1";else console="cadence0";fi
|
||||
|
||||
### Check if ATF_FILE is .elf or path to arm-trusted-firmware
|
||||
if [ "$ATF_FILE" != "" ] && [ -d $ATF_FILE ]; then
|
||||
@ -66,7 +71,7 @@ if [ "$ATF_FILE" != "" ] && [ -d $ATF_FILE ]; then
|
||||
cd $ATF_FILE
|
||||
make distclean
|
||||
git checkout $atf_version
|
||||
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=zynqmp RESET_TO_BL31=1
|
||||
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=zynqmp RESET_TO_BL31=1 ZYNQMP_CONSOLE=$console
|
||||
)
|
||||
cp $ATF_FILE/build/zynqmp/release/bl31/bl31.elf $OUTPUT_DIR/bl31.elf
|
||||
elif [ "$ATF_FILE" == "download" ]; then
|
||||
@ -76,7 +81,7 @@ elif [ "$ATF_FILE" == "download" ]; then
|
||||
git clone https://github.com/Xilinx/arm-trusted-firmware.git
|
||||
cd arm-trusted-firmware
|
||||
git checkout $atf_version
|
||||
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=zynqmp RESET_TO_BL31=1
|
||||
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=zynqmp RESET_TO_BL31=1 ZYNQMP_CONSOLE=$console
|
||||
)
|
||||
cp $BUILD_DIR/arm-trusted-firmware/build/zynqmp/release/bl31/bl31.elf $OUTPUT_DIR/bl31.elf
|
||||
else
|
||||
@ -88,45 +93,52 @@ else
|
||||
cp $ATF_FILE $OUTPUT_DIR/bl31.elf
|
||||
fi
|
||||
|
||||
cp $HDF_FILE $BUILD_DIR/
|
||||
cp $UBOOT_FILE $OUTPUT_DIR/u-boot.elf
|
||||
cp $HDF_FILE $OUTPUT_DIR/
|
||||
cp "$HDF_FILE" "$BUILD_DIR/"
|
||||
cp "$UBOOT_FILE" "$OUTPUT_DIR/u-boot.elf"
|
||||
cp "$HDF_FILE" "$OUTPUT_DIR/"
|
||||
|
||||
# get the tools version (e.g., v2018.3)
|
||||
tool_version=$(hsi -version)
|
||||
tool_version=${tool_version#hsi\ }
|
||||
tool_version=${tool_version%\ (64-bit)*}
|
||||
|
||||
# Work-arownd for MPSoC ZCU102 and ZCU106 Evaluation Kits - DDR4 SODIMM change
|
||||
# Work-around for MPSoC ZCU102 and ZCU106 Evaluation Kits - DDR4 SODIMM change
|
||||
# (https://www.xilinx.com/support/answers/71961.html)
|
||||
if [ $tool_version == "v2018.3" ];then
|
||||
(
|
||||
# wget https://www.xilinx.com/Attachment/72113-files.zip -P $BUILD_DIR
|
||||
cp -P 72113-files.zip $BUILD_DIR
|
||||
wget https://www.xilinx.com/Attachment/72113-files.zip -P $BUILD_DIR
|
||||
unzip $BUILD_DIR/72113-files.zip -d $BUILD_DIR
|
||||
)
|
||||
fi
|
||||
|
||||
### Create create_fsbl_project.tcl file used by xsdk to create the fsbl
|
||||
### Create create_fsbl_project.tcl file used by xsct to create the fsbl.
|
||||
echo "hsi open_hw_design `basename $HDF_FILE`" > $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'set cpu_name [lindex [hsi get_cells -filter {IP_TYPE==PROCESSOR}] 0]' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk setws ./build/sdk' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "sdk createhw -name hw_0 -hwspec `basename $HDF_FILE`" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq MP FSBL}' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'configapp -app fsbl build-config release' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
if [ $tool_version == "v2018.3" ];then
|
||||
(
|
||||
echo "file copy -force xfsbl_ddr_init.c ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "file copy -force xfsbl_hooks.c ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "file copy -force xfsbl_hooks.h ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
)
|
||||
fi
|
||||
echo 'sdk projects -build -type all' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
### The fsbl creating flow is different starting with 2019.2 Xilinx version
|
||||
if [[ "$HDF_FILE" =~ ".hdf" ]];then
|
||||
echo 'sdk setws ./build/sdk' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "sdk createhw -name hw_0 -hwspec `basename $HDF_FILE`" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq MP FSBL}' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'configapp -app fsbl build-config release' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
if [ $tool_version == "v2018.3" ];then
|
||||
echo "file copy -force xfsbl_ddr_init.c ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "file copy -force xfsbl_hooks.c ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo "file copy -force xfsbl_hooks.h ./build/sdk/fsbl/src" >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
fi
|
||||
echo 'sdk projects -build -type all' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
|
||||
### Create create_pmufw_project.tcl
|
||||
echo "set hwdsgn [open_hw_design `basename $HDF_FILE`]" > $BUILD_DIR/create_pmufw_project.tcl
|
||||
echo 'generate_app -hw $hwdsgn -os standalone -proc psu_pmu_0 -app zynqmp_pmufw -sw pmufw -dir pmufw' >> $BUILD_DIR/create_pmufw_project.tcl
|
||||
echo 'quit' >> $BUILD_DIR/create_pmufw_project.tcl
|
||||
### Create create_pmufw_project.tcl
|
||||
echo "set hwdsgn [open_hw_design `basename $HDF_FILE`]" > $BUILD_DIR/create_pmufw_project.tcl
|
||||
echo 'generate_app -hw $hwdsgn -os standalone -proc psu_pmu_0 -app zynqmp_pmufw -compile -sw pmufw -dir pmufw' >> $BUILD_DIR/create_pmufw_project.tcl
|
||||
echo 'quit' >> $BUILD_DIR/create_pmufw_project.tcl
|
||||
|
||||
FSBL_PATH="$BUILD_DIR/build/sdk/fsbl/Release/fsbl.elf"
|
||||
SYSTEM_TOP_BIT_PATH="$BUILD_DIR/build/sdk/hw_0/system_top.bit"
|
||||
PMUFW_PATH="$BUILD_DIR/pmufw/executable.elf"
|
||||
else
|
||||
# Flow got changed starting with 2019.2 version (when Vitis replaced SDK) and pmufw is generated automatically with fsbl
|
||||
echo 'platform create -name hw0 -hw system_top.xsa -os standalone -out ./build/sdk -proc $cpu_name' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
echo 'platform generate' >> $BUILD_DIR/create_fsbl_project.tcl
|
||||
|
||||
FSBL_PATH="$BUILD_DIR/build/sdk/hw0/export/hw0/sw/hw0/boot/fsbl.elf"
|
||||
SYSTEM_TOP_BIT_PATH="$BUILD_DIR/build/sdk/hw0/hw/system_top.bit"
|
||||
PMUFW_PATH="$BUILD_DIR/build/sdk/hw0/export/hw0/sw/hw0/boot/pmufw.elf"
|
||||
fi
|
||||
|
||||
### Create zynq.bif file used by bootgen
|
||||
echo "the_ROM_image:" > $OUTPUT_DIR/zynq.bif
|
||||
@ -138,22 +150,22 @@ echo "[destination_cpu=a53-0,exception_level=el-3,trustzone] bl31.elf" >> $OUTPU
|
||||
echo "[destination_cpu=a53-0, exception_level=el-2] u-boot.elf" >> $OUTPUT_DIR/zynq.bif
|
||||
echo "}" >> $OUTPUT_DIR/zynq.bif
|
||||
|
||||
|
||||
### Build fsbl.elf & pmufw.elf
|
||||
(
|
||||
cd $BUILD_DIR
|
||||
xsdk -batch -source create_fsbl_project.tcl
|
||||
hsi -source create_pmufw_project.tcl
|
||||
### There was a bug in some vivado version where they build would fail -> check CC_FLAGS
|
||||
grep "CC_FLAGS :=" pmufw/Makefile | grep -e "-Os" || sed -i '/-mxl-soft-mul/ s/$/ -Os -flto -ffat-lto-objects/' pmufw/Makefile
|
||||
cd pmufw
|
||||
make
|
||||
xsct create_fsbl_project.tcl
|
||||
if [[ "$HDF_FILE" =~ ".hdf" ]];then
|
||||
hsi -source create_pmufw_project.tcl
|
||||
### There was a bug in some vivado version where they build would fail -> check CC_FLAGS
|
||||
grep "CC_FLAGS :=" pmufw/Makefile | grep -e "-Os" || sed -i '/-mxl-soft-mul/ s/$/ -Os -flto -ffat-lto-objects/' pmufw/Makefile
|
||||
cd pmufw
|
||||
make
|
||||
fi
|
||||
)
|
||||
|
||||
### Copy fsbl and system_top.bit into the output folder
|
||||
cp $BUILD_DIR/build/sdk/fsbl/Release/fsbl.elf $OUTPUT_DIR/fsbl.elf
|
||||
cp $BUILD_DIR/build/sdk/hw_0/system_top.bit $OUTPUT_DIR/system_top.bit
|
||||
cp $BUILD_DIR/pmufw/executable.elf $OUTPUT_DIR/pmufw.elf
|
||||
cp "$FSBL_PATH" "$OUTPUT_DIR/fsbl.elf"
|
||||
cp "$SYSTEM_TOP_BIT_PATH" "$OUTPUT_DIR/system_top.bit"
|
||||
cp "$PMUFW_PATH" "$OUTPUT_DIR/pmufw.elf"
|
||||
|
||||
### Build BOOT.BIN
|
||||
(
|
||||
@ -161,7 +173,11 @@ cp $BUILD_DIR/pmufw/executable.elf $OUTPUT_DIR/pmufw.elf
|
||||
bootgen -arch zynqmp -image zynq.bif -o BOOT.BIN -w
|
||||
)
|
||||
|
||||
### Optionally tar.gz the entire output folder with the name given in argument 3
|
||||
if [ ${#4} -ne 0 ]; then
|
||||
tar czvf $4.tar.gz $OUTPUT_DIR
|
||||
### Optionally tar.gz the entire output folder with the name given in argument 4/5
|
||||
if [[ ( $4 == "uart"* && ${#5} -ne 0 ) ]]; then
|
||||
tar czvf $5.tar.gz $OUTPUT_DIR
|
||||
fi
|
||||
|
||||
if [[ ( ${#4} -ne 0 && $4 != "uart"* && ${#5} -eq 0 ) ]]; then
|
||||
tar czvf $4.tar.gz $OUTPUT_DIR
|
||||
fi
|
||||
|
@ -5,18 +5,18 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
echo "You must enter exactly 3 arguments: \$OPENWIFI_HW_DIR \$XILINX_DIR \$BOARD_NAME"
|
||||
echo "You must enter exactly 3 arguments: \$XILINX_DIR \$BOARD_NAME DIR_TO_system_top.xsa"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPENWIFI_HW_DIR=$1
|
||||
XILINX_DIR=$2
|
||||
BOARD_NAME=$3
|
||||
XILINX_DIR=$1
|
||||
BOARD_NAME=$2
|
||||
XSA_FILE=$3
|
||||
|
||||
OPENWIFI_DIR=$(pwd)/../
|
||||
|
||||
echo OPENWIFI_DIR $OPENWIFI_DIR
|
||||
echo OPENWIFI_HW_DIR $OPENWIFI_HW_DIR
|
||||
echo XSA_FILE $XSA_FILE
|
||||
|
||||
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
|
||||
echo "\$OPENWIFI_DIR is found!"
|
||||
@ -25,24 +25,24 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$XILINX_DIR/SDK" ]; then
|
||||
if [ -d "$XILINX_DIR/Vitis" ]; then
|
||||
echo "\$XILINX_DIR is found!"
|
||||
else
|
||||
echo "\$XILINX_DIR is not correct. Please check!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "antsdr_e200" ] && [ "$BOARD_NAME" != "sdrpi" ] && [ "$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
|
||||
# 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
|
||||
|
||||
if [ -d "$OPENWIFI_HW_DIR/boards/$BOARD_NAME" ]; then
|
||||
echo "\$OPENWIFI_HW_DIR is found!"
|
||||
if [ -f "$XSA_FILE" ]; then
|
||||
echo "\$XSA_FILE is found!"
|
||||
else
|
||||
echo "\$OPENWIFI_HW_DIR is not correct. Please check!"
|
||||
echo "\$XSA_FILE is not found. Please check!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -50,17 +50,22 @@ home_dir=$(pwd)
|
||||
|
||||
set -ex
|
||||
|
||||
# check if user entered the right path to SDK
|
||||
source $XILINX_DIR/SDK/2018.3/settings64.sh
|
||||
|
||||
# uncompress the system.hdf and system_top.bit for use
|
||||
mkdir -p hdf_and_bit
|
||||
tar -zxvf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/hdf_and_bit.tar.gz -C ./hdf_and_bit
|
||||
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
|
||||
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system_top.bit $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
|
||||
source $XILINX_DIR/Vitis/2021.1/settings64.sh
|
||||
|
||||
cd $OPENWIFI_DIR/kernel_boot
|
||||
|
||||
./build_boot_bin.sh $OPENWIFI_HW_DIR $BOARD_NAME
|
||||
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
|
||||
elif [ "$BOARD_NAME" == "antsdr" ] || [ "$BOARD_NAME" == "zc706_fmcs2" ] || [ "$BOARD_NAME" == "zc702_fmcs2" ] || [ "$BOARD_NAME" == "zed_fmcs2" ] || [ "$BOARD_NAME" == "adrv9361z7035" ] || [ "$BOARD_NAME" == "adrv9364z7020" ]; then
|
||||
./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/
|
||||
|
||||
cd $home_dir
|
||||
|
@ -1,70 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Author: Xianjun Jiao
|
||||
# SPDX-FileCopyrightText: 2019 UGent
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
echo "You must enter exactly 3 arguments: \$OPENWIFI_HW_DIR \$XILINX_DIR \$BOARD_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPENWIFI_HW_DIR=$1
|
||||
XILINX_DIR=$2
|
||||
BOARD_NAME=$3
|
||||
|
||||
OPENWIFI_DIR=$(pwd)/../
|
||||
|
||||
echo OPENWIFI_DIR $OPENWIFI_DIR
|
||||
echo OPENWIFI_HW_DIR $OPENWIFI_HW_DIR
|
||||
|
||||
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
|
||||
echo "\$OPENWIFI_DIR is found!"
|
||||
else
|
||||
echo "\$OPENWIFI_DIR is not correct. Please check!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$XILINX_DIR/SDK" ]; then
|
||||
echo "\$XILINX_DIR is found!"
|
||||
else
|
||||
echo "\$XILINX_DIR is not correct. Please check!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then
|
||||
echo "\$BOARD_NAME is not correct. Please check!"
|
||||
exit 1
|
||||
else
|
||||
echo "\$BOARD_NAME is found!"
|
||||
fi
|
||||
|
||||
if [ -d "$OPENWIFI_HW_DIR/boards/$BOARD_NAME" ]; then
|
||||
echo "\$OPENWIFI_HW_DIR is found!"
|
||||
else
|
||||
echo "\$OPENWIFI_HW_DIR is not correct. Please check!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
home_dir=$(pwd)
|
||||
|
||||
set -ex
|
||||
|
||||
# check if user entered the right path to SDK
|
||||
source $XILINX_DIR/SDK/2018.3/settings64.sh
|
||||
|
||||
# uncompress the system.hdf and system_top.bit for use
|
||||
mkdir -p hdf_and_bit
|
||||
tar -zxvf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/hdf_and_bit.tar.gz -C ./hdf_and_bit
|
||||
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
|
||||
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system_top.bit $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
|
||||
|
||||
cd $OPENWIFI_DIR/kernel_boot
|
||||
|
||||
./build_zynqmp_boot_bin.sh $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf boards/$BOARD_NAME/u-boot-zcu.elf boards/$BOARD_NAME/bl31.elf
|
||||
|
||||
rm -rf build_boot_bin
|
||||
rm -rf boards/$BOARD_NAME/output_boot_bin
|
||||
mv output_boot_bin boards/$BOARD_NAME/
|
||||
|
||||
cd $home_dir
|
Loading…
Reference in New Issue
Block a user