feat(plat/mediatek/mt8195): dump EMI MPU configurations

Add dump_emi_mpu_regions() to dump EMI MPU configurations.

BUG=b:204347737
TEST=build pass

Change-Id: Ia92c6d19b96d429682dff1680d5f5b2dc2bc1b8f
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
This commit is contained in:
Tinghan Shen 2021-11-15 18:07:47 +08:00 committed by Rex-BC Chen
parent 8a63739b31
commit 20ef588e86
1 changed files with 20 additions and 1 deletions

View File

@ -91,7 +91,26 @@ int emi_mpu_set_protection(struct emi_region_info_t *region_info)
return 0;
}
void dump_emi_mpu_regions(void)
{
unsigned long apc[EMI_MPU_DGROUP_NUM], sa, ea;
int region, i;
/* Only dump 8 regions(max: EMI_MPU_REGION_NUM --> 32) */
for (region = 0; region < 8; ++region) {
for (i = 0; i < EMI_MPU_DGROUP_NUM; ++i)
apc[i] = mmio_read_32(EMI_MPU_APC(region, i));
sa = mmio_read_32(EMI_MPU_SA(region));
ea = mmio_read_32(EMI_MPU_EA(region));
INFO("region %d:\n", region);
INFO("\tsa:0x%lx, ea:0x%lx, apc0: 0x%lx apc1: 0x%lx\n",
sa, ea, apc[0], apc[1]);
}
}
void emi_mpu_init(void)
{
/* TODO: more setting for EMI MPU. */
dump_emi_mpu_regions();
}