1 /* 2 * Copyright (c) 2017-2020, STMicroelectronics - All Rights Reserved 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef DRIVERS_ST_ETZPC_H 8 #define DRIVERS_ST_ETZPC_H 9 10 #include <stdbool.h> 11 #include <stdint.h> 12 13 /* Define security level for each peripheral (DECPROT) */ 14 enum etzpc_decprot_attributes { 15 ETZPC_DECPROT_S_RW = 0, 16 ETZPC_DECPROT_NS_R_S_W = 1, 17 ETZPC_DECPROT_MCU_ISOLATION = 2, 18 ETZPC_DECPROT_NS_RW = 3, 19 ETZPC_DECPROT_MAX = 4, 20 }; 21 22 void etzpc_configure_decprot(uint32_t decprot_id, 23 enum etzpc_decprot_attributes decprot_attr); 24 enum etzpc_decprot_attributes etzpc_get_decprot(uint32_t decprot_id); 25 void etzpc_lock_decprot(uint32_t decprot_id); 26 27 void etzpc_configure_tzma(uint32_t tzma_id, uint16_t tzma_value); 28 uint16_t etzpc_get_tzma(uint32_t tzma_id); 29 void etzpc_lock_tzma(uint32_t tzma_id); 30 bool etzpc_get_lock_tzma(uint32_t tzma_id); 31 32 uint8_t etzpc_get_num_per_sec(void); 33 uint8_t etzpc_get_revision(void); 34 uintptr_t etzpc_get_base_address(void); 35 36 int etzpc_init(void); 37 38 #endif /* DRIVERS_ST_ETZPC_H */ 39