From 62f1699feaeb18b316a0799bdced10a4f8bb5175 Mon Sep 17 00:00:00 2001 From: Li Hua Qian Date: Tue, 3 Dec 2024 10:58:47 +0800 Subject: [PATCH] linux-iot2050: Make PVU only available for secureboot build Signed-off-by: Li Hua Qian --- kas/opt/secure-boot.yml | 1 + .../linux/files/iot2050_defconfig_base | 1 - recipes-kernel/linux/linux-iot2050-6.1.inc | 26 ++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/kas/opt/secure-boot.yml b/kas/opt/secure-boot.yml index d3327ffe7..c30f74522 100644 --- a/kas/opt/secure-boot.yml +++ b/kas/opt/secure-boot.yml @@ -12,6 +12,7 @@ local_conf_header: secureboot_override: | OVERRIDES .= ":uefi-stmm" OVERRIDES .= ":secureboot" + OVERRIDES .= ":pvu-dma" secure-boot-signer: | IMAGER_BUILD_DEPS += "ebg-secure-boot-signer" IMAGER_INSTALL += "ebg-secure-boot-signer" diff --git a/recipes-kernel/linux/files/iot2050_defconfig_base b/recipes-kernel/linux/files/iot2050_defconfig_base index ec1358f6a..c07b93df4 100644 --- a/recipes-kernel/linux/files/iot2050_defconfig_base +++ b/recipes-kernel/linux/files/iot2050_defconfig_base @@ -609,7 +609,6 @@ CONFIG_RPMSG_QCOM_GLINK_RPM=y CONFIG_RPMSG_VIRTIO=m CONFIG_TI_SCI_PM_DOMAINS=y CONFIG_TI_PRUSS=y -CONFIG_TI_PVU=y CONFIG_EXTCON_PALMAS=m CONFIG_EXTCON_USB_GPIO=m CONFIG_MEMORY=y diff --git a/recipes-kernel/linux/linux-iot2050-6.1.inc b/recipes-kernel/linux/linux-iot2050-6.1.inc index 51ac9bc59..613a53a8e 100644 --- a/recipes-kernel/linux/linux-iot2050-6.1.inc +++ b/recipes-kernel/linux/linux-iot2050-6.1.inc @@ -17,12 +17,36 @@ def get_patches(d, patchdir): return ' '.join(['file://' + patch[len(files_dir)+1:] for patch in patches]) +def get_extra_configs(d): + import re + import os + + overrides = d.getVar('OVERRIDES') + append_config = [] + + if re.search("pvu-dma", overrides): + append_config.append('CONFIG_TI_PVU=y') + + if append_config: + append_config_file = os.path.join(d.getVar('T'), 'iot2050_append_config.cfg') + append_config_dir = os.path.dirname(append_config_file) + + if not os.path.exists(append_config_dir): + return '' + with open(append_config_file, 'w') as f: + for line in append_config: + f.write(line + '\n') + return 'file://' + append_config_file + else: + return '' + SRC_URI += " \ https://cdn.kernel.org/pub/linux/kernel/projects/cip/6.1/linux-cip-${PV}.tar.xz \ ${@get_patches(d, 'patches-6.1')} \ file://patches-6.1/ \ file://${KERNEL_DEFCONFIG} \ - file://iot2050_defconfig_extra.cfg" + file://iot2050_defconfig_extra.cfg \ + ${@get_extra_configs(d)} " S = "${WORKDIR}/linux-cip-${PV}"