12 #include <linux/module.h>
13 #include <linux/kernel.h>
19 #include <mach/addr-map.h>
24 #define APBC_TWSI0 0x4
25 #define APBC_TWSI1 0x8
26 #define APBC_TWSI2 0xc
27 #define APBC_TWSI3 0x10
28 #define APBC_TWSI4 0x7c
29 #define APBC_TWSI5 0x80
31 #define APBC_UART0 0x2c
32 #define APBC_UART1 0x30
33 #define APBC_UART2 0x34
34 #define APBC_UART3 0x88
35 #define APBC_GPIO 0x38
36 #define APBC_PWM0 0x3c
37 #define APBC_PWM1 0x40
38 #define APBC_PWM2 0x44
39 #define APBC_PWM3 0x48
40 #define APBC_SSP0 0x50
41 #define APBC_SSP1 0x54
42 #define APBC_SSP2 0x58
43 #define APBC_SSP3 0x5c
44 #define APMU_SDH0 0x54
45 #define APMU_SDH1 0x58
46 #define APMU_SDH2 0xe8
47 #define APMU_SDH3 0xec
49 #define APMU_DISP0 0x4c
50 #define APMU_DISP1 0x110
51 #define APMU_CCIC0 0x50
52 #define APMU_CCIC1 0xf4
53 #define MPMU_UART_PLL 0x14
66 {.num = 14634, .den = 2165},
67 {.num = 3521, .den = 689},
68 {.num = 9679, .den = 5728},
69 {.num = 15850, .den = 9451},
72 static const char *uart_parent[] = {
"uart_pll",
"vctcxo"};
73 static const char *ssp_parent[] = {
"vctcxo_4",
"vctcxo_2",
"vctcxo",
"pll1_16"};
74 static const char *sdh_parent[] = {
"pll1_4",
"pll2",
"usb_pll",
"pll1"};
75 static const char *disp_parent[] = {
"pll1",
"pll1_16",
"pll2",
"vctcxo"};
76 static const char *ccic_parent[] = {
"pll1_2",
"pll1_16",
"vctcxo"};
87 if (mpmu_base ==
NULL) {
88 pr_err(
"error to ioremap MPMU base\n");
93 if (apmu_base ==
NULL) {
94 pr_err(
"error to ioremap APMU base\n");
99 if (apbc_base ==
NULL) {
100 pr_err(
"error to ioremap APBC base\n");
124 CLK_SET_RATE_PARENT, 1, 2);
128 CLK_SET_RATE_PARENT, 1, 2);
132 CLK_SET_RATE_PARENT, 1, 2);
136 CLK_SET_RATE_PARENT, 1, 2);
140 CLK_SET_RATE_PARENT, 1, 5);
144 CLK_SET_RATE_PARENT, 1, 3);
148 CLK_SET_RATE_PARENT, 1, 2);
152 CLK_SET_RATE_PARENT, 1, 2);
156 CLK_SET_RATE_PARENT, 1, 2);
160 CLK_SET_RATE_PARENT, 1, 2);
164 CLK_SET_RATE_PARENT, 1, 2);
168 CLK_SET_RATE_PARENT, 1, 2);
172 CLK_SET_RATE_PARENT, 1, 3);
176 CLK_SET_RATE_PARENT, 1, 2);
180 CLK_SET_RATE_PARENT, 1, 2);
184 CLK_SET_RATE_PARENT, 1, 2);
188 CLK_SET_RATE_PARENT, 1, 2);
193 &uart_factor_masks, uart_factor_tbl,
223 apbc_base +
APBC_GPIO, 10, 0, &clk_lock);
227 apbc_base +
APBC_KPC, 10, 0, &clk_lock);
231 apbc_base +
APBC_RTC, 10, 0, &clk_lock);
235 apbc_base +
APBC_PWM0, 10, 0, &clk_lock);
239 apbc_base +
APBC_PWM1, 10, 0, &clk_lock);
243 apbc_base +
APBC_PWM2, 10, 0, &clk_lock);
247 apbc_base +
APBC_PWM3, 10, 0, &clk_lock);
292 apbc_base +
APBC_SSP0, 4, 3, 0, &clk_lock);
296 apbc_base +
APBC_SSP0, 10, 0, &clk_lock);
301 apbc_base +
APBC_SSP1, 4, 3, 0, &clk_lock);
305 apbc_base +
APBC_SSP1, 10, 0, &clk_lock);
310 apbc_base +
APBC_SSP2, 4, 3, 0, &clk_lock);
314 apbc_base +
APBC_SSP2, 10, 0, &clk_lock);
319 apbc_base +
APBC_SSP3, 4, 3, 0, &clk_lock);
323 apbc_base +
APBC_SSP3, 10, 0, &clk_lock);
328 apmu_base +
APMU_SDH0, 8, 2, 0, &clk_lock);
332 CLK_SET_RATE_PARENT, apmu_base +
APMU_SDH0,
333 10, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
363 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
385 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
403 17, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
416 10, 5, 0, &clk_lock);
430 16, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
443 10, 5, 0, &clk_lock);