aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7724.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 2bbff53fcd87..2d9700c6b53a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -41,8 +41,6 @@
41 41
42/* Fixed 32 KHz root clock for RTC and Power Management purposes */ 42/* Fixed 32 KHz root clock for RTC and Power Management purposes */
43static struct clk r_clk = { 43static struct clk r_clk = {
44 .name = "rclk",
45 .id = -1,
46 .rate = 32768, 44 .rate = 32768,
47}; 45};
48 46
@@ -51,8 +49,6 @@ static struct clk r_clk = {
51 * from the platform code. 49 * from the platform code.
52 */ 50 */
53struct clk extal_clk = { 51struct clk extal_clk = {
54 .name = "extal",
55 .id = -1,
56 .rate = 33333333, 52 .rate = 33333333,
57}; 53};
58 54
@@ -76,8 +72,6 @@ static struct clk_ops fll_clk_ops = {
76}; 72};
77 73
78static struct clk fll_clk = { 74static struct clk fll_clk = {
79 .name = "fll_clk",
80 .id = -1,
81 .ops = &fll_clk_ops, 75 .ops = &fll_clk_ops,
82 .parent = &r_clk, 76 .parent = &r_clk,
83 .flags = CLK_ENABLE_ON_INIT, 77 .flags = CLK_ENABLE_ON_INIT,
@@ -98,8 +92,6 @@ static struct clk_ops pll_clk_ops = {
98}; 92};
99 93
100static struct clk pll_clk = { 94static struct clk pll_clk = {
101 .name = "pll_clk",
102 .id = -1,
103 .ops = &pll_clk_ops, 95 .ops = &pll_clk_ops,
104 .flags = CLK_ENABLE_ON_INIT, 96 .flags = CLK_ENABLE_ON_INIT,
105}; 97};
@@ -115,8 +107,6 @@ static struct clk_ops div3_clk_ops = {
115}; 107};
116 108
117static struct clk div3_clk = { 109static struct clk div3_clk = {
118 .name = "div3_clk",
119 .id = -1,
120 .ops = &div3_clk_ops, 110 .ops = &div3_clk_ops,
121 .parent = &pll_clk, 111 .parent = &pll_clk,
122}; 112};
@@ -153,15 +143,15 @@ static struct clk_div4_table div4_table = {
153 143
154enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR }; 144enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };
155 145
156#define DIV4(_str, _reg, _bit, _mask, _flags) \ 146#define DIV4(_reg, _bit, _mask, _flags) \
157 SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) 147 SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
158 148
159struct clk div4_clks[DIV4_NR] = { 149struct clk div4_clks[DIV4_NR] = {
160 [DIV4_I] = DIV4("cpu_clk", FRQCRA, 20, 0x2f7d, CLK_ENABLE_ON_INIT), 150 [DIV4_I] = DIV4(FRQCRA, 20, 0x2f7d, CLK_ENABLE_ON_INIT),
161 [DIV4_SH] = DIV4("shyway_clk", FRQCRA, 12, 0x2f7c, CLK_ENABLE_ON_INIT), 151 [DIV4_SH] = DIV4(FRQCRA, 12, 0x2f7c, CLK_ENABLE_ON_INIT),
162 [DIV4_B] = DIV4("bus_clk", FRQCRA, 8, 0x2f7c, CLK_ENABLE_ON_INIT), 152 [DIV4_B] = DIV4(FRQCRA, 8, 0x2f7c, CLK_ENABLE_ON_INIT),
163 [DIV4_P] = DIV4("peripheral_clk", FRQCRA, 0, 0x2f7c, 0), 153 [DIV4_P] = DIV4(FRQCRA, 0, 0x2f7c, 0),
164 [DIV4_M1] = DIV4("vpu_clk", FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), 154 [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT),
165}; 155};
166 156
167enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR }; 157enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR };
@@ -234,6 +224,20 @@ static struct clk mstp_clks[HWBLK_NR] = {
234#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } 224#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
235 225
236static struct clk_lookup lookups[] = { 226static struct clk_lookup lookups[] = {
227 /* main clocks */
228 CLKDEV_CON_ID("rclk", &r_clk),
229 CLKDEV_CON_ID("extal", &extal_clk),
230 CLKDEV_CON_ID("fll_clk", &fll_clk),
231 CLKDEV_CON_ID("pll_clk", &pll_clk),
232 CLKDEV_CON_ID("div3_clk", &div3_clk),
233
234 /* DIV4 clocks */
235 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
236 CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]),
237 CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]),
238 CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
239 CLKDEV_CON_ID("vpu_clk", &div4_clks[DIV4_M1]),
240
237 /* DIV6 clocks */ 241 /* DIV6 clocks */
238 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), 242 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]),
239 CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), 243 CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]),