CPU-MMU
The CPU-MMU is used for virtual-to-physical memory address translation.
Introduction
The CPU-MMU diagram is shown in the following figure. A MMU can perform virtual-to-physical memory address translation. This can be used to map an external memory to a certain virtual memory area.
MMU virtual address to physical address is illustrated in the following figure. For example, if you want to access physical page 4 ~ 7 through virtual page 0 ~ 3, an MMU entry can be used to map virtual page 0 ~ 3 to physical page 4 ~ 7.
The chip provides 4 MMU entries.
If virtual address is not included in the MMU entry, use virtual address as physical address.
If virtual address is included in the MMU entry, physical address should be
VAddress + MMU_ENTRYx_OFFSET.
Registers
REMAP以1024Byte为整数倍进行映射,如果要访问的地址VAddress在MMU entry区间内则进行remap,判断条件为 VAddress >= REG_REMAPxBAR,且 VAddress <= REG_REMAPxEAR,映射后的地址physical address由3部分组成:
physical address[9:0] = VAddress[9:0];
physical address[19:10] = VAddress[19:10] + REG_REMAPxEAR [19:10];
physical address[31:20] = VAddress[31:20].
整个Register Map应该在Secure syson区间,PG时需要 retention 所有的Register,否则CPU1 Wakeup会出错 (Syson不会掉电)
Name |
Address offset |
Access |
Description |
|---|---|---|---|
000h |
R/W |
Region EMAP0 Base Address Register |
|
004h |
R/W |
Region EMAP0 End Address Register |
|
008h |
R/W |
Remap 0 Offset Register |
|
00Ch |
R/W |
Region EMAP1 Base Address Register |
|
010h |
R/W |
Region EMAP1 End Address Register |
|
014h |
R/W |
Remap 1 Offset Register |
|
018h |
R/W |
Region EMAP2 Base Address Register |
|
01Ch |
R/W |
Region EMAP2 End Address Register |
|
020h |
R/W |
Remap 2 Offset Register |
|
024h |
R/W |
Region EMAP3 Base Address Register |
|
028h |
R/W |
Region EMAP3 End Address Register |
|
02Ch |
R/W |
Remap 3 Offset Register |
REG_REMAPxBAR
Name: Remap x Base Address Register (x={0, 1, 2, 3})
Size: 32 bits
Address offset: Refer to virtual address base register.
Read/write access: R/W
Bit |
Symbol |
Access |
Reset |
Description |
|---|---|---|---|---|
31:10 |
REMAP_BASE_x_ADDR |
R/W |
0x0 |
Remap region x base address [31:10] The region address is 1KB aligned. |
9:0 |
RSVD |
- |
0 |
Reserved |
REG_REMAPxEAR
Name: Remap x End Address Register (x={0, 1, 2, 3})
Size: 32 bits
Address offset: Refer to virtual address end register.
Read/write access: R/W
Bit |
Symbol |
Access |
Reset |
Description |
|---|---|---|---|---|
31:10 |
REMAP_END_x_OFFSET |
R/W |
0x0 |
Remap region x end address [31:10] The region address is 1KB aligned. |
9:0 |
RSVD |
- |
0 |
Reserved |
REG_REMAPxOR
Name: Remap x Offset Register (x={0, 1, 2, 3})
Size: 32 bits
Address offset: Refer to actual register address offset.
Read/write access: R/W
Bit |
Symbol |
Access |
Reset |
Description |
|---|---|---|---|---|
31:20 |
RSVD |
- |
0 |
Reserved |
19:10 |
REMAP_x_OFFSET |
R/W |
0x0 |
Remap region x offset [19:10] The output address [19:10] is “Access address[19:10]+ Region_Offset[19:10]”. |
9:1 |
RSVD |
- |
0 |
Reserved |
0 |
REMAP_x_ENABLE |
R/W |
0x0 |
Remap region x enable |