Loading drivers/firmware/qcom_scm-smc.c +32 −0 Original line number Diff line number Diff line Loading @@ -2086,6 +2086,38 @@ int __qcom_scm_qseecom_do(struct device *dev, u32 cmd_id, struct scm_desc *desc, return _ret; } #ifdef CONFIG_QCOM_RTIC #define TZ_RTIC_ENABLE_MEM_PROTECTION 0x4 int __init scm_mem_protection_init_do(struct device *dev) { int ret = 0, resp; struct qcom_scm_desc desc = { .svc = SCM_SVC_RTIC, .cmd = TZ_RTIC_ENABLE_MEM_PROTECTION, .owner = ARM_SMCCC_OWNER_SIP, }; desc.args[0] = 0; desc.arginfo = 0; ret = qcom_scm_call(dev, &desc); resp = desc.res[0]; if (ret == -1) { pr_err("%s: SCM call not supported\n", __func__); return ret; } else if (ret || resp) { pr_err("%s: SCM call failed\n", __func__); if (ret) return ret; else return resp; } return resp; } #endif void __qcom_scm_init(void) { __query_convention(); Loading drivers/firmware/qcom_scm.c +9 −0 Original line number Diff line number Diff line Loading @@ -1165,6 +1165,15 @@ static int __init qcom_scm_init(void) } subsys_initcall(qcom_scm_init); #ifdef CONFIG_QCOM_RTIC static int __init scm_mem_protection_init(void) { return scm_mem_protection_init_do(__scm ? __scm->dev : NULL); } early_initcall(scm_mem_protection_init); #endif #if IS_MODULE(CONFIG_QCOM_SCM) static void __exit qcom_scm_exit(void) { Loading drivers/firmware/qcom_scm.h +7 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,13 @@ extern int __qcom_scm_invoke_callback_response(struct device *dev, extern void __qcom_scm_init(void); #ifdef CONFIG_QCOM_RTIC #define SCM_SVC_RTIC 0x19 extern int __init scm_mem_protection_init_do(struct device *dev); #endif /* common error codes */ #define QCOM_SCM_V2_EBUSY -12 #define QCOM_SCM_ENOMEM -5 Loading Loading
drivers/firmware/qcom_scm-smc.c +32 −0 Original line number Diff line number Diff line Loading @@ -2086,6 +2086,38 @@ int __qcom_scm_qseecom_do(struct device *dev, u32 cmd_id, struct scm_desc *desc, return _ret; } #ifdef CONFIG_QCOM_RTIC #define TZ_RTIC_ENABLE_MEM_PROTECTION 0x4 int __init scm_mem_protection_init_do(struct device *dev) { int ret = 0, resp; struct qcom_scm_desc desc = { .svc = SCM_SVC_RTIC, .cmd = TZ_RTIC_ENABLE_MEM_PROTECTION, .owner = ARM_SMCCC_OWNER_SIP, }; desc.args[0] = 0; desc.arginfo = 0; ret = qcom_scm_call(dev, &desc); resp = desc.res[0]; if (ret == -1) { pr_err("%s: SCM call not supported\n", __func__); return ret; } else if (ret || resp) { pr_err("%s: SCM call failed\n", __func__); if (ret) return ret; else return resp; } return resp; } #endif void __qcom_scm_init(void) { __query_convention(); Loading
drivers/firmware/qcom_scm.c +9 −0 Original line number Diff line number Diff line Loading @@ -1165,6 +1165,15 @@ static int __init qcom_scm_init(void) } subsys_initcall(qcom_scm_init); #ifdef CONFIG_QCOM_RTIC static int __init scm_mem_protection_init(void) { return scm_mem_protection_init_do(__scm ? __scm->dev : NULL); } early_initcall(scm_mem_protection_init); #endif #if IS_MODULE(CONFIG_QCOM_SCM) static void __exit qcom_scm_exit(void) { Loading
drivers/firmware/qcom_scm.h +7 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,13 @@ extern int __qcom_scm_invoke_callback_response(struct device *dev, extern void __qcom_scm_init(void); #ifdef CONFIG_QCOM_RTIC #define SCM_SVC_RTIC 0x19 extern int __init scm_mem_protection_init_do(struct device *dev); #endif /* common error codes */ #define QCOM_SCM_V2_EBUSY -12 #define QCOM_SCM_ENOMEM -5 Loading