1d9e0586bSYann Gautier// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2d9e0586bSYann Gautier/* 3d9e0586bSYann Gautier * Copyright (c) 2021, STMicroelectronics - All Rights Reserved 4d9e0586bSYann Gautier */ 5d9e0586bSYann Gautier 6d9e0586bSYann Gautier#include <common/tbbr/tbbr_img_def.h> 7*86b43c58SYann Gautier#include <dt-bindings/soc/stm32mp15-tzc400.h> 8d9e0586bSYann Gautier 9d9e0586bSYann Gautier#include <platform_def.h> 10d9e0586bSYann Gautier 11*86b43c58SYann Gautier#ifndef DDR_SIZE 12*86b43c58SYann Gautier#error "DDR_SIZE is not defined" 13*86b43c58SYann Gautier#endif 14*86b43c58SYann Gautier 15*86b43c58SYann Gautier#define DDR_NS_BASE STM32MP_DDR_BASE 16*86b43c58SYann Gautier#ifdef AARCH32_SP_OPTEE 17*86b43c58SYann Gautier/* OP-TEE reserved shared memory: located at DDR top */ 18*86b43c58SYann Gautier#define DDR_SHARE_SIZE STM32MP_DDR_SHMEM_SIZE 19*86b43c58SYann Gautier#define DDR_SHARE_BASE (STM32MP_DDR_BASE + (DDR_SIZE - DDR_SHARE_SIZE)) 20*86b43c58SYann Gautier/* OP-TEE secure memory: located right below OP-TEE reserved shared memory */ 21*86b43c58SYann Gautier#define DDR_SEC_SIZE STM32MP_DDR_S_SIZE 22*86b43c58SYann Gautier#define DDR_SEC_BASE (DDR_SHARE_BASE - DDR_SEC_SIZE) 23*86b43c58SYann Gautier#define DDR_NS_SIZE (DDR_SEC_BASE - DDR_NS_BASE) 24*86b43c58SYann Gautier#else /* !AARCH32_SP_OPTEE */ 25*86b43c58SYann Gautier#define DDR_NS_SIZE DDR_SIZE 26*86b43c58SYann Gautier#endif /* AARCH32_SP_OPTEE */ 27*86b43c58SYann Gautier 28d9e0586bSYann Gautier/dts-v1/; 29d9e0586bSYann Gautier 30d9e0586bSYann Gautier/ { 31d9e0586bSYann Gautier dtb-registry { 32d9e0586bSYann Gautier compatible = "fconf,dyn_cfg-dtb_registry"; 33d9e0586bSYann Gautier 34d9e0586bSYann Gautier hw-config { 35d9e0586bSYann Gautier load-address = <0x0 STM32MP_HW_CONFIG_BASE>; 36d9e0586bSYann Gautier max-size = <STM32MP_HW_CONFIG_MAX_SIZE>; 37d9e0586bSYann Gautier id = <HW_CONFIG_ID>; 38d9e0586bSYann Gautier }; 39d9e0586bSYann Gautier 40d9e0586bSYann Gautier nt_fw { 41d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL33_BASE>; 42d9e0586bSYann Gautier max-size = <STM32MP_BL33_MAX_SIZE>; 43d9e0586bSYann Gautier id = <BL33_IMAGE_ID>; 44d9e0586bSYann Gautier }; 45d9e0586bSYann Gautier 46d9e0586bSYann Gautier#ifdef AARCH32_SP_OPTEE 47d9e0586bSYann Gautier tos_fw { 48d9e0586bSYann Gautier load-address = <0x0 STM32MP_OPTEE_BASE>; 49d9e0586bSYann Gautier max-size = <STM32MP_OPTEE_SIZE>; 50d9e0586bSYann Gautier id = <BL32_IMAGE_ID>; 51d9e0586bSYann Gautier }; 52d9e0586bSYann Gautier#else 53d9e0586bSYann Gautier tos_fw { 54d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL32_BASE>; 55d9e0586bSYann Gautier max-size = <STM32MP_BL32_SIZE>; 56d9e0586bSYann Gautier id = <BL32_IMAGE_ID>; 57d9e0586bSYann Gautier }; 58d9e0586bSYann Gautier 59d9e0586bSYann Gautier tos_fw-config { 60d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL32_DTB_BASE>; 61d9e0586bSYann Gautier max-size = <STM32MP_BL32_DTB_SIZE>; 62d9e0586bSYann Gautier id = <TOS_FW_CONFIG_ID>; 63d9e0586bSYann Gautier }; 64d9e0586bSYann Gautier#endif 65d9e0586bSYann Gautier }; 66*86b43c58SYann Gautier 67*86b43c58SYann Gautier st-mem-firewall { 68*86b43c58SYann Gautier compatible = "st,mem-firewall"; 69*86b43c58SYann Gautier#ifdef AARCH32_SP_OPTEE 70*86b43c58SYann Gautier memory-ranges = < 71*86b43c58SYann Gautier DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR 72*86b43c58SYann Gautier DDR_SEC_BASE DDR_SEC_SIZE TZC_REGION_S_RDWR 0 73*86b43c58SYann Gautier DDR_SHARE_BASE DDR_SHARE_SIZE TZC_REGION_S_NONE 74*86b43c58SYann Gautier TZC_REGION_ACCESS_RDWR(STM32MP1_TZC_A7_ID)>; 75*86b43c58SYann Gautier#else 76*86b43c58SYann Gautier memory-ranges = < 77*86b43c58SYann Gautier DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR>; 78*86b43c58SYann Gautier#endif 79*86b43c58SYann Gautier }; 80d9e0586bSYann Gautier}; 81