1 /* 2 * Copyright (c) 2023, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #ifndef __PLATFORM_DCU_H__ 9 #define __PLATFORM_DCU_H__ 10 11 #include <stdint.h> 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 #define NUM_OF_DCU_REG 4 18 #define DCU_LOCK_REG0_VALUE 0xFFFFFFFF 19 #define DCU_LOCK_REG1_VALUE 0xFFFFFFFF 20 #define DCU_LOCK_REG2_VALUE 0xFFFFFFFF 21 #define DCU_LOCK_REG3_VALUE 0xFFFFFFFF 22 23 #define DCU_DEBUG_ENABLED_REG0_VALUE 0xFFFFE7FC 24 #define DCU_DEBUG_ENABLED_REG1_VALUE 0x800703FF 25 #define DCU_DEBUG_ENABLED_REG2_VALUE 0xFFFFFFFF 26 #define DCU_DEBUG_ENABLED_REG3_VALUE 0xFFFFFFFF 27 28 /** 29 * \brief Applies corresponding zone related debug permissions by 30 * setting appropriate dcu registers 31 * 32 * \param[in] zone Platform specific selected zone 33 * 34 * \return 0 on success, non-zero on error. 35 */ 36 int32_t tfm_plat_apply_debug_permissions(uint16_t zone); 37 38 /** 39 * \brief Locks the Debug Control Unit so that debug permissions cannot 40 * be altered anymore. 41 * 42 * \return 0 on success, non-zero on error. 43 */ 44 int32_t tfm_plat_lock_dcu(void); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif /* __PLATFORM_DCU_H__ */ 51