0003-codaj12-fix-building-issue-and-support-the-vendor-co.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. From e88d5d10314d2bbaa99c1ecf8bc9640555c1e674 Mon Sep 17 00:00:00 2001
  2. From: Andy Hu <andy.hu@starfivetech.com>
  3. Date: Fri, 18 Nov 2022 12:52:51 +0800
  4. Subject: [PATCH] codaj12: fix building issue and support the vendor code
  5. building
  6. ---
  7. codaj12/Makefile | 2 +-
  8. codaj12/build_for_riscv.sh | 15 +++++++++------
  9. codaj12/codaj12_buildroot.mak | 31 ++++++++++++++++++++++++++++++-
  10. 3 files changed, 40 insertions(+), 8 deletions(-)
  11. diff --git a/codaj12/Makefile b/codaj12/Makefile
  12. index 8e41864..1be8a83 100644
  13. --- a/codaj12/Makefile
  14. +++ b/codaj12/Makefile
  15. @@ -38,7 +38,7 @@ ifeq ("$(BUILD_CONFIGURATION)", "NonOS")
  16. USE_ALLOCATOR = yes
  17. endif
  18. ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedLinux")
  19. - CROSS_CC_PREFIX = riscv64-buildroot-linux-gnu-
  20. + CROSS_CC_PREFIX =
  21. PLATFORM = riscvlinux
  22. USE_FFMPEG ?= yes
  23. endif
  24. diff --git a/codaj12/build_for_riscv.sh b/codaj12/build_for_riscv.sh
  25. index 75c1c31..dee8ad4 100755
  26. --- a/codaj12/build_for_riscv.sh
  27. +++ b/codaj12/build_for_riscv.sh
  28. @@ -25,10 +25,13 @@ cp -rdvp ${jpu_path}/yuv $obj_jpu
  29. cp -rdvp ${jpu_path}/stream $obj_jpu
  30. #make linux driver
  31. -cd $jpu_driver
  32. -source build_env_setup_riscv.sh
  33. -make clean
  34. -make
  35. +# cd $jpu_driver
  36. +# source build_env_setup_riscv.sh
  37. +# make clean
  38. +# make
  39. +export ARCH=riscv
  40. +export SUBARCH=riscv
  41. +export CROSS_COMPILE=
  42. #make multi_instance
  43. cd $jpu_path
  44. @@ -42,7 +45,7 @@ make USE_FFMPEG=no
  45. cp ${jpu_path}/jpg_enc_test ${jpu_path}/jpg_dec_test $obj_jpu
  46. #cp driver
  47. -cp ${jpu_driver}/jpu.ko $obj_jpu_driver
  48. -cp -rdvp jpu_driver ../../work/buildroot_initramfs_sysroot/root/
  49. +# cp ${jpu_driver}/jpu.ko $obj_jpu_driver
  50. +# cp -rdvp jpu_driver ../../work/buildroot_initramfs_sysroot/root/
  51. diff --git a/codaj12/codaj12_buildroot.mak b/codaj12/codaj12_buildroot.mak
  52. index bffe02d..6833f09 100644
  53. --- a/codaj12/codaj12_buildroot.mak
  54. +++ b/codaj12/codaj12_buildroot.mak
  55. @@ -53,7 +53,8 @@ ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedLinux")
  56. endif
  57. ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedRiscvLinux")
  58. - CROSS_CC_PREFIX = riscv64-buildroot-linux-gnu-
  59. +# CROSS_CC_PREFIX = riscv64-buildroot-linux-gnu-
  60. + CROSS_CC_PREFIX =
  61. PLATFORM = riscvlinux
  62. endif
  63. CC = $(CROSS_CC_PREFIX)gcc
  64. @@ -146,3 +147,31 @@ obj/%.o: %.c $(MAKEFILE)
  65. lint:
  66. "$(LINT_HOME)/flint" -i"$(LINT_HOME)" $(DEFINES) $(INCLUDES) $(VPATH2) linux_std.lnt $(HAPS_RULE) $(NONOS_RULE) $(SOURCES_COMMON)
  67. +TARGET_DIR=../target
  68. +STAGING_DIR=$(TARGET_DIR)
  69. +INSTALL=install
  70. +
  71. +install:
  72. + @echo install ...
  73. + $(INSTALL) -D -m 0777 jdi/linux/driver/load.sh $(TARGET_DIR)/root/codaj12/load.sh
  74. + $(INSTALL) -D -m 0777 jdi/linux/driver/unload.sh $(TARGET_DIR)/root/codaj12/unload.sh
  75. + $(INSTALL) -D -m 0644 libcodadec.so $(TARGET_DIR)/usr/lib/libcodadec.so
  76. + @echo "install STAGING_DIR ..."
  77. + $(INSTALL) -D -m 0644 jpuapi/jpuapi.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/jpuapi.h
  78. + $(INSTALL) -D -m 0644 jpuapi/jpuapifunc.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/jpuapifunc.h
  79. + $(INSTALL) -D -m 0644 jpuapi/regdefine.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/regdefine.h
  80. + $(INSTALL) -D -m 0644 jpuapi/jpuconfig.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/jpuconfig.h
  81. + $(INSTALL) -D -m 0644 jpuapi/jputypes.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/jputypes.h
  82. + $(INSTALL) -D -m 0644 jpuapi/jputable.h $(STAGING_DIR)/usr/include/codaj12/jpuapi/jputable.h
  83. + $(INSTALL) -D -m 0644 sample/helper/cnm_fpga.h $(STAGING_DIR)/usr/include/codaj12/sample/helper/cnm_fpga.h
  84. + $(INSTALL) -D -m 0644 sample/helper/platform.h $(STAGING_DIR)/usr/include/codaj12/sample/helper/platform.h
  85. + $(INSTALL) -D -m 0644 sample/helper/yuv_feeder.h $(STAGING_DIR)/usr/include/codaj12/sample/helper/yuv_feeder.h
  86. + $(INSTALL) -D -m 0644 sample/helper/datastructure.h $(STAGING_DIR)/usr/include/codaj12/sample/helper/datastructure.h
  87. + $(INSTALL) -D -m 0644 sample/helper/jpulog.h $(STAGING_DIR)/usr/include/codaj12/sample/helper/jpulog.h
  88. + $(INSTALL) -D -m 0644 sample/main_helper.h $(STAGING_DIR)/usr/include/codaj12/sample/main_helper.h
  89. + $(INSTALL) -D -m 0644 jdi/linux/driver/jpu.h $(STAGING_DIR)/usr/include/codaj12/jdi/linux/driver/jpu.h
  90. + $(INSTALL) -D -m 0644 jdi/linux/driver/jmm.h $(STAGING_DIR)/usr/include/codaj12/jdi/linux/driver/jmm.h
  91. + $(INSTALL) -D -m 0644 jdi/jdi.h $(STAGING_DIR)/usr/include/codaj12/jdi/jdi.h
  92. + $(INSTALL) -D -m 0644 jdi/mm.h $(STAGING_DIR)/usr/include/codaj12/jdi/mm.h
  93. + $(INSTALL) -D -m 0644 config.h $(STAGING_DIR)/usr/include/codaj12/config.h
  94. +
  95. --
  96. 2.36.0