feat(mt8196): add Mediatek EMI stub implementation for mt8196

Implement stub functions for the EMI driver to ensure that the build
can pass when a prebuilt library is not available.

Change-Id: I296945a3df6766a3a133cd385a1e5038ca979403
Signed-off-by: Gavin Liu <gavin.liu@mediatek.corp-partner.google.com>
This commit is contained in:
Gavin Liu 2024-12-31 14:34:00 +08:00 committed by Gavin Liu
parent 79e11f5654
commit 39f5e27820
6 changed files with 67 additions and 4 deletions

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2025, Mediatek Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef EMI_H
#define EMI_H
#include <stdint.h>
#define EMI_MPU_ALIGN_BITS 12
uint64_t sip_emi_mpu_set_protection(u_register_t start, u_register_t end, u_register_t region);
#endif /* EMI_H */

View file

@ -0,0 +1,15 @@
/*
* Copyright (c) 2025, Mediatek Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <common/debug.h>
#include "common/emi.h"
#include <mtk_sip_svc.h>
uint64_t sip_emi_mpu_set_protection(u_register_t start, u_register_t end,
u_register_t region)
{
return MTK_SIP_E_NOT_SUPPORTED;
}

View file

@ -0,0 +1,15 @@
#
# Copyright (c) 2025, MediaTek Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
LOCAL_DIR := $(call GET_LOCAL_DIR)
MODULE := emi
ifeq ($(MTKLIB_PATH),)
LOCAL_SRCS-y := $(LOCAL_DIR)/emi_stub.c
endif
$(eval $(call MAKE_MODULE,$(MODULE),$(LOCAL_SRCS-y),$(MTK_BL)))

View file

@ -13,6 +13,7 @@
_func(MTK_SIP_KERNEL_DFD, 0x205) \
_func(MTK_SIP_KERNEL_MSDC, 0x273) \
_func(MTK_SIP_VCORE_CONTROL, 0x506) \
_func(MTK_SIP_EMIDBG_CONTROL, 0x50B) \
_func(MTK_SIP_IOMMU_CONTROL, 0x514) \
_func(MTK_SIP_AUDIO_CONTROL, 0x517) \
_func(MTK_SIP_APUSYS_CONTROL, 0x51E) \
@ -21,9 +22,11 @@
_func(MTK_SIP_KERNEL_VCP_CONTROL, 0x52C)
#define MTK_SIP_SMC_FROM_S_EL1_TABLE(_func) \
_func(MTK_SIP_TEE_MPU_PERM_SET, 0x031)
_func(MTK_SIP_TEE_MPU_PERM_SET, 0x031) \
_func(MTK_SIP_TEE_EMI_MPU_CONTROL, 0x048)
#define MTK_SIP_SMC_FROM_BL33_TABLE(_func) \
_func(MTK_SIP_KERNEL_BOOT, 0x115)
_func(MTK_SIP_KERNEL_BOOT, 0x115) \
_func(MTK_SIP_BL_EMIMPU_CONTROL, 0x415)
#endif /* MTK_SIP_DEF_H */

View file

@ -169,8 +169,21 @@
/*******************************************************************************
* EMI MPU related constants
*******************************************************************************/
#define EMI_MPU_BASE (IO_PHYS + 0x00428000)
#define SUB_EMI_MPU_BASE (IO_PHYS + 0x00528000)
#define EMI_MPU_BASE (IO_PHYS + 0x00428000)
#define SUB_EMI_MPU_BASE (IO_PHYS + 0x00528000)
#define EMI_SLB_BASE (IO_PHYS + 0x0042e000)
#define SUB_EMI_SLB_BASE (IO_PHYS + 0x0052e000)
#define CHN0_EMI_APB_BASE (IO_PHYS + 0x00201000)
#define CHN1_EMI_APB_BASE (IO_PHYS + 0x00205000)
#define CHN2_EMI_APB_BASE (IO_PHYS + 0x00209000)
#define CHN3_EMI_APB_BASE (IO_PHYS + 0x0020D000)
#define EMI_APB_BASE (IO_PHYS + 0x00429000)
#define INFRA_EMI_DEBUG_CFG_BASE (IO_PHYS + 0x00425000)
#define NEMI_SMPU_BASE (IO_PHYS + 0x0042f000)
#define SEMI_SMPU_BASE (IO_PHYS + 0x0052f000)
#define SUB_EMI_APB_BASE (IO_PHYS + 0x00529000)
#define SUB_INFRA_EMI_DEBUG_CFG_BASE (IO_PHYS + 0x00525000)
#define SUB_INFRACFG_AO_MEM_BASE (IO_PHYS + 0x00504000)
/*******************************************************************************
* System counter frequency related constants

View file

@ -27,6 +27,7 @@ MODULES-y += $(MTK_PLAT)/lib/mtk_init
MODULES-y += $(MTK_PLAT)/lib/pm
MODULES-y += $(MTK_PLAT)/drivers/apusys
MODULES-y += $(MTK_PLAT)/drivers/dp
MODULES-y += $(MTK_PLAT)/drivers/emi
MODULES-y += $(MTK_PLAT)/drivers/mcusys
MODULES-y += $(MTK_PLAT)/drivers/timer
MODULES-y += $(MTK_PLAT)/drivers/vcp