diff options
author | Magnus Damm <damm@opensource.se> | 2010-05-11 01:00:30 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-13 04:33:02 -0400 |
commit | 8bc23d95a0cd639e8766e522e5b9cfd5345bd3e2 (patch) | |
tree | 22808e7d6748d7160ec429264cd30d5ec6211048 /arch/sh/kernel/cpu/sh4a/clock-sh7786.c | |
parent | eb85dcaa3e386eb5f1b9b48f707088538a789d58 (diff) |
sh: sh7786 mstp32 index rework
This patch adds sh7786 MSTP enums for mstp_clks[] index.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7786.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7786.c | 94 |
1 files changed, 51 insertions, 43 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c index c4a84bb2f3d..57c13ba358c 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c | |||
@@ -87,39 +87,47 @@ struct clk div4_clks[DIV4_NR] = { | |||
87 | #define MSTPCR0 0xffc40030 | 87 | #define MSTPCR0 0xffc40030 |
88 | #define MSTPCR1 0xffc40034 | 88 | #define MSTPCR1 0xffc40034 |
89 | 89 | ||
90 | static struct clk mstp_clks[] = { | 90 | enum { MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, |
91 | MSTP023, MSTP022, MSTP021, MSTP020, MSTP017, MSTP016, | ||
92 | MSTP015, MSTP014, MSTP011, MSTP010, MSTP009, MSTP008, | ||
93 | MSTP005, MSTP004, MSTP002, | ||
94 | MSTP112, MSTP110, MSTP109, MSTP108, | ||
95 | MSTP105, MSTP104, MSTP103, MSTP102, | ||
96 | MSTP_NR }; | ||
97 | |||
98 | static struct clk mstp_clks[MSTP_NR] = { | ||
91 | /* MSTPCR0 */ | 99 | /* MSTPCR0 */ |
92 | SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), | 100 | [MSTP029] = SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), |
93 | SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), | 101 | [MSTP028] = SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), |
94 | SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), | 102 | [MSTP027] = SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), |
95 | SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), | 103 | [MSTP026] = SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), |
96 | SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), | 104 | [MSTP025] = SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), |
97 | SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), | 105 | [MSTP024] = SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), |
98 | SH_CLK_MSTP32("ssi_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 23, 0), | 106 | [MSTP023] = SH_CLK_MSTP32("ssi_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 23, 0), |
99 | SH_CLK_MSTP32("ssi_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 22, 0), | 107 | [MSTP022] = SH_CLK_MSTP32("ssi_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 22, 0), |
100 | SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), | 108 | [MSTP021] = SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), |
101 | SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0), | 109 | [MSTP020] = SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0), |
102 | SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0), | 110 | [MSTP017] = SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0), |
103 | SH_CLK_MSTP32("hac_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 16, 0), | 111 | [MSTP016] = SH_CLK_MSTP32("hac_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 16, 0), |
104 | SH_CLK_MSTP32("i2c_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 15, 0), | 112 | [MSTP015] = SH_CLK_MSTP32("i2c_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 15, 0), |
105 | SH_CLK_MSTP32("i2c_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 14, 0), | 113 | [MSTP014] = SH_CLK_MSTP32("i2c_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 14, 0), |
106 | SH_CLK_MSTP32("tmu9_11_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 11, 0), | 114 | [MSTP011] = SH_CLK_MSTP32("tmu9_11_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 11, 0), |
107 | SH_CLK_MSTP32("tmu678_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 10, 0), | 115 | [MSTP010] = SH_CLK_MSTP32("tmu678_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 10, 0), |
108 | SH_CLK_MSTP32("tmu345_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 9, 0), | 116 | [MSTP009] = SH_CLK_MSTP32("tmu345_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 9, 0), |
109 | SH_CLK_MSTP32("tmu012_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 8, 0), | 117 | [MSTP008] = SH_CLK_MSTP32("tmu012_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 8, 0), |
110 | SH_CLK_MSTP32("sdif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 5, 0), | 118 | [MSTP005] = SH_CLK_MSTP32("sdif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 5, 0), |
111 | SH_CLK_MSTP32("sdif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 4, 0), | 119 | [MSTP004] = SH_CLK_MSTP32("sdif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 4, 0), |
112 | SH_CLK_MSTP32("hspi_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 2, 0), | 120 | [MSTP002] = SH_CLK_MSTP32("hspi_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 2, 0), |
113 | 121 | ||
114 | /* MSTPCR1 */ | 122 | /* MSTPCR1 */ |
115 | SH_CLK_MSTP32("usb_fck", -1, NULL, MSTPCR1, 12, 0), | 123 | [MSTP112] = SH_CLK_MSTP32("usb_fck", -1, NULL, MSTPCR1, 12, 0), |
116 | SH_CLK_MSTP32("pcie_fck", 2, NULL, MSTPCR1, 10, 0), | 124 | [MSTP110] = SH_CLK_MSTP32("pcie_fck", 2, NULL, MSTPCR1, 10, 0), |
117 | SH_CLK_MSTP32("pcie_fck", 1, NULL, MSTPCR1, 9, 0), | 125 | [MSTP109] = SH_CLK_MSTP32("pcie_fck", 1, NULL, MSTPCR1, 9, 0), |
118 | SH_CLK_MSTP32("pcie_fck", 0, NULL, MSTPCR1, 8, 0), | 126 | [MSTP108] = SH_CLK_MSTP32("pcie_fck", 0, NULL, MSTPCR1, 8, 0), |
119 | SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), | 127 | [MSTP105] = SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), |
120 | SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), | 128 | [MSTP104] = SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), |
121 | SH_CLK_MSTP32("du_fck", -1, NULL, MSTPCR1, 3, 0), | 129 | [MSTP103] = SH_CLK_MSTP32("du_fck", -1, NULL, MSTPCR1, 3, 0), |
122 | SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0), | 130 | [MSTP102] = SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0), |
123 | }; | 131 | }; |
124 | 132 | ||
125 | static struct clk_lookup lookups[] = { | 133 | static struct clk_lookup lookups[] = { |
@@ -127,62 +135,62 @@ static struct clk_lookup lookups[] = { | |||
127 | /* TMU0 */ | 135 | /* TMU0 */ |
128 | .dev_id = "sh_tmu.0", | 136 | .dev_id = "sh_tmu.0", |
129 | .con_id = "tmu_fck", | 137 | .con_id = "tmu_fck", |
130 | .clk = &mstp_clks[17], /* tmu012_fck */ | 138 | .clk = &mstp_clks[MSTP008], |
131 | }, { | 139 | }, { |
132 | /* TMU1 */ | 140 | /* TMU1 */ |
133 | .dev_id = "sh_tmu.1", | 141 | .dev_id = "sh_tmu.1", |
134 | .con_id = "tmu_fck", | 142 | .con_id = "tmu_fck", |
135 | .clk = &mstp_clks[17], | 143 | .clk = &mstp_clks[MSTP008], |
136 | }, { | 144 | }, { |
137 | /* TMU2 */ | 145 | /* TMU2 */ |
138 | .dev_id = "sh_tmu.2", | 146 | .dev_id = "sh_tmu.2", |
139 | .con_id = "tmu_fck", | 147 | .con_id = "tmu_fck", |
140 | .clk = &mstp_clks[17], | 148 | .clk = &mstp_clks[MSTP008], |
141 | }, { | 149 | }, { |
142 | /* TMU3 */ | 150 | /* TMU3 */ |
143 | .dev_id = "sh_tmu.3", | 151 | .dev_id = "sh_tmu.3", |
144 | .con_id = "tmu_fck", | 152 | .con_id = "tmu_fck", |
145 | .clk = &mstp_clks[16], /* tmu345_fck */ | 153 | .clk = &mstp_clks[MSTP009], |
146 | }, { | 154 | }, { |
147 | /* TMU4 */ | 155 | /* TMU4 */ |
148 | .dev_id = "sh_tmu.4", | 156 | .dev_id = "sh_tmu.4", |
149 | .con_id = "tmu_fck", | 157 | .con_id = "tmu_fck", |
150 | .clk = &mstp_clks[16], | 158 | .clk = &mstp_clks[MSTP009], |
151 | }, { | 159 | }, { |
152 | /* TMU5 */ | 160 | /* TMU5 */ |
153 | .dev_id = "sh_tmu.5", | 161 | .dev_id = "sh_tmu.5", |
154 | .con_id = "tmu_fck", | 162 | .con_id = "tmu_fck", |
155 | .clk = &mstp_clks[16], | 163 | .clk = &mstp_clks[MSTP009], |
156 | }, { | 164 | }, { |
157 | /* TMU6 */ | 165 | /* TMU6 */ |
158 | .dev_id = "sh_tmu.6", | 166 | .dev_id = "sh_tmu.6", |
159 | .con_id = "tmu_fck", | 167 | .con_id = "tmu_fck", |
160 | .clk = &mstp_clks[15], /* tmu678_fck */ | 168 | .clk = &mstp_clks[MSTP010], |
161 | }, { | 169 | }, { |
162 | /* TMU7 */ | 170 | /* TMU7 */ |
163 | .dev_id = "sh_tmu.7", | 171 | .dev_id = "sh_tmu.7", |
164 | .con_id = "tmu_fck", | 172 | .con_id = "tmu_fck", |
165 | .clk = &mstp_clks[15], | 173 | .clk = &mstp_clks[MSTP010], |
166 | }, { | 174 | }, { |
167 | /* TMU8 */ | 175 | /* TMU8 */ |
168 | .dev_id = "sh_tmu.8", | 176 | .dev_id = "sh_tmu.8", |
169 | .con_id = "tmu_fck", | 177 | .con_id = "tmu_fck", |
170 | .clk = &mstp_clks[15], | 178 | .clk = &mstp_clks[MSTP010], |
171 | }, { | 179 | }, { |
172 | /* TMU9 */ | 180 | /* TMU9 */ |
173 | .dev_id = "sh_tmu.9", | 181 | .dev_id = "sh_tmu.9", |
174 | .con_id = "tmu_fck", | 182 | .con_id = "tmu_fck", |
175 | .clk = &mstp_clks[14], /* tmu9_11_fck */ | 183 | .clk = &mstp_clks[MSTP011], |
176 | }, { | 184 | }, { |
177 | /* TMU10 */ | 185 | /* TMU10 */ |
178 | .dev_id = "sh_tmu.10", | 186 | .dev_id = "sh_tmu.10", |
179 | .con_id = "tmu_fck", | 187 | .con_id = "tmu_fck", |
180 | .clk = &mstp_clks[14], | 188 | .clk = &mstp_clks[MSTP011], |
181 | }, { | 189 | }, { |
182 | /* TMU11 */ | 190 | /* TMU11 */ |
183 | .dev_id = "sh_tmu.11", | 191 | .dev_id = "sh_tmu.11", |
184 | .con_id = "tmu_fck", | 192 | .con_id = "tmu_fck", |
185 | .clk = &mstp_clks[14], | 193 | .clk = &mstp_clks[MSTP011], |
186 | } | 194 | } |
187 | }; | 195 | }; |
188 | 196 | ||
@@ -199,7 +207,7 @@ int __init arch_clk_init(void) | |||
199 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), | 207 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), |
200 | &div4_table); | 208 | &div4_table); |
201 | if (!ret) | 209 | if (!ret) |
202 | ret = sh_clk_mstp32_register(mstp_clks, ARRAY_SIZE(mstp_clks)); | 210 | ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); |
203 | 211 | ||
204 | return ret; | 212 | return ret; |
205 | } | 213 | } |