1 /*
2  * Copyright (C) 2018-2019, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 #ifndef IMX_SNVS_H
7 #define IMX_SNVS_H
8 
9 #include <cdefs.h>
10 #include <stdint.h>
11 
12 #include <arch.h>
13 
14 struct snvs {
15 	uint32_t hplr;
16 	uint32_t hpcomr;
17 	uint32_t hpcr;
18 	uint32_t hpsicr;
19 	uint32_t hpsvcr;
20 	uint32_t hpsr;
21 	uint32_t hpsvsr;
22 	uint32_t hphacivr;
23 	uint32_t hphacr;
24 	uint32_t hprtcmr;
25 	uint32_t hprtclr;
26 	uint32_t hptamr;
27 	uint32_t hptalr;
28 	uint32_t lplr;
29 	uint32_t lpcr;
30 	uint32_t lpmkcr;
31 	uint32_t lpsvcr;
32 	uint32_t lptgfcr;
33 	uint32_t lptdcr;
34 	uint32_t lpsr;
35 	uint32_t lpsrtcmr;
36 	uint32_t lpsrtclr;
37 	uint32_t lptar;
38 	uint32_t lpsmcmr;
39 	uint32_t lpsmclr;
40 	uint32_t lppgdr;
41 	uint32_t lpgpr0_alias;
42 	uint8_t  lpzmkr[32];
43 	uint16_t res0;
44 	uint32_t lpgpr0[4];
45 	uint32_t lptdc2r;
46 	uint32_t lptdsr;
47 	uint32_t lptgf1cr;
48 	uint32_t lptgf2cr;
49 	uint32_t res1[4];
50 	uint32_t lpat1cr;
51 	uint32_t lpat2cr;
52 	uint32_t lpat3cr;
53 	uint32_t lpat4cr;
54 	uint32_t lpat5cr;
55 	uint32_t res2[3];
56 	uint32_t lpatctlr;
57 	uint32_t lpatclkr;
58 	uint32_t lpatrc1r;
59 	uint32_t lpatrc2r;
60 	uint32_t res3[706];
61 	uint32_t hpvidr1;
62 	uint32_t hpvidr2;
63 } __packed;
64 
65 /* Define the HPCOMR bits */
66 #define HPCOMR_NPSWA_EN		BIT(31)
67 #define HPCOMR_HAC_STOP		BIT(19)
68 #define HPCOMR_HAC_CLEAR	BIT(18)
69 #define HPCOMR_HAC_LOAD		BIT(17)
70 #define HPCOMR_HAC_EN		BIT(16)
71 #define HPCOMR_MKS_EN		BIT(13)
72 #define HPCOMR_PROG_ZMK		BIT(12)
73 #define HPCOMR_SW_LPSV		BIT(10)
74 #define HPCOMR_SW_FSV		BIT(9)
75 #define HPCOMR_SW_SV		BIT(8)
76 #define HPCOMR_LP_SWR_DIS	BIT(5)
77 #define HPCOMR_LP_SWR		BIT(4)
78 #define HPCOMR_SSM_SFNS_DIS	BIT(2)
79 #define HPCOMR_SSM_ST_DIS	BIT(1)
80 #define HPCOMR_SSM_ST		BIT(0)
81 
82 void imx_snvs_init(void);
83 
84 #endif /* IMX_SNVS_H */
85