Skip to content

Commit 8fd4d26

Browse files
etienne-lmsjforissier
authored andcommitted
plat-hikey: support generic RAM layout
Move default secure and non-secure Optee memory locations from platform_config.h to conf.mk using the generic_ram_layout. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
1 parent ab9801a commit 8fd4d26

File tree

2 files changed

+9
-42
lines changed

2 files changed

+9
-42
lines changed

core/arch/arm/plat-hikey/conf.mk

+5
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,8 @@ ifeq ($(PLATFORM_FLAVOR),hikey960)
5656
CFG_CONSOLE_UART ?= 6
5757
CFG_DRAM_SIZE_GB ?= 3
5858
endif
59+
60+
CFG_TZDRAM_START ?= 0x3F000000
61+
CFG_TZDRAM_SIZE ?= 0x01000000
62+
CFG_SHMEM_START ?= 0x3EE00000
63+
CFG_SHMEM_SIZE ?= 0x00200000

core/arch/arm/plat-hikey/platform_config.h

+4-42
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef PLATFORM_CONFIG_H
77
#define PLATFORM_CONFIG_H
88

9+
#include <mm/generic_ram_layout.h>
10+
911
/* Make stacks aligned to data cache line length */
1012
#define STACK_ALIGNMENT 64
1113

@@ -44,6 +46,8 @@
4446
/*
4547
* HiKey and HiKey960 memory map
4648
*
49+
* Refer to the default configuration from conf.mk for description below.
50+
*
4751
* TZDRAM is secured (firewalled) by the DDR controller, see ARM-TF, but note
4852
* that security of this type of memory is weak for two reasons:
4953
* 1. It is prone to physical tampering since DRAM is external to the SoC
@@ -126,46 +130,4 @@
126130
#error Unknown HiKey PLATFORM_FLAVOR
127131
#endif /* PLATFORM_FLAVOR_hikey */
128132

129-
130-
#ifdef CFG_WITH_PAGER
131-
132-
#define TZSRAM_BASE 0x3F000000
133-
#define TZSRAM_SIZE CFG_CORE_TZSRAM_EMUL_SIZE
134-
135-
#define TZDRAM_BASE 0x3F200000
136-
#define TZDRAM_SIZE (14 * 1024 * 1024)
137-
138-
#else /* CFG_WITH_PAGER */
139-
140-
#define TZDRAM_BASE 0x3F000000
141-
#define TZDRAM_SIZE (16 * 1024 * 1024)
142-
143-
#endif /* CFG_WITH_PAGER */
144-
145-
#define TEE_SHMEM_START 0x3EE00000
146-
#define TEE_SHMEM_SIZE (2 * 1024 * 1024)
147-
148-
#define TEE_RAM_VA_SIZE (2 * 1024 * 1024)
149-
150-
#define TEE_LOAD_ADDR 0x3F000000
151-
152-
#ifdef CFG_WITH_PAGER
153-
154-
#define TEE_RAM_START TZSRAM_BASE
155-
#define TEE_RAM_PH_SIZE TZSRAM_SIZE
156-
#define TA_RAM_START ROUNDUP(TZDRAM_BASE, CORE_MMU_DEVICE_SIZE)
157-
#define TA_RAM_SIZE ROUNDDOWN(TZDRAM_SIZE, CORE_MMU_DEVICE_SIZE)
158-
159-
#else /* CFG_WITH_PAGER */
160-
161-
#define TEE_RAM_PH_SIZE TEE_RAM_VA_SIZE
162-
#define TEE_RAM_START TZDRAM_BASE
163-
#define TA_RAM_START ROUNDUP((TZDRAM_BASE + TEE_RAM_VA_SIZE), \
164-
CORE_MMU_DEVICE_SIZE)
165-
166-
#define TA_RAM_SIZE ROUNDDOWN((TZDRAM_SIZE - TEE_RAM_VA_SIZE),\
167-
CORE_MMU_DEVICE_SIZE)
168-
169-
#endif /* CFG_WITH_PAGER */
170-
171133
#endif /* PLATFORM_CONFIG_H */

0 commit comments

Comments
 (0)