20 #include <mach/spear.h>
24 #define SPEAR1310_PLL_CFG (VA_MISC_BASE + 0x210)
26 #define SPEAR1310_CLCD_SYNT_CLK_MASK 1
27 #define SPEAR1310_CLCD_SYNT_CLK_SHIFT 31
28 #define SPEAR1310_RAS_SYNT2_3_CLK_MASK 2
29 #define SPEAR1310_RAS_SYNT2_3_CLK_SHIFT 29
30 #define SPEAR1310_RAS_SYNT_CLK_MASK 2
31 #define SPEAR1310_RAS_SYNT0_1_CLK_SHIFT 27
32 #define SPEAR1310_PLL_CLK_MASK 2
33 #define SPEAR1310_PLL3_CLK_SHIFT 24
34 #define SPEAR1310_PLL2_CLK_SHIFT 22
35 #define SPEAR1310_PLL1_CLK_SHIFT 20
37 #define SPEAR1310_PLL1_CTR (VA_MISC_BASE + 0x214)
38 #define SPEAR1310_PLL1_FRQ (VA_MISC_BASE + 0x218)
39 #define SPEAR1310_PLL2_CTR (VA_MISC_BASE + 0x220)
40 #define SPEAR1310_PLL2_FRQ (VA_MISC_BASE + 0x224)
41 #define SPEAR1310_PLL3_CTR (VA_MISC_BASE + 0x22C)
42 #define SPEAR1310_PLL3_FRQ (VA_MISC_BASE + 0x230)
43 #define SPEAR1310_PLL4_CTR (VA_MISC_BASE + 0x238)
44 #define SPEAR1310_PLL4_FRQ (VA_MISC_BASE + 0x23C)
45 #define SPEAR1310_PERIP_CLK_CFG (VA_MISC_BASE + 0x244)
47 #define SPEAR1310_GPT_OSC24_VAL 0
48 #define SPEAR1310_GPT_APB_VAL 1
49 #define SPEAR1310_GPT_CLK_MASK 1
50 #define SPEAR1310_GPT3_CLK_SHIFT 11
51 #define SPEAR1310_GPT2_CLK_SHIFT 10
52 #define SPEAR1310_GPT1_CLK_SHIFT 9
53 #define SPEAR1310_GPT0_CLK_SHIFT 8
54 #define SPEAR1310_UART_CLK_PLL5_VAL 0
55 #define SPEAR1310_UART_CLK_OSC24_VAL 1
56 #define SPEAR1310_UART_CLK_SYNT_VAL 2
57 #define SPEAR1310_UART_CLK_MASK 2
58 #define SPEAR1310_UART_CLK_SHIFT 4
60 #define SPEAR1310_AUX_CLK_PLL5_VAL 0
61 #define SPEAR1310_AUX_CLK_SYNT_VAL 1
62 #define SPEAR1310_CLCD_CLK_MASK 2
63 #define SPEAR1310_CLCD_CLK_SHIFT 2
64 #define SPEAR1310_C3_CLK_MASK 1
65 #define SPEAR1310_C3_CLK_SHIFT 1
67 #define SPEAR1310_GMAC_CLK_CFG (VA_MISC_BASE + 0x248)
68 #define SPEAR1310_GMAC_PHY_IF_SEL_MASK 3
69 #define SPEAR1310_GMAC_PHY_IF_SEL_SHIFT 4
70 #define SPEAR1310_GMAC_PHY_CLK_MASK 1
71 #define SPEAR1310_GMAC_PHY_CLK_SHIFT 3
72 #define SPEAR1310_GMAC_PHY_INPUT_CLK_MASK 2
73 #define SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT 1
75 #define SPEAR1310_I2S_CLK_CFG (VA_MISC_BASE + 0x24C)
77 #define SPEAR1310_I2S_SCLK_X_MASK 0x1F
78 #define SPEAR1310_I2S_SCLK_X_SHIFT 27
79 #define SPEAR1310_I2S_SCLK_Y_MASK 0x1F
80 #define SPEAR1310_I2S_SCLK_Y_SHIFT 22
81 #define SPEAR1310_I2S_SCLK_EQ_SEL_SHIFT 21
82 #define SPEAR1310_I2S_SCLK_SYNTH_ENB 20
83 #define SPEAR1310_I2S_PRS1_CLK_X_MASK 0xFF
84 #define SPEAR1310_I2S_PRS1_CLK_X_SHIFT 12
85 #define SPEAR1310_I2S_PRS1_CLK_Y_MASK 0xFF
86 #define SPEAR1310_I2S_PRS1_CLK_Y_SHIFT 4
87 #define SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT 3
88 #define SPEAR1310_I2S_REF_SEL_MASK 1
89 #define SPEAR1310_I2S_REF_SHIFT 2
90 #define SPEAR1310_I2S_SRC_CLK_MASK 2
91 #define SPEAR1310_I2S_SRC_CLK_SHIFT 0
93 #define SPEAR1310_C3_CLK_SYNT (VA_MISC_BASE + 0x250)
94 #define SPEAR1310_UART_CLK_SYNT (VA_MISC_BASE + 0x254)
95 #define SPEAR1310_GMAC_CLK_SYNT (VA_MISC_BASE + 0x258)
96 #define SPEAR1310_SDHCI_CLK_SYNT (VA_MISC_BASE + 0x25C)
97 #define SPEAR1310_CFXD_CLK_SYNT (VA_MISC_BASE + 0x260)
98 #define SPEAR1310_ADC_CLK_SYNT (VA_MISC_BASE + 0x264)
99 #define SPEAR1310_AMBA_CLK_SYNT (VA_MISC_BASE + 0x268)
100 #define SPEAR1310_CLCD_CLK_SYNT (VA_MISC_BASE + 0x270)
101 #define SPEAR1310_RAS_CLK_SYNT0 (VA_MISC_BASE + 0x280)
102 #define SPEAR1310_RAS_CLK_SYNT1 (VA_MISC_BASE + 0x288)
103 #define SPEAR1310_RAS_CLK_SYNT2 (VA_MISC_BASE + 0x290)
104 #define SPEAR1310_RAS_CLK_SYNT3 (VA_MISC_BASE + 0x298)
107 #define SPEAR1310_PERIP1_CLK_ENB (VA_MISC_BASE + 0x300)
109 #define SPEAR1310_RTC_CLK_ENB 31
110 #define SPEAR1310_ADC_CLK_ENB 30
111 #define SPEAR1310_C3_CLK_ENB 29
112 #define SPEAR1310_JPEG_CLK_ENB 28
113 #define SPEAR1310_CLCD_CLK_ENB 27
114 #define SPEAR1310_DMA_CLK_ENB 25
115 #define SPEAR1310_GPIO1_CLK_ENB 24
116 #define SPEAR1310_GPIO0_CLK_ENB 23
117 #define SPEAR1310_GPT1_CLK_ENB 22
118 #define SPEAR1310_GPT0_CLK_ENB 21
119 #define SPEAR1310_I2S0_CLK_ENB 20
120 #define SPEAR1310_I2S1_CLK_ENB 19
121 #define SPEAR1310_I2C0_CLK_ENB 18
122 #define SPEAR1310_SSP_CLK_ENB 17
123 #define SPEAR1310_UART_CLK_ENB 15
124 #define SPEAR1310_PCIE_SATA_2_CLK_ENB 14
125 #define SPEAR1310_PCIE_SATA_1_CLK_ENB 13
126 #define SPEAR1310_PCIE_SATA_0_CLK_ENB 12
127 #define SPEAR1310_UOC_CLK_ENB 11
128 #define SPEAR1310_UHC1_CLK_ENB 10
129 #define SPEAR1310_UHC0_CLK_ENB 9
130 #define SPEAR1310_GMAC_CLK_ENB 8
131 #define SPEAR1310_CFXD_CLK_ENB 7
132 #define SPEAR1310_SDHCI_CLK_ENB 6
133 #define SPEAR1310_SMI_CLK_ENB 5
134 #define SPEAR1310_FSMC_CLK_ENB 4
135 #define SPEAR1310_SYSRAM0_CLK_ENB 3
136 #define SPEAR1310_SYSRAM1_CLK_ENB 2
137 #define SPEAR1310_SYSROM_CLK_ENB 1
138 #define SPEAR1310_BUS_CLK_ENB 0
140 #define SPEAR1310_PERIP2_CLK_ENB (VA_MISC_BASE + 0x304)
142 #define SPEAR1310_THSENS_CLK_ENB 8
143 #define SPEAR1310_I2S_REF_PAD_CLK_ENB 7
144 #define SPEAR1310_ACP_CLK_ENB 6
145 #define SPEAR1310_GPT3_CLK_ENB 5
146 #define SPEAR1310_GPT2_CLK_ENB 4
147 #define SPEAR1310_KBD_CLK_ENB 3
148 #define SPEAR1310_CPU_DBG_CLK_ENB 2
149 #define SPEAR1310_DDR_CORE_CLK_ENB 1
150 #define SPEAR1310_DDR_CTRL_CLK_ENB 0
152 #define SPEAR1310_RAS_CLK_ENB (VA_MISC_BASE + 0x310)
154 #define SPEAR1310_SYNT3_CLK_ENB 17
155 #define SPEAR1310_SYNT2_CLK_ENB 16
156 #define SPEAR1310_SYNT1_CLK_ENB 15
157 #define SPEAR1310_SYNT0_CLK_ENB 14
158 #define SPEAR1310_PCLK3_CLK_ENB 13
159 #define SPEAR1310_PCLK2_CLK_ENB 12
160 #define SPEAR1310_PCLK1_CLK_ENB 11
161 #define SPEAR1310_PCLK0_CLK_ENB 10
162 #define SPEAR1310_PLL3_CLK_ENB 9
163 #define SPEAR1310_PLL2_CLK_ENB 8
164 #define SPEAR1310_C125M_PAD_CLK_ENB 7
165 #define SPEAR1310_C30M_CLK_ENB 6
166 #define SPEAR1310_C48M_CLK_ENB 5
167 #define SPEAR1310_OSC_25M_CLK_ENB 4
168 #define SPEAR1310_OSC_32K_CLK_ENB 3
169 #define SPEAR1310_OSC_24M_CLK_ENB 2
170 #define SPEAR1310_PCLK_CLK_ENB 1
171 #define SPEAR1310_ACLK_CLK_ENB 0
174 #define SPEAR1310_RAS_CTRL_REG0 (VA_SPEAR1310_RAS_BASE + 0x000)
175 #define SPEAR1310_SSP1_CLK_MASK 3
176 #define SPEAR1310_SSP1_CLK_SHIFT 26
177 #define SPEAR1310_TDM_CLK_MASK 1
178 #define SPEAR1310_TDM2_CLK_SHIFT 24
179 #define SPEAR1310_TDM1_CLK_SHIFT 23
180 #define SPEAR1310_I2C_CLK_MASK 1
181 #define SPEAR1310_I2C7_CLK_SHIFT 22
182 #define SPEAR1310_I2C6_CLK_SHIFT 21
183 #define SPEAR1310_I2C5_CLK_SHIFT 20
184 #define SPEAR1310_I2C4_CLK_SHIFT 19
185 #define SPEAR1310_I2C3_CLK_SHIFT 18
186 #define SPEAR1310_I2C2_CLK_SHIFT 17
187 #define SPEAR1310_I2C1_CLK_SHIFT 16
188 #define SPEAR1310_GPT64_CLK_MASK 1
189 #define SPEAR1310_GPT64_CLK_SHIFT 15
190 #define SPEAR1310_RAS_UART_CLK_MASK 1
191 #define SPEAR1310_UART5_CLK_SHIFT 14
192 #define SPEAR1310_UART4_CLK_SHIFT 13
193 #define SPEAR1310_UART3_CLK_SHIFT 12
194 #define SPEAR1310_UART2_CLK_SHIFT 11
195 #define SPEAR1310_UART1_CLK_SHIFT 10
196 #define SPEAR1310_PCI_CLK_MASK 1
197 #define SPEAR1310_PCI_CLK_SHIFT 0
199 #define SPEAR1310_RAS_CTRL_REG1 (VA_SPEAR1310_RAS_BASE + 0x004)
200 #define SPEAR1310_PHY_CLK_MASK 0x3
201 #define SPEAR1310_RMII_PHY_CLK_SHIFT 0
202 #define SPEAR1310_SMII_RGMII_PHY_CLK_SHIFT 2
204 #define SPEAR1310_RAS_SW_CLK_CTRL (VA_SPEAR1310_RAS_BASE + 0x0148)
205 #define SPEAR1310_CAN1_CLK_ENB 25
206 #define SPEAR1310_CAN0_CLK_ENB 24
207 #define SPEAR1310_GPT64_CLK_ENB 23
208 #define SPEAR1310_SSP1_CLK_ENB 22
209 #define SPEAR1310_I2C7_CLK_ENB 21
210 #define SPEAR1310_I2C6_CLK_ENB 20
211 #define SPEAR1310_I2C5_CLK_ENB 19
212 #define SPEAR1310_I2C4_CLK_ENB 18
213 #define SPEAR1310_I2C3_CLK_ENB 17
214 #define SPEAR1310_I2C2_CLK_ENB 16
215 #define SPEAR1310_I2C1_CLK_ENB 15
216 #define SPEAR1310_UART5_CLK_ENB 14
217 #define SPEAR1310_UART4_CLK_ENB 13
218 #define SPEAR1310_UART3_CLK_ENB 12
219 #define SPEAR1310_UART2_CLK_ENB 11
220 #define SPEAR1310_UART1_CLK_ENB 10
221 #define SPEAR1310_RS485_1_CLK_ENB 9
222 #define SPEAR1310_RS485_0_CLK_ENB 8
223 #define SPEAR1310_TDM2_CLK_ENB 7
224 #define SPEAR1310_TDM1_CLK_ENB 6
225 #define SPEAR1310_PCI_CLK_ENB 5
226 #define SPEAR1310_GMII_CLK_ENB 4
227 #define SPEAR1310_MII2_CLK_ENB 3
228 #define SPEAR1310_MII1_CLK_ENB 2
229 #define SPEAR1310_MII0_CLK_ENB 1
230 #define SPEAR1310_ESRAM_CLK_ENB 0
237 {.mode = 0, .m = 0x83, .n = 0x04, .p = 0x5},
238 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x3},
239 {.mode = 0, .m = 0x64, .n = 0x06, .p = 0x1},
240 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x1},
241 {.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x1},
242 {.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x1},
243 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x0},
248 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x2},
249 {.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x2},
250 {.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x2},
251 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x0},
257 {.xscale = 10, .yscale = 204, .eq = 0},
258 {.xscale = 4, .yscale = 21, .eq = 0},
259 {.xscale = 2, .yscale = 6, .eq = 0},
260 {.xscale = 2, .yscale = 4, .eq = 0},
261 {.xscale = 1, .yscale = 3, .eq = 1},
262 {.xscale = 1, .yscale = 2, .eq = 1},
268 {.xscale = 2, .yscale = 6, .eq = 0},
269 {.xscale = 2, .yscale = 4, .eq = 0},
270 {.xscale = 1, .yscale = 3, .eq = 1},
271 {.xscale = 1, .yscale = 2, .eq = 1},
316 {.xscale = 1, .yscale = 2, .eq = 0},
322 {.xscale = 1, .yscale = 4, .eq = 0},
323 {.xscale = 1, .yscale = 2, .eq = 0},
330 {.xscale = 1, .yscale = 31, .eq = 0},
331 {.xscale = 2, .yscale = 21, .eq = 0},
332 {.xscale = 4, .yscale = 21, .eq = 0},
333 {.xscale = 10, .yscale = 42, .eq = 0},
346 static const char *vco_parents[] = {
"osc_24m_clk",
"osc_25m_clk", };
347 static const char *gpt_parents[] = {
"osc_24m_clk",
"apb_clk", };
348 static const char *uart0_parents[] = {
"pll5_clk",
"uart_syn_gclk", };
349 static const char *c3_parents[] = {
"pll5_clk",
"c3_syn_gclk", };
350 static const char *gmac_phy_input_parents[] = {
"gmii_pad_clk",
"pll2_clk",
352 static const char *gmac_phy_parents[] = {
"phy_input_mclk",
"phy_syn_gclk", };
353 static const char *clcd_synth_parents[] = {
"vco1div4_clk",
"pll2_clk", };
354 static const char *clcd_pixel_parents[] = {
"pll5_clk",
"clcd_syn_clk", };
355 static const char *i2s_src_parents[] = {
"vco1div2_clk",
"none",
"pll3_clk",
356 "i2s_src_pad_clk", };
357 static const char *i2s_ref_parents[] = {
"i2s_src_mclk",
"i2s_prs1_clk", };
358 static const char *gen_synth0_1_parents[] = {
"vco1div4_clk",
"vco3div2_clk",
360 static const char *gen_synth2_3_parents[] = {
"vco1div4_clk",
"vco3div2_clk",
362 static const char *rmii_phy_parents[] = {
"ras_tx50_clk",
"none",
363 "ras_pll2_clk",
"ras_syn0_clk", };
364 static const char *smii_rgmii_phy_parents[] = {
"none",
"ras_tx125_clk",
365 "ras_pll2_clk",
"ras_syn0_clk", };
366 static const char *uart_parents[] = {
"ras_apb_clk",
"gen_syn3_clk", };
367 static const char *i2c_parents[] = {
"ras_apb_clk",
"gen_syn1_clk", };
368 static const char *ssp1_parents[] = {
"ras_apb_clk",
"gen_syn1_clk",
370 static const char *pci_parents[] = {
"ras_pll3_clk",
"gen_syn2_clk", };
371 static const char *tdm_parents[] = {
"ras_pll3_clk",
"gen_syn1_clk", };
397 CLK_IS_ROOT, 12288000);
562 aux_rtbl,
ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
668 &i2s_sclk_masks, i2s_sclk_rtbl,
914 smii_rgmii_phy_parents,