Commit a564bdc5 authored by Xi Chen's avatar Xi Chen Committed by Yidi Lin
Browse files

mediatek: mt8192: Add MPU Support for SCP/PCIe



1 Only enable domain D0 and D1:PCIe access 0xC0000000~0xC4000000;
2 Only enable domain D0 and D3(SCP) access 0x50000000~0x51400000;
Signed-off-by: default avatarXi Chen <xixi.chen@mediatek.com>
Change-Id: Ic4f9e6d85bfd1cebdb24ffc1d14309c89c103b2a
parent f3febcca
...@@ -91,30 +91,41 @@ int emi_mpu_set_protection(struct emi_region_info_t *region_info) ...@@ -91,30 +91,41 @@ int emi_mpu_set_protection(struct emi_region_info_t *region_info)
void emi_mpu_init(void) void emi_mpu_init(void)
{ {
/* Set permission */
struct emi_region_info_t region_info; struct emi_region_info_t region_info;
/* PCE-e protect address(TODO) */ /* reserve region 0 for future use */
region_info.start = 0x80000000ULL;
region_info.end = 0x83FF0000ULL; /* PCI-e protect address(64MB) */
region_info.start = 0xC0000000ULL;
region_info.end = 0xC3FF0000ULL;
region_info.region = 1; region_info.region = 1;
SET_ACCESS_PERMISSION(region_info.apc, 1, SET_ACCESS_PERMISSION(region_info.apc, 1,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, NO_PROT, FORBIDDEN, FORBIDDEN, NO_PROT, NO_PROT);
NO_PROT /*FORBIDDEN*/); emi_mpu_set_protection(&region_info);
/* SCP protect address */
region_info.start = 0x50000000ULL;
region_info.end = 0x513F0000ULL;
region_info.region = 2;
SET_ACCESS_PERMISSION(region_info.apc, 1,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
NO_PROT, FORBIDDEN, FORBIDDEN, NO_PROT);
emi_mpu_set_protection(&region_info); emi_mpu_set_protection(&region_info);
/* Forbidden All */ /* Forbidden All */
region_info.start = 0x40000000ULL; /* dram base addr */ region_info.start = 0x40000000ULL; /* dram base addr */
region_info.end = 0x1FFFF0000ULL; region_info.end = 0x1FFFF0000ULL;
region_info.region = 2; region_info.region = 3;
SET_ACCESS_PERMISSION(region_info.apc, 1, SET_ACCESS_PERMISSION(region_info.apc, 1,
NO_PROT, NO_PROT, NO_PROT, NO_PROT, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
NO_PROT, NO_PROT, NO_PROT, NO_PROT, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
NO_PROT, NO_PROT, NO_PROT, NO_PROT, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
NO_PROT, FORBIDDEN, NO_PROT, NO_PROT); FORBIDDEN, FORBIDDEN, FORBIDDEN, NO_PROT);
emi_mpu_set_protection(&region_info); emi_mpu_set_protection(&region_info);
dump_emi_mpu_regions(); dump_emi_mpu_regions();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment