diff options
author | Ryan Mallon <ryan@bluewatersys.com> | 2009-02-25 16:22:38 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-27 15:57:48 -0500 |
commit | 1c8daabe1dafc30fcc1d929e620269ffe99b6f8a (patch) | |
tree | 3071003264d125385b658bc2826770a7ac6c941f /arch/arm/mach-ep93xx/clock.c | |
parent | c633c3cfcf41efe720020553aa3d4782fa0b9bd5 (diff) |
[ARM] 5413/1: Add ep93xx dma m2p clocks
Add the clocks for ep93xx m2p dma engine.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ep93xx/clock.c')
-rw-r--r-- | arch/arm/mach-ep93xx/clock.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 96049283a10a..e8ebeaea6c48 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -41,6 +41,56 @@ static struct clk clk_usb_host = { | |||
41 | .enable_mask = EP93XX_SYSCON_CLOCK_USH_EN, | 41 | .enable_mask = EP93XX_SYSCON_CLOCK_USH_EN, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | /* DMA Clocks */ | ||
45 | static struct clk clk_m2p0 = { | ||
46 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
47 | .enable_mask = 0x00020000, | ||
48 | }; | ||
49 | static struct clk clk_m2p1 = { | ||
50 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
51 | .enable_mask = 0x00010000, | ||
52 | }; | ||
53 | static struct clk clk_m2p2 = { | ||
54 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
55 | .enable_mask = 0x00080000, | ||
56 | }; | ||
57 | static struct clk clk_m2p3 = { | ||
58 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
59 | .enable_mask = 0x00040000, | ||
60 | }; | ||
61 | static struct clk clk_m2p4 = { | ||
62 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
63 | .enable_mask = 0x00200000, | ||
64 | }; | ||
65 | static struct clk clk_m2p5 = { | ||
66 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
67 | .enable_mask = 0x00100000, | ||
68 | }; | ||
69 | static struct clk clk_m2p6 = { | ||
70 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
71 | .enable_mask = 0x00800000, | ||
72 | }; | ||
73 | static struct clk clk_m2p7 = { | ||
74 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
75 | .enable_mask = 0x00400000, | ||
76 | }; | ||
77 | static struct clk clk_m2p8 = { | ||
78 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
79 | .enable_mask = 0x02000000, | ||
80 | }; | ||
81 | static struct clk clk_m2p9 = { | ||
82 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
83 | .enable_mask = 0x01000000, | ||
84 | }; | ||
85 | static struct clk clk_m2m0 = { | ||
86 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
87 | .enable_mask = 0x04000000, | ||
88 | }; | ||
89 | static struct clk clk_m2m1 = { | ||
90 | .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL, | ||
91 | .enable_mask = 0x08000000, | ||
92 | }; | ||
93 | |||
44 | #define INIT_CK(dev,con,ck) \ | 94 | #define INIT_CK(dev,con,ck) \ |
45 | { .dev_id = dev, .con_id = con, .clk = ck } | 95 | { .dev_id = dev, .con_id = con, .clk = ck } |
46 | 96 | ||
@@ -54,6 +104,18 @@ static struct clk_lookup clocks[] = { | |||
54 | INIT_CK(NULL, "pclk", &clk_p), | 104 | INIT_CK(NULL, "pclk", &clk_p), |
55 | INIT_CK(NULL, "pll2", &clk_pll2), | 105 | INIT_CK(NULL, "pll2", &clk_pll2), |
56 | INIT_CK(NULL, "usb_host", &clk_usb_host), | 106 | INIT_CK(NULL, "usb_host", &clk_usb_host), |
107 | INIT_CK(NULL, "m2p0", &clk_m2p0), | ||
108 | INIT_CK(NULL, "m2p1", &clk_m2p1), | ||
109 | INIT_CK(NULL, "m2p2", &clk_m2p2), | ||
110 | INIT_CK(NULL, "m2p3", &clk_m2p3), | ||
111 | INIT_CK(NULL, "m2p4", &clk_m2p4), | ||
112 | INIT_CK(NULL, "m2p5", &clk_m2p5), | ||
113 | INIT_CK(NULL, "m2p6", &clk_m2p6), | ||
114 | INIT_CK(NULL, "m2p7", &clk_m2p7), | ||
115 | INIT_CK(NULL, "m2p8", &clk_m2p8), | ||
116 | INIT_CK(NULL, "m2p9", &clk_m2p9), | ||
117 | INIT_CK(NULL, "m2m0", &clk_m2m0), | ||
118 | INIT_CK(NULL, "m2m1", &clk_m2m1), | ||
57 | }; | 119 | }; |
58 | 120 | ||
59 | 121 | ||
@@ -110,6 +172,22 @@ static unsigned long calc_pll_rate(u32 config_word) | |||
110 | return (unsigned long)rate; | 172 | return (unsigned long)rate; |
111 | } | 173 | } |
112 | 174 | ||
175 | static void __init ep93xx_dma_clock_init(void) | ||
176 | { | ||
177 | clk_m2p0.rate = clk_h.rate; | ||
178 | clk_m2p1.rate = clk_h.rate; | ||
179 | clk_m2p2.rate = clk_h.rate; | ||
180 | clk_m2p3.rate = clk_h.rate; | ||
181 | clk_m2p4.rate = clk_h.rate; | ||
182 | clk_m2p5.rate = clk_h.rate; | ||
183 | clk_m2p6.rate = clk_h.rate; | ||
184 | clk_m2p7.rate = clk_h.rate; | ||
185 | clk_m2p8.rate = clk_h.rate; | ||
186 | clk_m2p9.rate = clk_h.rate; | ||
187 | clk_m2m0.rate = clk_h.rate; | ||
188 | clk_m2m1.rate = clk_h.rate; | ||
189 | } | ||
190 | |||
113 | static int __init ep93xx_clock_init(void) | 191 | static int __init ep93xx_clock_init(void) |
114 | { | 192 | { |
115 | u32 value; | 193 | u32 value; |
@@ -124,6 +202,7 @@ static int __init ep93xx_clock_init(void) | |||
124 | clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; | 202 | clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; |
125 | clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; | 203 | clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; |
126 | clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; | 204 | clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; |
205 | ep93xx_dma_clock_init(); | ||
127 | 206 | ||
128 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2); | 207 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2); |
129 | if (!(value & 0x00080000)) { /* PLL2 bypassed? */ | 208 | if (!(value & 0x00080000)) { /* PLL2 bypassed? */ |