build_soft_3rdpart.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. exit 1
  19. fi
  20. fi
  21. echo "$Target_DIR"
  22. if [ ! -d $Target_DIR ]; then
  23. echo "Warning: need building the usdk firstly: $1"
  24. exit 1
  25. fi
  26. ################################################################
  27. # 1. jpu drvier and test script
  28. JPU_SRC_DIR="./soft_3rdpart/codaj12/"
  29. if [ -d $Target_DIR/jpu_driver ]; then
  30. rm -rf $Target_DIR/jpu_driver
  31. fi
  32. cd $JPU_SRC_DIR && ./build_for_riscv.sh && cp -ar jpu_driver/ $Target_DIR/
  33. cd $TOP_DIR
  34. echo "install jpu ok"
  35. ################################################################
  36. # 2. vpu dec drvier and test script
  37. VDEC_SRC_DIR="./soft_3rdpart/wave511/code/"
  38. if [ -d $Target_DIR/vdec_driver ]; then
  39. rm -rf $Target_DIR/vdec_driver
  40. fi
  41. cd $VDEC_SRC_DIR && ./build_for_vdec.sh && cp -ar vdec_driver/ $Target_DIR/
  42. cd $TOP_DIR
  43. echo "install vdec ok"
  44. ################################################################
  45. # 3. vpu enc drvier and test script
  46. VENC_SRC_DIR="./soft_3rdpart/wave420l/code/"
  47. if [ -d $Target_DIR/venc_driver ]; then
  48. rm -rf $Target_DIR/venc_driver
  49. fi
  50. cd $VENC_SRC_DIR && ./build.sh && cp -ar venc_driver/ $Target_DIR/
  51. cd $TOP_DIR
  52. echo "install venc ok"
  53. ################################################################
  54. # 4. mailbox driver and test demo
  55. # How to test: refer to soft_3rdpart/mailbox/mailbox_test.docx
  56. if [ -d $Target_DIR/mailbox ]; then
  57. rm -rf $Target_DIR/mailbox
  58. fi
  59. mkdir -p $Target_DIR/mailbox
  60. cp work/linux/drivers/mailbox/starfive_mailbox.ko \
  61. work/linux/drivers/mailbox/starfive_mailbox-test.ko \
  62. soft_3rdpart/mailbox/read_test $Target_DIR/mailbox
  63. chmod +x $Target_DIR/mailbox/read_test
  64. echo "install mailbox ok"
  65. ################################################################
  66. # 5. e24 driver and test demo
  67. # How to test: refer to soft_3rdpart/e24/e24_test.docx
  68. if [ -d $Target_DIR/e24 ]; then
  69. rm -rf $Target_DIR/e24
  70. fi
  71. mkdir -p $Target_DIR/e24
  72. # install e24 firmware
  73. cp soft_3rdpart/e24/e24_elf $Target_DIR/../lib/firmware/
  74. # install e24 driver and test demo
  75. cp work/linux/drivers/e24/e24.ko \
  76. soft_3rdpart/e24/e24_share_mem $Target_DIR/e24
  77. echo "install e24 ok"
  78. ################################################################
  79. # 6. xrp driver
  80. cp work/linux/drivers/xrp/xrp.ko $Target_DIR/