securemsm-kernel: Enable Qseecom driver by default
Enable qseecom driver by default to compile on all chipset in parallel with Qseecom-compat enable. Change-Id: I3dd3aa2864c41196197f0770020225fa36f088c1 Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
3983090d0e
commit
cdef6720fe
@@ -111,7 +111,6 @@ LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
|||||||
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
||||||
###################################################
|
###################################################
|
||||||
###################################################
|
###################################################
|
||||||
ifneq (, $(filter true, $(TARGET_ENABLE_QSEECOM) $(TARGET_BOARD_AUTO)))
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_SRC_FILES := $(SSG_SRC_FILES)
|
LOCAL_SRC_FILES := $(SSG_SRC_FILES)
|
||||||
LOCAL_MODULE := qseecom_dlkm.ko
|
LOCAL_MODULE := qseecom_dlkm.ko
|
||||||
@@ -120,7 +119,6 @@ LOCAL_MODULE_TAGS := optional
|
|||||||
LOCAL_MODULE_DEBUG_ENABLE := true
|
LOCAL_MODULE_DEBUG_ENABLE := true
|
||||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||||
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
||||||
endif #TARGET_ENABLE_QSEECOM OR TARGET_BOARD_AUTO
|
|
||||||
###################################################
|
###################################################
|
||||||
###################################################
|
###################################################
|
||||||
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
||||||
|
4
Kbuild
4
Kbuild
@@ -13,10 +13,12 @@ endif
|
|||||||
ifneq (, $(filter y, $(CONFIG_QTI_QUIN_GVM) $(CONFIG_ARCH_KHAJE) $(CONFIG_ARCH_SA8155)))
|
ifneq (, $(filter y, $(CONFIG_QTI_QUIN_GVM) $(CONFIG_ARCH_KHAJE) $(CONFIG_ARCH_SA8155)))
|
||||||
include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_qseecom.conf
|
include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_qseecom.conf
|
||||||
LINUXINCLUDE += -include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_qseecom.h
|
LINUXINCLUDE += -include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_qseecom.h
|
||||||
|
else
|
||||||
|
LINUXINCLUDE += -include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_qseecom_compat.h
|
||||||
|
endif
|
||||||
|
|
||||||
obj-$(CONFIG_QSEECOM) += qseecom_dlkm.o
|
obj-$(CONFIG_QSEECOM) += qseecom_dlkm.o
|
||||||
qseecom_dlkm-objs := qseecom/qseecom.o
|
qseecom_dlkm-objs := qseecom/qseecom.o
|
||||||
endif
|
|
||||||
|
|
||||||
include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_smcinvoke.conf
|
include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_smcinvoke.conf
|
||||||
LINUXINCLUDE += -include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_smcinvoke.h
|
LINUXINCLUDE += -include $(SSG_MODULE_ROOT)/config/sec-kernel_defconfig_smcinvoke.h
|
||||||
|
@@ -3,3 +3,5 @@ export CONFIG_CRYPTO_DEV_QCEDEV=m
|
|||||||
export CONFIG_CRYPTO_DEV_QCRYPTO=m
|
export CONFIG_CRYPTO_DEV_QCRYPTO=m
|
||||||
export CONFIG_HDCP_QSEECOM=m
|
export CONFIG_HDCP_QSEECOM=m
|
||||||
export CONFIG_HW_RANDOM_MSM_LEGACY=m
|
export CONFIG_HW_RANDOM_MSM_LEGACY=m
|
||||||
|
export CONFIG_QSEECOM_PROXY=m
|
||||||
|
export CONFIG_QSEECOM=m
|
||||||
|
@@ -1 +1 @@
|
|||||||
export CONFIG_QSEECOM=m
|
export CONFIG_QTI_CRYPTO_FDE=m
|
||||||
|
6
config/sec-kernel_defconfig_qseecom_compat.h
Normal file
6
config/sec-kernel_defconfig_qseecom_compat.h
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved..
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CONFIG_QSEECOM_COMPAT 1
|
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __QSEECOM_PRIV_H_
|
#ifndef __QSEECOM_PRIV_H_
|
||||||
@@ -20,6 +20,5 @@ static inline int qseecom_process_listener_from_smcinvoke(uint32_t *result,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int get_qseecom_kernel_fun_ops(void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -11,7 +11,8 @@ def define_pineapple():
|
|||||||
"qcedev-mod_dlkm",
|
"qcedev-mod_dlkm",
|
||||||
"qrng_dlkm",
|
"qrng_dlkm",
|
||||||
"qcrypto-msm_dlkm",
|
"qcrypto-msm_dlkm",
|
||||||
"smmu_proxy_dlkm"
|
"smmu_proxy_dlkm",
|
||||||
|
"qseecom_dlkm"
|
||||||
],
|
],
|
||||||
extra_options = [
|
extra_options = [
|
||||||
"CONFIG_QCOM_SMCINVOKE",
|
"CONFIG_QCOM_SMCINVOKE",
|
||||||
|
@@ -380,6 +380,7 @@ struct qseecom_control {
|
|||||||
struct task_struct *unload_app_kthread_task;
|
struct task_struct *unload_app_kthread_task;
|
||||||
wait_queue_head_t unload_app_kthread_wq;
|
wait_queue_head_t unload_app_kthread_wq;
|
||||||
atomic_t unload_app_kthread_state;
|
atomic_t unload_app_kthread_state;
|
||||||
|
bool no_user_contig_mem_support;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct qseecom_unload_app_pending_list {
|
struct qseecom_unload_app_pending_list {
|
||||||
@@ -4720,6 +4721,8 @@ static void __qseecom_free_coherent_buf(uint32_t size,
|
|||||||
dma_free_coherent(qseecom.dev, size, vaddr, paddr);
|
dma_free_coherent(qseecom.dev, size, vaddr, paddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_QSEECOM)
|
||||||
static int __qseecom_load_fw(struct qseecom_dev_handle *data, char *appname,
|
static int __qseecom_load_fw(struct qseecom_dev_handle *data, char *appname,
|
||||||
uint32_t *app_id)
|
uint32_t *app_id)
|
||||||
{
|
{
|
||||||
@@ -4859,6 +4862,7 @@ exit_free_img_data:
|
|||||||
__qseecom_free_coherent_buf(fw_size, img_data, pa);
|
__qseecom_free_coherent_buf(fw_size, img_data, pa);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int qseecom_load_commonlib_image(struct qseecom_dev_handle *data,
|
static int qseecom_load_commonlib_image(struct qseecom_dev_handle *data,
|
||||||
char *cmnlib_name)
|
char *cmnlib_name)
|
||||||
@@ -5006,6 +5010,7 @@ static int qseecom_unload_commonlib_image(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_QSEECOM)
|
||||||
static int __qseecom_start_app(struct qseecom_handle **handle,
|
static int __qseecom_start_app(struct qseecom_handle **handle,
|
||||||
char *app_name, uint32_t size)
|
char *app_name, uint32_t size)
|
||||||
{
|
{
|
||||||
@@ -5313,6 +5318,7 @@ static int __qseecom_send_command(struct qseecom_handle *handle, void *send_buf,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_QSEECOM)
|
||||||
#if IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
#if IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
||||||
const static struct qseecom_drv_ops qseecom_driver_ops = {
|
const static struct qseecom_drv_ops qseecom_driver_ops = {
|
||||||
.qseecom_send_command = __qseecom_send_command,
|
.qseecom_send_command = __qseecom_send_command,
|
||||||
@@ -5348,6 +5354,7 @@ int qseecom_send_command(struct qseecom_handle *handle, void *send_buf,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(qseecom_send_command);
|
EXPORT_SYMBOL(qseecom_send_command);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
int qseecom_set_bandwidth(struct qseecom_handle *handle, bool high)
|
int qseecom_set_bandwidth(struct qseecom_handle *handle, bool high)
|
||||||
{
|
{
|
||||||
@@ -5429,7 +5436,7 @@ int qseecom_process_listener_from_smcinvoke(uint32_t *result,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(qseecom_process_listener_from_smcinvoke);
|
EXPORT_SYMBOL(qseecom_process_listener_from_smcinvoke);
|
||||||
|
#endif
|
||||||
static int qseecom_send_resp(void)
|
static int qseecom_send_resp(void)
|
||||||
{
|
{
|
||||||
qseecom.send_resp_flag = 1;
|
qseecom.send_resp_flag = 1;
|
||||||
@@ -9500,6 +9507,11 @@ static int qseecom_register_shmbridge(struct platform_device *pdev)
|
|||||||
qtee_shmbridge_deregister(qseecom.ta_bridge_handle);
|
qtee_shmbridge_deregister(qseecom.ta_bridge_handle);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* no-user-contig-mem is present in dtsi if user_contig_region is not needed*/
|
||||||
|
qseecom.no_user_contig_mem_support = of_property_read_bool((&pdev->dev)->of_node,
|
||||||
|
"qcom,no-user-contig-mem-support");
|
||||||
|
if (!qseecom.no_user_contig_mem_support) {
|
||||||
ret = qseecom_register_heap_shmbridge(pdev, "user_contig_mem",
|
ret = qseecom_register_heap_shmbridge(pdev, "user_contig_mem",
|
||||||
&qseecom.user_contig_bridge_handle);
|
&qseecom.user_contig_bridge_handle);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -9507,6 +9519,7 @@ static int qseecom_register_shmbridge(struct platform_device *pdev)
|
|||||||
qtee_shmbridge_deregister(qseecom.ta_bridge_handle);
|
qtee_shmbridge_deregister(qseecom.ta_bridge_handle);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9549,7 +9562,7 @@ static int qseecom_probe(struct platform_device *pdev)
|
|||||||
if (rc)
|
if (rc)
|
||||||
goto exit_deinit_bus;
|
goto exit_deinit_bus;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
#if IS_ENABLED(CONFIG_QSEECOM) && IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
||||||
/*If the api fails to get the func ops, print the error and continue
|
/*If the api fails to get the func ops, print the error and continue
|
||||||
* Do not treat it as fatal*/
|
* Do not treat it as fatal*/
|
||||||
rc = get_qseecom_kernel_fun_ops();
|
rc = get_qseecom_kernel_fun_ops();
|
||||||
|
@@ -16,16 +16,12 @@ PRODUCT_PACKAGES += qcrypto-msm_dlkm.ko
|
|||||||
PRODUCT_PACKAGES += hdcp_qseecom_dlkm.ko
|
PRODUCT_PACKAGES += hdcp_qseecom_dlkm.ko
|
||||||
PRODUCT_PACKAGES += qrng_dlkm.ko
|
PRODUCT_PACKAGES += qrng_dlkm.ko
|
||||||
PRODUCT_PACKAGES += smcinvoke_dlkm.ko
|
PRODUCT_PACKAGES += smcinvoke_dlkm.ko
|
||||||
|
PRODUCT_PACKAGES += qseecom_dlkm.ko
|
||||||
|
|
||||||
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
||||||
PRODUCT_PACKAGES += smmu_proxy_dlkm.ko
|
PRODUCT_PACKAGES += smmu_proxy_dlkm.ko
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#Enable Qseecom if TARGET_ENABLE_QSEECOM or TARGET_BOARD_AUTO is set to true
|
|
||||||
ifneq (, $(filter true, $(TARGET_ENABLE_QSEECOM) $(TARGET_BOARD_AUTO)))
|
|
||||||
PRODUCT_PACKAGES += qseecom_dlkm.ko
|
|
||||||
endif #TARGET_ENABLE_QSEECOM OR TARGET_BOARD_AUTO
|
|
||||||
|
|
||||||
endif #ENABLE_SECUREMSM_DLKM
|
endif #ENABLE_SECUREMSM_DLKM
|
||||||
|
|
||||||
|
|
||||||
|
@@ -24,14 +24,13 @@ BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/smcinvoke_dlkm.ko
|
|||||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/smcinvoke_dlkm.ko
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/smcinvoke_dlkm.ko
|
||||||
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD += $(KERNEL_MODULES_OUT)/smcinvoke_dlkm.ko
|
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD += $(KERNEL_MODULES_OUT)/smcinvoke_dlkm.ko
|
||||||
|
|
||||||
|
|
||||||
|
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
||||||
|
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
||||||
|
|
||||||
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
ifeq ($(TARGET_USES_SMMU_PROXY), true)
|
||||||
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/smmu_proxy_dlkm.ko
|
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/smmu_proxy_dlkm.ko
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#Enable Qseecom if TARGET_ENABLE_QSEECOM or TARGET_BOARD_AUTO is set to true
|
|
||||||
ifneq (, $(filter true, $(TARGET_ENABLE_QSEECOM) $(TARGET_BOARD_AUTO)))
|
|
||||||
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
|
||||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
|
||||||
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD += $(KERNEL_MODULES_OUT)/qseecom_dlkm.ko
|
|
||||||
endif #TARGET_ENABLE_QSEECOM OR TARGET_BOARD_AUTO
|
|
||||||
endif #ENABLE_SECUREMSM_DLKM
|
endif #ENABLE_SECUREMSM_DLKM
|
||||||
|
@@ -3226,7 +3226,7 @@ static int smcinvoke_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
smcinvoke_pdev = pdev;
|
smcinvoke_pdev = pdev;
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_QSEECOM) && IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
#if IS_ENABLED(CONFIG_QSEECOM_COMPAT) && IS_ENABLED(CONFIG_QSEECOM_PROXY)
|
||||||
/*If the api fails to get the func ops, print the error and continue
|
/*If the api fails to get the func ops, print the error and continue
|
||||||
* Do not treat it as fatal*/
|
* Do not treat it as fatal*/
|
||||||
rc = get_qseecom_kernel_fun_ops();
|
rc = get_qseecom_kernel_fun_ops();
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "smcinvoke.h"
|
#include "smcinvoke.h"
|
||||||
#include "smcinvoke_object.h"
|
#include "smcinvoke_object.h"
|
||||||
#include "IClientEnv.h"
|
#include "IClientEnv.h"
|
||||||
#if !IS_ENABLED(CONFIG_QSEECOM)
|
#if IS_ENABLED(CONFIG_QSEECOM_COMPAT)
|
||||||
#include "IQSEEComCompat.h"
|
#include "IQSEEComCompat.h"
|
||||||
#include "IQSEEComCompatAppLoader.h"
|
#include "IQSEEComCompatAppLoader.h"
|
||||||
#include "linux/qseecom_api.h"
|
#include "linux/qseecom_api.h"
|
||||||
@@ -323,7 +323,7 @@ int32_t get_client_env_object(struct Object *clientEnvObj)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(get_client_env_object);
|
EXPORT_SYMBOL(get_client_env_object);
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_QSEECOM)
|
#if IS_ENABLED(CONFIG_QSEECOM_COMPAT)
|
||||||
|
|
||||||
static int load_app(struct qseecom_compat_context *cxt, const char *app_name)
|
static int load_app(struct qseecom_compat_context *cxt, const char *app_name)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user