18 #include <mach/misc_regs.h>
23 #define PLL1_CTR (MISC_BASE + 0x008)
24 #define PLL1_FRQ (MISC_BASE + 0x00C)
25 #define PLL2_CTR (MISC_BASE + 0x014)
26 #define PLL2_FRQ (MISC_BASE + 0x018)
27 #define PLL_CLK_CFG (MISC_BASE + 0x020)
29 #define MCTR_CLK_SHIFT 28
30 #define MCTR_CLK_MASK 3
32 #define CORE_CLK_CFG (MISC_BASE + 0x024)
34 #define GEN_SYNTH2_3_CLK_SHIFT 18
35 #define GEN_SYNTH2_3_CLK_MASK 1
37 #define HCLK_RATIO_SHIFT 10
38 #define HCLK_RATIO_MASK 2
39 #define PCLK_RATIO_SHIFT 8
40 #define PCLK_RATIO_MASK 2
42 #define PERIP_CLK_CFG (MISC_BASE + 0x028)
44 #define UART_CLK_SHIFT 4
45 #define UART_CLK_MASK 1
46 #define FIRDA_CLK_SHIFT 5
47 #define FIRDA_CLK_MASK 2
48 #define GPT0_CLK_SHIFT 8
49 #define GPT1_CLK_SHIFT 11
50 #define GPT2_CLK_SHIFT 12
51 #define GPT_CLK_MASK 1
53 #define PERIP1_CLK_ENB (MISC_BASE + 0x02C)
55 #define UART_CLK_ENB 3
58 #define JPEG_CLK_ENB 8
59 #define FIRDA_CLK_ENB 10
60 #define GPT1_CLK_ENB 11
61 #define GPT2_CLK_ENB 12
62 #define ADC_CLK_ENB 15
63 #define RTC_CLK_ENB 17
64 #define GPIO_CLK_ENB 18
65 #define DMA_CLK_ENB 19
66 #define SMI_CLK_ENB 21
67 #define GMAC_CLK_ENB 23
68 #define USBD_CLK_ENB 24
69 #define USBH_CLK_ENB 25
72 #define RAS_CLK_ENB (MISC_BASE + 0x034)
73 #define RAS_AHB_CLK_ENB 0
74 #define RAS_PLL1_CLK_ENB 1
75 #define RAS_APB_CLK_ENB 2
76 #define RAS_32K_CLK_ENB 3
77 #define RAS_24M_CLK_ENB 4
78 #define RAS_48M_CLK_ENB 5
79 #define RAS_PLL2_CLK_ENB 7
80 #define RAS_SYNT0_CLK_ENB 8
81 #define RAS_SYNT1_CLK_ENB 9
82 #define RAS_SYNT2_CLK_ENB 10
83 #define RAS_SYNT3_CLK_ENB 11
85 #define PRSC0_CLK_CFG (MISC_BASE + 0x044)
86 #define PRSC1_CLK_CFG (MISC_BASE + 0x048)
87 #define PRSC2_CLK_CFG (MISC_BASE + 0x04C)
88 #define AMEM_CLK_CFG (MISC_BASE + 0x050)
89 #define AMEM_CLK_ENB 0
91 #define CLCD_CLK_SYNT (MISC_BASE + 0x05C)
92 #define FIRDA_CLK_SYNT (MISC_BASE + 0x060)
93 #define UART_CLK_SYNT (MISC_BASE + 0x064)
94 #define GMAC_CLK_SYNT (MISC_BASE + 0x068)
95 #define GEN0_CLK_SYNT (MISC_BASE + 0x06C)
96 #define GEN1_CLK_SYNT (MISC_BASE + 0x070)
97 #define GEN2_CLK_SYNT (MISC_BASE + 0x074)
98 #define GEN3_CLK_SYNT (MISC_BASE + 0x078)
102 {.mode = 0, .m = 0x53, .n = 0x0C, .p = 0x1},
103 {.mode = 0, .m = 0x85, .n = 0x0C, .p = 0x1},
104 {.mode = 0, .m = 0xA6, .n = 0x0C, .p = 0x1},
110 {.xscale = 2, .yscale = 27, .eq = 0},
111 {.xscale = 2, .yscale = 8, .eq = 0},
112 {.xscale = 2, .yscale = 4, .eq = 0},
113 {.xscale = 1, .yscale = 2, .eq = 1},
119 {.mscale = 4, .nscale = 0},
120 {.mscale = 2, .nscale = 0},
121 {.mscale = 1, .nscale = 0},
125 static const char *uart0_parents[] = {
"pll3_clk",
"uart_syn_gclk", };
126 static const char *firda_parents[] = {
"pll3_clk",
"firda_syn_gclk",
128 static const char *gpt0_parents[] = {
"pll3_clk",
"gpt0_syn_clk", };
129 static const char *gpt1_parents[] = {
"pll3_clk",
"gpt1_syn_clk", };
130 static const char *gpt2_parents[] = {
"pll3_clk",
"gpt2_syn_clk", };
131 static const char *gen2_3_parents[] = {
"pll1_clk",
"pll2_clk", };
132 static const char *ddr_parents[] = {
"ahb_clk",
"ahbmult2_clk",
"none",
135 #ifdef CONFIG_MACH_SPEAR300
136 static void __init spear300_clk_init(
void)
163 #ifdef CONFIG_MACH_SPEAR310
164 static void __init spear310_clk_init(
void)
203 #ifdef CONFIG_MACH_SPEAR320
204 #define SMII_PCLK_SHIFT 18
205 #define SMII_PCLK_MASK 2
206 #define SMII_PCLK_VAL_PAD 0x0
207 #define SMII_PCLK_VAL_PLL2 0x1
208 #define SMII_PCLK_VAL_SYNTH0 0x2
209 #define SDHCI_PCLK_SHIFT 15
210 #define SDHCI_PCLK_MASK 1
211 #define SDHCI_PCLK_VAL_48M 0x0
212 #define SDHCI_PCLK_VAL_SYNTH3 0x1
213 #define I2S_REF_PCLK_SHIFT 8
214 #define I2S_REF_PCLK_MASK 1
215 #define I2S_REF_PCLK_SYNTH_VAL 0x1
216 #define I2S_REF_PCLK_PLL2_VAL 0x0
217 #define UART1_PCLK_SHIFT 6
218 #define UART1_PCLK_MASK 1
219 #define SPEAR320_UARTX_PCLK_VAL_SYNTH1 0x0
220 #define SPEAR320_UARTX_PCLK_VAL_APB 0x1
222 static const char *i2s_ref_parents[] = {
"ras_pll2_clk",
"ras_syn2_gclk", };
223 static const char *sdhci_parents[] = {
"ras_pll3_clk",
"ras_syn3_gclk", };
224 static const char *smii0_parents[] = {
"smii_125m_pad",
"ras_pll2_clk",
226 static const char *uartx_parents[] = {
"ras_syn1_gclk",
"ras_apb_clk", };
228 static void __init spear320_clk_init(
void)
233 CLK_IS_ROOT, 125000000);
278 I2S_REF_PCLK_SHIFT, I2S_REF_PCLK_MASK, 0, &_lock);
293 SDHCI_PCLK_SHIFT, SDHCI_PCLK_MASK, 0, &_lock);
298 SMII_PCLK_SHIFT, SMII_PCLK_MASK, 0, &_lock);
306 UART1_PCLK_SHIFT, UART1_PCLK_MASK, 0, &_lock);
343 struct clk *clk, *clk1;