diff options
Diffstat (limited to 'src/soc')
-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()); |