1d9e0586bSYann Gautier// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2d9e0586bSYann Gautier/* 3*8dd2a64aSYann Gautier * Copyright (c) 2021-2024, STMicroelectronics - All Rights Reserved 4d9e0586bSYann Gautier */ 5d9e0586bSYann Gautier 6d9e0586bSYann Gautier#include <common/tbbr/tbbr_img_def.h> 786b43c58SYann Gautier#include <dt-bindings/soc/stm32mp15-tzc400.h> 8d9e0586bSYann Gautier 9d9e0586bSYann Gautier#include <platform_def.h> 10d9e0586bSYann Gautier 1186b43c58SYann Gautier#ifndef DDR_SIZE 1286b43c58SYann Gautier#error "DDR_SIZE is not defined" 1386b43c58SYann Gautier#endif 1486b43c58SYann Gautier 1586b43c58SYann Gautier#define DDR_NS_BASE STM32MP_DDR_BASE 1686b43c58SYann Gautier#ifdef AARCH32_SP_OPTEE 17*8dd2a64aSYann Gautier/* OP-TEE secure memory: located at DDR top */ 1886b43c58SYann Gautier#define DDR_SEC_SIZE STM32MP_DDR_S_SIZE 19*8dd2a64aSYann Gautier#define DDR_SEC_BASE (STM32MP_DDR_BASE + (DDR_SIZE - DDR_SEC_SIZE)) 2086b43c58SYann Gautier#define DDR_NS_SIZE (DDR_SEC_BASE - DDR_NS_BASE) 2186b43c58SYann Gautier#else /* !AARCH32_SP_OPTEE */ 2286b43c58SYann Gautier#define DDR_NS_SIZE DDR_SIZE 2386b43c58SYann Gautier#endif /* AARCH32_SP_OPTEE */ 2486b43c58SYann Gautier 25d9e0586bSYann Gautier/dts-v1/; 26d9e0586bSYann Gautier 27d9e0586bSYann Gautier/ { 28d9e0586bSYann Gautier dtb-registry { 29d9e0586bSYann Gautier compatible = "fconf,dyn_cfg-dtb_registry"; 30d9e0586bSYann Gautier 31d9e0586bSYann Gautier hw-config { 32d9e0586bSYann Gautier load-address = <0x0 STM32MP_HW_CONFIG_BASE>; 33d9e0586bSYann Gautier max-size = <STM32MP_HW_CONFIG_MAX_SIZE>; 34d9e0586bSYann Gautier id = <HW_CONFIG_ID>; 35d9e0586bSYann Gautier }; 36d9e0586bSYann Gautier 37d9e0586bSYann Gautier nt_fw { 38d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL33_BASE>; 39d9e0586bSYann Gautier max-size = <STM32MP_BL33_MAX_SIZE>; 40d9e0586bSYann Gautier id = <BL33_IMAGE_ID>; 41d9e0586bSYann Gautier }; 42d9e0586bSYann Gautier 43d9e0586bSYann Gautier#ifdef AARCH32_SP_OPTEE 44d9e0586bSYann Gautier tos_fw { 45d9e0586bSYann Gautier load-address = <0x0 STM32MP_OPTEE_BASE>; 46d9e0586bSYann Gautier max-size = <STM32MP_OPTEE_SIZE>; 47d9e0586bSYann Gautier id = <BL32_IMAGE_ID>; 48d9e0586bSYann Gautier }; 49d9e0586bSYann Gautier#else 50d9e0586bSYann Gautier tos_fw { 51d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL32_BASE>; 52d9e0586bSYann Gautier max-size = <STM32MP_BL32_SIZE>; 53d9e0586bSYann Gautier id = <BL32_IMAGE_ID>; 54d9e0586bSYann Gautier }; 55d9e0586bSYann Gautier 56d9e0586bSYann Gautier tos_fw-config { 57d9e0586bSYann Gautier load-address = <0x0 STM32MP_BL32_DTB_BASE>; 58d9e0586bSYann Gautier max-size = <STM32MP_BL32_DTB_SIZE>; 59d9e0586bSYann Gautier id = <TOS_FW_CONFIG_ID>; 60d9e0586bSYann Gautier }; 61d9e0586bSYann Gautier#endif 62d9e0586bSYann Gautier }; 6386b43c58SYann Gautier 6486b43c58SYann Gautier st-mem-firewall { 6586b43c58SYann Gautier compatible = "st,mem-firewall"; 6686b43c58SYann Gautier#ifdef AARCH32_SP_OPTEE 6786b43c58SYann Gautier memory-ranges = < 6886b43c58SYann Gautier DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR 6986b43c58SYann Gautier DDR_SEC_BASE DDR_SEC_SIZE TZC_REGION_S_RDWR 0 70722ca35eSYann Gautier >; 7186b43c58SYann Gautier#else 7286b43c58SYann Gautier memory-ranges = < 7386b43c58SYann Gautier DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR>; 7486b43c58SYann Gautier#endif 7586b43c58SYann Gautier }; 76d9e0586bSYann Gautier}; 77