diff options
author | Jarried Lin <jarried.lin@mediatek.corp-partner.google.com> | 2024-06-03 10:13:46 +0800 |
---|---|---|
committer | Yidi Lin <yidilin@google.com> | 2024-11-29 07:08:50 +0000 |
commit | 758174c61bf2ecabaa4817b804f3bdb7e9c8d358 (patch) | |
tree | 5803c25814a554b0b177d4278b9b249b224d3871 /src/soc/mediatek | |
parent | 605c76bd9c44c111c1dea1da5dfa2072af74cda6 (diff) |
soc/mediatek/mt8196: Reserve 70 MB memory for OP-TEE
Reserve 70MB memory space for running the OP-TEE image.
BUG=b:317009620
TEST=build pass
Change-Id: I6f75870bdd76e89866508d351b04a0921f30fe4d
Signed-off-by: Jarried Lin <jarried.lin@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85249
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek')
-rw-r--r-- | src/soc/mediatek/common/include/soc/symbols.h | 1 | ||||
-rw-r--r-- | src/soc/mediatek/mt8196/include/soc/memlayout.ld | 4 | ||||
-rw-r--r-- | src/soc/mediatek/mt8196/soc.c | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/include/soc/symbols.h b/src/soc/mediatek/common/include/soc/symbols.h index 5e1c7058c3..065c300ed2 100644 --- a/src/soc/mediatek/common/include/soc/symbols.h +++ b/src/soc/mediatek/common/include/soc/symbols.h @@ -6,5 +6,6 @@ #include <symbols.h> DECLARE_REGION(dram_dma) +DECLARE_REGION(resv_mem_optee) #endif /* _SOC_MEDIATEK_COMMON_SYMBOLS_H_ */ diff --git a/src/soc/mediatek/mt8196/include/soc/memlayout.ld b/src/soc/mediatek/mt8196/include/soc/memlayout.ld index f5710f45c2..f038e23907 100644 --- a/src/soc/mediatek/mt8196/include/soc/memlayout.ld +++ b/src/soc/mediatek/mt8196/include/soc/memlayout.ld @@ -2,6 +2,9 @@ #include <soc/memlayout.h> +#define OPTEE_BUF(addr, size) \ + REGION(resv_mem_optee, addr, size, 4K) + SECTIONS { /* MT8196 has 256KB SRAM. */ @@ -54,6 +57,7 @@ SECTIONS DRAM_DMA(0x80000000, 1M) POSTRAM_CBFS_CACHE(0x80100000, 2M) RAMSTAGE(0x80300000, 2M) + OPTEE_BUF(0x80500000, 70M) BL31(0x94600000, 0x200000) } diff --git a/src/soc/mediatek/mt8196/soc.c b/src/soc/mediatek/mt8196/soc.c index eb72fca365..d3aeb5a72c 100644 --- a/src/soc/mediatek/mt8196/soc.c +++ b/src/soc/mediatek/mt8196/soc.c @@ -5,8 +5,16 @@ #include <soc/emi.h> #include <soc/mmu_operations.h> #include <soc/pcie.h> +#include <soc/symbols.h> #include <symbols.h> +void bootmem_platform_add_ranges(void) +{ + if (CONFIG(ARM64_BL31_OPTEE_WITH_SMC)) + bootmem_add_range((uint64_t)_resv_mem_optee, + REGION_SIZE(resv_mem_optee), BM_MEM_RESERVED); +} + static void soc_read_resources(struct device *dev) { ram_range(dev, 0, (uintptr_t)_dram, sdram_size()); |