libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
anadig.h
Go to the documentation of this file.
1
/** @defgroup anadig_defines ANADIG Defines
2
*
3
* @brief <b>Defined Constants and Types for the VF6xx Analog components
4
* control digital interface</b>
5
*
6
* @ingroup VF6xx_defines
7
*
8
* @version 1.0.0
9
*
10
* @author @htmlonly © @endhtmlonly 2014
11
* Stefan Agner <stefan@agner.ch>
12
*
13
* @date 01 July 2014
14
*
15
* LGPL License Terms @ref lgpl_license
16
* */
17
/*
18
* This file is part of the libopencm3 project.
19
*
20
* Copyright (C) 2014 Stefan Agner <stefan@agner.ch>
21
*
22
* This library is free software: you can redistribute it and/or modify
23
* it under the terms of the GNU Lesser General Public License as published by
24
* the Free Software Foundation, either version 3 of the License, or
25
* (at your option) any later version.
26
*
27
* This library is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU Lesser General Public License for more details.
31
*
32
* You should have received a copy of the GNU Lesser General Public License
33
* along with this library. If not, see <http://www.gnu.org/licenses/>.
34
*/
35
36
#ifndef LIBOPENCM3_ANADIG_H
37
#define LIBOPENCM3_ANADIG_H
38
39
#include <
libopencm3/cm3/common.h
>
40
#include <
libopencm3/vf6xx/memorymap.h
>
41
42
/* --- ANADIG registers ---------------------------------------------------- */
43
44
#define ANADIG_PLL3_CTRL MMIO32(ANADIG_BASE + 0x010)
45
#define ANADIG_PLL7_CTRL MMIO32(ANADIG_BASE + 0x020)
46
#define ANADIG_PLL2_CTRL MMIO32(ANADIG_BASE + 0x030)
47
#define ANADIG_PLL2_SS MMIO32(ANADIG_BASE + 0x040)
48
#define ANADIG_PLL2_NUM MMIO32(ANADIG_BASE + 0x050)
49
#define ANADIG_PLL2_DENOM MMIO32(ANADIG_BASE + 0x060)
50
#define ANADIG_PLL4_CTRL MMIO32(ANADIG_BASE + 0x070)
51
#define ANADIG_PLL4_NUM MMIO32(ANADIG_BASE + 0x080)
52
#define ANADIG_PLL4_DENOM MMIO32(ANADIG_BASE + 0x090)
53
#define ANADIG_PLL6_CTRL MMIO32(ANADIG_BASE + 0x0A0)
54
#define ANADIG_PLL6_NUM MMIO32(ANADIG_BASE + 0x0B0)
55
#define ANADIG_PLL6_DENOM MMIO32(ANADIG_BASE + 0x0C0)
56
#define ANADIG_PLL5_CTRL MMIO32(ANADIG_BASE + 0x0E0)
57
#define ANADIG_PLL3_PFD MMIO32(ANADIG_BASE + 0x0F0)
58
#define ANADIG_PLL2_PFD MMIO32(ANADIG_BASE + 0x100)
59
#define ANADIG_REG_1P1 MMIO32(ANADIG_BASE + 0x110)
60
#define ANADIG_REG_3P0 MMIO32(ANADIG_BASE + 0x120)
61
#define ANADIG_REG_2P5 MMIO32(ANADIG_BASE + 0x130)
62
#define ANADIG_ANA_MISC0 MMIO32(ANADIG_BASE + 0x150)
63
#define ANADIG_ANA_MISC1 MMIO32(ANADIG_BASE + 0x160)
64
#define ANADIG_ANADIG_DIGPROG MMIO32(ANADIG_BASE + 0x260)
65
#define ANADIG_PLL1_CTRL MMIO32(ANADIG_BASE + 0x270)
66
#define ANADIG_PLL1_SS MMIO32(ANADIG_BASE + 0x280)
67
#define ANADIG_PLL1_NUM MMIO32(ANADIG_BASE + 0x290)
68
#define ANADIG_PLL1_DENOM MMIO32(ANADIG_BASE + 0x2A0)
69
#define ANADIG_PLL1_PFD MMIO32(ANADIG_BASE + 0x2B0)
70
#define ANADIG_PLL_LOCK MMIO32(ANADIG_BASE + 0x2C0)
71
72
/* --- ANADIG values -....-------------------------------------------------- */
73
74
/* ANADIG_PLL3_CTRL: PLL3 Control Register (480MHz PLL of USB0) */
75
#define ANADIG_PLL3_CTRL_LOCK (1 << 31)
76
#define ANADIG_PLL3_CTRL_BYPASS (1 << 16)
77
#define ANADIG_PLL3_CTRL_BYPASS_CLK_SRC (1 << 14)
78
#define ANADIG_PLL3_CTRL_ENABLE (1 << 13)
79
#define ANADIG_PLL3_CTRL_POWER (1 << 12)
80
#define ANADIG_PLL3_CTRL_EN_USB_CLKS (1 << 6)
81
#define ANADIG_PLL3_CTRL_DIV_SELECT (1 << 1)
82
83
/* ANADIG_PLL7_CTRL: PLL7 Control Register (480MHz PLL of USB1) */
84
#define ANADIG_PLL7_CTRL_LOCK (1 << 31)
85
#define ANADIG_PLL7_CTRL_BYPASS (1 << 16)
86
#define ANADIG_PLL7_CTRL_BYPASS_CLK_SRC (1 << 14)
87
#define ANADIG_PLL7_CTRL_ENABLE (1 << 13)
88
#define ANADIG_PLL7_CTRL_POWER (1 << 12)
89
#define ANADIG_PLL7_CTRL_EN_USB_CLKS (1 << 6)
90
#define ANADIG_PLL7_CTRL_DIV_SELECT (1 << 1)
91
92
/* ANADIG_PLL2_CTRL: PLL2 Control Register (528MHz PLL) */
93
#define ANADIG_PLL2_CTRL_LOCK (1 << 31)
94
#define ANADIG_PLL2_CTRL_PFD_OFFSET_EN (1 << 18)
95
#define ANADIG_PLL2_CTRL_DITHER_ENABLE (1 << 17)
96
#define ANADIG_PLL2_CTRL_BYPASS (1 << 16)
97
#define ANADIG_PLL2_CTRL_BYPASS_CLK_SRC (1 << 14)
98
#define ANADIG_PLL2_CTRL_ENABLE (1 << 13)
99
#define ANADIG_PLL2_CTRL_POWERDOWN (1 << 12)
100
#define ANADIG_PLL2_CTRL_DIV_SELECT (1 << 1)
101
102
/* ANADIG_PLL2_SS: PLL2 Spread Spectrum definition register */
103
#define ANADIG_PLL2_SS_STOP_MASK (0xffff << 16)
104
#define ANADIG_PLL2_SS_ENABLE (1 << 15)
105
#define ANADIG_PLL2_SS_STEP_MASK 0x8fff
106
107
/* ANADIG_PLL2_NUM: PLL2 Numerator definition register */
108
#define ANADIG_PLL2_NUM_MFN_MASK 0x3fffffff
109
110
/* ANADIG_PLL2_DENOM: PLL2 Denominator definition register */
111
#define ANADIG_PLL2_DENOM_MFN_MASK 0x3fffffff
112
113
/* ANADIG_PLL4_CTRL: PLL4 Control Register (audio PLL) */
114
#define ANADIG_PLL4_CTRL_LOCK (1 << 31)
115
#define ANADIG_PLL4_CTRL_PFD_OFFSET_EN (1 << 18)
116
#define ANADIG_PLL4_CTRL_DITHER_ENABLE (1 << 17)
117
#define ANADIG_PLL4_CTRL_BYPASS (1 << 16)
118
#define ANADIG_PLL4_CTRL_BYPASS_CLK_SRC (1 << 14)
119
#define ANADIG_PLL4_CTRL_ENABLE (1 << 13)
120
#define ANADIG_PLL4_CTRL_POWERDOWN (1 << 12)
121
#define ANADIG_PLL4_CTRL_DIV_SELECT_MASK (0x7f)
122
123
/* ANADIG_PLL4_NUM: PLL4 Numerator definition register */
124
#define ANADIG_PLL4_NUM_MFN_MASK 0x3fffffff
125
126
/* ANADIG_PLL4_DENOM: PLL4 Denominator definition register */
127
#define ANADIG_PLL4_DENOM_MFN_MASK 0x3fffffff
128
129
/* ANADIG_PLL6_CTRL: PLL6 Control Register (video PLL) */
130
#define ANADIG_PLL6_CTRL_LOCK (1 << 31)
131
#define ANADIG_PLL6_CTRL_PFD_OFFSET_EN (1 << 18)
132
#define ANADIG_PLL6_CTRL_DITHER_ENABLE (1 << 17)
133
#define ANADIG_PLL6_CTRL_BYPASS (1 << 16)
134
#define ANADIG_PLL6_CTRL_BYPASS_CLK_SRC (1 << 14)
135
#define ANADIG_PLL6_CTRL_ENABLE (1 << 13)
136
#define ANADIG_PLL6_CTRL_POWERDOWN (1 << 12)
137
#define ANADIG_PLL6_CTRL_DIV_SELECT_MASK (0x7f)
138
139
/* ANADIG_PLL6_NUM: PLL6 Numerator definition register */
140
#define ANADIG_PLL6_NUM_MFN_MASK 0x3fffffff
141
142
/* ANADIG_PLL6_DENOM: PLL6 Denominator definition register */
143
#define ANADIG_PLL6_DENOM_MFN_MASK 0x3fffffff
144
145
/* ANADIG_PLL5_CTRL: PLL5 Control Register (video PLL) */
146
#define ANADIG_PLL5_CTRL_LOCK (1 << 31)
147
#define ANADIG_PLL5_CTRL_PFD_OFFSET_EN (1 << 18)
148
#define ANADIG_PLL5_CTRL_DITHER_ENABLE (1 << 17)
149
#define ANADIG_PLL5_CTRL_BYPASS (1 << 16)
150
#define ANADIG_PLL5_CTRL_BYPASS_CLK_SRC (1 << 14)
151
#define ANADIG_PLL5_CTRL_ENABLE (1 << 13)
152
#define ANADIG_PLL5_CTRL_POWERDOWN (1 << 12)
153
#define ANADIG_PLL5_CTRL_DIV_SELECT_MASK (0x3)
154
155
/* ANADIG_PLL_PFD: PLL1/PLL2/PLL3 PFD Clocks */
156
#define ANADIG_PLL_PFD4_CLKGATE (1 << 31)
157
#define ANADIG_PLL_PFD4_STABLE (1 << 30)
158
#define ANADIG_PLL_PFD4_FRAC_SHIFT 24
159
#define ANADIG_PLL_PFD4_FRAC_MASK (0x3f << 24)
160
#define ANADIG_PLL_PFD3_CLKGATE (1 << 23)
161
#define ANADIG_PLL_PFD3_STABLE (1 << 22)
162
#define ANADIG_PLL_PFD3_FRAC_SHIFT 16
163
#define ANADIG_PLL_PFD3_FRAC_MASK (0x3f << 16)
164
#define ANADIG_PLL_PFD2_CLKGATE (1 << 15)
165
#define ANADIG_PLL_PFD2_STABLE (1 << 14)
166
#define ANADIG_PLL_PFD2_FRAC_SHIFT 8
167
#define ANADIG_PLL_PFD2_FRAC_MASK (0x3f << 8)
168
#define ANADIG_PLL_PFD1_CLKGATE (1 << 7)
169
#define ANADIG_PLL_PFD1_STABLE (1 << 6)
170
#define ANADIG_PLL_PFD1_FRAC_SHIFT 0
171
#define ANADIG_PLL_PFD1_FRAC_MASK (0x3f << 0)
172
173
/* AANADIG_ANA_MISC0: miscellaneous analog blocks */
174
#define ANADIG_ANA_MISC0_OSC_XTALOK_EN (1 << 17)
175
#define ANADIG_ANA_MISC0_OSC_XTALOK (1 << 16)
176
#define ANADIG_ANA_MISC0_CLK_24M_IRC_XTAL_SEL (1 << 13)
177
#define ANADIG_ANA_MISC0_STOP_MODE_CONFIG (1 << 12)
178
#define ANADIG_ANA_MISC0_REFTOP_VBGUP (1 << 7)
179
#define ANADIG_ANA_MISC0_REFTOP_SELBIASOFF (1 << 3)
180
#define ANADIG_ANA_MISC0_REFTOP_LOWPOWER (1 << 2)
181
#define ANADIG_ANA_MISC0_REFTOP_PWDVBGUP (1 << 1)
182
#define ANADIG_ANA_MISC0_REFTOP_PWD (1 << 0)
183
184
/* AANADIG_ANA_MISC0: miscellaneous analog blocks */
185
#define ANADIG_ANA_MISC1_IRQ_ANA_BO (1 << 30)
186
#define ANADIG_ANA_MISC1_IRQ_TEMPSENSE (1 << 29)
187
#define ANADIG_ANA_MISC1_LVDSCLK1_IBEN (1 << 12)
188
#define ANADIG_ANA_MISC1_LVDSCLK1_OBEN (1 << 10)
189
190
/* AANADIG_ANA_DIGPROG: Digital Program register */
191
#define ANADIG_ANADIG_DIGPROG_MAJOR_MASK (0xffff << 8)
192
#define ANADIG_ANADIG_DIGPROG_MINOR_MASK (0xff << 0)
193
194
/* ANADIG_PLL1_CTRL: PLL1 Control Register (video PLL) */
195
#define ANADIG_PLL1_CTRL_LOCK (1 << 31)
196
#define ANADIG_PLL1_CTRL_PFD_OFFSET_EN (1 << 18)
197
#define ANADIG_PLL1_CTRL_DITHER_ENABLE (1 << 17)
198
#define ANADIG_PLL1_CTRL_BYPASS (1 << 16)
199
#define ANADIG_PLL1_CTRL_BYPASS_CLK_SRC (1 << 14)
200
#define ANADIG_PLL1_CTRL_ENABLE (1 << 13)
201
#define ANADIG_PLL1_CTRL_POWERDOWN (1 << 12)
202
#define ANADIG_PLL1_CTRL_DIV_SELECT (1 << 1)
203
204
/* ANADIG_PLL1_SS: PLL1 Spread Spectrum definition register */
205
#define ANADIG_PLL1_SS_STOP_MASK (0xffff << 16)
206
#define ANADIG_PLL1_SS_ENABLE (1 << 15)
207
#define ANADIG_PLL1_SS_STEP_MASK 0x8fff
208
209
/* ANADIG_PLL1_NUM: PLL1 Numerator definition register */
210
#define ANADIG_PLL1_NUM_MFN_MASK 0x3fffffff
211
212
/* ANADIG_PLL1_DENOM: PLL1 Denominator definition register */
213
#define ANADIG_PLL1_DENOM_MFN_MASK 0x3fffffff
214
215
/* ANADIG_PLL_LOCK: PLL Lock Register */
216
#define ANADIG_PLL_LOCK_PLL1 (1 << 6)
217
#define ANADIG_PLL_LOCK_PLL2 (1 << 5)
218
#define ANADIG_PLL_LOCK_PLL4 (1 << 4)
219
#define ANADIG_PLL_LOCK_PLL6 (1 << 3)
220
#define ANADIG_PLL_LOCK_PLL5 (1 << 2)
221
#define ANADIG_PLL_LOCK_PLL3 (1 << 1)
222
#define ANADIG_PLL_LOCK_PLL7 (1 << 0)
223
224
#endif
common.h
memorymap.h
include
libopencm3
vf6xx
anadig.h
Generated on Tue Mar 7 2023 16:13:10 for libopencm3 by
1.9.4