forked from starfive-tech/VisionFive2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_soft_3rdpart.sh
executable file
·88 lines (80 loc) · 2.76 KB
/
build_soft_3rdpart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
TOP_DIR=$(pwd)
# parse the args to install to initramfs or rootfs target path
if [ $# -eq 0 ]; then
Target_DIR="$TOP_DIR/work/buildroot_initramfs_sysroot/root/"
else
if [ "$1" = "initramfs" ]; then
Target_DIR="$TOP_DIR/work/buildroot_initramfs_sysroot/root/"
elif [ "$1" = "rootfs" ]; then
Target_DIR="$TOP_DIR/work/buildroot_rootfs/target/root/"
else
echo "Usage: $0 [initramfs|rootfs]"
echo "If not specify args, the default is initramfs"
echo "For example:"
echo " $0";
echo " $0 initramfs";
echo " $0 rootfs";
exit 1
fi
fi
echo "$Target_DIR"
if [ ! -d $Target_DIR ]; then
echo "Warning: need building the usdk firstly: $1"
exit 1
fi
################################################################
# 1. jpu drvier and test script
JPU_SRC_DIR="./soft_3rdpart/codaj12/"
if [ -d $Target_DIR/jpu_driver ]; then
rm -rf $Target_DIR/jpu_driver
fi
cd $JPU_SRC_DIR && ./build_for_riscv.sh && cp -ar jpu_driver/ $Target_DIR/
cd $TOP_DIR
echo "install jpu ok"
################################################################
# 2. vpu dec drvier and test script
VDEC_SRC_DIR="./soft_3rdpart/wave511/code/"
if [ -d $Target_DIR/vdec_driver ]; then
rm -rf $Target_DIR/vdec_driver
fi
cd $VDEC_SRC_DIR && ./build_for_vdec.sh && cp -ar vdec_driver/ $Target_DIR/
cd $TOP_DIR
echo "install vdec ok"
################################################################
# 3. vpu enc drvier and test script
VENC_SRC_DIR="./soft_3rdpart/wave420l/code/"
if [ -d $Target_DIR/venc_driver ]; then
rm -rf $Target_DIR/venc_driver
fi
cd $VENC_SRC_DIR && ./build.sh && cp -ar venc_driver/ $Target_DIR/
cd $TOP_DIR
echo "install venc ok"
################################################################
# 4. mailbox driver and test demo
# How to test: refer to soft_3rdpart/mailbox/mailbox_test.docx
if [ -d $Target_DIR/mailbox ]; then
rm -rf $Target_DIR/mailbox
fi
mkdir -p $Target_DIR/mailbox
cp work/linux/drivers/mailbox/starfive_mailbox.ko \
work/linux/drivers/mailbox/starfive_mailbox-test.ko \
soft_3rdpart/mailbox/read_test $Target_DIR/mailbox
chmod +x $Target_DIR/mailbox/read_test
echo "install mailbox ok"
################################################################
# 5. e24 driver and test demo
# How to test: refer to soft_3rdpart/e24/e24_test.docx
if [ -d $Target_DIR/e24 ]; then
rm -rf $Target_DIR/e24
fi
mkdir -p $Target_DIR/e24
# install e24 firmware
cp soft_3rdpart/e24/e24_elf $Target_DIR/../lib/firmware/
# install e24 driver and test demo
cp work/linux/drivers/e24/e24.ko \
soft_3rdpart/e24/e24_share_mem $Target_DIR/e24
echo "install e24 ok"
################################################################
# 6. xrp driver
cp work/linux/drivers/xrp/xrp.ko $Target_DIR/