aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2016-09-27 11:37:05 -0700
committerJens Wiklander <jens.wiklander@linaro.org>2016-09-27 15:57:58 -0700
commitf5f914aa755a2aa1aa0a5fb93c2d4bb16b7f8fe4 (patch)
tree15189784a8b6852a23c886a335aaf615aa79ddcb
parent79a90f9b04ce3c0b9360ca40a3a359d605486592 (diff)
core: Add default CFG_CORE_HEAP_SIZE
Adds a CFG_CORE_HEAP_SIZE replacing the defined HEAP_SIZE in each platform_config.h. Default value is defined in mk/config.mk as 64 kB. This is larger than most of the previous values at 24 kB or just above. Platforms with a previous heap size defined larger than 64 kB overrides the mk/config.mk setting with a $(platform-dir)/conf.mk setting using the previous value. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (Hikey pager) Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v7 pager) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (FVP Aarch32 pager) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--core/arch/arm/kernel/kern.ld.S10
-rw-r--r--core/arch/arm/plat-d02/conf.mk2
-rw-r--r--core/arch/arm/plat-d02/platform_config.h3
-rw-r--r--core/arch/arm/plat-hikey/platform_config.h2
-rw-r--r--core/arch/arm/plat-imx/platform_config.h2
-rw-r--r--core/arch/arm/plat-ls/platform_config.h2
-rw-r--r--core/arch/arm/plat-mediatek/platform_config.h2
-rw-r--r--core/arch/arm/plat-rcar/platform_config.h2
-rw-r--r--core/arch/arm/plat-rpi3/platform_config.h2
-rw-r--r--core/arch/arm/plat-sprd/conf.mk2
-rw-r--r--core/arch/arm/plat-sprd/platform_config.h3
-rw-r--r--core/arch/arm/plat-stm/platform_config.h2
-rw-r--r--core/arch/arm/plat-ti/platform_config.h2
-rw-r--r--core/arch/arm/plat-vexpress/platform_config.h2
-rw-r--r--core/arch/arm/plat-zynqmp/platform_config.h1
-rw-r--r--mk/config.mk3
16 files changed, 12 insertions, 30 deletions
diff --git a/core/arch/arm/kernel/kern.ld.S b/core/arch/arm/kernel/kern.ld.S
index 67e5f6df..7fbaf9d0 100644
--- a/core/arch/arm/kernel/kern.ld.S
+++ b/core/arch/arm/kernel/kern.ld.S
@@ -198,7 +198,7 @@ SECTIONS
*/
__heap1_start = .;
#ifndef CFG_WITH_PAGER
- . += HEAP_SIZE;
+ . += CFG_CORE_HEAP_SIZE;
#endif
. = ALIGN(16 * 1024);
__heap1_end = .;
@@ -225,11 +225,11 @@ SECTIONS
.heap2 (NOLOAD) : {
__heap2_start = .;
/*
- * Reserve additional memory for heap, the total should
- * be at least HEAP_SIZE, but count what has already been
- * reserved in .heap1
+ * Reserve additional memory for heap, the total should be
+ * at least CFG_CORE_HEAP_SIZE, but count what has already
+ * been reserved in .heap1
*/
- . += HEAP_SIZE - (__heap1_end - __heap1_start);
+ . += CFG_CORE_HEAP_SIZE - (__heap1_end - __heap1_start);
. = ALIGN(4 * 1024);
__heap2_end = .;
}
diff --git a/core/arch/arm/plat-d02/conf.mk b/core/arch/arm/plat-d02/conf.mk
index c0e1ce84..06a573cd 100644
--- a/core/arch/arm/plat-d02/conf.mk
+++ b/core/arch/arm/plat-d02/conf.mk
@@ -4,6 +4,8 @@ CFG_WITH_STACK_CANARIES ?= y
CFG_WITH_SOFTWARE_PRNG ?= n
# Override default size of emulated TrustZone protected SRAM, 384 kB
CFG_CORE_TZSRAM_EMUL_SIZE ?= 393216
+# Overrides default in mk/config.mk with 96 kB
+CFG_CORE_HEAP_SIZE ?= 98304
$(call force,CFG_GENERIC_BOOT,y)
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y)
diff --git a/core/arch/arm/plat-d02/platform_config.h b/core/arch/arm/plat-d02/platform_config.h
index c927a67a..fffa3d19 100644
--- a/core/arch/arm/plat-d02/platform_config.h
+++ b/core/arch/arm/plat-d02/platform_config.h
@@ -51,9 +51,6 @@
#define RNG_BASE 0xD1010000
#define RNG_REG_SIZE 0x18
-/* TEE core heap */
-#define HEAP_SIZE (96 * 1024)
-
/*
* HiSilicon D02 memory map
*
diff --git a/core/arch/arm/plat-hikey/platform_config.h b/core/arch/arm/plat-hikey/platform_config.h
index a2dba8bf..633759f3 100644
--- a/core/arch/arm/plat-hikey/platform_config.h
+++ b/core/arch/arm/plat-hikey/platform_config.h
@@ -49,8 +49,6 @@
#define CONSOLE_BAUDRATE 115200
#define CONSOLE_UART_CLK_IN_HZ 19200000
-#define HEAP_SIZE (32 * 1024)
-
/*
* HiKey memory map
*
diff --git a/core/arch/arm/plat-imx/platform_config.h b/core/arch/arm/plat-imx/platform_config.h
index 3fde9e1d..d8de1d4c 100644
--- a/core/arch/arm/plat-imx/platform_config.h
+++ b/core/arch/arm/plat-imx/platform_config.h
@@ -76,8 +76,6 @@
#define CFG_SHMEM_START (TZDRAM_BASE - 0x100000)
#define CFG_SHMEM_SIZE 0x100000
-#define HEAP_SIZE (24 * 1024)
-
/* Location of trusted dram on imx */
#define TZDRAM_BASE (0x9c100000)
#define TZDRAM_SIZE (0x03000000)
diff --git a/core/arch/arm/plat-ls/platform_config.h b/core/arch/arm/plat-ls/platform_config.h
index 96b9304b..1651bd9e 100644
--- a/core/arch/arm/plat-ls/platform_config.h
+++ b/core/arch/arm/plat-ls/platform_config.h
@@ -68,8 +68,6 @@
#define CFG_DDR_TEETZ_RESERVED_SIZE 0x03F00000
-#define HEAP_SIZE (24 * 1024)
-
#define CFG_TEE_RAM_VA_SIZE (1024 * 1024)
#define CFG_TEE_CORE_NB_CORE 2
diff --git a/core/arch/arm/plat-mediatek/platform_config.h b/core/arch/arm/plat-mediatek/platform_config.h
index 44de7dc7..95843c5f 100644
--- a/core/arch/arm/plat-mediatek/platform_config.h
+++ b/core/arch/arm/plat-mediatek/platform_config.h
@@ -69,8 +69,6 @@
#error "Unknown platform flavor"
#endif
-#define HEAP_SIZE (24 * 1024)
-
#define CFG_TEE_RAM_VA_SIZE (1024 * 1024)
#ifndef CFG_TEE_LOAD_ADDR
diff --git a/core/arch/arm/plat-rcar/platform_config.h b/core/arch/arm/plat-rcar/platform_config.h
index 34763b3c..287689d4 100644
--- a/core/arch/arm/plat-rcar/platform_config.h
+++ b/core/arch/arm/plat-rcar/platform_config.h
@@ -56,8 +56,6 @@
#define CFG_SHMEM_START (TZDRAM_BASE + TZDRAM_SIZE)
#define CFG_SHMEM_SIZE 0x100000
-#define HEAP_SIZE (24 * 1024)
-
#define CFG_TEE_RAM_VA_SIZE (1024 * 1024)
#ifndef CFG_TEE_LOAD_ADDR
diff --git a/core/arch/arm/plat-rpi3/platform_config.h b/core/arch/arm/plat-rpi3/platform_config.h
index 75a667b4..ac53e262 100644
--- a/core/arch/arm/plat-rpi3/platform_config.h
+++ b/core/arch/arm/plat-rpi3/platform_config.h
@@ -42,8 +42,6 @@
#define CONSOLE_BAUDRATE 115200
#define CONSOLE_UART_CLK_IN_HZ 19200000
-#define HEAP_SIZE (64 * 1024)
-
/*
* RPi memory map
*
diff --git a/core/arch/arm/plat-sprd/conf.mk b/core/arch/arm/plat-sprd/conf.mk
index 438f678a..137214f9 100644
--- a/core/arch/arm/plat-sprd/conf.mk
+++ b/core/arch/arm/plat-sprd/conf.mk
@@ -24,3 +24,5 @@ $(call force,CFG_PM_STUBS,y)
$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y)
CFG_WITH_STACK_CANARIES ?= y
+# Overrides default in mk/config.mk with 128 kB
+CFG_CORE_HEAP_SIZE ?= 131072
diff --git a/core/arch/arm/plat-sprd/platform_config.h b/core/arch/arm/plat-sprd/platform_config.h
index 3ab24192..b30583e2 100644
--- a/core/arch/arm/plat-sprd/platform_config.h
+++ b/core/arch/arm/plat-sprd/platform_config.h
@@ -65,9 +65,6 @@
#error "Unknown platform flavor"
#endif
-#define HEAP_SIZE (128 * 1024)
-
-
#define CFG_TEE_RAM_VA_SIZE (1024 * 1024)
#ifndef CFG_TEE_LOAD_ADDR
diff --git a/core/arch/arm/plat-stm/platform_config.h b/core/arch/arm/plat-stm/platform_config.h
index e370a635..595ee128 100644
--- a/core/arch/arm/plat-stm/platform_config.h
+++ b/core/arch/arm/plat-stm/platform_config.h
@@ -40,8 +40,6 @@
#error "LPAE not supported for platform STM"
#endif
-#define HEAP_SIZE (24 * 1024)
-
/*
* TEE/TZ RAM layout:
*
diff --git a/core/arch/arm/plat-ti/platform_config.h b/core/arch/arm/plat-ti/platform_config.h
index 107219f6..c557fc9c 100644
--- a/core/arch/arm/plat-ti/platform_config.h
+++ b/core/arch/arm/plat-ti/platform_config.h
@@ -58,8 +58,6 @@
/* Make stacks aligned to data cache line length */
#define STACK_ALIGNMENT 64
-#define HEAP_SIZE (24 * 1024)
-
/* Full GlobalPlatform test suite requires CFG_SHMEM_SIZE to be at least 2MB */
#define CFG_SHMEM_START (DRAM0_BASE)
#define CFG_SHMEM_SIZE 0x100000
diff --git a/core/arch/arm/plat-vexpress/platform_config.h b/core/arch/arm/plat-vexpress/platform_config.h
index c146c0b2..fd61cd15 100644
--- a/core/arch/arm/plat-vexpress/platform_config.h
+++ b/core/arch/arm/plat-vexpress/platform_config.h
@@ -101,8 +101,6 @@
#error "Unknown platform flavor"
#endif
-#define HEAP_SIZE (24 * 1024)
-
#if defined(PLATFORM_FLAVOR_fvp)
/*
* FVP specifics.
diff --git a/core/arch/arm/plat-zynqmp/platform_config.h b/core/arch/arm/plat-zynqmp/platform_config.h
index 288ab799..91c0f82f 100644
--- a/core/arch/arm/plat-zynqmp/platform_config.h
+++ b/core/arch/arm/plat-zynqmp/platform_config.h
@@ -30,7 +30,6 @@
/* Make stacks aligned to data cache line length */
#define STACK_ALIGNMENT 64
-#define HEAP_SIZE (24 * 1024)
#ifdef CFG_WITH_PAGER
#error "Pager not supported for zynqmp"
diff --git a/mk/config.mk b/mk/config.mk
index 424c901e..1c42f89c 100644
--- a/mk/config.mk
+++ b/mk/config.mk
@@ -204,3 +204,6 @@ CFG_BUILT_IN_ARGS ?= n
CFG_PAGEABLE_ADDR ?= 0x0
CFG_NS_ENTRY_ADDR ?=0x0
CFG_DT_ADDR ?= 0x0
+
+# Default heap size for Core, 64 kB
+CFG_CORE_HEAP_SIZE ?= 65536