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