developer | 880fb17 | 2022-09-05 19:08:59 +0800 | [diff] [blame] | 1 | /* |
Chungying Lu | 59c1c2b | 2023-04-25 15:39:10 +0800 | [diff] [blame] | 2 | * Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved. |
developer | 880fb17 | 2022-09-05 19:08:59 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <common/debug.h> |
| 8 | #include <emi_mpu.h> |
| 9 | |
| 10 | void set_emi_mpu_regions(void) |
| 11 | { |
| 12 | /* TODO: set emi mpu region */ |
| 13 | INFO("%s, emi mpu is not setting currently\n", __func__); |
| 14 | } |
Chungying Lu | 59c1c2b | 2023-04-25 15:39:10 +0800 | [diff] [blame] | 15 | |
| 16 | int set_apu_emi_mpu_region(void) |
| 17 | { |
| 18 | struct emi_region_info_t region_info; |
| 19 | |
| 20 | region_info.start = (unsigned long long)APUSYS_SEC_BUF_PA; |
| 21 | region_info.end = (unsigned long long)(APUSYS_SEC_BUF_PA + APUSYS_SEC_BUF_SZ) - 1; |
| 22 | region_info.region = APUSYS_SEC_BUF_EMI_REGION; |
| 23 | |
| 24 | SET_ACCESS_PERMISSION(region_info.apc, UNLOCK, |
| 25 | FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, |
| 26 | FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, |
| 27 | NO_PROTECTION, FORBIDDEN, NO_PROTECTION, FORBIDDEN, |
| 28 | FORBIDDEN, FORBIDDEN, FORBIDDEN, SEC_RW); |
| 29 | |
| 30 | return emi_mpu_set_protection(®ion_info); |
| 31 | } |