openwifi/driver/xilinx_dma/make_xilinx_dma.sh

56 lines
1.3 KiB
Bash
Raw Normal View History

2019-12-10 13:03:47 +00:00
#!/bin/bash
2020-04-27 07:37:04 +00:00
if [ "$#" -ne 3 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR \$ARCH(32 or 64)"
exit 1
fi
2019-12-10 13:03:47 +00:00
WORKDIR=$PWD
2020-04-27 07:37:04 +00:00
OPENWIFI_DIR=$1
XILINX_DIR=$2
ARCH_OPTION=$3
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