2019-12-10 13:03:47 +00:00
|
|
|
#!/bin/bash
|
2021-01-20 12:30:12 +00:00
|
|
|
|
2021-02-03 14:43:59 +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
|
|
|
|
|
2021-10-20 20:50:30 +00:00
|
|
|
if [ "$#" -ne 2 ]; then
|
|
|
|
echo "You must enter exactly 2 arguments: \$XILINX_DIR \$ARCH(32 or 64)"
|
2020-04-27 07:37:04 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-12-10 13:03:47 +00:00
|
|
|
|
|
|
|
WORKDIR=$PWD
|
2021-10-20 20:50:30 +00:00
|
|
|
OPENWIFI_DIR=$(pwd)/../../
|
|
|
|
XILINX_DIR=$1
|
|
|
|
ARCH_OPTION=$2
|
2020-04-27 07:37:04 +00:00
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
|
|
|
|
echo "\$OPENWIFI_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$OPENWIFI_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-12-10 13:03:47 +00:00
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
if [ -d "$XILINX_DIR/SDK" ]; then
|
|
|
|
echo "\$XILINX_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$XILINX_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ARCH_OPTION" != "32" ] && [ "$ARCH_OPTION" != "64" ]; then
|
|
|
|
echo "\$ARCH_OPTION is not correct. Should be 32 or 64. Please check!"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "\$ARCH_OPTION is valid!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
source $XILINX_DIR/SDK/2018.3/settings64.sh
|
|
|
|
if [ "$ARCH_OPTION" == "64" ]; then
|
|
|
|
KDIR=$OPENWIFI_DIR/adi-linux-64/
|
|
|
|
export ARCH=arm64
|
|
|
|
export CROSS_COMPILE=aarch64-linux-gnu-
|
|
|
|
else
|
|
|
|
KDIR=$OPENWIFI_DIR/adi-linux/
|
|
|
|
export ARCH=arm
|
|
|
|
export CROSS_COMPILE=arm-linux-gnueabihf-
|
|
|
|
fi
|
|
|
|
|
|
|
|
SUBMODULE=xilinx_dma
|
2019-12-10 13:03:47 +00:00
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
cp $KDIR/drivers/dma/xilinx/xilinx_dma.c $KDIR/drivers/dma/xilinx/xilinx_dma.c.bak
|
2019-12-10 13:03:47 +00:00
|
|
|
cp xilinx_dma.c $KDIR/drivers/dma/xilinx -rf
|
|
|
|
cd $KDIR
|
|
|
|
make $KDIR/drivers/dma/xilinx/$SUBMODULE.ko
|
|
|
|
cp $KDIR/drivers/dma/xilinx/$SUBMODULE.ko $WORKDIR -rf
|
2020-04-27 07:37:04 +00:00
|
|
|
# cp $KDIR/drivers/dma/xilinx/xilinx_dma.c.bak $KDIR/drivers/dma/xilinx/xilinx_dma.c
|
2019-12-10 13:03:47 +00:00
|
|
|
cd $WORKDIR
|
|
|
|
ls $SUBMODULE.ko
|