xref: /freebsd/sys/arm/freescale/imx/imx6_anatopreg.h (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2013 Ian Lepore <ian@freebsd.org>
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 AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef	IMX6_ANATOPREG_H
32 #define	IMX6_ANATOPREG_H
33 
34 #define	IMX6_ANALOG_CCM_PLL_ARM				0x000
35 #define	IMX6_ANALOG_CCM_PLL_ARM_SET			0x004
36 #define	IMX6_ANALOG_CCM_PLL_ARM_CLR			0x008
37 #define	IMX6_ANALOG_CCM_PLL_ARM_TOG			0x00C
38 #define	  IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK		  0x7F
39 #define	  IMX6_ANALOG_CCM_PLL_ARM_LOCK			  (1U << 31)
40 #define	  IMX6_ANALOG_CCM_PLL_ARM_BYPASS		  (1 << 16)
41 #define	  IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK		  (0x03 << 16)
42 #define	IMX6_ANALOG_CCM_PLL_USB1			0x010
43 #define	IMX6_ANALOG_CCM_PLL_USB1_SET			0x014
44 #define	IMX6_ANALOG_CCM_PLL_USB1_CLR			0x018
45 #define	IMX6_ANALOG_CCM_PLL_USB1_TOG			0x01C
46 #define	   IMX6_ANALOG_CCM_PLL_USB_LOCK			  (1U << 31)
47 #define	   IMX6_ANALOG_CCM_PLL_USB_BYPASS		  (1 << 16)
48 #define	   IMX6_ANALOG_CCM_PLL_USB_ENABLE		  (1 << 13)
49 #define	   IMX6_ANALOG_CCM_PLL_USB_POWER		  (1 << 12)
50 #define	   IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS		  (1 <<  6)
51 #define	IMX6_ANALOG_CCM_PLL_USB2			0x020
52 #define	IMX6_ANALOG_CCM_PLL_USB2_SET			0x024
53 #define	IMX6_ANALOG_CCM_PLL_USB2_CLR			0x028
54 #define	IMX6_ANALOG_CCM_PLL_USB2_TOG			0x02C
55 #define	IMX6_ANALOG_CCM_PLL_SYS				0x030
56 #define	IMX6_ANALOG_CCM_PLL_SYS_SET			0x034
57 #define	IMX6_ANALOG_CCM_PLL_SYS_CLR			0x038
58 #define	IMX6_ANALOG_CCM_PLL_SYS_TOG			0x03C
59 #define	IMX6_ANALOG_CCM_PLL_SYS_SS			0x040
60 #define	IMX6_ANALOG_CCM_PLL_SYS_NUM			0x050
61 #define	IMX6_ANALOG_CCM_PLL_SYS_DENOM			0x060
62 #define	IMX6_ANALOG_CCM_PLL_AUDIO			0x070
63 #define	   IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE		  (1 << 13)
64 #define	   IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT	  0
65 #define	   IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK	  0x7f
66 #define	IMX6_ANALOG_CCM_PLL_AUDIO_SET			0x074
67 #define	IMX6_ANALOG_CCM_PLL_AUDIO_CLR			0x078
68 #define	IMX6_ANALOG_CCM_PLL_AUDIO_TOG			0x07C
69 #define	IMX6_ANALOG_CCM_PLL_AUDIO_NUM			0x080
70 #define	IMX6_ANALOG_CCM_PLL_AUDIO_DENOM			0x090
71 #define	IMX6_ANALOG_CCM_PLL_VIDEO			0x0A0
72 #define	IMX6_ANALOG_CCM_PLL_VIDEO_SET			0x0A4
73 #define	IMX6_ANALOG_CCM_PLL_VIDEO_CLR			0x0A8
74 #define	IMX6_ANALOG_CCM_PLL_VIDEO_TOG			0x0AC
75 #define	IMX6_ANALOG_CCM_PLL_VIDEO_NUM			0x0B0
76 #define	IMX6_ANALOG_CCM_PLL_VIDEO_DENOM			0x0C0
77 #define	IMX6_ANALOG_CCM_PLL_MLB				0x0D0
78 #define	IMX6_ANALOG_CCM_PLL_MLB_SET			0x0D4
79 #define	IMX6_ANALOG_CCM_PLL_MLB_CLR			0x0D8
80 #define	IMX6_ANALOG_CCM_PLL_MLB_TOG			0x0DC
81 #define	IMX6_ANALOG_CCM_PLL_ENET			0x0E0
82 #define	IMX6_ANALOG_CCM_PLL_ENET_SET			0x0E4
83 #define	IMX6_ANALOG_CCM_PLL_ENET_CLR			0x0E8
84 #define	IMX6_ANALOG_CCM_PLL_ENET_TOG			0x0EC
85 #define	IMX6_ANALOG_CCM_PFD_480				0x0F0
86 #define	IMX6_ANALOG_CCM_PFD_480_SET			0x0F4
87 #define	IMX6_ANALOG_CCM_PFD_480_CLR			0x0F8
88 #define	IMX6_ANALOG_CCM_PFD_480_TOG			0x0FC
89 #define	IMX6_ANALOG_CCM_PFD_528				0x100
90 #define	IMX6_ANALOG_CCM_PFD_528_SET			0x104
91 #define	IMX6_ANALOG_CCM_PFD_528_CLR			0x108
92 #define	IMX6_ANALOG_CCM_PFD_528_TOG			0x10C
93 
94 #define	IMX6_ANALOG_PMU_REG_CORE			0x140
95 #define	  IMX6_ANALOG_PMU_REG2_TARG_SHIFT		  18
96 #define	  IMX6_ANALOG_PMU_REG2_TARG_MASK		   \
97     (0x1f << IMX6_ANALOG_PMU_REG2_TARG_SHIFT)
98 #define	  IMX6_ANALOG_PMU_REG1_TARG_SHIFT		   9
99 #define	  IMX6_ANALOG_PMU_REG1_TARG_MASK		   \
100     (0x1f << IMX6_ANALOG_PMU_REG1_TARG_SHIFT)
101 #define	  IMX6_ANALOG_PMU_REG0_TARG_SHIFT		   0
102 #define	  IMX6_ANALOG_PMU_REG0_TARG_MASK		   \
103     (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT)
104 
105 #define	IMX6_ANALOG_PMU_MISC0				0x150
106 #define	IMX6_ANALOG_PMU_MISC0_SET			0x154
107 #define	IMX6_ANALOG_PMU_MISC0_CLR			0x158
108 #define	IMX6_ANALOG_PMU_MISC0_TOG			0x15C
109 #define	  IMX6_ANALOG_PMU_MISC0_SELFBIASOFF		  (1 << 3)
110 
111 #define	IMX6_ANALOG_PMU_MISC1				0x160
112 #define	IMX6_ANALOG_PMU_MISC1_SET			0x164
113 #define	IMX6_ANALOG_PMU_MISC1_CLR			0x168
114 #define	IMX6_ANALOG_PMU_MISC1_TOG			0x16C
115 #define	  IMX6_ANALOG_PMU_MISC1_IRQ_TEMPSENSE		  (1 << 29)
116 
117 #define	IMX6_ANALOG_PMU_MISC2				0x170
118 #define	IMX6_ANALOG_PMU_MISC2_SET			0x174
119 #define	IMX6_ANALOG_PMU_MISC2_CLR			0x178
120 #define	IMX6_ANALOG_PMU_MISC2_TOG			0x17C
121 
122 /*
123  * Note that the ANALOG_CCM_MISCn registers are the same as the PMU_MISCn
124  * registers; some bits conceptually belong to the PMU and some to the CCM.
125  */
126 #define	IMX6_ANALOG_CCM_MISC0				IMX6_ANALOG_PMU_MISC0
127 #define	IMX6_ANALOG_CCM_MISC0_SET			IMX6_ANALOG_PMU_MISC0_SET
128 #define	IMX6_ANALOG_CCM_MISC0_CLR			IMX6_ANALOG_PMU_MISC0_CLR
129 #define	IMX6_ANALOG_CCM_MISC0_TOG			IMX6_ANALOG_PMU_MISC0_TOG
130 
131 #define	IMX6_ANALOG_CCM_MISC2				IMX6_ANALOG_PMU_MISC2
132 #define	IMX6_ANALOG_CCM_MISC2_SET			IMX6_ANALOG_PMU_MISC2_SET
133 #define	IMX6_ANALOG_CCM_MISC2_CLR			IMX6_ANALOG_PMU_MISC2_CLR
134 #define	IMX6_ANALOG_CCM_MISC2_TOG			IMX6_ANALOG_PMU_MISC2_TOG
135 
136 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE0			0x180
137 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET		0x184
138 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR		0x188
139 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG		0x18C
140 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG		0x18C
141 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT	 20
142 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK	  \
143     (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT)
144 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT	  8
145 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK	  \
146     (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT)
147 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID		0x4
148 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE	0x2
149 #define	  IMX6_ANALOG_TEMPMON_TEMPSENSE0_POWER_DOWN	0x1
150 
151 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE1			0x190
152 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE1_SET		0x194
153 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE1_CLR		0x198
154 #define	IMX6_ANALOG_TEMPMON_TEMPSENSE1_TOG		0x19C
155 
156 #define	IMX6_ANALOG_USB1_VBUS_DETECT			0x1A0
157 #define	IMX6_ANALOG_USB1_VBUS_DETECT_SET		0x1A4
158 #define	IMX6_ANALOG_USB1_VBUS_DETECT_CLR		0x1A8
159 #define	IMX6_ANALOG_USB1_VBUS_DETECT_TOG		0x1AC
160 #define	IMX6_ANALOG_USB1_CHRG_DETECT			0x1B0
161 #define	IMX6_ANALOG_USB1_CHRG_DETECT_SET		0x1B4
162 #define	IMX6_ANALOG_USB1_CHRG_DETECT_CLR		0x1B8
163 #define	IMX6_ANALOG_USB1_CHRG_DETECT_TOG		0x1BC
164 #define	  IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE		  (1 << 20) /* EN_B */
165 #define	  IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG	  (1 << 19) /* CHK_CHRG_B */
166 #define	  IMX6_ANALOG_USB_CHRG_DETECT_CHK_CONTACT	  (1 << 18)
167 #define	IMX6_ANALOG_USB1_VBUS_DETECT_STAT		0x1C0
168 #define	IMX6_ANALOG_USB1_CHRG_DETECT_STAT		0x1D0
169 #define	IMX6_ANALOG_USB1_MISC				0x1F0
170 #define	IMX6_ANALOG_USB1_MISC_SET			0x1F4
171 #define	IMX6_ANALOG_USB1_MISC_CLR			0x1F8
172 #define	IMX6_ANALOG_USB1_MISC_TOG			0x1FC
173 #define	IMX6_ANALOG_USB2_VBUS_DETECT			0x200
174 #define	IMX6_ANALOG_USB2_VBUS_DETECT_SET		0x204
175 #define	IMX6_ANALOG_USB2_VBUS_DETECT_CLR		0x208
176 #define	IMX6_ANALOG_USB2_VBUS_DETECT_TOG		0x20C
177 #define	IMX6_ANALOG_USB2_CHRG_DETECT			0x210
178 #define	IMX6_ANALOG_USB2_CHRG_DETECT_SET		0x214
179 #define	IMX6_ANALOG_USB2_CHRG_DETECT_CLR		0x218
180 #define	IMX6_ANALOG_USB2_CHRG_DETECT_TOG		0x21C
181 #define	IMX6_ANALOG_USB2_VBUS_DETECT_STAT		0x220
182 #define	IMX6_ANALOG_USB2_CHRG_DETECT_STAT		0x230
183 #define	IMX6_ANALOG_USB2_MISC				0x250
184 #define	IMX6_ANALOG_USB2_MISC_SET			0x254
185 #define	IMX6_ANALOG_USB2_MISC_CLR			0x258
186 #define	IMX6_ANALOG_USB2_MISC_TOG			0x25C
187 #define	IMX6_ANALOG_DIGPROG				0x260
188 #define	IMX6_ANALOG_DIGPROG_SL				0x280
189 #define	  IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT		  16
190 #define	  IMX6_ANALOG_DIGPROG_SOCTYPE_MASK		  \
191     (0xff << IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT)
192 
193 #endif
194