Secure Area:
CR7 and CM33 Area:
H.264 Encode/Decode Area:
LCD Frame Buffer area
DDR Restricted Area (beginning of DDR)
Default DDR RZ/G2L Memory Map in the BSP |
┌───────────────────────────────────────┐0x40000000 │ unused (DDR controller) │ ├───────────────────────────────────────┤0x40010000 │ CM33 │ ├───────────────────────────────────────┤0x43F00000 │ BL31 Secure Monitor (2MB) │ ├───────────────────────────────────────┤0x44100000 │ BL32 (OP-TEE) (61MB) │ ├───────────────────────────────────────┤0x47E00000 │ unused │ ├───────────────────────────────────────┤0x48000000 │ BL33 (u-boot) and Linux (1.99GB) │ └───────────────────────────────────────┘0x80000000 |
Item | QSPI boot | eMMC boot (1) | eSD boot | Execution address | Secure / Non-secure (security package) |
---|---|---|---|---|---|
Boot parameters (3) | 0x0 | sector 1 | sector 1 | 0x11E00-12000 (2) | Secure |
BL2 (3) | 0x200 | sector 2 | sector 8 | 0x12000-0x2EFFF (5) | |
BL31 (Secure Monitor) | 0x1D200 | sector 256 | sector 128 | 0x44000000-0x44040000 | Secure |
BL32 (OP-TEE) | 0x4410000-0x47E00000 | Secure | |||
BL33 (u-boot) | 0x50000000-0x58000000 (4) | Non-secure | |||
u-boot environment variables | eMMC boot partition 2 | NA | NA | ||
Linux | Many options | 0x48000000-end | Non-secure |
(1) Boot partition selected by [179] field (PARTITION CONFIG) of the EXT_CSD register. eMMC / SD sector size = 512bytes
(2) Boot parameters are not executed, just copied
(3) These addresses are fixed and cannot be configured
(4) Relocated at the end of the DDR
(5) For secure boot, actual BL2 code starts at 0x13000, at 0x12000 there's the key certificate and at 0x12400 the code certificate
Item | Cortex-M33 address | Cortex-A55 address |
---|---|---|
Non-secure vector table | 0x10000-0x107FF | 0x10000-0x107FF |
Secure vector table | 0x1001FF80-0x1001FFFF | 0x1FF80-1FFFF |
Non-secure code | 0x60010000-0x6010FFFF | 0x40010000-0x4010FFFF |
Secure code | 0x72EFF440-0x72EFF7FF | 0x42EFF440-0x42EFF7FF |
Non-secure data | 0x600110000-0x72EFF43F | 0x40110000-0x42EFF43F |
Secure data | 0x72EFF800-0x72EFFFFF | 0x42EFF800-0x42EFFFFF |
OpenAMP resource table | 0x62F00000-0x62F0FFF | 0x42F00000-0x42F0FFF |
OpenAMP vring | 0x63000000-0x637FFFFF | 0x43000000-0x437FFFFF |
MHU shared memory | 0x62F01000-0x62F01FFF | 0x42F01000-0x42F01FFF |
Start Address and size of Trusted Firmware (BL31):
/* Trusted Firmware(BL31) secure DRAM 0x43F00000 - 0x440FFFFF */ #define PLAT_FW_TZC_PROT_DRAM1_BASE (0x43F00000) #define PLAT_FW_TZC_PROT_DRAM1_SIZE (0x00200000)
/******************************************************************************* * BL31 specific defines. ******************************************************************************/ #define BL31_BASE (0x44000000) #define BL31_LIMIT (0x44040000)
Start Address and size of OP-TEE (BL32):
/* OP-TEE secure DRAM 0x44100000 - 0x47DFFFFF */ #define PLAT_TEE_TZC_PROT_DRAM1_BASE (0x44100000) #define PLAT_TEE_TZC_PROT_DRAM1_SIZE (0x03D00000)
/******************************************************************************* * BL32 specific defines. ******************************************************************************/ #ifndef SPD_none #define BL32_BASE (0x44100000) #define BL32_LIMIT (BL32_BASE + 0x100000) #endif
Remove OP-TEE Area (optional)
diff --git a/plat/renesas/rz/common/plat_security.c b/plat/renesas/rz/common/plat_security.c index 4e9c96f81..35a4910c0 100755 --- a/plat/renesas/rz/common/plat_security.c +++ b/plat/renesas/rz/common/plat_security.c @@ -115,8 +115,10 @@ static void bl2_security_setup(void) const arm_tzc_regions_info_t ddr_tzc_regions[] = { {PLAT_FW_TZC_PROT_DRAM1_BASE, PLAT_FW_TZC_PROT_DRAM1_END, TZC_REGION_S_RDWR, PLAT_TZC_REGION_ACCESS_S_UNPRIV}, +#if 0 {PLAT_TEE_TZC_PROT_DRAM1_BASE, PLAT_TEE_TZC_PROT_DRAM1_END, TZC_REGION_S_RDWR, PLAT_TZC_REGION_ACCESS_S_UNPRIV}, +#endif {} };
memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0 0x48000000 0 0x78000000>; };
#define DRAM_RSV_SIZE 0x08000000 /* 128MB by default */
memory Node
memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x78000000>; };
linux,cma Node
reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; reserved: linux,cma@58000000 { compatible = "shared-dma-pool"; linux,cma-default; reusable; reg = <0x0 0x58000000 0x0 0x10000000>; }; };
linux,multimedia Node
reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; mmp_reserved: linux,multimedia { compatible = "shared-dma-pool"; reusable; reg = <0x00000000 0x68000000 0x0 0x8000000>; }; };
|
Trusted Firmware-A File: drivers/renesas/common/io/io_rcar.c -#define RCAR_SDRAM_certESS (0x43F00000U) +#define RCAR_SDRAM_certESS (0x40F00000U) File: plat/renesas/common/include/platform_def.h -#define RCAR_BL31_LOG_BASE (0x44040000) +#define RCAR_BL31_LOG_BASE (0x41040000) -#define BL32_BASE U(0x44100000) +#define BL32_BASE U(0x41100000) -#define BL33_BASE DRAM1_NS_BASE +#define BL33_BASE U(0x50000000)//(hard code u-boot address) it was DRAM1_NS_BASE File: plat/renesas/common/include/rcar_def.h -#define RCAR_TRUSTED_SRAM_BASE 0x44000000 +#define RCAR_TRUSTED_SRAM_BASE 0x41000000 -#define DRAM1_NS_BASE (DRAM1_BASE + U(0x10000000)) +#define DRAM1_NS_BASE (DRAM1_BASE + U(0x02000000)) -#define DRAM_PROTECTED_BASE ULL(0x43F00000) +#define DRAM_PROTECTED_BASE ULL(0x40F00000) //(images have to be loaded inside this area) -#define DRAM_PROTECTED_SIZE ULL(0x03F00000) +#define DRAM_PROTECTED_SIZE ULL(0x01100000) -#define RCAR_BL31_CRASH_BASE U(0x4403F000) +#define RCAR_BL31_CRASH_BASE U(0x4103F000) File: plat/renesas/rzg/bl2_plat_setup.c - start = 0x48000000U; - size -= 0x8000000U; + start = 0x42000000U; + size -= 0x2000000U; File: tools/renesas/rzg_layout_create/sa6.c -#define RCAR_BL31DST_ADDRESS (0x44000000U) +#define RCAR_BL31DST_ADDRESS (0x41000000U) -#define RCAR_BL32DST_ADDRESS (0x44100000U) +#define RCAR_BL32DST_ADDRESS (0x41100000U)
File: include/configs/rcar-gen3-common.h -#define DRAM_RSV_SIZE 0x08000000 +#define DRAM_RSV_SIZE 0x02000000 File: arch/arm/dts/r8a774c0-ek874.dts - memory@48000000 { + memory@42000000 { device_type = "memory"; - /* first 128MB is reserved for secure area. */ - reg = <0x0 0x48000000 0x0 0x78000000>; + /* first 32MB is reserved for secure area. */ + reg = <0x0 0x42000000 0x0 0x7E000000>; }; kernel
File: arch/arm64/boot/dts/renesas/cat874-common.dtsi memory@42000000 { device_type = "memory"; /* first 32MB is reserved for secure area. */ reg = <0x0 0x42000000 0x0 0x7E000000>; }; New Boot Command:
=> set sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x42080000 Image-ek874.bin ; fatload mmc 1:1 0x42000000 /Image-r8a774c0-es10-ek874.dtb' => set sd_boot2 'setenv bootargs root=/dev/mmcblk1p2 rootwait ; booti 0x42080000 - 0x42000000' => saveenv |