xref: /netbsd-src/sys/arch/arm/imx/imxsnvsreg.h (revision 90313c06e62e910bf0d1bb24faa9d17dcefd0ab6)
1 /*	$NetBSD: imxsnvsreg.h,v 1.2 2024/02/07 04:20:26 msaitoh Exp $	*/
2 
3 /*
4  * Copyright (c) 2014 Ryo Shimizu
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 #ifndef _IMXSNVSREG_H_
29 #define _IMXSNVSREG_H_
30 
31 #define SVNS_COUNTER_HZ			(32 * 1024)	/* 32kHz */
32 #define SVNS_COUNTER_SHIFT		15
33 
34 #define SNVS_HPLR			0x00000000
35 #define SNVS_HPCOMR			0x00000004
36 #define SNVS_HPCR			0x00000008
37 #define SNVS_HPSR			0x00000014
38 #define SNVS_HPRTCMR			0x00000024
39 #define SNVS_HPRTCLR			0x00000028
40 #define SNVS_HPTAMR			0x0000002c
41 #define SNVS_HPTALR			0x00000030
42 #define SNVS_LPLR			0x00000034
43 #define  SNVS_LPLR_GPR_HL		__BIT(5)
44 #define  SNVS_LPLR_MC_HL		__BIT(4)
45 #define  SNVS_LPLR_LPCALB_HL		__BIT(3)
46 #define  SNVS_LPLR_SRTC_HL		__BIT(2)
47 #define SNVS_LPCR			0x00000038
48 #define  SNVS_LPCR_PK_OVERRIDE		__BIT(23)
49 #define  SNVS_LPCR_PK_EN		__BIT(22)
50 #define  SNVS_LPCR_ON_TIME		__BITS(21, 20)
51 #define  SNVS_LPCR_DEBOUNCE		__BITS(19, 18)
52 #define  SNVS_LPCR_BTN_PRESS_TIME	__BITS(17, 16)
53 #define  SNVS_LPCR_LPCALB_VAL		__BITS(14, 10)
54 #define  SNVS_LPCR_LPCALB_EN		__BIT(8)
55 #define  SNVS_LPCR_PWR_GLITCH_EN	__BIT(7)
56 #define  SNVS_LPCR_TOP			__BIT(6)
57 #define  SNVS_LPCR_DP_EN		__BIT(5)
58 #define  SNVS_LPCR_SRTC_INV_EN		__BIT(4)
59 #define  SNVS_LPCR_LPWUI_EN		__BIT(3)
60 #define  SNVS_LPCR_MC_ENV		__BIT(2)
61 #define  SNVS_LPCR_LPTA_EN		__BIT(1)
62 #define  SNVS_LPCR_SRTC_ENV		__BIT(0)
63 #define SNVS_LPSR			0x0000004c
64 #define  SNVS_LPSR_SPO			__BIT(18)
65 #define  SNVS_LPSR_EO			__BIT(17)
66 #define  SNVS_LPSR_MCR			__BIT(2)
67 #define  SNVS_LPSR_SRTCR		__BIT(1)
68 #define  SNVS_LPSR_LPTA			__BIT(0)
69 #define SNVS_LPSRTCMR			0x00000050
70 #define  SNVS_LPSRTCMR_SRTC		__BITS(14, 0)
71 #define SNVS_LPSRTCLR			0x00000054
72 #define SNVS_LPTAR			0x00000058
73 #define SNVS_LPSMCMR			0x0000005c
74 #define  SNVS_LPSMCMR_MC_ERA_BIT	__BITS(31, 16)
75 #define  SNVS_LPSMCMR_MON_COUNTER	__BITS(15, 0)
76 #define SNVS_LPSMCLR			0x00000060
77 #define SNVS_LPGPR			0x00000068
78 #define SNVS_HPVIDR1			0x00000bf8
79 #define  SNVS_HPVIDR1_IP_ID		__BITS(31, 16)
80 #define  SNVS_HPVIDR1_MAJOR_REV		__BITS(15, 8)
81 #define  SNVS_HPVIDR1_MINOR_REV		__BITS(7, 0)
82 #define SNVS_HPVIDR2			0x00000bfc
83 #define  SNVS_HPVIDR2_IP_ERA		__BITS(31, 24)
84 #define  SNVS_HPVIDR2_INTG_OPT		__BITS(23, 16)
85 #define  SNVS_HPVIDR2_ECO_REV		__BITS(15, 8)
86 #define  SNVS_HPVIDR2_CONFIG_OPT	__BITS(7, 0)
87 
88 #endif /* _IMXSNVSREG_H_ */
89