mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 13:36:05 +00:00
feat(mt8188): update SVP region ID protection flow
- Extend the SVP region number from 1 to 10 - Mapping one region each time Change-Id: I2dd517127018c71174f3d52a2118463370caf569 Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
This commit is contained in:
parent
26f2f24c69
commit
e66c4ea8ae
2 changed files with 8 additions and 5 deletions
plat/mediatek/drivers/emi_mpu/mt8188
|
@ -120,13 +120,13 @@ int emi_mpu_optee_handler(uint64_t encoded_addr, uint64_t zone_size,
|
|||
{
|
||||
uint64_t phys_addr = get_decoded_phys_addr(encoded_addr);
|
||||
struct emi_region_info_t region_info;
|
||||
enum MPU_REQ_ORIGIN_ZONE_ID zone_id = get_decoded_zone_id(zone_info);
|
||||
enum region_ids zone_id = get_decoded_zone_id(zone_info);
|
||||
uint32_t is_set = get_decoded_set_clear_info(zone_info);
|
||||
|
||||
INFO("encoded_addr = 0x%lx, zone_size = 0x%lx, zone_info = 0x%lx\n",
|
||||
encoded_addr, zone_size, zone_info);
|
||||
|
||||
if (zone_id != MPU_REQ_ORIGIN_TEE_ZONE_SVP) {
|
||||
if (zone_id < SVP_DRAM_REGION_ID_START || zone_id > SVP_DRAM_REGION_ID_END) {
|
||||
ERROR("Invalid param %s, %d\n", __func__, __LINE__);
|
||||
return MTK_SIP_E_INVALID_PARAM;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ int emi_mpu_optee_handler(uint64_t encoded_addr, uint64_t zone_size,
|
|||
/* SVP DRAM */
|
||||
region_info.start = phys_addr;
|
||||
region_info.end = phys_addr + zone_size - 1;
|
||||
region_info.region = SVP_DRAM_REGION_ID;
|
||||
region_info.region = zone_id;
|
||||
SET_ACCESS_PERMISSION(region_info.apc, UNLOCK,
|
||||
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
|
||||
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
|
||||
|
@ -144,7 +144,7 @@ int emi_mpu_optee_handler(uint64_t encoded_addr, uint64_t zone_size,
|
|||
|
||||
emi_mpu_set_protection(®ion_info);
|
||||
} else { /* clear region protection */
|
||||
emi_mpu_clear_protection(SVP_DRAM_REGION_ID);
|
||||
emi_mpu_clear_protection(zone_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -56,13 +56,16 @@
|
|||
#define APUSYS_SEC_BUF_PA (0x55000000)
|
||||
#define APUSYS_SEC_BUF_SZ (0x100000)
|
||||
|
||||
#define SVP_DRAM_REGION_COUNT (10)
|
||||
|
||||
enum region_ids {
|
||||
BL31_EMI_REGION_ID = 0,
|
||||
BL32_REGION_ID,
|
||||
SCP_CORE0_REGION_ID,
|
||||
SCP_CORE1_REGION_ID,
|
||||
DSP_PROTECT_REGION_ID,
|
||||
SVP_DRAM_REGION_ID,
|
||||
SVP_DRAM_REGION_ID_START = 5,
|
||||
SVP_DRAM_REGION_ID_END = SVP_DRAM_REGION_ID_START + SVP_DRAM_REGION_COUNT - 1,
|
||||
|
||||
APUSYS_SEC_BUF_EMI_REGION_ID = 21,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue