20 #include <mach/spear.h>
24 #define SPEAR1340_SYS_CLK_CTRL (VA_MISC_BASE + 0x200)
25 #define SPEAR1340_HCLK_SRC_SEL_SHIFT 27
26 #define SPEAR1340_HCLK_SRC_SEL_MASK 1
27 #define SPEAR1340_SCLK_SRC_SEL_SHIFT 23
28 #define SPEAR1340_SCLK_SRC_SEL_MASK 3
31 #define SPEAR1340_PLL_CFG (VA_MISC_BASE + 0x210)
33 #define SPEAR1340_CLCD_SYNT_CLK_MASK 1
34 #define SPEAR1340_CLCD_SYNT_CLK_SHIFT 31
35 #define SPEAR1340_GEN_SYNT2_3_CLK_SHIFT 29
36 #define SPEAR1340_GEN_SYNT_CLK_MASK 2
37 #define SPEAR1340_GEN_SYNT0_1_CLK_SHIFT 27
38 #define SPEAR1340_PLL_CLK_MASK 2
39 #define SPEAR1340_PLL3_CLK_SHIFT 24
40 #define SPEAR1340_PLL2_CLK_SHIFT 22
41 #define SPEAR1340_PLL1_CLK_SHIFT 20
43 #define SPEAR1340_PLL1_CTR (VA_MISC_BASE + 0x214)
44 #define SPEAR1340_PLL1_FRQ (VA_MISC_BASE + 0x218)
45 #define SPEAR1340_PLL2_CTR (VA_MISC_BASE + 0x220)
46 #define SPEAR1340_PLL2_FRQ (VA_MISC_BASE + 0x224)
47 #define SPEAR1340_PLL3_CTR (VA_MISC_BASE + 0x22C)
48 #define SPEAR1340_PLL3_FRQ (VA_MISC_BASE + 0x230)
49 #define SPEAR1340_PLL4_CTR (VA_MISC_BASE + 0x238)
50 #define SPEAR1340_PLL4_FRQ (VA_MISC_BASE + 0x23C)
51 #define SPEAR1340_PERIP_CLK_CFG (VA_MISC_BASE + 0x244)
53 #define SPEAR1340_SPDIF_CLK_MASK 1
54 #define SPEAR1340_SPDIF_OUT_CLK_SHIFT 15
55 #define SPEAR1340_SPDIF_IN_CLK_SHIFT 14
56 #define SPEAR1340_GPT3_CLK_SHIFT 13
57 #define SPEAR1340_GPT2_CLK_SHIFT 12
58 #define SPEAR1340_GPT_CLK_MASK 1
59 #define SPEAR1340_GPT1_CLK_SHIFT 9
60 #define SPEAR1340_GPT0_CLK_SHIFT 8
61 #define SPEAR1340_UART_CLK_MASK 2
62 #define SPEAR1340_UART1_CLK_SHIFT 6
63 #define SPEAR1340_UART0_CLK_SHIFT 4
64 #define SPEAR1340_CLCD_CLK_MASK 2
65 #define SPEAR1340_CLCD_CLK_SHIFT 2
66 #define SPEAR1340_C3_CLK_MASK 1
67 #define SPEAR1340_C3_CLK_SHIFT 1
69 #define SPEAR1340_GMAC_CLK_CFG (VA_MISC_BASE + 0x248)
70 #define SPEAR1340_GMAC_PHY_CLK_MASK 1
71 #define SPEAR1340_GMAC_PHY_CLK_SHIFT 2
72 #define SPEAR1340_GMAC_PHY_INPUT_CLK_MASK 2
73 #define SPEAR1340_GMAC_PHY_INPUT_CLK_SHIFT 0
75 #define SPEAR1340_I2S_CLK_CFG (VA_MISC_BASE + 0x24C)
77 #define SPEAR1340_I2S_SCLK_X_MASK 0x1F
78 #define SPEAR1340_I2S_SCLK_X_SHIFT 27
79 #define SPEAR1340_I2S_SCLK_Y_MASK 0x1F
80 #define SPEAR1340_I2S_SCLK_Y_SHIFT 22
81 #define SPEAR1340_I2S_SCLK_EQ_SEL_SHIFT 21
82 #define SPEAR1340_I2S_SCLK_SYNTH_ENB 20
83 #define SPEAR1340_I2S_PRS1_CLK_X_MASK 0xFF
84 #define SPEAR1340_I2S_PRS1_CLK_X_SHIFT 12
85 #define SPEAR1340_I2S_PRS1_CLK_Y_MASK 0xFF
86 #define SPEAR1340_I2S_PRS1_CLK_Y_SHIFT 4
87 #define SPEAR1340_I2S_PRS1_EQ_SEL_SHIFT 3
88 #define SPEAR1340_I2S_REF_SEL_MASK 1
89 #define SPEAR1340_I2S_REF_SHIFT 2
90 #define SPEAR1340_I2S_SRC_CLK_MASK 2
91 #define SPEAR1340_I2S_SRC_CLK_SHIFT 0
93 #define SPEAR1340_C3_CLK_SYNT (VA_MISC_BASE + 0x250)
94 #define SPEAR1340_UART0_CLK_SYNT (VA_MISC_BASE + 0x254)
95 #define SPEAR1340_UART1_CLK_SYNT (VA_MISC_BASE + 0x258)
96 #define SPEAR1340_GMAC_CLK_SYNT (VA_MISC_BASE + 0x25C)
97 #define SPEAR1340_SDHCI_CLK_SYNT (VA_MISC_BASE + 0x260)
98 #define SPEAR1340_CFXD_CLK_SYNT (VA_MISC_BASE + 0x264)
99 #define SPEAR1340_ADC_CLK_SYNT (VA_MISC_BASE + 0x270)
100 #define SPEAR1340_AMBA_CLK_SYNT (VA_MISC_BASE + 0x274)
101 #define SPEAR1340_CLCD_CLK_SYNT (VA_MISC_BASE + 0x27C)
102 #define SPEAR1340_SYS_CLK_SYNT (VA_MISC_BASE + 0x284)
103 #define SPEAR1340_GEN_CLK_SYNT0 (VA_MISC_BASE + 0x28C)
104 #define SPEAR1340_GEN_CLK_SYNT1 (VA_MISC_BASE + 0x294)
105 #define SPEAR1340_GEN_CLK_SYNT2 (VA_MISC_BASE + 0x29C)
106 #define SPEAR1340_GEN_CLK_SYNT3 (VA_MISC_BASE + 0x304)
107 #define SPEAR1340_PERIP1_CLK_ENB (VA_MISC_BASE + 0x30C)
108 #define SPEAR1340_RTC_CLK_ENB 31
109 #define SPEAR1340_ADC_CLK_ENB 30
110 #define SPEAR1340_C3_CLK_ENB 29
111 #define SPEAR1340_CLCD_CLK_ENB 27
112 #define SPEAR1340_DMA_CLK_ENB 25
113 #define SPEAR1340_GPIO1_CLK_ENB 24
114 #define SPEAR1340_GPIO0_CLK_ENB 23
115 #define SPEAR1340_GPT1_CLK_ENB 22
116 #define SPEAR1340_GPT0_CLK_ENB 21
117 #define SPEAR1340_I2S_PLAY_CLK_ENB 20
118 #define SPEAR1340_I2S_REC_CLK_ENB 19
119 #define SPEAR1340_I2C0_CLK_ENB 18
120 #define SPEAR1340_SSP_CLK_ENB 17
121 #define SPEAR1340_UART0_CLK_ENB 15
122 #define SPEAR1340_PCIE_SATA_CLK_ENB 12
123 #define SPEAR1340_UOC_CLK_ENB 11
124 #define SPEAR1340_UHC1_CLK_ENB 10
125 #define SPEAR1340_UHC0_CLK_ENB 9
126 #define SPEAR1340_GMAC_CLK_ENB 8
127 #define SPEAR1340_CFXD_CLK_ENB 7
128 #define SPEAR1340_SDHCI_CLK_ENB 6
129 #define SPEAR1340_SMI_CLK_ENB 5
130 #define SPEAR1340_FSMC_CLK_ENB 4
131 #define SPEAR1340_SYSRAM0_CLK_ENB 3
132 #define SPEAR1340_SYSRAM1_CLK_ENB 2
133 #define SPEAR1340_SYSROM_CLK_ENB 1
134 #define SPEAR1340_BUS_CLK_ENB 0
136 #define SPEAR1340_PERIP2_CLK_ENB (VA_MISC_BASE + 0x310)
137 #define SPEAR1340_THSENS_CLK_ENB 8
138 #define SPEAR1340_I2S_REF_PAD_CLK_ENB 7
139 #define SPEAR1340_ACP_CLK_ENB 6
140 #define SPEAR1340_GPT3_CLK_ENB 5
141 #define SPEAR1340_GPT2_CLK_ENB 4
142 #define SPEAR1340_KBD_CLK_ENB 3
143 #define SPEAR1340_CPU_DBG_CLK_ENB 2
144 #define SPEAR1340_DDR_CORE_CLK_ENB 1
145 #define SPEAR1340_DDR_CTRL_CLK_ENB 0
147 #define SPEAR1340_PERIP3_CLK_ENB (VA_MISC_BASE + 0x314)
148 #define SPEAR1340_PLGPIO_CLK_ENB 18
149 #define SPEAR1340_VIDEO_DEC_CLK_ENB 16
150 #define SPEAR1340_VIDEO_ENC_CLK_ENB 15
151 #define SPEAR1340_SPDIF_OUT_CLK_ENB 13
152 #define SPEAR1340_SPDIF_IN_CLK_ENB 12
153 #define SPEAR1340_VIDEO_IN_CLK_ENB 11
154 #define SPEAR1340_CAM0_CLK_ENB 10
155 #define SPEAR1340_CAM1_CLK_ENB 9
156 #define SPEAR1340_CAM2_CLK_ENB 8
157 #define SPEAR1340_CAM3_CLK_ENB 7
158 #define SPEAR1340_MALI_CLK_ENB 6
159 #define SPEAR1340_CEC0_CLK_ENB 5
160 #define SPEAR1340_CEC1_CLK_ENB 4
161 #define SPEAR1340_PWM_CLK_ENB 3
162 #define SPEAR1340_I2C1_CLK_ENB 2
163 #define SPEAR1340_UART1_CLK_ENB 1
170 {.mode = 0, .m = 0x83, .n = 0x04, .p = 0x5},
171 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x3},
172 {.mode = 0, .m = 0x64, .n = 0x06, .p = 0x1},
173 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x1},
174 {.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x1},
175 {.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x1},
176 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x0},
177 {.mode = 0, .m = 0x96, .n = 0x06, .p = 0x0},
182 {.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x2},
183 {.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x2},
184 {.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x2},
185 {.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},
319 {.xscale = 1, .yscale = 12, .eq = 0},
320 {.xscale = 11, .yscale = 96, .eq = 0},
321 {.xscale = 1, .yscale = 6, .eq = 0},
322 {.xscale = 11, .yscale = 48, .eq = 0},
328 {.xscale = 1, .yscale = 3, .eq = 0},
331 {.xscale = 17, .yscale = 37, .eq = 0},
332 {.xscale = 1, .yscale = 2, .eq = 0},
338 {.xscale = 1, .yscale = 4, .eq = 0},
339 {.xscale = 1, .yscale = 2, .eq = 0},
346 {.xscale = 1, .yscale = 31, .eq = 0},
347 {.xscale = 2, .yscale = 21, .eq = 0},
348 {.xscale = 4, .yscale = 21, .eq = 0},
349 {.xscale = 10, .yscale = 42, .eq = 0},
371 static const char *vco_parents[] = {
"osc_24m_clk",
"osc_25m_clk", };
372 static const char *sys_parents[] = {
"pll1_clk",
"pll1_clk",
"pll1_clk",
373 "pll1_clk",
"sys_synth_clk",
"sys_synth_clk",
"pll2_clk",
"pll3_clk", };
374 static const char *ahb_parents[] = {
"cpu_div3_clk",
"amba_syn_clk", };
375 static const char *gpt_parents[] = {
"osc_24m_clk",
"apb_clk", };
376 static const char *uart0_parents[] = {
"pll5_clk",
"osc_24m_clk",
378 static const char *uart1_parents[] = {
"pll5_clk",
"osc_24m_clk",
380 static const char *c3_parents[] = {
"pll5_clk",
"c3_syn_gclk", };
381 static const char *gmac_phy_input_parents[] = {
"gmii_pad_clk",
"pll2_clk",
383 static const char *gmac_phy_parents[] = {
"phy_input_mclk",
"phy_syn_gclk", };
384 static const char *clcd_synth_parents[] = {
"vco1div4_clk",
"pll2_clk", };
385 static const char *clcd_pixel_parents[] = {
"pll5_clk",
"clcd_syn_clk", };
386 static const char *i2s_src_parents[] = {
"vco1div2_clk",
"pll2_clk",
"pll3_clk",
387 "i2s_src_pad_clk", };
388 static const char *i2s_ref_parents[] = {
"i2s_src_mclk",
"i2s_prs1_clk", };
389 static const char *spdif_out_parents[] = {
"i2s_src_pad_clk",
"gen_syn2_clk", };
390 static const char *spdif_in_parents[] = {
"pll2_clk",
"gen_syn3_clk", };
392 static const char *gen_synth0_1_parents[] = {
"vco1div4_clk",
"vco3div2_clk",
394 static const char *gen_synth2_3_parents[] = {
"vco1div4_clk",
"vco3div2_clk",
421 CLK_IS_ROOT, 12288000);
592 aux_rtbl,
ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
609 aux_rtbl,
ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
626 aux_rtbl,
ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
732 i2s_sclk_rtbl,
ARRAY_SIZE(i2s_sclk_rtbl), &_lock,