]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(mediatek): add SMC handler for EMI MPU
authorBo-Chen Chen <rex-bc.chen@mediatek.com>
Tue, 6 Dec 2022 07:22:33 +0000 (15:22 +0800)
committerjason-ch chen <Jason-ch.Chen@mediatek.com>
Tue, 21 Mar 2023 02:49:17 +0000 (10:49 +0800)
EMI MPU will handle the SMC call from optee, so we need to add this
patch to support it.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Signed-off-by: jason-ch chen <Jason-ch.Chen@mediatek.com>
Change-Id: I22e128c4246814cbd5855f51a26e4e11ccfe3a6b

plat/mediatek/drivers/emi_mpu/emi_mpu_common.c

index 27b2b07f94cdf1880c29e730344c77531a66e8eb..bf777912de0ba75a2a22c66b61b466164c1a91ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -9,6 +9,7 @@
 #include <lib/mmio.h>
 #include <emi_mpu.h>
 #include <lib/mtk_init/mtk_init.h>
+#include <mtk_sip_svc.h>
 
 #if ENABLE_EMI_MPU_SW_LOCK
 static unsigned char region_lock_state[EMI_MPU_REGION_NUM];
@@ -111,6 +112,16 @@ int emi_mpu_set_protection(struct emi_region_info_t *region_info)
        return 0;
 }
 
+u_register_t mtk_emi_mpu_sip_handler(u_register_t x1, u_register_t x2,
+                                    u_register_t x3, u_register_t x4,
+                                    void *handle, struct smccc_res *smccc_ret)
+{
+       /* TODO: implement emi mpu handler */
+
+       return 0;
+}
+DECLARE_SMC_HANDLER(MTK_SIP_TEE_MPU_PERM_SET, mtk_emi_mpu_sip_handler);
+
 int emi_mpu_init(void)
 {
        INFO("[%s] emi mpu initialization\n", __func__);