blob: 4cd2b4e0bb382c90f8aeffbdb809b004614c4837 [file] [log] [blame]
Etienne Carrieree5bed892019-12-08 08:15:15 +01001/*
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
Yann Gautier4b94d912020-09-07 13:46:04 +020010#include <stdbool.h>
11#include <stdint.h>
12
Etienne Carrieree5bed892019-12-08 08:15:15 +010013/* Define security level for each peripheral (DECPROT) */
14enum 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
22void etzpc_configure_decprot(uint32_t decprot_id,
23 enum etzpc_decprot_attributes decprot_attr);
24enum etzpc_decprot_attributes etzpc_get_decprot(uint32_t decprot_id);
25void etzpc_lock_decprot(uint32_t decprot_id);
26
27void etzpc_configure_tzma(uint32_t tzma_id, uint16_t tzma_value);
28uint16_t etzpc_get_tzma(uint32_t tzma_id);
29void etzpc_lock_tzma(uint32_t tzma_id);
30bool etzpc_get_lock_tzma(uint32_t tzma_id);
31
32uint8_t etzpc_get_num_per_sec(void);
33uint8_t etzpc_get_revision(void);
34uintptr_t etzpc_get_base_address(void);
35
36int etzpc_init(void);
37
38#endif /* DRIVERS_ST_ETZPC_H */