build_soft_3rdpart.sh 2.7 KB

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