1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (C) 2020 Pengutronix
4  * Rouven Czerwinski <entwicklung@pengutronix.de>
5  */
6 #ifndef __DRIVERS_IMX_SNVS_H
7 #define __DRIVERS_IMX_SNVS_H
8 
9 #include <tee_api_types.h>
10 
11 #define SNVS_HPSR	0x14
12 
13 #define HPSR_SSM_ST_MASK			GENMASK_32(11, 8)
14 #define HPSR_SSM_ST_SHIFT			8
15 
16 #define SNVS_HPSR_SYS_SECURITY_BAD BIT(14)
17 #define SNVS_HPSR_SYS_SECURITY_CLOSED BIT(13)
18 #define SNVS_HPSR_SYS_SECURITY_OPEN BIT(12)
19 
20 enum snvs_ssm_mode {
21 	SNVS_SSM_MODE_INIT,
22 	SNVS_SSM_MODE_HARD_FAIL,
23 	SNVS_SSM_MODE_SOFT_FAIL = 3,
24 	SNVS_SSM_MODE_INIT_INTERMEDIATE = 8,
25 	SNVS_SSM_MODE_CHECK,
26 	SNVS_SSM_MODE_NON_SECURE = 11,
27 	SNVS_SSM_MODE_TRUSTED = 13,
28 	SNVS_SSM_MODE_SECURE,
29 };
30 
31 enum snvs_security_cfg {
32 	SNVS_SECURITY_CFG_FAB,
33 	SNVS_SECURITY_CFG_OPEN,
34 	SNVS_SECURITY_CFG_CLOSED,
35 	SNVS_SECURITY_CFG_FIELD_RETURN,
36 };
37 
38 enum snvs_ssm_mode snvs_get_ssm_mode(void);
39 
40 enum snvs_security_cfg snvs_get_security_cfg(void);
41 
42 #endif /* __DRIVERS_IMX_SNVS_H */
43