Commit 95d3c46a authored by Xi Chen's avatar Xi Chen Committed by kenny liang
Browse files

mediatek: mt8183: protect 4GB~8GB dram memory



The offset there is the virtual address space on the bus side (1-9GB for 8GB RAM),
and that emi_mpu_set_region_protection will translate to the physical memory space (0-8GB).

8GB is 33-bit (the memory bus width is 33-bit on this platform),
so 0x23FFFFFFFUL-EMI_PHY_OFFSET = 0x1_FFFF_FFFF.

Change-Id: I7be4759ed7546f7e15a5868b6f08988928c34075
Signed-off-by: default avatarXi Chen <xixi.chen@mediatek.com>
parent 572fcdd5
...@@ -138,15 +138,9 @@ void emi_mpu_init(void) ...@@ -138,15 +138,9 @@ void emi_mpu_init(void)
(FORBIDDEN << 6)); (FORBIDDEN << 6));
emi_mpu_set_region_protection(0x52900000UL, 0x5FFFFFFFUL, 2, emi_mpu_set_region_protection(0x52900000UL, 0x5FFFFFFFUL, 2,
(FORBIDDEN << 3 | FORBIDDEN << 6)); (FORBIDDEN << 3 | FORBIDDEN << 6));
emi_mpu_set_region_protection(0x60000000UL, 0x7FFFFFFFUL, 3, emi_mpu_set_region_protection(0x60000000UL, 0xFFFFFFFFUL, 3,
(FORBIDDEN << 3 | FORBIDDEN << 6)); (FORBIDDEN << 3 | FORBIDDEN << 6));
emi_mpu_set_region_protection(0x80000000UL, 0x9FFFFFFFUL, 4, emi_mpu_set_region_protection(0x100000000UL, 0x23FFFFFFFUL, 4,
(FORBIDDEN << 3 | FORBIDDEN << 6));
emi_mpu_set_region_protection(0xA0000000UL, 0xBFFFFFFFUL, 5,
(FORBIDDEN << 3 | FORBIDDEN << 6));
emi_mpu_set_region_protection(0xC0000000UL, 0xDFFFFFFFUL, 6,
(FORBIDDEN << 3 | FORBIDDEN << 6));
emi_mpu_set_region_protection(0xE0000000UL, 0xFFFFFFFFUL, 7,
(FORBIDDEN << 3 | FORBIDDEN << 6)); (FORBIDDEN << 3 | FORBIDDEN << 6));
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