2 * Copyright 2013 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __ARCH_ARM_MACH_VF610_CCM_REGS_H__
8 #define __ARCH_ARM_MACH_VF610_CCM_REGS_H__
12 /* Clock Controller Module (CCM) */
56 /* Analog components control digital interface (ANADIG) */
113 #define CCM_CCR_FIRC_EN (1 << 16)
114 #define CCM_CCR_OSCNT_MASK 0xff
115 #define CCM_CCR_OSCNT(v) ((v) & 0xff)
117 #define CCM_CCSR_PLL2_PFD_CLK_SEL_OFFSET 19
118 #define CCM_CCSR_PLL2_PFD_CLK_SEL_MASK (0x7 << 19)
119 #define CCM_CCSR_PLL2_PFD_CLK_SEL(v) (((v) & 0x7) << 19)
121 #define CCM_CCSR_PLL1_PFD_CLK_SEL_OFFSET 16
122 #define CCM_CCSR_PLL1_PFD_CLK_SEL_MASK (0x7 << 16)
123 #define CCM_CCSR_PLL1_PFD_CLK_SEL(v) (((v) & 0x7) << 16)
125 #define CCM_CCSR_PLL2_PFD4_EN (1 << 15)
126 #define CCM_CCSR_PLL2_PFD3_EN (1 << 14)
127 #define CCM_CCSR_PLL2_PFD2_EN (1 << 13)
128 #define CCM_CCSR_PLL2_PFD1_EN (1 << 12)
129 #define CCM_CCSR_PLL1_PFD4_EN (1 << 11)
130 #define CCM_CCSR_PLL1_PFD3_EN (1 << 10)
131 #define CCM_CCSR_PLL1_PFD2_EN (1 << 9)
132 #define CCM_CCSR_PLL1_PFD1_EN (1 << 8)
134 #define CCM_CCSR_DDRC_CLK_SEL(v) ((v) << 6)
135 #define CCM_CCSR_FAST_CLK_SEL(v) ((v) << 5)
137 #define CCM_CCSR_SYS_CLK_SEL_OFFSET 0
138 #define CCM_CCSR_SYS_CLK_SEL_MASK 0x7
139 #define CCM_CCSR_SYS_CLK_SEL(v) ((v) & 0x7)
141 #define CCM_CACRR_IPG_CLK_DIV_OFFSET 11
142 #define CCM_CACRR_IPG_CLK_DIV_MASK (0x3 << 11)
143 #define CCM_CACRR_IPG_CLK_DIV(v) (((v) & 0x3) << 11)
144 #define CCM_CACRR_BUS_CLK_DIV_OFFSET 3
145 #define CCM_CACRR_BUS_CLK_DIV_MASK (0x7 << 3)
146 #define CCM_CACRR_BUS_CLK_DIV(v) (((v) & 0x7) << 3)
147 #define CCM_CACRR_ARM_CLK_DIV_OFFSET 0
148 #define CCM_CACRR_ARM_CLK_DIV_MASK 0x7
149 #define CCM_CACRR_ARM_CLK_DIV(v) ((v) & 0x7)
151 #define CCM_CSCMR1_ESDHC1_CLK_SEL_OFFSET 18
152 #define CCM_CSCMR1_ESDHC1_CLK_SEL_MASK (0x3 << 18)
153 #define CCM_CSCMR1_ESDHC1_CLK_SEL(v) (((v) & 0x3) << 18)
155 #define CCM_CSCDR1_RMII_CLK_EN (1 << 24)
157 #define CCM_CSCDR2_ESDHC1_EN (1 << 29)
158 #define CCM_CSCDR2_ESDHC1_CLK_DIV_OFFSET 20
159 #define CCM_CSCDR2_ESDHC1_CLK_DIV_MASK (0xf << 20)
160 #define CCM_CSCDR2_ESDHC1_CLK_DIV(v) (((v) & 0xf) << 20)
162 #define CCM_CSCMR2_RMII_CLK_SEL_OFFSET 4
163 #define CCM_CSCMR2_RMII_CLK_SEL_MASK (0x3 << 4)
164 #define CCM_CSCMR2_RMII_CLK_SEL(v) (((v) & 0x3) << 4)
166 #define CCM_REG_CTRL_MASK 0xffffffff
167 #define CCM_CCGR0_UART1_CTRL_MASK (0x3 << 16)
168 #define CCM_CCGR1_PIT_CTRL_MASK (0x3 << 14)
169 #define CCM_CCGR1_WDOGA5_CTRL_MASK (0x3 << 28)
170 #define CCM_CCGR2_IOMUXC_CTRL_MASK (0x3 << 16)
171 #define CCM_CCGR2_PORTA_CTRL_MASK (0x3 << 18)
172 #define CCM_CCGR2_PORTB_CTRL_MASK (0x3 << 20)
173 #define CCM_CCGR2_PORTC_CTRL_MASK (0x3 << 22)
174 #define CCM_CCGR2_PORTD_CTRL_MASK (0x3 << 24)
175 #define CCM_CCGR2_PORTE_CTRL_MASK (0x3 << 26)
176 #define CCM_CCGR3_ANADIG_CTRL_MASK 0x3
177 #define CCM_CCGR4_WKUP_CTRL_MASK (0x3 << 20)
178 #define CCM_CCGR4_CCM_CTRL_MASK (0x3 << 22)
179 #define CCM_CCGR4_GPC_CTRL_MASK (0x3 << 24)
180 #define CCM_CCGR4_I2C0_CTRL_MASK (0x3 << 12)
181 #define CCM_CCGR6_OCOTP_CTRL_MASK (0x3 << 10)
182 #define CCM_CCGR6_DDRMC_CTRL_MASK (0x3 << 28)
183 #define CCM_CCGR7_SDHC1_CTRL_MASK (0x3 << 4)
184 #define CCM_CCGR9_FEC0_CTRL_MASK 0x3
185 #define CCM_CCGR9_FEC1_CTRL_MASK (0x3 << 2)
187 #define ANADIG_PLL2_CTRL_ENABLE (1 << 13)
188 #define ANADIG_PLL2_CTRL_POWERDOWN (1 << 12)
189 #define ANADIG_PLL2_CTRL_DIV_SELECT 1
190 #define ANADIG_PLL1_CTRL_ENABLE (1 << 13)
191 #define ANADIG_PLL1_CTRL_POWERDOWN (1 << 12)
192 #define ANADIG_PLL1_CTRL_DIV_SELECT 1
194 #define FASE_CLK_FREQ 24000000
195 #define SLOW_CLK_FREQ 32000
196 #define PLL1_PFD1_FREQ 500000000
197 #define PLL1_PFD2_FREQ 452000000
198 #define PLL1_PFD3_FREQ 396000000
199 #define PLL1_PFD4_FREQ 528000000
200 #define PLL1_MAIN_FREQ 528000000
201 #define PLL2_PFD1_FREQ 500000000
202 #define PLL2_PFD2_FREQ 396000000
203 #define PLL2_PFD3_FREQ 339000000
204 #define PLL2_PFD4_FREQ 413000000
205 #define PLL2_MAIN_FREQ 528000000
206 #define PLL3_MAIN_FREQ 480000000
207 #define PLL3_PFD3_FREQ 298000000
208 #define PLL5_MAIN_FREQ 500000000
210 #define ENET_EXTERNAL_CLK 50000000
211 #define AUDIO_EXTERNAL_CLK 24576000
213 #endif /*__ARCH_ARM_MACH_VF610_CCM_REGS_H__ */