From 193077b2cf70dd634dc3e608113771c5c933f2aa Mon Sep 17 00:00:00 2001 From: Guochunrong Date: Wed, 20 Sep 2023 16:16:24 +0800 Subject: [PATCH] vpu: add recipes Signed-off-by: Guochunrong --- .../recipes-core/images/core-image-xfce.bb | 1 + meta-bsp/recipes-graphics/vpu/vpu-lib.bb | 18 ++++++++++++++ meta-bsp/recipes-graphics/vpu/vpu.inc | 22 +++++++++++++++++ .../kernel-modules/kernel-module-vpu_4.19.bb | 23 ++++++++++++++++++ .../kernel-modules/kernel-module-vpu_5.10.bb | 24 +++++++++++++++++++ .../linux/linux-phytium_4.19.bbappend | 4 +++- .../linux/linux-phytium_5.10.bbappend | 5 +++- 7 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 meta-bsp/recipes-graphics/vpu/vpu-lib.bb create mode 100644 meta-bsp/recipes-graphics/vpu/vpu.inc create mode 100644 meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_4.19.bb create mode 100644 meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_5.10.bb diff --git a/meta-bsp/recipes-core/images/core-image-xfce.bb b/meta-bsp/recipes-core/images/core-image-xfce.bb index b7db9c0..624be02 100644 --- a/meta-bsp/recipes-core/images/core-image-xfce.bb +++ b/meta-bsp/recipes-core/images/core-image-xfce.bb @@ -45,5 +45,6 @@ IMAGE_INSTALL += " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'pa gtk+3 default-locale xdg-user-dirs \ packagegroup-phy-tools-core-dev \ packagegroup-gui-base \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vpu', 'kernel-module-vpu vpu-lib', '', d)} \ " IMAGE_ROOTFS_EXTRA_SPACE:phytiumpi = "5242880" diff --git a/meta-bsp/recipes-graphics/vpu/vpu-lib.bb b/meta-bsp/recipes-graphics/vpu/vpu-lib.bb new file mode 100644 index 0000000..a1dbeb8 --- /dev/null +++ b/meta-bsp/recipes-graphics/vpu/vpu-lib.bb @@ -0,0 +1,18 @@ +require vpu.inc +do_install () { + mkdir -p ${D}/usr + mkdir -p ${D}/usr/lib/gstreamer-1.0 + oe_runmake install DESTDIR=${D} + #chown -R root:root ${D}${sysconfdir}/xdg + chown -R root:root ${D}/usr/bin/vdec_test + chown -R root:root ${D}/usr/lib + rm -rf ${D}/lib + cp -rf ${D}/usr/lib/aarch64-linux-gnu/gstreamer-1.0/* ${D}/usr/lib/gstreamer-1.0/ + install -D -p -m0644 ${S}/e2000/etc/xdg/gstomx.conf ${D}${sysconfdir}/xdg/gstomx.conf + mkdir -p ${D}/lib/firmware + chown -R root:root ${D}/lib/firmware + cp ${S}/e2000/lib/firmware/* ${D}/lib/firmware/ +} + +FILES:${PN} += " /usr/lib/* /usr/bin/* ${sysconfdir}/xdg/gstomx.conf /lib/firmware/*" +INSANE_SKIP:${PN}-dev += "ldflags dev-elf file-rdeps" diff --git a/meta-bsp/recipes-graphics/vpu/vpu.inc b/meta-bsp/recipes-graphics/vpu/vpu.inc new file mode 100644 index 0000000..5ae42c6 --- /dev/null +++ b/meta-bsp/recipes-graphics/vpu/vpu.inc @@ -0,0 +1,22 @@ +SUMMARY = "vpu binary static library" +DESCRIPTION = "vpu binary static library" +HOMEPAGE = "https://gitee.com/phytium_embedded/vpu-lib" +SECTION = "multimedia" +LICENSE = "PSLA" + +LIC_FILES_CHKSUM = "file://Makefile;md5=ec13c0fd422eb9684f2c898e3516f6c3" +SRCBRANCH ?= "master" + +SRC_URI = "" +do_fetch:prepend() { + src_uri = (d.getVar('SRC_URI') or "").split() + if len(src_uri) == 0: + bb.fatal("Please Checking vpu code in /home/path-to-your-source-tree") +} + +SRCREV = "4d37e7c0d76466d3ada4e899ebbe9d4fe5bae767" + +S = "${WORKDIR}" + +INSANE_SKIP:${PN} += "ldflags dev-elf dev-deps file-rdeps" +CLEANBROKEN = "1" diff --git a/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_4.19.bb b/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_4.19.bb new file mode 100644 index 0000000..ea114f7 --- /dev/null +++ b/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_4.19.bb @@ -0,0 +1,23 @@ +SUMMARY = "Kernel loadable module for Vivante GPU" +DESCRIPTION = "Builds the Vivante GPU kernel driver as a loadable kernel module, \ +allowing flexibility to use a newer graphics release with an older kernel." +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" +KERNEL_SRC = "git://gitee.com/phytium_embedded/phytium-linux-kernel.git;protocol=https;branch=${KERNEL_BRANCH}" +SRC_URI = "${KERNEL_SRC}" +SRC_URI:append = " file://0001-Add-vpu-driver-add-vpu-in-phytium_defconfig.patch \ + file://0002-Add-vpu-in-pe220x-dtsi.patch \ + file://0004-Add-vpu-in-other-e2000q-board.patch \ + file://0005-Makefile-update.patch \ +" + +KERNEL_BRANCH = "linux-4.19" + +SRCREV = "9b16f504fde64d82530b25810dca1247f1ef63a8" +S = "${WORKDIR}/git" +B = "${WORKDIR}/git/drivers/staging/phytium-vpu" + +inherit module + +EXTRA_OEMAKE += "CONFIG_VIDEO_PHYTIUM_VPU=m " +KERNEL_MODULE_AUTOLOAD += "phytium_vpu_mem phytium_vpu_vxd" diff --git a/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_5.10.bb b/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_5.10.bb new file mode 100644 index 0000000..9dfef74 --- /dev/null +++ b/meta-bsp/recipes-kernel/kernel-modules/kernel-module-vpu_5.10.bb @@ -0,0 +1,24 @@ +SUMMARY = "Kernel loadable module for Vivante GPU" +DESCRIPTION = "Builds the Vivante GPU kernel driver as a loadable kernel module, \ +allowing flexibility to use a newer graphics release with an older kernel." +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" +KERNEL_SRC = "git://gitee.com/phytium_embedded/phytium-linux-kernel.git;protocol=https;branch=${KERNEL_BRANCH}" +SRC_URI = "${KERNEL_SRC}" +SRC_URI:append = " file://0001-Add-vpu-driver-add-vpu-in-phytium_defconfig-in-5.10.patch \ + file://0002-Add-vpu-in-pe220x-dtsi-in-5.10.patch \ + file://0003-Add-vpu-in-phytiumpi-dts-in-5.10.patch \ + file://0004-Add-vpu-in-other-e2000q-board-in-5.10.patch \ + file://0005-Makefile-update.patch \ +" + +KERNEL_BRANCH = "linux-5.10" + +SRCREV = "bcbcb1389b3cda718c8e265f9f21eca825ad917c" +S = "${WORKDIR}/git" +B = "${WORKDIR}/git/drivers/staging/phytium-vpu" + +inherit module + +EXTRA_OEMAKE += "CONFIG_VIDEO_PHYTIUM_VPU=m " +KERNEL_MODULE_AUTOLOAD += "phytium_vpu_mem phytium_vpu_vxd" diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bbappend b/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bbappend index a0fea0c..75fd2ab 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bbappend +++ b/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bbappend @@ -2,8 +2,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" XEN_PATCHES = " file://xen.cfg" JAJLHOUSE_PATCHES = " file://0001-modify-the-dts-of-e2000-linux-4.19-kernel-to-reserve.patch" - +VPU_PATCHES = " file://0002-Add-vpu-in-pe220x-dtsi.patch \ + file://0004-Add-vpu-in-other-e2000q-board.patch " SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_PATCHES}', '', d)}" SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'jailhouse', '${JAJLHOUSE_PATCHES}', '', d)}" +SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'vpu', '${VPU_PATCHES}', '', d)}" DELTA_KERNEL_DEFCONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen.cfg', '', d)}" diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bbappend b/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bbappend index 2705460..675eeb1 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bbappend +++ b/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bbappend @@ -1,6 +1,9 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" JAJLHOUSE_PATCHES = " file://0001-modify-the-dts-of-e2000-linux-5.10-kernel-to-reserve.patch" - +VPU_PATCHES = " file://0002-Add-vpu-in-pe220x-dtsi-in-5.10.patch \ + file://0003-Add-vpu-in-phytiumpi-dts-in-5.10.patch \ + file://0004-Add-vpu-in-other-e2000q-board-in-5.10.patch " SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'jailhouse', '${JAJLHOUSE_PATCHES}', '', d)}" SRC_URI:append = " file://0001-Makefile-fix-cannot-find-.h.patch" +SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'vpu', '${VPU_PATCHES}', '', d)}" -- Gitee