aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-04-23 07:15:15 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-05-11 06:35:27 -0400
commit1399c195ef5009bf44a41649da4718f6e67c0bff (patch)
treee3110135db8be1c1057b03520c3c42f734a77be8
parent356af68bf483e4564f75a35287a8f5f39d31041f (diff)
sh: Switch to new style TMU device
The TMU (Timer Unit) driver implements a new style of platform data that handles the timer as a single device with multiple channel. Switch from the old-style platform data to the new-style platform data. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/sh/kernel/cpu/clock-cpg.c5
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh770x.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7720.c78
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh4-202.c78
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c138
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c78
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7734.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c16
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c78
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7366.c78
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c78
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c155
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7734.c235
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c48
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c230
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c299
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-shx3.c150
-rw-r--r--arch/sh/kernel/cpu/sh5/setup-sh5.c79
30 files changed, 239 insertions, 2486 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
index 8de314b8e5df..121ef690763f 100644
--- a/arch/sh/kernel/cpu/clock-cpg.c
+++ b/arch/sh/kernel/cpu/clock-cpg.c
@@ -56,7 +56,10 @@ int __init __deprecated cpg_clk_init(void)
56 56
57 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 57 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
58 58
59 clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); 59 clk_add_alias("fck", "sh-tmu-sh3.0", "peripheral_clk", NULL);
60 clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL);
61 clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL);
62 clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL);
60 clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); 63 clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
61 clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL); 64 clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
62 clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL); 65 clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index c76b2543b85f..6a72fd14de21 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -143,25 +143,18 @@ static struct platform_device rtc_device = {
143}; 143};
144 144
145static struct sh_timer_config tmu0_platform_data = { 145static struct sh_timer_config tmu0_platform_data = {
146 .channel_offset = 0x02, 146 .channels_mask = 7,
147 .timer_bit = 0,
148 .clockevent_rating = 200,
149}; 147};
150 148
151static struct resource tmu0_resources[] = { 149static struct resource tmu0_resources[] = {
152 [0] = { 150 DEFINE_RES_MEM(0xfffffe90, 0x2c),
153 .start = 0xfffffe94, 151 DEFINE_RES_IRQ(evt2irq(0x400)),
154 .end = 0xfffffe9f, 152 DEFINE_RES_IRQ(evt2irq(0x420)),
155 .flags = IORESOURCE_MEM, 153 DEFINE_RES_IRQ(evt2irq(0x440)),
156 },
157 [1] = {
158 .start = evt2irq(0x400),
159 .flags = IORESOURCE_IRQ,
160 },
161}; 154};
162 155
163static struct platform_device tmu0_device = { 156static struct platform_device tmu0_device = {
164 .name = "sh_tmu", 157 .name = "sh-tmu-sh3",
165 .id = 0, 158 .id = 0,
166 .dev = { 159 .dev = {
167 .platform_data = &tmu0_platform_data, 160 .platform_data = &tmu0_platform_data,
@@ -170,67 +163,10 @@ static struct platform_device tmu0_device = {
170 .num_resources = ARRAY_SIZE(tmu0_resources), 163 .num_resources = ARRAY_SIZE(tmu0_resources),
171}; 164};
172 165
173static struct sh_timer_config tmu1_platform_data = {
174 .channel_offset = 0xe,
175 .timer_bit = 1,
176 .clocksource_rating = 200,
177};
178
179static struct resource tmu1_resources[] = {
180 [0] = {
181 .start = 0xfffffea0,
182 .end = 0xfffffeab,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = evt2irq(0x420),
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device tmu1_device = {
192 .name = "sh_tmu",
193 .id = 1,
194 .dev = {
195 .platform_data = &tmu1_platform_data,
196 },
197 .resource = tmu1_resources,
198 .num_resources = ARRAY_SIZE(tmu1_resources),
199};
200
201static struct sh_timer_config tmu2_platform_data = {
202 .channel_offset = 0x1a,
203 .timer_bit = 2,
204};
205
206static struct resource tmu2_resources[] = {
207 [0] = {
208 .start = 0xfffffeac,
209 .end = 0xfffffebb,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = evt2irq(0x440),
214 .flags = IORESOURCE_IRQ,
215 },
216};
217
218static struct platform_device tmu2_device = {
219 .name = "sh_tmu",
220 .id = 2,
221 .dev = {
222 .platform_data = &tmu2_platform_data,
223 },
224 .resource = tmu2_resources,
225 .num_resources = ARRAY_SIZE(tmu2_resources),
226};
227
228static struct platform_device *sh7705_devices[] __initdata = { 166static struct platform_device *sh7705_devices[] __initdata = {
229 &scif0_device, 167 &scif0_device,
230 &scif1_device, 168 &scif1_device,
231 &tmu0_device, 169 &tmu0_device,
232 &tmu1_device,
233 &tmu2_device,
234 &rtc_device, 170 &rtc_device,
235}; 171};
236 172
@@ -245,8 +181,6 @@ static struct platform_device *sh7705_early_devices[] __initdata = {
245 &scif0_device, 181 &scif0_device,
246 &scif1_device, 182 &scif1_device,
247 &tmu0_device, 183 &tmu0_device,
248 &tmu1_device,
249 &tmu2_device,
250}; 184};
251 185
252void __init plat_early_device_setup(void) 186void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index ff1465c0519c..9139d14b9c53 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -185,25 +185,18 @@ static struct platform_device scif2_device = {
185#endif 185#endif
186 186
187static struct sh_timer_config tmu0_platform_data = { 187static struct sh_timer_config tmu0_platform_data = {
188 .channel_offset = 0x02, 188 .channels_mask = 7,
189 .timer_bit = 0,
190 .clockevent_rating = 200,
191}; 189};
192 190
193static struct resource tmu0_resources[] = { 191static struct resource tmu0_resources[] = {
194 [0] = { 192 DEFINE_RES_MEM(0xfffffe90, 0x2c),
195 .start = 0xfffffe94, 193 DEFINE_RES_IRQ(evt2irq(0x400)),
196 .end = 0xfffffe9f, 194 DEFINE_RES_IRQ(evt2irq(0x420)),
197 .flags = IORESOURCE_MEM, 195 DEFINE_RES_IRQ(evt2irq(0x440)),
198 },
199 [1] = {
200 .start = evt2irq(0x400),
201 .flags = IORESOURCE_IRQ,
202 },
203}; 196};
204 197
205static struct platform_device tmu0_device = { 198static struct platform_device tmu0_device = {
206 .name = "sh_tmu", 199 .name = "sh-tmu-sh3",
207 .id = 0, 200 .id = 0,
208 .dev = { 201 .dev = {
209 .platform_data = &tmu0_platform_data, 202 .platform_data = &tmu0_platform_data,
@@ -212,61 +205,6 @@ static struct platform_device tmu0_device = {
212 .num_resources = ARRAY_SIZE(tmu0_resources), 205 .num_resources = ARRAY_SIZE(tmu0_resources),
213}; 206};
214 207
215static struct sh_timer_config tmu1_platform_data = {
216 .channel_offset = 0xe,
217 .timer_bit = 1,
218 .clocksource_rating = 200,
219};
220
221static struct resource tmu1_resources[] = {
222 [0] = {
223 .start = 0xfffffea0,
224 .end = 0xfffffeab,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x420),
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu1_device = {
234 .name = "sh_tmu",
235 .id = 1,
236 .dev = {
237 .platform_data = &tmu1_platform_data,
238 },
239 .resource = tmu1_resources,
240 .num_resources = ARRAY_SIZE(tmu1_resources),
241};
242
243static struct sh_timer_config tmu2_platform_data = {
244 .channel_offset = 0x1a,
245 .timer_bit = 2,
246};
247
248static struct resource tmu2_resources[] = {
249 [0] = {
250 .start = 0xfffffeac,
251 .end = 0xfffffebb,
252 .flags = IORESOURCE_MEM,
253 },
254 [1] = {
255 .start = evt2irq(0x440),
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device tmu2_device = {
261 .name = "sh_tmu",
262 .id = 2,
263 .dev = {
264 .platform_data = &tmu2_platform_data,
265 },
266 .resource = tmu2_resources,
267 .num_resources = ARRAY_SIZE(tmu2_resources),
268};
269
270static struct platform_device *sh770x_devices[] __initdata = { 208static struct platform_device *sh770x_devices[] __initdata = {
271 &scif0_device, 209 &scif0_device,
272#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 210#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
@@ -279,8 +217,6 @@ static struct platform_device *sh770x_devices[] __initdata = {
279 &scif2_device, 217 &scif2_device,
280#endif 218#endif
281 &tmu0_device, 219 &tmu0_device,
282 &tmu1_device,
283 &tmu2_device,
284 &rtc_device, 220 &rtc_device,
285}; 221};
286 222
@@ -303,8 +239,6 @@ static struct platform_device *sh770x_early_devices[] __initdata = {
303 &scif2_device, 239 &scif2_device,
304#endif 240#endif
305 &tmu0_device, 241 &tmu0_device,
306 &tmu1_device,
307 &tmu2_device,
308}; 242};
309 243
310void __init plat_early_device_setup(void) 244void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index e2ce9360ed5a..e9ed300dba5c 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -142,25 +142,18 @@ static struct platform_device scif1_device = {
142}; 142};
143 143
144static struct sh_timer_config tmu0_platform_data = { 144static struct sh_timer_config tmu0_platform_data = {
145 .channel_offset = 0x02, 145 .channels_mask = 7,
146 .timer_bit = 0,
147 .clockevent_rating = 200,
148}; 146};
149 147
150static struct resource tmu0_resources[] = { 148static struct resource tmu0_resources[] = {
151 [0] = { 149 DEFINE_RES_MEM(0xa412fe90, 0x28),
152 .start = 0xa412fe94, 150 DEFINE_RES_IRQ(evt2irq(0x400)),
153 .end = 0xa412fe9f, 151 DEFINE_RES_IRQ(evt2irq(0x420)),
154 .flags = IORESOURCE_MEM, 152 DEFINE_RES_IRQ(evt2irq(0x440)),
155 },
156 [1] = {
157 .start = evt2irq(0x400),
158 .flags = IORESOURCE_IRQ,
159 },
160}; 153};
161 154
162static struct platform_device tmu0_device = { 155static struct platform_device tmu0_device = {
163 .name = "sh_tmu", 156 .name = "sh-tmu-sh3",
164 .id = 0, 157 .id = 0,
165 .dev = { 158 .dev = {
166 .platform_data = &tmu0_platform_data, 159 .platform_data = &tmu0_platform_data,
@@ -169,67 +162,10 @@ static struct platform_device tmu0_device = {
169 .num_resources = ARRAY_SIZE(tmu0_resources), 162 .num_resources = ARRAY_SIZE(tmu0_resources),
170}; 163};
171 164
172static struct sh_timer_config tmu1_platform_data = {
173 .channel_offset = 0xe,
174 .timer_bit = 1,
175 .clocksource_rating = 200,
176};
177
178static struct resource tmu1_resources[] = {
179 [0] = {
180 .start = 0xa412fea0,
181 .end = 0xa412feab,
182 .flags = IORESOURCE_MEM,
183 },
184 [1] = {
185 .start = evt2irq(0x420),
186 .flags = IORESOURCE_IRQ,
187 },
188};
189
190static struct platform_device tmu1_device = {
191 .name = "sh_tmu",
192 .id = 1,
193 .dev = {
194 .platform_data = &tmu1_platform_data,
195 },
196 .resource = tmu1_resources,
197 .num_resources = ARRAY_SIZE(tmu1_resources),
198};
199
200static struct sh_timer_config tmu2_platform_data = {
201 .channel_offset = 0x1a,
202 .timer_bit = 2,
203};
204
205static struct resource tmu2_resources[] = {
206 [0] = {
207 .start = 0xa412feac,
208 .end = 0xa412feb5,
209 .flags = IORESOURCE_MEM,
210 },
211 [1] = {
212 .start = evt2irq(0x440),
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217static struct platform_device tmu2_device = {
218 .name = "sh_tmu",
219 .id = 2,
220 .dev = {
221 .platform_data = &tmu2_platform_data,
222 },
223 .resource = tmu2_resources,
224 .num_resources = ARRAY_SIZE(tmu2_resources),
225};
226
227static struct platform_device *sh7710_devices[] __initdata = { 165static struct platform_device *sh7710_devices[] __initdata = {
228 &scif0_device, 166 &scif0_device,
229 &scif1_device, 167 &scif1_device,
230 &tmu0_device, 168 &tmu0_device,
231 &tmu1_device,
232 &tmu2_device,
233 &rtc_device, 169 &rtc_device,
234}; 170};
235 171
@@ -244,8 +180,6 @@ static struct platform_device *sh7710_early_devices[] __initdata = {
244 &scif0_device, 180 &scif0_device,
245 &scif1_device, 181 &scif1_device,
246 &tmu0_device, 182 &tmu0_device,
247 &tmu1_device,
248 &tmu2_device,
249}; 183};
250 184
251void __init plat_early_device_setup(void) 185void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index a53d21925b94..84df85a5b800 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -172,25 +172,18 @@ static struct platform_device cmt_device = {
172}; 172};
173 173
174static struct sh_timer_config tmu0_platform_data = { 174static struct sh_timer_config tmu0_platform_data = {
175 .channel_offset = 0x02, 175 .channels_mask = 7,
176 .timer_bit = 0,
177 .clockevent_rating = 200,
178}; 176};
179 177
180static struct resource tmu0_resources[] = { 178static struct resource tmu0_resources[] = {
181 [0] = { 179 DEFINE_RES_MEM(0xa412fe90, 0x28),
182 .start = 0xa412fe94, 180 DEFINE_RES_IRQ(evt2irq(0x400)),
183 .end = 0xa412fe9f, 181 DEFINE_RES_IRQ(evt2irq(0x420)),
184 .flags = IORESOURCE_MEM, 182 DEFINE_RES_IRQ(evt2irq(0x440)),
185 },
186 [1] = {
187 .start = evt2irq(0x400),
188 .flags = IORESOURCE_IRQ,
189 },
190}; 183};
191 184
192static struct platform_device tmu0_device = { 185static struct platform_device tmu0_device = {
193 .name = "sh_tmu", 186 .name = "sh-tmu-sh3",
194 .id = 0, 187 .id = 0,
195 .dev = { 188 .dev = {
196 .platform_data = &tmu0_platform_data, 189 .platform_data = &tmu0_platform_data,
@@ -199,68 +192,11 @@ static struct platform_device tmu0_device = {
199 .num_resources = ARRAY_SIZE(tmu0_resources), 192 .num_resources = ARRAY_SIZE(tmu0_resources),
200}; 193};
201 194
202static struct sh_timer_config tmu1_platform_data = {
203 .channel_offset = 0xe,
204 .timer_bit = 1,
205 .clocksource_rating = 200,
206};
207
208static struct resource tmu1_resources[] = {
209 [0] = {
210 .start = 0xa412fea0,
211 .end = 0xa412feab,
212 .flags = IORESOURCE_MEM,
213 },
214 [1] = {
215 .start = evt2irq(0x420),
216 .flags = IORESOURCE_IRQ,
217 },
218};
219
220static struct platform_device tmu1_device = {
221 .name = "sh_tmu",
222 .id = 1,
223 .dev = {
224 .platform_data = &tmu1_platform_data,
225 },
226 .resource = tmu1_resources,
227 .num_resources = ARRAY_SIZE(tmu1_resources),
228};
229
230static struct sh_timer_config tmu2_platform_data = {
231 .channel_offset = 0x1a,
232 .timer_bit = 2,
233};
234
235static struct resource tmu2_resources[] = {
236 [0] = {
237 .start = 0xa412feac,
238 .end = 0xa412feb5,
239 .flags = IORESOURCE_MEM,
240 },
241 [1] = {
242 .start = evt2irq(0x440),
243 .flags = IORESOURCE_IRQ,
244 },
245};
246
247static struct platform_device tmu2_device = {
248 .name = "sh_tmu",
249 .id = 2,
250 .dev = {
251 .platform_data = &tmu2_platform_data,
252 },
253 .resource = tmu2_resources,
254 .num_resources = ARRAY_SIZE(tmu2_resources),
255};
256
257static struct platform_device *sh7720_devices[] __initdata = { 195static struct platform_device *sh7720_devices[] __initdata = {
258 &scif0_device, 196 &scif0_device,
259 &scif1_device, 197 &scif1_device,
260 &cmt_device, 198 &cmt_device,
261 &tmu0_device, 199 &tmu0_device,
262 &tmu1_device,
263 &tmu2_device,
264 &rtc_device, 200 &rtc_device,
265 &usb_ohci_device, 201 &usb_ohci_device,
266 &usbf_device, 202 &usbf_device,
@@ -278,8 +214,6 @@ static struct platform_device *sh7720_early_devices[] __initdata = {
278 &scif1_device, 214 &scif1_device,
279 &cmt_device, 215 &cmt_device,
280 &tmu0_device, 216 &tmu0_device,
281 &tmu1_device,
282 &tmu2_device,
283}; 217};
284 218
285void __init plat_early_device_setup(void) 219void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index a8bd778d5ac8..e7a7b3cdf68d 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -41,25 +41,18 @@ static struct platform_device scif0_device = {
41}; 41};
42 42
43static struct sh_timer_config tmu0_platform_data = { 43static struct sh_timer_config tmu0_platform_data = {
44 .channel_offset = 0x04, 44 .channels_mask = 7,
45 .timer_bit = 0,
46 .clockevent_rating = 200,
47}; 45};
48 46
49static struct resource tmu0_resources[] = { 47static struct resource tmu0_resources[] = {
50 [0] = { 48 DEFINE_RES_MEM(0xffd80000, 0x30),
51 .start = 0xffd80008, 49 DEFINE_RES_IRQ(evt2irq(0x400)),
52 .end = 0xffd80013, 50 DEFINE_RES_IRQ(evt2irq(0x420)),
53 .flags = IORESOURCE_MEM, 51 DEFINE_RES_IRQ(evt2irq(0x440)),
54 },
55 [1] = {
56 .start = evt2irq(0x400),
57 .flags = IORESOURCE_IRQ,
58 },
59}; 52};
60 53
61static struct platform_device tmu0_device = { 54static struct platform_device tmu0_device = {
62 .name = "sh_tmu", 55 .name = "sh-tmu",
63 .id = 0, 56 .id = 0,
64 .dev = { 57 .dev = {
65 .platform_data = &tmu0_platform_data, 58 .platform_data = &tmu0_platform_data,
@@ -68,66 +61,9 @@ static struct platform_device tmu0_device = {
68 .num_resources = ARRAY_SIZE(tmu0_resources), 61 .num_resources = ARRAY_SIZE(tmu0_resources),
69}; 62};
70 63
71static struct sh_timer_config tmu1_platform_data = {
72 .channel_offset = 0x10,
73 .timer_bit = 1,
74 .clocksource_rating = 200,
75};
76
77static struct resource tmu1_resources[] = {
78 [0] = {
79 .start = 0xffd80014,
80 .end = 0xffd8001f,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = evt2irq(0x420),
85 .flags = IORESOURCE_IRQ,
86 },
87};
88
89static struct platform_device tmu1_device = {
90 .name = "sh_tmu",
91 .id = 1,
92 .dev = {
93 .platform_data = &tmu1_platform_data,
94 },
95 .resource = tmu1_resources,
96 .num_resources = ARRAY_SIZE(tmu1_resources),
97};
98
99static struct sh_timer_config tmu2_platform_data = {
100 .channel_offset = 0x1c,
101 .timer_bit = 2,
102};
103
104static struct resource tmu2_resources[] = {
105 [0] = {
106 .start = 0xffd80020,
107 .end = 0xffd8002f,
108 .flags = IORESOURCE_MEM,
109 },
110 [1] = {
111 .start = evt2irq(0x440),
112 .flags = IORESOURCE_IRQ,
113 },
114};
115
116static struct platform_device tmu2_device = {
117 .name = "sh_tmu",
118 .id = 2,
119 .dev = {
120 .platform_data = &tmu2_platform_data,
121 },
122 .resource = tmu2_resources,
123 .num_resources = ARRAY_SIZE(tmu2_resources),
124};
125
126static struct platform_device *sh4202_devices[] __initdata = { 64static struct platform_device *sh4202_devices[] __initdata = {
127 &scif0_device, 65 &scif0_device,
128 &tmu0_device, 66 &tmu0_device,
129 &tmu1_device,
130 &tmu2_device,
131}; 67};
132 68
133static int __init sh4202_devices_setup(void) 69static int __init sh4202_devices_setup(void)
@@ -140,8 +76,6 @@ arch_initcall(sh4202_devices_setup);
140static struct platform_device *sh4202_early_devices[] __initdata = { 76static struct platform_device *sh4202_early_devices[] __initdata = {
141 &scif0_device, 77 &scif0_device,
142 &tmu0_device, 78 &tmu0_device,
143 &tmu1_device,
144 &tmu2_device,
145}; 79};
146 80
147void __init plat_early_device_setup(void) 81void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index a447a248491f..5f08c59b9f3e 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -82,25 +82,18 @@ static struct platform_device scif_device = {
82}; 82};
83 83
84static struct sh_timer_config tmu0_platform_data = { 84static struct sh_timer_config tmu0_platform_data = {
85 .channel_offset = 0x04, 85 .channels_mask = 7,
86 .timer_bit = 0,
87 .clockevent_rating = 200,
88}; 86};
89 87
90static struct resource tmu0_resources[] = { 88static struct resource tmu0_resources[] = {
91 [0] = { 89 DEFINE_RES_MEM(0xffd80000, 0x30),
92 .start = 0xffd80008, 90 DEFINE_RES_IRQ(evt2irq(0x400)),
93 .end = 0xffd80013, 91 DEFINE_RES_IRQ(evt2irq(0x420)),
94 .flags = IORESOURCE_MEM, 92 DEFINE_RES_IRQ(evt2irq(0x440)),
95 },
96 [1] = {
97 .start = evt2irq(0x400),
98 .flags = IORESOURCE_IRQ,
99 },
100}; 93};
101 94
102static struct platform_device tmu0_device = { 95static struct platform_device tmu0_device = {
103 .name = "sh_tmu", 96 .name = "sh-tmu",
104 .id = 0, 97 .id = 0,
105 .dev = { 98 .dev = {
106 .platform_data = &tmu0_platform_data, 99 .platform_data = &tmu0_platform_data,
@@ -109,26 +102,23 @@ static struct platform_device tmu0_device = {
109 .num_resources = ARRAY_SIZE(tmu0_resources), 102 .num_resources = ARRAY_SIZE(tmu0_resources),
110}; 103};
111 104
105/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
106#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
107 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
108 defined(CONFIG_CPU_SUBTYPE_SH7751R)
109
112static struct sh_timer_config tmu1_platform_data = { 110static struct sh_timer_config tmu1_platform_data = {
113 .channel_offset = 0x10, 111 .channels_mask = 3,
114 .timer_bit = 1,
115 .clocksource_rating = 200,
116}; 112};
117 113
118static struct resource tmu1_resources[] = { 114static struct resource tmu1_resources[] = {
119 [0] = { 115 DEFINE_RES_MEM(0xfe100000, 0x20),
120 .start = 0xffd80014, 116 DEFINE_RES_IRQ(evt2irq(0xb00)),
121 .end = 0xffd8001f, 117 DEFINE_RES_IRQ(evt2irq(0xb80)),
122 .flags = IORESOURCE_MEM,
123 },
124 [1] = {
125 .start = evt2irq(0x420),
126 .flags = IORESOURCE_IRQ,
127 },
128}; 118};
129 119
130static struct platform_device tmu1_device = { 120static struct platform_device tmu1_device = {
131 .name = "sh_tmu", 121 .name = "sh-tmu",
132 .id = 1, 122 .id = 1,
133 .dev = { 123 .dev = {
134 .platform_data = &tmu1_platform_data, 124 .platform_data = &tmu1_platform_data,
@@ -137,104 +127,15 @@ static struct platform_device tmu1_device = {
137 .num_resources = ARRAY_SIZE(tmu1_resources), 127 .num_resources = ARRAY_SIZE(tmu1_resources),
138}; 128};
139 129
140static struct sh_timer_config tmu2_platform_data = {
141 .channel_offset = 0x1c,
142 .timer_bit = 2,
143};
144
145static struct resource tmu2_resources[] = {
146 [0] = {
147 .start = 0xffd80020,
148 .end = 0xffd8002f,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = evt2irq(0x440),
153 .flags = IORESOURCE_IRQ,
154 },
155};
156
157static struct platform_device tmu2_device = {
158 .name = "sh_tmu",
159 .id = 2,
160 .dev = {
161 .platform_data = &tmu2_platform_data,
162 },
163 .resource = tmu2_resources,
164 .num_resources = ARRAY_SIZE(tmu2_resources),
165};
166
167/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
168#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
169 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
170 defined(CONFIG_CPU_SUBTYPE_SH7751R)
171
172static struct sh_timer_config tmu3_platform_data = {
173 .channel_offset = 0x04,
174 .timer_bit = 0,
175};
176
177static struct resource tmu3_resources[] = {
178 [0] = {
179 .start = 0xfe100008,
180 .end = 0xfe100013,
181 .flags = IORESOURCE_MEM,
182 },
183 [1] = {
184 .start = evt2irq(0xb00),
185 .flags = IORESOURCE_IRQ,
186 },
187};
188
189static struct platform_device tmu3_device = {
190 .name = "sh_tmu",
191 .id = 3,
192 .dev = {
193 .platform_data = &tmu3_platform_data,
194 },
195 .resource = tmu3_resources,
196 .num_resources = ARRAY_SIZE(tmu3_resources),
197};
198
199static struct sh_timer_config tmu4_platform_data = {
200 .channel_offset = 0x10,
201 .timer_bit = 1,
202};
203
204static struct resource tmu4_resources[] = {
205 [0] = {
206 .start = 0xfe100014,
207 .end = 0xfe10001f,
208 .flags = IORESOURCE_MEM,
209 },
210 [1] = {
211 .start = evt2irq(0xb80),
212 .flags = IORESOURCE_IRQ,
213 },
214};
215
216static struct platform_device tmu4_device = {
217 .name = "sh_tmu",
218 .id = 4,
219 .dev = {
220 .platform_data = &tmu4_platform_data,
221 },
222 .resource = tmu4_resources,
223 .num_resources = ARRAY_SIZE(tmu4_resources),
224};
225
226#endif 130#endif
227 131
228static struct platform_device *sh7750_devices[] __initdata = { 132static struct platform_device *sh7750_devices[] __initdata = {
229 &rtc_device, 133 &rtc_device,
230 &tmu0_device, 134 &tmu0_device,
231 &tmu1_device,
232 &tmu2_device,
233#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 135#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
234 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 136 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
235 defined(CONFIG_CPU_SUBTYPE_SH7751R) 137 defined(CONFIG_CPU_SUBTYPE_SH7751R)
236 &tmu3_device, 138 &tmu1_device,
237 &tmu4_device,
238#endif 139#endif
239}; 140};
240 141
@@ -254,13 +155,10 @@ arch_initcall(sh7750_devices_setup);
254 155
255static struct platform_device *sh7750_early_devices[] __initdata = { 156static struct platform_device *sh7750_early_devices[] __initdata = {
256 &tmu0_device, 157 &tmu0_device,
257 &tmu1_device,
258 &tmu2_device,
259#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 158#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
260 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 159 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
261 defined(CONFIG_CPU_SUBTYPE_SH7751R) 160 defined(CONFIG_CPU_SUBTYPE_SH7751R)
262 &tmu3_device, 161 &tmu1_device,
263 &tmu4_device,
264#endif 162#endif
265}; 163};
266 164
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 1abd9fb4a386..973b736b3b98 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -227,25 +227,18 @@ static struct platform_device scif3_device = {
227}; 227};
228 228
229static struct sh_timer_config tmu0_platform_data = { 229static struct sh_timer_config tmu0_platform_data = {
230 .channel_offset = 0x04, 230 .channels_mask = 7,
231 .timer_bit = 0,
232 .clockevent_rating = 200,
233}; 231};
234 232
235static struct resource tmu0_resources[] = { 233static struct resource tmu0_resources[] = {
236 [0] = { 234 DEFINE_RES_MEM(0xffd80000, 0x30),
237 .start = 0xffd80008, 235 DEFINE_RES_IRQ(evt2irq(0x400)),
238 .end = 0xffd80013, 236 DEFINE_RES_IRQ(evt2irq(0x420)),
239 .flags = IORESOURCE_MEM, 237 DEFINE_RES_IRQ(evt2irq(0x440)),
240 },
241 [1] = {
242 .start = evt2irq(0x400),
243 .flags = IORESOURCE_IRQ,
244 },
245}; 238};
246 239
247static struct platform_device tmu0_device = { 240static struct platform_device tmu0_device = {
248 .name = "sh_tmu", 241 .name = "sh-tmu",
249 .id = 0, 242 .id = 0,
250 .dev = { 243 .dev = {
251 .platform_data = &tmu0_platform_data, 244 .platform_data = &tmu0_platform_data,
@@ -254,61 +247,6 @@ static struct platform_device tmu0_device = {
254 .num_resources = ARRAY_SIZE(tmu0_resources), 247 .num_resources = ARRAY_SIZE(tmu0_resources),
255}; 248};
256 249
257static struct sh_timer_config tmu1_platform_data = {
258 .channel_offset = 0x10,
259 .timer_bit = 1,
260 .clocksource_rating = 200,
261};
262
263static struct resource tmu1_resources[] = {
264 [0] = {
265 .start = 0xffd80014,
266 .end = 0xffd8001f,
267 .flags = IORESOURCE_MEM,
268 },
269 [1] = {
270 .start = evt2irq(0x420),
271 .flags = IORESOURCE_IRQ,
272 },
273};
274
275static struct platform_device tmu1_device = {
276 .name = "sh_tmu",
277 .id = 1,
278 .dev = {
279 .platform_data = &tmu1_platform_data,
280 },
281 .resource = tmu1_resources,
282 .num_resources = ARRAY_SIZE(tmu1_resources),
283};
284
285static struct sh_timer_config tmu2_platform_data = {
286 .channel_offset = 0x1c,
287 .timer_bit = 2,
288};
289
290static struct resource tmu2_resources[] = {
291 [0] = {
292 .start = 0xffd80020,
293 .end = 0xffd8002f,
294 .flags = IORESOURCE_MEM,
295 },
296 [1] = {
297 .start = evt2irq(0x440),
298 .flags = IORESOURCE_IRQ,
299 },
300};
301
302static struct platform_device tmu2_device = {
303 .name = "sh_tmu",
304 .id = 2,
305 .dev = {
306 .platform_data = &tmu2_platform_data,
307 },
308 .resource = tmu2_resources,
309 .num_resources = ARRAY_SIZE(tmu2_resources),
310};
311
312 250
313static struct platform_device *sh7760_devices[] __initdata = { 251static struct platform_device *sh7760_devices[] __initdata = {
314 &scif0_device, 252 &scif0_device,
@@ -316,8 +254,6 @@ static struct platform_device *sh7760_devices[] __initdata = {
316 &scif2_device, 254 &scif2_device,
317 &scif3_device, 255 &scif3_device,
318 &tmu0_device, 256 &tmu0_device,
319 &tmu1_device,
320 &tmu2_device,
321}; 257};
322 258
323static int __init sh7760_devices_setup(void) 259static int __init sh7760_devices_setup(void)
@@ -333,8 +269,6 @@ static struct platform_device *sh7760_early_devices[] __initdata = {
333 &scif2_device, 269 &scif2_device,
334 &scif3_device, 270 &scif3_device,
335 &tmu0_device, 271 &tmu0_device,
336 &tmu1_device,
337 &tmu2_device,
338}; 272};
339 273
340void __init plat_early_device_setup(void) 274void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 40974934512a..8f07a1a38692 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -203,9 +203,7 @@ static struct clk_lookup lookups[] = {
203 CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]), 203 CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),
204 CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]), 204 CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]),
205 205
206 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU]), 206 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU]),
207 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]),
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
209 207
210 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]), 208 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
211 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 209 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index da64734b0fd3..ccbcab550df2 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -264,12 +264,8 @@ static struct clk_lookup lookups[] = {
264 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]), 264 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
265 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), 265 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
266 266
267 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), 267 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
268 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), 268 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
269 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
270 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
271 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
272 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
273 269
274 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 270 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
275 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 271 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index f917f1926507..f579dd528198 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -304,17 +304,13 @@ static struct clk_lookup lookups[] = {
304 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), 304 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
305 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 305 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
306 306
307 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), 307 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
308 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), 308 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
309 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
310 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
311 309
312 CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]), 310 CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]),
313 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 311 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
314 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), 312 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
315 313
316 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
317 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
318 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 314 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
319 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 315 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
320 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), 316 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index ed9501519ab3..1fdf1ee672de 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -201,15 +201,9 @@ static struct clk_lookup lookups[] = {
201 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]), 201 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]),
202 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]), 202 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]),
203 CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]), 203 CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]),
204 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP016]), 204 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
205 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP016]), 205 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
206 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP016]), 206 CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP014]),
207 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP015]),
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP015]),
209 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP015]),
210 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP014]),
211 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP014]),
212 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP014]),
213 CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]), 207 CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]),
214 CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]), 208 CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]),
215 CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]), 209 CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 5c0e3c335161..9a28fdb36387 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -123,8 +123,8 @@ static struct clk_lookup lookups[] = {
123 CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]), 123 CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
124 CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]), 124 CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
125 125
126 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]), 126 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP113]),
127 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]), 127 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP114]),
128 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]), 128 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
129 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]), 129 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
130 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]), 130 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 1c83788db76a..17d0ea55a5a2 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -146,12 +146,8 @@ static struct clk_lookup lookups[] = {
146 CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]), 146 CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]),
147 CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]), 147 CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]),
148 148
149 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 149 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
150 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 150 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
151 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
152 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
153 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
154 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
155 151
156 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]), 152 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),
157 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), 153 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index 8bba6f159023..bec2a83f1ba5 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -155,18 +155,10 @@ static struct clk_lookup lookups[] = {
155 CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]), 155 CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]),
156 CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]), 156 CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]),
157 157
158 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 158 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
159 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 159 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
160 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]), 160 CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP010]),
161 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]), 161 CLKDEV_ICK_ID("fck", "sh-tmu.3", &mstp_clks[MSTP011]),
162 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
163 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
164 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP010]),
165 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP010]),
166 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP010]),
167 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.9", &mstp_clks[MSTP011]),
168 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.10", &mstp_clks[MSTP011]),
169 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.11", &mstp_clks[MSTP011]),
170 162
171 CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]), 163 CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]),
172 CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]), 164 CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index a9422dab0ce7..9a49a44f6f94 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -124,12 +124,8 @@ static struct clk_lookup lookups[] = {
124 CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]), 124 CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),
125 CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]), 125 CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]),
126 126
127 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 127 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
128 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 128 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
129 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
130 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
131 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
132 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
133 129
134 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), 130 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
135 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), 131 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index ad96492f290d..ceb3dedad983 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -247,25 +247,18 @@ static struct platform_device cmt_device = {
247}; 247};
248 248
249static struct sh_timer_config tmu0_platform_data = { 249static struct sh_timer_config tmu0_platform_data = {
250 .channel_offset = 0x04, 250 .channels_mask = 7,
251 .timer_bit = 0,
252 .clockevent_rating = 200,
253}; 251};
254 252
255static struct resource tmu0_resources[] = { 253static struct resource tmu0_resources[] = {
256 [0] = { 254 DEFINE_RES_MEM(0xffd80000, 0x2c),
257 .start = 0xffd80008, 255 DEFINE_RES_IRQ(evt2irq(0x400)),
258 .end = 0xffd80013, 256 DEFINE_RES_IRQ(evt2irq(0x420)),
259 .flags = IORESOURCE_MEM, 257 DEFINE_RES_IRQ(evt2irq(0x440)),
260 },
261 [1] = {
262 .start = evt2irq(0x400),
263 .flags = IORESOURCE_IRQ,
264 },
265}; 258};
266 259
267static struct platform_device tmu0_device = { 260static struct platform_device tmu0_device = {
268 .name = "sh_tmu", 261 .name = "sh-tmu",
269 .id = 0, 262 .id = 0,
270 .dev = { 263 .dev = {
271 .platform_data = &tmu0_platform_data, 264 .platform_data = &tmu0_platform_data,
@@ -274,61 +267,6 @@ static struct platform_device tmu0_device = {
274 .num_resources = ARRAY_SIZE(tmu0_resources), 267 .num_resources = ARRAY_SIZE(tmu0_resources),
275}; 268};
276 269
277static struct sh_timer_config tmu1_platform_data = {
278 .channel_offset = 0x10,
279 .timer_bit = 1,
280 .clocksource_rating = 200,
281};
282
283static struct resource tmu1_resources[] = {
284 [0] = {
285 .start = 0xffd80014,
286 .end = 0xffd8001f,
287 .flags = IORESOURCE_MEM,
288 },
289 [1] = {
290 .start = evt2irq(0x420),
291 .flags = IORESOURCE_IRQ,
292 },
293};
294
295static struct platform_device tmu1_device = {
296 .name = "sh_tmu",
297 .id = 1,
298 .dev = {
299 .platform_data = &tmu1_platform_data,
300 },
301 .resource = tmu1_resources,
302 .num_resources = ARRAY_SIZE(tmu1_resources),
303};
304
305static struct sh_timer_config tmu2_platform_data = {
306 .channel_offset = 0x1c,
307 .timer_bit = 2,
308};
309
310static struct resource tmu2_resources[] = {
311 [0] = {
312 .start = 0xffd80020,
313 .end = 0xffd8002b,
314 .flags = IORESOURCE_MEM,
315 },
316 [1] = {
317 .start = evt2irq(0x440),
318 .flags = IORESOURCE_IRQ,
319 },
320};
321
322static struct platform_device tmu2_device = {
323 .name = "sh_tmu",
324 .id = 2,
325 .dev = {
326 .platform_data = &tmu2_platform_data,
327 },
328 .resource = tmu2_resources,
329 .num_resources = ARRAY_SIZE(tmu2_resources),
330};
331
332static struct platform_device *sh7343_devices[] __initdata = { 270static struct platform_device *sh7343_devices[] __initdata = {
333 &scif0_device, 271 &scif0_device,
334 &scif1_device, 272 &scif1_device,
@@ -336,8 +274,6 @@ static struct platform_device *sh7343_devices[] __initdata = {
336 &scif3_device, 274 &scif3_device,
337 &cmt_device, 275 &cmt_device,
338 &tmu0_device, 276 &tmu0_device,
339 &tmu1_device,
340 &tmu2_device,
341 &iic0_device, 277 &iic0_device,
342 &iic1_device, 278 &iic1_device,
343 &vpu_device, 279 &vpu_device,
@@ -363,8 +299,6 @@ static struct platform_device *sh7343_early_devices[] __initdata = {
363 &scif3_device, 299 &scif3_device,
364 &cmt_device, 300 &cmt_device,
365 &tmu0_device, 301 &tmu0_device,
366 &tmu1_device,
367 &tmu2_device,
368}; 302};
369 303
370void __init plat_early_device_setup(void) 304void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 4e4985d95e53..f75f67343139 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -195,25 +195,18 @@ static struct platform_device cmt_device = {
195}; 195};
196 196
197static struct sh_timer_config tmu0_platform_data = { 197static struct sh_timer_config tmu0_platform_data = {
198 .channel_offset = 0x04, 198 .channels_mask = 7,
199 .timer_bit = 0,
200 .clockevent_rating = 200,
201}; 199};
202 200
203static struct resource tmu0_resources[] = { 201static struct resource tmu0_resources[] = {
204 [0] = { 202 DEFINE_RES_MEM(0xffd80000, 0x2c),
205 .start = 0xffd80008, 203 DEFINE_RES_IRQ(evt2irq(0x400)),
206 .end = 0xffd80013, 204 DEFINE_RES_IRQ(evt2irq(0x420)),
207 .flags = IORESOURCE_MEM, 205 DEFINE_RES_IRQ(evt2irq(0x440)),
208 },
209 [1] = {
210 .start = 16,
211 .flags = IORESOURCE_IRQ,
212 },
213}; 206};
214 207
215static struct platform_device tmu0_device = { 208static struct platform_device tmu0_device = {
216 .name = "sh_tmu", 209 .name = "sh-tmu",
217 .id = 0, 210 .id = 0,
218 .dev = { 211 .dev = {
219 .platform_data = &tmu0_platform_data, 212 .platform_data = &tmu0_platform_data,
@@ -222,67 +215,10 @@ static struct platform_device tmu0_device = {
222 .num_resources = ARRAY_SIZE(tmu0_resources), 215 .num_resources = ARRAY_SIZE(tmu0_resources),
223}; 216};
224 217
225static struct sh_timer_config tmu1_platform_data = {
226 .channel_offset = 0x10,
227 .timer_bit = 1,
228 .clocksource_rating = 200,
229};
230
231static struct resource tmu1_resources[] = {
232 [0] = {
233 .start = 0xffd80014,
234 .end = 0xffd8001f,
235 .flags = IORESOURCE_MEM,
236 },
237 [1] = {
238 .start = evt2irq(0x420),
239 .flags = IORESOURCE_IRQ,
240 },
241};
242
243static struct platform_device tmu1_device = {
244 .name = "sh_tmu",
245 .id = 1,
246 .dev = {
247 .platform_data = &tmu1_platform_data,
248 },
249 .resource = tmu1_resources,
250 .num_resources = ARRAY_SIZE(tmu1_resources),
251};
252
253static struct sh_timer_config tmu2_platform_data = {
254 .channel_offset = 0x1c,
255 .timer_bit = 2,
256};
257
258static struct resource tmu2_resources[] = {
259 [0] = {
260 .start = 0xffd80020,
261 .end = 0xffd8002b,
262 .flags = IORESOURCE_MEM,
263 },
264 [1] = {
265 .start = evt2irq(0x440),
266 .flags = IORESOURCE_IRQ,
267 },
268};
269
270static struct platform_device tmu2_device = {
271 .name = "sh_tmu",
272 .id = 2,
273 .dev = {
274 .platform_data = &tmu2_platform_data,
275 },
276 .resource = tmu2_resources,
277 .num_resources = ARRAY_SIZE(tmu2_resources),
278};
279
280static struct platform_device *sh7366_devices[] __initdata = { 218static struct platform_device *sh7366_devices[] __initdata = {
281 &scif0_device, 219 &scif0_device,
282 &cmt_device, 220 &cmt_device,
283 &tmu0_device, 221 &tmu0_device,
284 &tmu1_device,
285 &tmu2_device,
286 &iic_device, 222 &iic_device,
287 &usb_host_device, 223 &usb_host_device,
288 &vpu_device, 224 &vpu_device,
@@ -305,8 +241,6 @@ static struct platform_device *sh7366_early_devices[] __initdata = {
305 &scif0_device, 241 &scif0_device,
306 &cmt_device, 242 &cmt_device,
307 &tmu0_device, 243 &tmu0_device,
308 &tmu1_device,
309 &tmu2_device,
310}; 244};
311 245
312void __init plat_early_device_setup(void) 246void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 4e3218f288e7..57f83a92a505 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -432,25 +432,18 @@ static struct platform_device cmt_device = {
432}; 432};
433 433
434static struct sh_timer_config tmu0_platform_data = { 434static struct sh_timer_config tmu0_platform_data = {
435 .channel_offset = 0x04, 435 .channels_mask = 7,
436 .timer_bit = 0,
437 .clockevent_rating = 200,
438}; 436};
439 437
440static struct resource tmu0_resources[] = { 438static struct resource tmu0_resources[] = {
441 [0] = { 439 DEFINE_RES_MEM(0xffd80000, 0x2c),
442 .start = 0xffd80008, 440 DEFINE_RES_IRQ(evt2irq(0x400)),
443 .end = 0xffd80013, 441 DEFINE_RES_IRQ(evt2irq(0x420)),
444 .flags = IORESOURCE_MEM, 442 DEFINE_RES_IRQ(evt2irq(0x440)),
445 },
446 [1] = {
447 .start = evt2irq(0x400),
448 .flags = IORESOURCE_IRQ,
449 },
450}; 443};
451 444
452static struct platform_device tmu0_device = { 445static struct platform_device tmu0_device = {
453 .name = "sh_tmu", 446 .name = "sh-tmu",
454 .id = 0, 447 .id = 0,
455 .dev = { 448 .dev = {
456 .platform_data = &tmu0_platform_data, 449 .platform_data = &tmu0_platform_data,
@@ -459,61 +452,6 @@ static struct platform_device tmu0_device = {
459 .num_resources = ARRAY_SIZE(tmu0_resources), 452 .num_resources = ARRAY_SIZE(tmu0_resources),
460}; 453};
461 454
462static struct sh_timer_config tmu1_platform_data = {
463 .channel_offset = 0x10,
464 .timer_bit = 1,
465 .clocksource_rating = 200,
466};
467
468static struct resource tmu1_resources[] = {
469 [0] = {
470 .start = 0xffd80014,
471 .end = 0xffd8001f,
472 .flags = IORESOURCE_MEM,
473 },
474 [1] = {
475 .start = evt2irq(0x420),
476 .flags = IORESOURCE_IRQ,
477 },
478};
479
480static struct platform_device tmu1_device = {
481 .name = "sh_tmu",
482 .id = 1,
483 .dev = {
484 .platform_data = &tmu1_platform_data,
485 },
486 .resource = tmu1_resources,
487 .num_resources = ARRAY_SIZE(tmu1_resources),
488};
489
490static struct sh_timer_config tmu2_platform_data = {
491 .channel_offset = 0x1c,
492 .timer_bit = 2,
493};
494
495static struct resource tmu2_resources[] = {
496 [0] = {
497 .start = 0xffd80020,
498 .end = 0xffd8002b,
499 .flags = IORESOURCE_MEM,
500 },
501 [1] = {
502 .start = 18,
503 .flags = IORESOURCE_IRQ,
504 },
505};
506
507static struct platform_device tmu2_device = {
508 .name = "sh_tmu",
509 .id = 2,
510 .dev = {
511 .platform_data = &tmu2_platform_data,
512 },
513 .resource = tmu2_resources,
514 .num_resources = ARRAY_SIZE(tmu2_resources),
515};
516
517static struct siu_platform siu_platform_data = { 455static struct siu_platform siu_platform_data = {
518 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX, 456 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX,
519 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX, 457 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX,
@@ -549,8 +487,6 @@ static struct platform_device *sh7722_devices[] __initdata = {
549 &scif2_device, 487 &scif2_device,
550 &cmt_device, 488 &cmt_device,
551 &tmu0_device, 489 &tmu0_device,
552 &tmu1_device,
553 &tmu2_device,
554 &rtc_device, 490 &rtc_device,
555 &usbf_device, 491 &usbf_device,
556 &iic_device, 492 &iic_device,
@@ -578,8 +514,6 @@ static struct platform_device *sh7722_early_devices[] __initdata = {
578 &scif2_device, 514 &scif2_device,
579 &cmt_device, 515 &cmt_device,
580 &tmu0_device, 516 &tmu0_device,
581 &tmu1_device,
582 &tmu2_device,
583}; 517};
584 518
585void __init plat_early_device_setup(void) 519void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 5dfdb8501262..3533b56dd465 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -264,25 +264,18 @@ static struct platform_device cmt_device = {
264}; 264};
265 265
266static struct sh_timer_config tmu0_platform_data = { 266static struct sh_timer_config tmu0_platform_data = {
267 .channel_offset = 0x04, 267 .channels_mask = 7,
268 .timer_bit = 0,
269 .clockevent_rating = 200,
270}; 268};
271 269
272static struct resource tmu0_resources[] = { 270static struct resource tmu0_resources[] = {
273 [0] = { 271 DEFINE_RES_MEM(0xffd80000, 0x2c),
274 .start = 0xffd80008, 272 DEFINE_RES_IRQ(evt2irq(0x400)),
275 .end = 0xffd80013, 273 DEFINE_RES_IRQ(evt2irq(0x420)),
276 .flags = IORESOURCE_MEM, 274 DEFINE_RES_IRQ(evt2irq(0x440)),
277 },
278 [1] = {
279 .start = evt2irq(0x400),
280 .flags = IORESOURCE_IRQ,
281 },
282}; 275};
283 276
284static struct platform_device tmu0_device = { 277static struct platform_device tmu0_device = {
285 .name = "sh_tmu", 278 .name = "sh-tmu",
286 .id = 0, 279 .id = 0,
287 .dev = { 280 .dev = {
288 .platform_data = &tmu0_platform_data, 281 .platform_data = &tmu0_platform_data,
@@ -292,25 +285,18 @@ static struct platform_device tmu0_device = {
292}; 285};
293 286
294static struct sh_timer_config tmu1_platform_data = { 287static struct sh_timer_config tmu1_platform_data = {
295 .channel_offset = 0x10, 288 .channels_mask = 7,
296 .timer_bit = 1,
297 .clocksource_rating = 200,
298}; 289};
299 290
300static struct resource tmu1_resources[] = { 291static struct resource tmu1_resources[] = {
301 [0] = { 292 DEFINE_RES_MEM(0xffd90000, 0x2c),
302 .start = 0xffd80014, 293 DEFINE_RES_IRQ(evt2irq(0x920)),
303 .end = 0xffd8001f, 294 DEFINE_RES_IRQ(evt2irq(0x940)),
304 .flags = IORESOURCE_MEM, 295 DEFINE_RES_IRQ(evt2irq(0x960)),
305 },
306 [1] = {
307 .start = evt2irq(0x420),
308 .flags = IORESOURCE_IRQ,
309 },
310}; 296};
311 297
312static struct platform_device tmu1_device = { 298static struct platform_device tmu1_device = {
313 .name = "sh_tmu", 299 .name = "sh-tmu",
314 .id = 1, 300 .id = 1,
315 .dev = { 301 .dev = {
316 .platform_data = &tmu1_platform_data, 302 .platform_data = &tmu1_platform_data,
@@ -319,114 +305,6 @@ static struct platform_device tmu1_device = {
319 .num_resources = ARRAY_SIZE(tmu1_resources), 305 .num_resources = ARRAY_SIZE(tmu1_resources),
320}; 306};
321 307
322static struct sh_timer_config tmu2_platform_data = {
323 .channel_offset = 0x1c,
324 .timer_bit = 2,
325};
326
327static struct resource tmu2_resources[] = {
328 [0] = {
329 .start = 0xffd80020,
330 .end = 0xffd8002b,
331 .flags = IORESOURCE_MEM,
332 },
333 [1] = {
334 .start = evt2irq(0x440),
335 .flags = IORESOURCE_IRQ,
336 },
337};
338
339static struct platform_device tmu2_device = {
340 .name = "sh_tmu",
341 .id = 2,
342 .dev = {
343 .platform_data = &tmu2_platform_data,
344 },
345 .resource = tmu2_resources,
346 .num_resources = ARRAY_SIZE(tmu2_resources),
347};
348
349static struct sh_timer_config tmu3_platform_data = {
350 .channel_offset = 0x04,
351 .timer_bit = 0,
352};
353
354static struct resource tmu3_resources[] = {
355 [0] = {
356 .start = 0xffd90008,
357 .end = 0xffd90013,
358 .flags = IORESOURCE_MEM,
359 },
360 [1] = {
361 .start = evt2irq(0x920),
362 .flags = IORESOURCE_IRQ,
363 },
364};
365
366static struct platform_device tmu3_device = {
367 .name = "sh_tmu",
368 .id = 3,
369 .dev = {
370 .platform_data = &tmu3_platform_data,
371 },
372 .resource = tmu3_resources,
373 .num_resources = ARRAY_SIZE(tmu3_resources),
374};
375
376static struct sh_timer_config tmu4_platform_data = {
377 .channel_offset = 0x10,
378 .timer_bit = 1,
379};
380
381static struct resource tmu4_resources[] = {
382 [0] = {
383 .start = 0xffd90014,
384 .end = 0xffd9001f,
385 .flags = IORESOURCE_MEM,
386 },
387 [1] = {
388 .start = evt2irq(0x940),
389 .flags = IORESOURCE_IRQ,
390 },
391};
392
393static struct platform_device tmu4_device = {
394 .name = "sh_tmu",
395 .id = 4,
396 .dev = {
397 .platform_data = &tmu4_platform_data,
398 },
399 .resource = tmu4_resources,
400 .num_resources = ARRAY_SIZE(tmu4_resources),
401};
402
403static struct sh_timer_config tmu5_platform_data = {
404 .channel_offset = 0x1c,
405 .timer_bit = 2,
406};
407
408static struct resource tmu5_resources[] = {
409 [0] = {
410 .start = 0xffd90020,
411 .end = 0xffd9002b,
412 .flags = IORESOURCE_MEM,
413 },
414 [1] = {
415 .start = evt2irq(0x920),
416 .flags = IORESOURCE_IRQ,
417 },
418};
419
420static struct platform_device tmu5_device = {
421 .name = "sh_tmu",
422 .id = 5,
423 .dev = {
424 .platform_data = &tmu5_platform_data,
425 },
426 .resource = tmu5_resources,
427 .num_resources = ARRAY_SIZE(tmu5_resources),
428};
429
430static struct resource rtc_resources[] = { 308static struct resource rtc_resources[] = {
431 [0] = { 309 [0] = {
432 .start = 0xa465fec0, 310 .start = 0xa465fec0,
@@ -517,10 +395,6 @@ static struct platform_device *sh7723_devices[] __initdata = {
517 &cmt_device, 395 &cmt_device,
518 &tmu0_device, 396 &tmu0_device,
519 &tmu1_device, 397 &tmu1_device,
520 &tmu2_device,
521 &tmu3_device,
522 &tmu4_device,
523 &tmu5_device,
524 &rtc_device, 398 &rtc_device,
525 &iic_device, 399 &iic_device,
526 &sh7723_usb_host_device, 400 &sh7723_usb_host_device,
@@ -550,10 +424,6 @@ static struct platform_device *sh7723_early_devices[] __initdata = {
550 &cmt_device, 424 &cmt_device,
551 &tmu0_device, 425 &tmu0_device,
552 &tmu1_device, 426 &tmu1_device,
553 &tmu2_device,
554 &tmu3_device,
555 &tmu4_device,
556 &tmu5_device,
557}; 427};
558 428
559void __init plat_early_device_setup(void) 429void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index b435f076f292..b9e84b1d3aa7 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -667,25 +667,18 @@ static struct platform_device cmt_device = {
667}; 667};
668 668
669static struct sh_timer_config tmu0_platform_data = { 669static struct sh_timer_config tmu0_platform_data = {
670 .channel_offset = 0x04, 670 .channels_mask = 7,
671 .timer_bit = 0,
672 .clockevent_rating = 200,
673}; 671};
674 672
675static struct resource tmu0_resources[] = { 673static struct resource tmu0_resources[] = {
676 [0] = { 674 DEFINE_RES_MEM(0xffd80000, 0x2c),
677 .start = 0xffd80008, 675 DEFINE_RES_IRQ(evt2irq(0x400)),
678 .end = 0xffd80013, 676 DEFINE_RES_IRQ(evt2irq(0x420)),
679 .flags = IORESOURCE_MEM, 677 DEFINE_RES_IRQ(evt2irq(0x440)),
680 },
681 [1] = {
682 .start = evt2irq(0x400),
683 .flags = IORESOURCE_IRQ,
684 },
685}; 678};
686 679
687static struct platform_device tmu0_device = { 680static struct platform_device tmu0_device = {
688 .name = "sh_tmu", 681 .name = "sh-tmu",
689 .id = 0, 682 .id = 0,
690 .dev = { 683 .dev = {
691 .platform_data = &tmu0_platform_data, 684 .platform_data = &tmu0_platform_data,
@@ -695,25 +688,18 @@ static struct platform_device tmu0_device = {
695}; 688};
696 689
697static struct sh_timer_config tmu1_platform_data = { 690static struct sh_timer_config tmu1_platform_data = {
698 .channel_offset = 0x10, 691 .channels_mask = 7,
699 .timer_bit = 1,
700 .clocksource_rating = 200,
701}; 692};
702 693
703static struct resource tmu1_resources[] = { 694static struct resource tmu1_resources[] = {
704 [0] = { 695 DEFINE_RES_MEM(0xffd90000, 0x2c),
705 .start = 0xffd80014, 696 DEFINE_RES_IRQ(evt2irq(0x920)),
706 .end = 0xffd8001f, 697 DEFINE_RES_IRQ(evt2irq(0x940)),
707 .flags = IORESOURCE_MEM, 698 DEFINE_RES_IRQ(evt2irq(0x960)),
708 },
709 [1] = {
710 .start = evt2irq(0x420),
711 .flags = IORESOURCE_IRQ,
712 },
713}; 699};
714 700
715static struct platform_device tmu1_device = { 701static struct platform_device tmu1_device = {
716 .name = "sh_tmu", 702 .name = "sh-tmu",
717 .id = 1, 703 .id = 1,
718 .dev = { 704 .dev = {
719 .platform_data = &tmu1_platform_data, 705 .platform_data = &tmu1_platform_data,
@@ -722,115 +708,6 @@ static struct platform_device tmu1_device = {
722 .num_resources = ARRAY_SIZE(tmu1_resources), 708 .num_resources = ARRAY_SIZE(tmu1_resources),
723}; 709};
724 710
725static struct sh_timer_config tmu2_platform_data = {
726 .channel_offset = 0x1c,
727 .timer_bit = 2,
728};
729
730static struct resource tmu2_resources[] = {
731 [0] = {
732 .start = 0xffd80020,
733 .end = 0xffd8002b,
734 .flags = IORESOURCE_MEM,
735 },
736 [1] = {
737 .start = evt2irq(0x440),
738 .flags = IORESOURCE_IRQ,
739 },
740};
741
742static struct platform_device tmu2_device = {
743 .name = "sh_tmu",
744 .id = 2,
745 .dev = {
746 .platform_data = &tmu2_platform_data,
747 },
748 .resource = tmu2_resources,
749 .num_resources = ARRAY_SIZE(tmu2_resources),
750};
751
752
753static struct sh_timer_config tmu3_platform_data = {
754 .channel_offset = 0x04,
755 .timer_bit = 0,
756};
757
758static struct resource tmu3_resources[] = {
759 [0] = {
760 .start = 0xffd90008,
761 .end = 0xffd90013,
762 .flags = IORESOURCE_MEM,
763 },
764 [1] = {
765 .start = evt2irq(0x920),
766 .flags = IORESOURCE_IRQ,
767 },
768};
769
770static struct platform_device tmu3_device = {
771 .name = "sh_tmu",
772 .id = 3,
773 .dev = {
774 .platform_data = &tmu3_platform_data,
775 },
776 .resource = tmu3_resources,
777 .num_resources = ARRAY_SIZE(tmu3_resources),
778};
779
780static struct sh_timer_config tmu4_platform_data = {
781 .channel_offset = 0x10,
782 .timer_bit = 1,
783};
784
785static struct resource tmu4_resources[] = {
786 [0] = {
787 .start = 0xffd90014,
788 .end = 0xffd9001f,
789 .flags = IORESOURCE_MEM,
790 },
791 [1] = {
792 .start = evt2irq(0x940),
793 .flags = IORESOURCE_IRQ,
794 },
795};
796
797static struct platform_device tmu4_device = {
798 .name = "sh_tmu",
799 .id = 4,
800 .dev = {
801 .platform_data = &tmu4_platform_data,
802 },
803 .resource = tmu4_resources,
804 .num_resources = ARRAY_SIZE(tmu4_resources),
805};
806
807static struct sh_timer_config tmu5_platform_data = {
808 .channel_offset = 0x1c,
809 .timer_bit = 2,
810};
811
812static struct resource tmu5_resources[] = {
813 [0] = {
814 .start = 0xffd90020,
815 .end = 0xffd9002b,
816 .flags = IORESOURCE_MEM,
817 },
818 [1] = {
819 .start = evt2irq(0x920),
820 .flags = IORESOURCE_IRQ,
821 },
822};
823
824static struct platform_device tmu5_device = {
825 .name = "sh_tmu",
826 .id = 5,
827 .dev = {
828 .platform_data = &tmu5_platform_data,
829 },
830 .resource = tmu5_resources,
831 .num_resources = ARRAY_SIZE(tmu5_resources),
832};
833
834/* JPU */ 711/* JPU */
835static struct uio_info jpu_platform_data = { 712static struct uio_info jpu_platform_data = {
836 .name = "JPU", 713 .name = "JPU",
@@ -928,10 +805,6 @@ static struct platform_device *sh7724_devices[] __initdata = {
928 &cmt_device, 805 &cmt_device,
929 &tmu0_device, 806 &tmu0_device,
930 &tmu1_device, 807 &tmu1_device,
931 &tmu2_device,
932 &tmu3_device,
933 &tmu4_device,
934 &tmu5_device,
935 &dma0_device, 808 &dma0_device,
936 &dma1_device, 809 &dma1_device,
937 &rtc_device, 810 &rtc_device,
@@ -971,10 +844,6 @@ static struct platform_device *sh7724_early_devices[] __initdata = {
971 &cmt_device, 844 &cmt_device,
972 &tmu0_device, 845 &tmu0_device,
973 &tmu1_device, 846 &tmu1_device,
974 &tmu2_device,
975 &tmu3_device,
976 &tmu4_device,
977 &tmu5_device,
978}; 847};
979 848
980void __init plat_early_device_setup(void) 849void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
index dad4ed1b2f94..f617bcb734df 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
@@ -200,25 +200,18 @@ static struct platform_device i2c0_device = {
200 200
201/* TMU */ 201/* TMU */
202static struct sh_timer_config tmu0_platform_data = { 202static struct sh_timer_config tmu0_platform_data = {
203 .channel_offset = 0x04, 203 .channels_mask = 7,
204 .timer_bit = 0,
205 .clockevent_rating = 200,
206}; 204};
207 205
208static struct resource tmu0_resources[] = { 206static struct resource tmu0_resources[] = {
209 [0] = { 207 DEFINE_RES_MEM(0xffd80000, 0x30),
210 .start = 0xFFD80008, 208 DEFINE_RES_IRQ(evt2irq(0x400)),
211 .end = 0xFFD80014 - 1, 209 DEFINE_RES_IRQ(evt2irq(0x420)),
212 .flags = IORESOURCE_MEM, 210 DEFINE_RES_IRQ(evt2irq(0x440)),
213 },
214 [1] = {
215 .start = evt2irq(0x400),
216 .flags = IORESOURCE_IRQ,
217 },
218}; 211};
219 212
220static struct platform_device tmu0_device = { 213static struct platform_device tmu0_device = {
221 .name = "sh_tmu", 214 .name = "sh-tmu",
222 .id = 0, 215 .id = 0,
223 .dev = { 216 .dev = {
224 .platform_data = &tmu0_platform_data, 217 .platform_data = &tmu0_platform_data,
@@ -228,26 +221,19 @@ static struct platform_device tmu0_device = {
228}; 221};
229 222
230static struct sh_timer_config tmu1_platform_data = { 223static struct sh_timer_config tmu1_platform_data = {
231 .channel_offset = 0x10, 224 .channels_mask = 7,
232 .timer_bit = 1,
233 .clocksource_rating = 200,
234}; 225};
235 226
236static struct resource tmu1_resources[] = { 227static struct resource tmu1_resources[] = {
237 [0] = { 228 DEFINE_RES_MEM(0xffd81000, 0x30),
238 .start = 0xFFD80014, 229 DEFINE_RES_IRQ(evt2irq(0x480)),
239 .end = 0xFFD80020 - 1, 230 DEFINE_RES_IRQ(evt2irq(0x4a0)),
240 .flags = IORESOURCE_MEM, 231 DEFINE_RES_IRQ(evt2irq(0x4c0)),
241 },
242 [1] = {
243 .start = evt2irq(0x420),
244 .flags = IORESOURCE_IRQ,
245 },
246}; 232};
247 233
248static struct platform_device tmu1_device = { 234static struct platform_device tmu1_device = {
249 .name = "sh_tmu", 235 .name = "sh-tmu",
250 .id = 1, 236 .id = 1,
251 .dev = { 237 .dev = {
252 .platform_data = &tmu1_platform_data, 238 .platform_data = &tmu1_platform_data,
253 }, 239 },
@@ -256,25 +242,19 @@ static struct platform_device tmu1_device = {
256}; 242};
257 243
258static struct sh_timer_config tmu2_platform_data = { 244static struct sh_timer_config tmu2_platform_data = {
259 .channel_offset = 0x1c, 245 .channels_mask = 7,
260 .timer_bit = 2,
261}; 246};
262 247
263static struct resource tmu2_resources[] = { 248static struct resource tmu2_resources[] = {
264 [0] = { 249 DEFINE_RES_MEM(0xffd82000, 0x30),
265 .start = 0xFFD80020, 250 DEFINE_RES_IRQ(evt2irq(0x500)),
266 .end = 0xFFD80030 - 1, 251 DEFINE_RES_IRQ(evt2irq(0x520)),
267 .flags = IORESOURCE_MEM, 252 DEFINE_RES_IRQ(evt2irq(0x540)),
268 },
269 [1] = {
270 .start = evt2irq(0x440),
271 .flags = IORESOURCE_IRQ,
272 },
273}; 253};
274 254
275static struct platform_device tmu2_device = { 255static struct platform_device tmu2_device = {
276 .name = "sh_tmu", 256 .name = "sh-tmu",
277 .id = 2, 257 .id = 2,
278 .dev = { 258 .dev = {
279 .platform_data = &tmu2_platform_data, 259 .platform_data = &tmu2_platform_data,
280 }, 260 },
@@ -282,169 +262,6 @@ static struct platform_device tmu2_device = {
282 .num_resources = ARRAY_SIZE(tmu2_resources), 262 .num_resources = ARRAY_SIZE(tmu2_resources),
283}; 263};
284 264
285
286static struct sh_timer_config tmu3_platform_data = {
287 .channel_offset = 0x04,
288 .timer_bit = 0,
289};
290
291static struct resource tmu3_resources[] = {
292 [0] = {
293 .start = 0xFFD81008,
294 .end = 0xFFD81014 - 1,
295 .flags = IORESOURCE_MEM,
296 },
297 [1] = {
298 .start = evt2irq(0x480),
299 .flags = IORESOURCE_IRQ,
300 },
301};
302
303static struct platform_device tmu3_device = {
304 .name = "sh_tmu",
305 .id = 3,
306 .dev = {
307 .platform_data = &tmu3_platform_data,
308 },
309 .resource = tmu3_resources,
310 .num_resources = ARRAY_SIZE(tmu3_resources),
311};
312
313static struct sh_timer_config tmu4_platform_data = {
314 .channel_offset = 0x10,
315 .timer_bit = 1,
316};
317
318static struct resource tmu4_resources[] = {
319 [0] = {
320 .start = 0xFFD81014,
321 .end = 0xFFD81020 - 1,
322 .flags = IORESOURCE_MEM,
323 },
324 [1] = {
325 .start = evt2irq(0x4A0),
326 .flags = IORESOURCE_IRQ,
327 },
328};
329
330static struct platform_device tmu4_device = {
331 .name = "sh_tmu",
332 .id = 4,
333 .dev = {
334 .platform_data = &tmu4_platform_data,
335 },
336 .resource = tmu4_resources,
337 .num_resources = ARRAY_SIZE(tmu4_resources),
338};
339
340static struct sh_timer_config tmu5_platform_data = {
341 .channel_offset = 0x1c,
342 .timer_bit = 2,
343};
344
345static struct resource tmu5_resources[] = {
346 [0] = {
347 .start = 0xFFD81020,
348 .end = 0xFFD81030 - 1,
349 .flags = IORESOURCE_MEM,
350 },
351 [1] = {
352 .start = evt2irq(0x4C0),
353 .flags = IORESOURCE_IRQ,
354 },
355};
356
357static struct platform_device tmu5_device = {
358 .name = "sh_tmu",
359 .id = 5,
360 .dev = {
361 .platform_data = &tmu5_platform_data,
362 },
363 .resource = tmu5_resources,
364 .num_resources = ARRAY_SIZE(tmu5_resources),
365};
366
367static struct sh_timer_config tmu6_platform_data = {
368 .channel_offset = 0x4,
369 .timer_bit = 0,
370};
371
372static struct resource tmu6_resources[] = {
373 [0] = {
374 .start = 0xFFD82008,
375 .end = 0xFFD82014 - 1,
376 .flags = IORESOURCE_MEM,
377 },
378 [1] = {
379 .start = evt2irq(0x500),
380 .flags = IORESOURCE_IRQ,
381 },
382};
383
384static struct platform_device tmu6_device = {
385 .name = "sh_tmu",
386 .id = 6,
387 .dev = {
388 .platform_data = &tmu6_platform_data,
389 },
390 .resource = tmu6_resources,
391 .num_resources = ARRAY_SIZE(tmu6_resources),
392};
393
394static struct sh_timer_config tmu7_platform_data = {
395 .channel_offset = 0x10,
396 .timer_bit = 1,
397};
398
399static struct resource tmu7_resources[] = {
400 [0] = {
401 .start = 0xFFD82014,
402 .end = 0xFFD82020 - 1,
403 .flags = IORESOURCE_MEM,
404 },
405 [1] = {
406 .start = evt2irq(0x520),
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct platform_device tmu7_device = {
412 .name = "sh_tmu",
413 .id = 7,
414 .dev = {
415 .platform_data = &tmu7_platform_data,
416 },
417 .resource = tmu7_resources,
418 .num_resources = ARRAY_SIZE(tmu7_resources),
419};
420
421static struct sh_timer_config tmu8_platform_data = {
422 .channel_offset = 0x1c,
423 .timer_bit = 2,
424};
425
426static struct resource tmu8_resources[] = {
427 [0] = {
428 .start = 0xFFD82020,
429 .end = 0xFFD82030 - 1,
430 .flags = IORESOURCE_MEM,
431 },
432 [1] = {
433 .start = evt2irq(0x540),
434 .flags = IORESOURCE_IRQ,
435 },
436};
437
438static struct platform_device tmu8_device = {
439 .name = "sh_tmu",
440 .id = 8,
441 .dev = {
442 .platform_data = &tmu8_platform_data,
443 },
444 .resource = tmu8_resources,
445 .num_resources = ARRAY_SIZE(tmu8_resources),
446};
447
448static struct platform_device *sh7734_devices[] __initdata = { 265static struct platform_device *sh7734_devices[] __initdata = {
449 &scif0_device, 266 &scif0_device,
450 &scif1_device, 267 &scif1_device,
@@ -455,12 +272,6 @@ static struct platform_device *sh7734_devices[] __initdata = {
455 &tmu0_device, 272 &tmu0_device,
456 &tmu1_device, 273 &tmu1_device,
457 &tmu2_device, 274 &tmu2_device,
458 &tmu3_device,
459 &tmu4_device,
460 &tmu5_device,
461 &tmu6_device,
462 &tmu7_device,
463 &tmu8_device,
464 &rtc_device, 275 &rtc_device,
465}; 276};
466 277
@@ -474,12 +285,6 @@ static struct platform_device *sh7734_early_devices[] __initdata = {
474 &tmu0_device, 285 &tmu0_device,
475 &tmu1_device, 286 &tmu1_device,
476 &tmu2_device, 287 &tmu2_device,
477 &tmu3_device,
478 &tmu4_device,
479 &tmu5_device,
480 &tmu6_device,
481 &tmu7_device,
482 &tmu8_device,
483}; 288};
484 289
485void __init plat_early_device_setup(void) 290void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index e43e5db53913..7b24ec4b409a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -87,25 +87,17 @@ static struct platform_device scif4_device = {
87}; 87};
88 88
89static struct sh_timer_config tmu0_platform_data = { 89static struct sh_timer_config tmu0_platform_data = {
90 .channel_offset = 0x04, 90 .channels_mask = 3,
91 .timer_bit = 0,
92 .clockevent_rating = 200,
93}; 91};
94 92
95static struct resource tmu0_resources[] = { 93static struct resource tmu0_resources[] = {
96 [0] = { 94 DEFINE_RES_MEM(0xfe430000, 0x20),
97 .start = 0xfe430008, 95 DEFINE_RES_IRQ(evt2irq(0x580)),
98 .end = 0xfe430013, 96 DEFINE_RES_IRQ(evt2irq(0x5a0)),
99 .flags = IORESOURCE_MEM,
100 },
101 [1] = {
102 .start = evt2irq(0x580),
103 .flags = IORESOURCE_IRQ,
104 },
105}; 97};
106 98
107static struct platform_device tmu0_device = { 99static struct platform_device tmu0_device = {
108 .name = "sh_tmu", 100 .name = "sh-tmu",
109 .id = 0, 101 .id = 0,
110 .dev = { 102 .dev = {
111 .platform_data = &tmu0_platform_data, 103 .platform_data = &tmu0_platform_data,
@@ -114,34 +106,6 @@ static struct platform_device tmu0_device = {
114 .num_resources = ARRAY_SIZE(tmu0_resources), 106 .num_resources = ARRAY_SIZE(tmu0_resources),
115}; 107};
116 108
117static struct sh_timer_config tmu1_platform_data = {
118 .channel_offset = 0x10,
119 .timer_bit = 1,
120 .clocksource_rating = 200,
121};
122
123static struct resource tmu1_resources[] = {
124 [0] = {
125 .start = 0xfe430014,
126 .end = 0xfe43001f,
127 .flags = IORESOURCE_MEM,
128 },
129 [1] = {
130 .start = evt2irq(0x5a0),
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device tmu1_device = {
136 .name = "sh_tmu",
137 .id = 1,
138 .dev = {
139 .platform_data = &tmu1_platform_data,
140 },
141 .resource = tmu1_resources,
142 .num_resources = ARRAY_SIZE(tmu1_resources),
143};
144
145static struct resource spi0_resources[] = { 109static struct resource spi0_resources[] = {
146 [0] = { 110 [0] = {
147 .start = 0xfe002000, 111 .start = 0xfe002000,
@@ -782,7 +746,6 @@ static struct platform_device *sh7757_devices[] __initdata = {
782 &scif3_device, 746 &scif3_device,
783 &scif4_device, 747 &scif4_device,
784 &tmu0_device, 748 &tmu0_device,
785 &tmu1_device,
786 &dma0_device, 749 &dma0_device,
787 &dma1_device, 750 &dma1_device,
788 &dma2_device, 751 &dma2_device,
@@ -806,7 +769,6 @@ static struct platform_device *sh7757_early_devices[] __initdata = {
806 &scif3_device, 769 &scif3_device,
807 &scif4_device, 770 &scif4_device,
808 &tmu0_device, 771 &tmu0_device,
809 &tmu1_device,
810}; 772};
811 773
812void __init plat_early_device_setup(void) 774void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 5eebbd7f4c21..5a47d670ddec 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -158,25 +158,18 @@ static struct platform_device usbf_device = {
158}; 158};
159 159
160static struct sh_timer_config tmu0_platform_data = { 160static struct sh_timer_config tmu0_platform_data = {
161 .channel_offset = 0x04, 161 .channels_mask = 7,
162 .timer_bit = 0,
163 .clockevent_rating = 200,
164}; 162};
165 163
166static struct resource tmu0_resources[] = { 164static struct resource tmu0_resources[] = {
167 [0] = { 165 DEFINE_RES_MEM(0xffd80000, 0x30),
168 .start = 0xffd80008, 166 DEFINE_RES_IRQ(evt2irq(0x580)),
169 .end = 0xffd80013, 167 DEFINE_RES_IRQ(evt2irq(0x5a0)),
170 .flags = IORESOURCE_MEM, 168 DEFINE_RES_IRQ(evt2irq(0x5c0)),
171 },
172 [1] = {
173 .start = evt2irq(0x580),
174 .flags = IORESOURCE_IRQ,
175 },
176}; 169};
177 170
178static struct platform_device tmu0_device = { 171static struct platform_device tmu0_device = {
179 .name = "sh_tmu", 172 .name = "sh-tmu",
180 .id = 0, 173 .id = 0,
181 .dev = { 174 .dev = {
182 .platform_data = &tmu0_platform_data, 175 .platform_data = &tmu0_platform_data,
@@ -186,25 +179,18 @@ static struct platform_device tmu0_device = {
186}; 179};
187 180
188static struct sh_timer_config tmu1_platform_data = { 181static struct sh_timer_config tmu1_platform_data = {
189 .channel_offset = 0x10, 182 .channels_mask = 7,
190 .timer_bit = 1,
191 .clocksource_rating = 200,
192}; 183};
193 184
194static struct resource tmu1_resources[] = { 185static struct resource tmu1_resources[] = {
195 [0] = { 186 DEFINE_RES_MEM(0xffd88000, 0x2c),
196 .start = 0xffd80014, 187 DEFINE_RES_IRQ(evt2irq(0xe00)),
197 .end = 0xffd8001f, 188 DEFINE_RES_IRQ(evt2irq(0xe20)),
198 .flags = IORESOURCE_MEM, 189 DEFINE_RES_IRQ(evt2irq(0xe40)),
199 },
200 [1] = {
201 .start = evt2irq(0x5a0),
202 .flags = IORESOURCE_IRQ,
203 },
204}; 190};
205 191
206static struct platform_device tmu1_device = { 192static struct platform_device tmu1_device = {
207 .name = "sh_tmu", 193 .name = "sh-tmu",
208 .id = 1, 194 .id = 1,
209 .dev = { 195 .dev = {
210 .platform_data = &tmu1_platform_data, 196 .platform_data = &tmu1_platform_data,
@@ -213,124 +199,12 @@ static struct platform_device tmu1_device = {
213 .num_resources = ARRAY_SIZE(tmu1_resources), 199 .num_resources = ARRAY_SIZE(tmu1_resources),
214}; 200};
215 201
216static struct sh_timer_config tmu2_platform_data = {
217 .channel_offset = 0x1c,
218 .timer_bit = 2,
219};
220
221static struct resource tmu2_resources[] = {
222 [0] = {
223 .start = 0xffd80020,
224 .end = 0xffd8002f,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x5c0),
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu2_device = {
234 .name = "sh_tmu",
235 .id = 2,
236 .dev = {
237 .platform_data = &tmu2_platform_data,
238 },
239 .resource = tmu2_resources,
240 .num_resources = ARRAY_SIZE(tmu2_resources),
241};
242
243static struct sh_timer_config tmu3_platform_data = {
244 .channel_offset = 0x04,
245 .timer_bit = 0,
246};
247
248static struct resource tmu3_resources[] = {
249 [0] = {
250 .start = 0xffd88008,
251 .end = 0xffd88013,
252 .flags = IORESOURCE_MEM,
253 },
254 [1] = {
255 .start = evt2irq(0xe00),
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device tmu3_device = {
261 .name = "sh_tmu",
262 .id = 3,
263 .dev = {
264 .platform_data = &tmu3_platform_data,
265 },
266 .resource = tmu3_resources,
267 .num_resources = ARRAY_SIZE(tmu3_resources),
268};
269
270static struct sh_timer_config tmu4_platform_data = {
271 .channel_offset = 0x10,
272 .timer_bit = 1,
273};
274
275static struct resource tmu4_resources[] = {
276 [0] = {
277 .start = 0xffd88014,
278 .end = 0xffd8801f,
279 .flags = IORESOURCE_MEM,
280 },
281 [1] = {
282 .start = evt2irq(0xe20),
283 .flags = IORESOURCE_IRQ,
284 },
285};
286
287static struct platform_device tmu4_device = {
288 .name = "sh_tmu",
289 .id = 4,
290 .dev = {
291 .platform_data = &tmu4_platform_data,
292 },
293 .resource = tmu4_resources,
294 .num_resources = ARRAY_SIZE(tmu4_resources),
295};
296
297static struct sh_timer_config tmu5_platform_data = {
298 .channel_offset = 0x1c,
299 .timer_bit = 2,
300};
301
302static struct resource tmu5_resources[] = {
303 [0] = {
304 .start = 0xffd88020,
305 .end = 0xffd8802b,
306 .flags = IORESOURCE_MEM,
307 },
308 [1] = {
309 .start = evt2irq(0xe40),
310 .flags = IORESOURCE_IRQ,
311 },
312};
313
314static struct platform_device tmu5_device = {
315 .name = "sh_tmu",
316 .id = 5,
317 .dev = {
318 .platform_data = &tmu5_platform_data,
319 },
320 .resource = tmu5_resources,
321 .num_resources = ARRAY_SIZE(tmu5_resources),
322};
323
324static struct platform_device *sh7763_devices[] __initdata = { 202static struct platform_device *sh7763_devices[] __initdata = {
325 &scif0_device, 203 &scif0_device,
326 &scif1_device, 204 &scif1_device,
327 &scif2_device, 205 &scif2_device,
328 &tmu0_device, 206 &tmu0_device,
329 &tmu1_device, 207 &tmu1_device,
330 &tmu2_device,
331 &tmu3_device,
332 &tmu4_device,
333 &tmu5_device,
334 &rtc_device, 208 &rtc_device,
335 &usb_ohci_device, 209 &usb_ohci_device,
336 &usbf_device, 210 &usbf_device,
@@ -349,10 +223,6 @@ static struct platform_device *sh7763_early_devices[] __initdata = {
349 &scif2_device, 223 &scif2_device,
350 &tmu0_device, 224 &tmu0_device,
351 &tmu1_device, 225 &tmu1_device,
352 &tmu2_device,
353 &tmu3_device,
354 &tmu4_device,
355 &tmu5_device,
356}; 226};
357 227
358void __init plat_early_device_setup(void) 228void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index e1ba8cb74e5a..e9b532a76c37 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -226,25 +226,18 @@ static struct platform_device scif9_device = {
226}; 226};
227 227
228static struct sh_timer_config tmu0_platform_data = { 228static struct sh_timer_config tmu0_platform_data = {
229 .channel_offset = 0x04, 229 .channels_mask = 7,
230 .timer_bit = 0,
231 .clockevent_rating = 200,
232}; 230};
233 231
234static struct resource tmu0_resources[] = { 232static struct resource tmu0_resources[] = {
235 [0] = { 233 DEFINE_RES_MEM(0xffd80000, 0x30),
236 .start = 0xffd80008, 234 DEFINE_RES_IRQ(evt2irq(0x400)),
237 .end = 0xffd80013, 235 DEFINE_RES_IRQ(evt2irq(0x420)),
238 .flags = IORESOURCE_MEM, 236 DEFINE_RES_IRQ(evt2irq(0x440)),
239 },
240 [1] = {
241 .start = evt2irq(0x400),
242 .flags = IORESOURCE_IRQ,
243 },
244}; 237};
245 238
246static struct platform_device tmu0_device = { 239static struct platform_device tmu0_device = {
247 .name = "sh_tmu", 240 .name = "sh-tmu",
248 .id = 0, 241 .id = 0,
249 .dev = { 242 .dev = {
250 .platform_data = &tmu0_platform_data, 243 .platform_data = &tmu0_platform_data,
@@ -254,25 +247,18 @@ static struct platform_device tmu0_device = {
254}; 247};
255 248
256static struct sh_timer_config tmu1_platform_data = { 249static struct sh_timer_config tmu1_platform_data = {
257 .channel_offset = 0x10, 250 .channels_mask = 7,
258 .timer_bit = 1,
259 .clocksource_rating = 200,
260}; 251};
261 252
262static struct resource tmu1_resources[] = { 253static struct resource tmu1_resources[] = {
263 [0] = { 254 DEFINE_RES_MEM(0xffd81000, 0x30),
264 .start = 0xffd80014, 255 DEFINE_RES_IRQ(evt2irq(0x460)),
265 .end = 0xffd8001f, 256 DEFINE_RES_IRQ(evt2irq(0x480)),
266 .flags = IORESOURCE_MEM, 257 DEFINE_RES_IRQ(evt2irq(0x4a0)),
267 },
268 [1] = {
269 .start = evt2irq(0x420),
270 .flags = IORESOURCE_IRQ,
271 },
272}; 258};
273 259
274static struct platform_device tmu1_device = { 260static struct platform_device tmu1_device = {
275 .name = "sh_tmu", 261 .name = "sh-tmu",
276 .id = 1, 262 .id = 1,
277 .dev = { 263 .dev = {
278 .platform_data = &tmu1_platform_data, 264 .platform_data = &tmu1_platform_data,
@@ -282,24 +268,18 @@ static struct platform_device tmu1_device = {
282}; 268};
283 269
284static struct sh_timer_config tmu2_platform_data = { 270static struct sh_timer_config tmu2_platform_data = {
285 .channel_offset = 0x1c, 271 .channels_mask = 7,
286 .timer_bit = 2,
287}; 272};
288 273
289static struct resource tmu2_resources[] = { 274static struct resource tmu2_resources[] = {
290 [0] = { 275 DEFINE_RES_MEM(0xffd82000, 0x2c),
291 .start = 0xffd80020, 276 DEFINE_RES_IRQ(evt2irq(0x4c0)),
292 .end = 0xffd8002f, 277 DEFINE_RES_IRQ(evt2irq(0x4e0)),
293 .flags = IORESOURCE_MEM, 278 DEFINE_RES_IRQ(evt2irq(0x500)),
294 },
295 [1] = {
296 .start = evt2irq(0x440),
297 .flags = IORESOURCE_IRQ,
298 },
299}; 279};
300 280
301static struct platform_device tmu2_device = { 281static struct platform_device tmu2_device = {
302 .name = "sh_tmu", 282 .name = "sh-tmu",
303 .id = 2, 283 .id = 2,
304 .dev = { 284 .dev = {
305 .platform_data = &tmu2_platform_data, 285 .platform_data = &tmu2_platform_data,
@@ -308,168 +288,6 @@ static struct platform_device tmu2_device = {
308 .num_resources = ARRAY_SIZE(tmu2_resources), 288 .num_resources = ARRAY_SIZE(tmu2_resources),
309}; 289};
310 290
311static struct sh_timer_config tmu3_platform_data = {
312 .channel_offset = 0x04,
313 .timer_bit = 0,
314};
315
316static struct resource tmu3_resources[] = {
317 [0] = {
318 .start = 0xffd81008,
319 .end = 0xffd81013,
320 .flags = IORESOURCE_MEM,
321 },
322 [1] = {
323 .start = evt2irq(0x460),
324 .flags = IORESOURCE_IRQ,
325 },
326};
327
328static struct platform_device tmu3_device = {
329 .name = "sh_tmu",
330 .id = 3,
331 .dev = {
332 .platform_data = &tmu3_platform_data,
333 },
334 .resource = tmu3_resources,
335 .num_resources = ARRAY_SIZE(tmu3_resources),
336};
337
338static struct sh_timer_config tmu4_platform_data = {
339 .channel_offset = 0x10,
340 .timer_bit = 1,
341};
342
343static struct resource tmu4_resources[] = {
344 [0] = {
345 .start = 0xffd81014,
346 .end = 0xffd8101f,
347 .flags = IORESOURCE_MEM,
348 },
349 [1] = {
350 .start = evt2irq(0x480),
351 .flags = IORESOURCE_IRQ,
352 },
353};
354
355static struct platform_device tmu4_device = {
356 .name = "sh_tmu",
357 .id = 4,
358 .dev = {
359 .platform_data = &tmu4_platform_data,
360 },
361 .resource = tmu4_resources,
362 .num_resources = ARRAY_SIZE(tmu4_resources),
363};
364
365static struct sh_timer_config tmu5_platform_data = {
366 .channel_offset = 0x1c,
367 .timer_bit = 2,
368};
369
370static struct resource tmu5_resources[] = {
371 [0] = {
372 .start = 0xffd81020,
373 .end = 0xffd8102f,
374 .flags = IORESOURCE_MEM,
375 },
376 [1] = {
377 .start = evt2irq(0x4a0),
378 .flags = IORESOURCE_IRQ,
379 },
380};
381
382static struct platform_device tmu5_device = {
383 .name = "sh_tmu",
384 .id = 5,
385 .dev = {
386 .platform_data = &tmu5_platform_data,
387 },
388 .resource = tmu5_resources,
389 .num_resources = ARRAY_SIZE(tmu5_resources),
390};
391
392static struct sh_timer_config tmu6_platform_data = {
393 .channel_offset = 0x04,
394 .timer_bit = 0,
395};
396
397static struct resource tmu6_resources[] = {
398 [0] = {
399 .start = 0xffd82008,
400 .end = 0xffd82013,
401 .flags = IORESOURCE_MEM,
402 },
403 [1] = {
404 .start = evt2irq(0x4c0),
405 .flags = IORESOURCE_IRQ,
406 },
407};
408
409static struct platform_device tmu6_device = {
410 .name = "sh_tmu",
411 .id = 6,
412 .dev = {
413 .platform_data = &tmu6_platform_data,
414 },
415 .resource = tmu6_resources,
416 .num_resources = ARRAY_SIZE(tmu6_resources),
417};
418
419static struct sh_timer_config tmu7_platform_data = {
420 .channel_offset = 0x10,
421 .timer_bit = 1,
422};
423
424static struct resource tmu7_resources[] = {
425 [0] = {
426 .start = 0xffd82014,
427 .end = 0xffd8201f,
428 .flags = IORESOURCE_MEM,
429 },
430 [1] = {
431 .start = evt2irq(0x4e0),
432 .flags = IORESOURCE_IRQ,
433 },
434};
435
436static struct platform_device tmu7_device = {
437 .name = "sh_tmu",
438 .id = 7,
439 .dev = {
440 .platform_data = &tmu7_platform_data,
441 },
442 .resource = tmu7_resources,
443 .num_resources = ARRAY_SIZE(tmu7_resources),
444};
445
446static struct sh_timer_config tmu8_platform_data = {
447 .channel_offset = 0x1c,
448 .timer_bit = 2,
449};
450
451static struct resource tmu8_resources[] = {
452 [0] = {
453 .start = 0xffd82020,
454 .end = 0xffd8202b,
455 .flags = IORESOURCE_MEM,
456 },
457 [1] = {
458 .start = evt2irq(0x500),
459 .flags = IORESOURCE_IRQ,
460 },
461};
462
463static struct platform_device tmu8_device = {
464 .name = "sh_tmu",
465 .id = 8,
466 .dev = {
467 .platform_data = &tmu8_platform_data,
468 },
469 .resource = tmu8_resources,
470 .num_resources = ARRAY_SIZE(tmu8_resources),
471};
472
473static struct platform_device *sh7770_devices[] __initdata = { 291static struct platform_device *sh7770_devices[] __initdata = {
474 &scif0_device, 292 &scif0_device,
475 &scif1_device, 293 &scif1_device,
@@ -484,12 +302,6 @@ static struct platform_device *sh7770_devices[] __initdata = {
484 &tmu0_device, 302 &tmu0_device,
485 &tmu1_device, 303 &tmu1_device,
486 &tmu2_device, 304 &tmu2_device,
487 &tmu3_device,
488 &tmu4_device,
489 &tmu5_device,
490 &tmu6_device,
491 &tmu7_device,
492 &tmu8_device,
493}; 305};
494 306
495static int __init sh7770_devices_setup(void) 307static int __init sh7770_devices_setup(void)
@@ -513,12 +325,6 @@ static struct platform_device *sh7770_early_devices[] __initdata = {
513 &tmu0_device, 325 &tmu0_device,
514 &tmu1_device, 326 &tmu1_device,
515 &tmu2_device, 327 &tmu2_device,
516 &tmu3_device,
517 &tmu4_device,
518 &tmu5_device,
519 &tmu6_device,
520 &tmu7_device,
521 &tmu8_device,
522}; 328};
523 329
524void __init plat_early_device_setup(void) 330void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index 668e54bafa86..3ee7dd9b3a65 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -62,25 +62,18 @@ static struct platform_device scif1_device = {
62}; 62};
63 63
64static struct sh_timer_config tmu0_platform_data = { 64static struct sh_timer_config tmu0_platform_data = {
65 .channel_offset = 0x04, 65 .channels_mask = 7,
66 .timer_bit = 0,
67 .clockevent_rating = 200,
68}; 66};
69 67
70static struct resource tmu0_resources[] = { 68static struct resource tmu0_resources[] = {
71 [0] = { 69 DEFINE_RES_MEM(0xffd80000, 0x30),
72 .start = 0xffd80008, 70 DEFINE_RES_IRQ(evt2irq(0x580)),
73 .end = 0xffd80013, 71 DEFINE_RES_IRQ(evt2irq(0x5a0)),
74 .flags = IORESOURCE_MEM, 72 DEFINE_RES_IRQ(evt2irq(0x5c0)),
75 },
76 [1] = {
77 .start = evt2irq(0x580),
78 .flags = IORESOURCE_IRQ,
79 },
80}; 73};
81 74
82static struct platform_device tmu0_device = { 75static struct platform_device tmu0_device = {
83 .name = "sh_tmu", 76 .name = "sh-tmu",
84 .id = 0, 77 .id = 0,
85 .dev = { 78 .dev = {
86 .platform_data = &tmu0_platform_data, 79 .platform_data = &tmu0_platform_data,
@@ -90,25 +83,18 @@ static struct platform_device tmu0_device = {
90}; 83};
91 84
92static struct sh_timer_config tmu1_platform_data = { 85static struct sh_timer_config tmu1_platform_data = {
93 .channel_offset = 0x10, 86 .channels_mask = 7,
94 .timer_bit = 1,
95 .clocksource_rating = 200,
96}; 87};
97 88
98static struct resource tmu1_resources[] = { 89static struct resource tmu1_resources[] = {
99 [0] = { 90 DEFINE_RES_MEM(0xffdc0000, 0x2c),
100 .start = 0xffd80014, 91 DEFINE_RES_IRQ(evt2irq(0xe00)),
101 .end = 0xffd8001f, 92 DEFINE_RES_IRQ(evt2irq(0xe20)),
102 .flags = IORESOURCE_MEM, 93 DEFINE_RES_IRQ(evt2irq(0xe40)),
103 },
104 [1] = {
105 .start = evt2irq(0x5a0),
106 .flags = IORESOURCE_IRQ,
107 },
108}; 94};
109 95
110static struct platform_device tmu1_device = { 96static struct platform_device tmu1_device = {
111 .name = "sh_tmu", 97 .name = "sh-tmu",
112 .id = 1, 98 .id = 1,
113 .dev = { 99 .dev = {
114 .platform_data = &tmu1_platform_data, 100 .platform_data = &tmu1_platform_data,
@@ -117,114 +103,6 @@ static struct platform_device tmu1_device = {
117 .num_resources = ARRAY_SIZE(tmu1_resources), 103 .num_resources = ARRAY_SIZE(tmu1_resources),
118}; 104};
119 105
120static struct sh_timer_config tmu2_platform_data = {
121 .channel_offset = 0x1c,
122 .timer_bit = 2,
123};
124
125static struct resource tmu2_resources[] = {
126 [0] = {
127 .start = 0xffd80020,
128 .end = 0xffd8002f,
129 .flags = IORESOURCE_MEM,
130 },
131 [1] = {
132 .start = evt2irq(0x5c0),
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
137static struct platform_device tmu2_device = {
138 .name = "sh_tmu",
139 .id = 2,
140 .dev = {
141 .platform_data = &tmu2_platform_data,
142 },
143 .resource = tmu2_resources,
144 .num_resources = ARRAY_SIZE(tmu2_resources),
145};
146
147static struct sh_timer_config tmu3_platform_data = {
148 .channel_offset = 0x04,
149 .timer_bit = 0,
150};
151
152static struct resource tmu3_resources[] = {
153 [0] = {
154 .start = 0xffdc0008,
155 .end = 0xffdc0013,
156 .flags = IORESOURCE_MEM,
157 },
158 [1] = {
159 .start = evt2irq(0xe00),
160 .flags = IORESOURCE_IRQ,
161 },
162};
163
164static struct platform_device tmu3_device = {
165 .name = "sh_tmu",
166 .id = 3,
167 .dev = {
168 .platform_data = &tmu3_platform_data,
169 },
170 .resource = tmu3_resources,
171 .num_resources = ARRAY_SIZE(tmu3_resources),
172};
173
174static struct sh_timer_config tmu4_platform_data = {
175 .channel_offset = 0x10,
176 .timer_bit = 1,
177};
178
179static struct resource tmu4_resources[] = {
180 [0] = {
181 .start = 0xffdc0014,
182 .end = 0xffdc001f,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = evt2irq(0xe20),
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device tmu4_device = {
192 .name = "sh_tmu",
193 .id = 4,
194 .dev = {
195 .platform_data = &tmu4_platform_data,
196 },
197 .resource = tmu4_resources,
198 .num_resources = ARRAY_SIZE(tmu4_resources),
199};
200
201static struct sh_timer_config tmu5_platform_data = {
202 .channel_offset = 0x1c,
203 .timer_bit = 2,
204};
205
206static struct resource tmu5_resources[] = {
207 [0] = {
208 .start = 0xffdc0020,
209 .end = 0xffdc002b,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = evt2irq(0xe40),
214 .flags = IORESOURCE_IRQ,
215 },
216};
217
218static struct platform_device tmu5_device = {
219 .name = "sh_tmu",
220 .id = 5,
221 .dev = {
222 .platform_data = &tmu5_platform_data,
223 },
224 .resource = tmu5_resources,
225 .num_resources = ARRAY_SIZE(tmu5_resources),
226};
227
228static struct resource rtc_resources[] = { 106static struct resource rtc_resources[] = {
229 [0] = { 107 [0] = {
230 .start = 0xffe80000, 108 .start = 0xffe80000,
@@ -386,10 +264,6 @@ static struct platform_device *sh7780_devices[] __initdata = {
386 &scif1_device, 264 &scif1_device,
387 &tmu0_device, 265 &tmu0_device,
388 &tmu1_device, 266 &tmu1_device,
389 &tmu2_device,
390 &tmu3_device,
391 &tmu4_device,
392 &tmu5_device,
393 &rtc_device, 267 &rtc_device,
394 &dma0_device, 268 &dma0_device,
395 &dma1_device, 269 &dma1_device,
@@ -407,10 +281,6 @@ static struct platform_device *sh7780_early_devices[] __initdata = {
407 &scif1_device, 281 &scif1_device,
408 &tmu0_device, 282 &tmu0_device,
409 &tmu1_device, 283 &tmu1_device,
410 &tmu2_device,
411 &tmu3_device,
412 &tmu4_device,
413 &tmu5_device,
414}; 284};
415 285
416void __init plat_early_device_setup(void) 286void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 4aa679140209..c72d5a5d0995 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -152,25 +152,18 @@ static struct platform_device scif5_device = {
152}; 152};
153 153
154static struct sh_timer_config tmu0_platform_data = { 154static struct sh_timer_config tmu0_platform_data = {
155 .channel_offset = 0x04, 155 .channels_mask = 7,
156 .timer_bit = 0,
157 .clockevent_rating = 200,
158}; 156};
159 157
160static struct resource tmu0_resources[] = { 158static struct resource tmu0_resources[] = {
161 [0] = { 159 DEFINE_RES_MEM(0xffd80000, 0x30),
162 .start = 0xffd80008, 160 DEFINE_RES_IRQ(evt2irq(0x580)),
163 .end = 0xffd80013, 161 DEFINE_RES_IRQ(evt2irq(0x5a0)),
164 .flags = IORESOURCE_MEM, 162 DEFINE_RES_IRQ(evt2irq(0x5c0)),
165 },
166 [1] = {
167 .start = evt2irq(0x580),
168 .flags = IORESOURCE_IRQ,
169 },
170}; 163};
171 164
172static struct platform_device tmu0_device = { 165static struct platform_device tmu0_device = {
173 .name = "sh_tmu", 166 .name = "sh-tmu",
174 .id = 0, 167 .id = 0,
175 .dev = { 168 .dev = {
176 .platform_data = &tmu0_platform_data, 169 .platform_data = &tmu0_platform_data,
@@ -180,25 +173,18 @@ static struct platform_device tmu0_device = {
180}; 173};
181 174
182static struct sh_timer_config tmu1_platform_data = { 175static struct sh_timer_config tmu1_platform_data = {
183 .channel_offset = 0x10, 176 .channels_mask = 7,
184 .timer_bit = 1,
185 .clocksource_rating = 200,
186}; 177};
187 178
188static struct resource tmu1_resources[] = { 179static struct resource tmu1_resources[] = {
189 [0] = { 180 DEFINE_RES_MEM(0xffdc0000, 0x2c),
190 .start = 0xffd80014, 181 DEFINE_RES_IRQ(evt2irq(0xe00)),
191 .end = 0xffd8001f, 182 DEFINE_RES_IRQ(evt2irq(0xe20)),
192 .flags = IORESOURCE_MEM, 183 DEFINE_RES_IRQ(evt2irq(0xe40)),
193 },
194 [1] = {
195 .start = evt2irq(0x5a0),
196 .flags = IORESOURCE_IRQ,
197 },
198}; 184};
199 185
200static struct platform_device tmu1_device = { 186static struct platform_device tmu1_device = {
201 .name = "sh_tmu", 187 .name = "sh-tmu",
202 .id = 1, 188 .id = 1,
203 .dev = { 189 .dev = {
204 .platform_data = &tmu1_platform_data, 190 .platform_data = &tmu1_platform_data,
@@ -207,114 +193,6 @@ static struct platform_device tmu1_device = {
207 .num_resources = ARRAY_SIZE(tmu1_resources), 193 .num_resources = ARRAY_SIZE(tmu1_resources),
208}; 194};
209 195
210static struct sh_timer_config tmu2_platform_data = {
211 .channel_offset = 0x1c,
212 .timer_bit = 2,
213};
214
215static struct resource tmu2_resources[] = {
216 [0] = {
217 .start = 0xffd80020,
218 .end = 0xffd8002f,
219 .flags = IORESOURCE_MEM,
220 },
221 [1] = {
222 .start = evt2irq(0x5c0),
223 .flags = IORESOURCE_IRQ,
224 },
225};
226
227static struct platform_device tmu2_device = {
228 .name = "sh_tmu",
229 .id = 2,
230 .dev = {
231 .platform_data = &tmu2_platform_data,
232 },
233 .resource = tmu2_resources,
234 .num_resources = ARRAY_SIZE(tmu2_resources),
235};
236
237static struct sh_timer_config tmu3_platform_data = {
238 .channel_offset = 0x04,
239 .timer_bit = 0,
240};
241
242static struct resource tmu3_resources[] = {
243 [0] = {
244 .start = 0xffdc0008,
245 .end = 0xffdc0013,
246 .flags = IORESOURCE_MEM,
247 },
248 [1] = {
249 .start = evt2irq(0xe00),
250 .flags = IORESOURCE_IRQ,
251 },
252};
253
254static struct platform_device tmu3_device = {
255 .name = "sh_tmu",
256 .id = 3,
257 .dev = {
258 .platform_data = &tmu3_platform_data,
259 },
260 .resource = tmu3_resources,
261 .num_resources = ARRAY_SIZE(tmu3_resources),
262};
263
264static struct sh_timer_config tmu4_platform_data = {
265 .channel_offset = 0x10,
266 .timer_bit = 1,
267};
268
269static struct resource tmu4_resources[] = {
270 [0] = {
271 .start = 0xffdc0014,
272 .end = 0xffdc001f,
273 .flags = IORESOURCE_MEM,
274 },
275 [1] = {
276 .start = evt2irq(0xe20),
277 .flags = IORESOURCE_IRQ,
278 },
279};
280
281static struct platform_device tmu4_device = {
282 .name = "sh_tmu",
283 .id = 4,
284 .dev = {
285 .platform_data = &tmu4_platform_data,
286 },
287 .resource = tmu4_resources,
288 .num_resources = ARRAY_SIZE(tmu4_resources),
289};
290
291static struct sh_timer_config tmu5_platform_data = {
292 .channel_offset = 0x1c,
293 .timer_bit = 2,
294};
295
296static struct resource tmu5_resources[] = {
297 [0] = {
298 .start = 0xffdc0020,
299 .end = 0xffdc002b,
300 .flags = IORESOURCE_MEM,
301 },
302 [1] = {
303 .start = evt2irq(0xe40),
304 .flags = IORESOURCE_IRQ,
305 },
306};
307
308static struct platform_device tmu5_device = {
309 .name = "sh_tmu",
310 .id = 5,
311 .dev = {
312 .platform_data = &tmu5_platform_data,
313 },
314 .resource = tmu5_resources,
315 .num_resources = ARRAY_SIZE(tmu5_resources),
316};
317
318/* DMA */ 196/* DMA */
319static const struct sh_dmae_channel sh7785_dmae0_channels[] = { 197static const struct sh_dmae_channel sh7785_dmae0_channels[] = {
320 { 198 {
@@ -460,10 +338,6 @@ static struct platform_device *sh7785_devices[] __initdata = {
460 &scif5_device, 338 &scif5_device,
461 &tmu0_device, 339 &tmu0_device,
462 &tmu1_device, 340 &tmu1_device,
463 &tmu2_device,
464 &tmu3_device,
465 &tmu4_device,
466 &tmu5_device,
467 &dma0_device, 341 &dma0_device,
468 &dma1_device, 342 &dma1_device,
469}; 343};
@@ -484,10 +358,6 @@ static struct platform_device *sh7785_early_devices[] __initdata = {
484 &scif5_device, 358 &scif5_device,
485 &tmu0_device, 359 &tmu0_device,
486 &tmu1_device, 360 &tmu1_device,
487 &tmu2_device,
488 &tmu3_device,
489 &tmu4_device,
490 &tmu5_device,
491}; 361};
492 362
493void __init plat_early_device_setup(void) 363void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 5d619a551a3b..479e79bdd3d0 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -175,25 +175,18 @@ static struct platform_device scif5_device = {
175}; 175};
176 176
177static struct sh_timer_config tmu0_platform_data = { 177static struct sh_timer_config tmu0_platform_data = {
178 .channel_offset = 0x04, 178 .channels_mask = 7,
179 .timer_bit = 0,
180 .clockevent_rating = 200,
181}; 179};
182 180
183static struct resource tmu0_resources[] = { 181static struct resource tmu0_resources[] = {
184 [0] = { 182 DEFINE_RES_MEM(0xffd80000, 0x30),
185 .start = 0xffd80008, 183 DEFINE_RES_IRQ(evt2irq(0x400)),
186 .end = 0xffd80013, 184 DEFINE_RES_IRQ(evt2irq(0x420)),
187 .flags = IORESOURCE_MEM, 185 DEFINE_RES_IRQ(evt2irq(0x440)),
188 },
189 [1] = {
190 .start = evt2irq(0x400),
191 .flags = IORESOURCE_IRQ,
192 },
193}; 186};
194 187
195static struct platform_device tmu0_device = { 188static struct platform_device tmu0_device = {
196 .name = "sh_tmu", 189 .name = "sh-tmu",
197 .id = 0, 190 .id = 0,
198 .dev = { 191 .dev = {
199 .platform_data = &tmu0_platform_data, 192 .platform_data = &tmu0_platform_data,
@@ -203,25 +196,18 @@ static struct platform_device tmu0_device = {
203}; 196};
204 197
205static struct sh_timer_config tmu1_platform_data = { 198static struct sh_timer_config tmu1_platform_data = {
206 .channel_offset = 0x10, 199 .channels_mask = 7,
207 .timer_bit = 1,
208 .clocksource_rating = 200,
209}; 200};
210 201
211static struct resource tmu1_resources[] = { 202static struct resource tmu1_resources[] = {
212 [0] = { 203 DEFINE_RES_MEM(0xffda0000, 0x2c),
213 .start = 0xffd80014, 204 DEFINE_RES_IRQ(evt2irq(0x480)),
214 .end = 0xffd8001f, 205 DEFINE_RES_IRQ(evt2irq(0x4a0)),
215 .flags = IORESOURCE_MEM, 206 DEFINE_RES_IRQ(evt2irq(0x4c0)),
216 },
217 [1] = {
218 .start = evt2irq(0x420),
219 .flags = IORESOURCE_IRQ,
220 },
221}; 207};
222 208
223static struct platform_device tmu1_device = { 209static struct platform_device tmu1_device = {
224 .name = "sh_tmu", 210 .name = "sh-tmu",
225 .id = 1, 211 .id = 1,
226 .dev = { 212 .dev = {
227 .platform_data = &tmu1_platform_data, 213 .platform_data = &tmu1_platform_data,
@@ -231,24 +217,18 @@ static struct platform_device tmu1_device = {
231}; 217};
232 218
233static struct sh_timer_config tmu2_platform_data = { 219static struct sh_timer_config tmu2_platform_data = {
234 .channel_offset = 0x1c, 220 .channels_mask = 7,
235 .timer_bit = 2,
236}; 221};
237 222
238static struct resource tmu2_resources[] = { 223static struct resource tmu2_resources[] = {
239 [0] = { 224 DEFINE_RES_MEM(0xffdc0000, 0x2c),
240 .start = 0xffd80020, 225 DEFINE_RES_IRQ(evt2irq(0x7a0)),
241 .end = 0xffd8002f, 226 DEFINE_RES_IRQ(evt2irq(0x7a0)),
242 .flags = IORESOURCE_MEM, 227 DEFINE_RES_IRQ(evt2irq(0x7a0)),
243 },
244 [1] = {
245 .start = evt2irq(0x440),
246 .flags = IORESOURCE_IRQ,
247 },
248}; 228};
249 229
250static struct platform_device tmu2_device = { 230static struct platform_device tmu2_device = {
251 .name = "sh_tmu", 231 .name = "sh-tmu",
252 .id = 2, 232 .id = 2,
253 .dev = { 233 .dev = {
254 .platform_data = &tmu2_platform_data, 234 .platform_data = &tmu2_platform_data,
@@ -258,24 +238,18 @@ static struct platform_device tmu2_device = {
258}; 238};
259 239
260static struct sh_timer_config tmu3_platform_data = { 240static struct sh_timer_config tmu3_platform_data = {
261 .channel_offset = 0x04, 241 .channels_mask = 7,
262 .timer_bit = 0,
263}; 242};
264 243
265static struct resource tmu3_resources[] = { 244static struct resource tmu3_resources[] = {
266 [0] = { 245 DEFINE_RES_MEM(0xffde0000, 0x2c),
267 .start = 0xffda0008, 246 DEFINE_RES_IRQ(evt2irq(0x7c0)),
268 .end = 0xffda0013, 247 DEFINE_RES_IRQ(evt2irq(0x7c0)),
269 .flags = IORESOURCE_MEM, 248 DEFINE_RES_IRQ(evt2irq(0x7c0)),
270 },
271 [1] = {
272 .start = evt2irq(0x480),
273 .flags = IORESOURCE_IRQ,
274 },
275}; 249};
276 250
277static struct platform_device tmu3_device = { 251static struct platform_device tmu3_device = {
278 .name = "sh_tmu", 252 .name = "sh-tmu",
279 .id = 3, 253 .id = 3,
280 .dev = { 254 .dev = {
281 .platform_data = &tmu3_platform_data, 255 .platform_data = &tmu3_platform_data,
@@ -284,222 +258,6 @@ static struct platform_device tmu3_device = {
284 .num_resources = ARRAY_SIZE(tmu3_resources), 258 .num_resources = ARRAY_SIZE(tmu3_resources),
285}; 259};
286 260
287static struct sh_timer_config tmu4_platform_data = {
288 .channel_offset = 0x10,
289 .timer_bit = 1,
290};
291
292static struct resource tmu4_resources[] = {
293 [0] = {
294 .start = 0xffda0014,
295 .end = 0xffda001f,
296 .flags = IORESOURCE_MEM,
297 },
298 [1] = {
299 .start = evt2irq(0x4a0),
300 .flags = IORESOURCE_IRQ,
301 },
302};
303
304static struct platform_device tmu4_device = {
305 .name = "sh_tmu",
306 .id = 4,
307 .dev = {
308 .platform_data = &tmu4_platform_data,
309 },
310 .resource = tmu4_resources,
311 .num_resources = ARRAY_SIZE(tmu4_resources),
312};
313
314static struct sh_timer_config tmu5_platform_data = {
315 .channel_offset = 0x1c,
316 .timer_bit = 2,
317};
318
319static struct resource tmu5_resources[] = {
320 [0] = {
321 .start = 0xffda0020,
322 .end = 0xffda002b,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = evt2irq(0x4c0),
327 .flags = IORESOURCE_IRQ,
328 },
329};
330
331static struct platform_device tmu5_device = {
332 .name = "sh_tmu",
333 .id = 5,
334 .dev = {
335 .platform_data = &tmu5_platform_data,
336 },
337 .resource = tmu5_resources,
338 .num_resources = ARRAY_SIZE(tmu5_resources),
339};
340
341static struct sh_timer_config tmu6_platform_data = {
342 .channel_offset = 0x04,
343 .timer_bit = 0,
344};
345
346static struct resource tmu6_resources[] = {
347 [0] = {
348 .start = 0xffdc0008,
349 .end = 0xffdc0013,
350 .flags = IORESOURCE_MEM,
351 },
352 [1] = {
353 .start = evt2irq(0x7a0),
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device tmu6_device = {
359 .name = "sh_tmu",
360 .id = 6,
361 .dev = {
362 .platform_data = &tmu6_platform_data,
363 },
364 .resource = tmu6_resources,
365 .num_resources = ARRAY_SIZE(tmu6_resources),
366};
367
368static struct sh_timer_config tmu7_platform_data = {
369 .channel_offset = 0x10,
370 .timer_bit = 1,
371};
372
373static struct resource tmu7_resources[] = {
374 [0] = {
375 .start = 0xffdc0014,
376 .end = 0xffdc001f,
377 .flags = IORESOURCE_MEM,
378 },
379 [1] = {
380 .start = evt2irq(0x7a0),
381 .flags = IORESOURCE_IRQ,
382 },
383};
384
385static struct platform_device tmu7_device = {
386 .name = "sh_tmu",
387 .id = 7,
388 .dev = {
389 .platform_data = &tmu7_platform_data,
390 },
391 .resource = tmu7_resources,
392 .num_resources = ARRAY_SIZE(tmu7_resources),
393};
394
395static struct sh_timer_config tmu8_platform_data = {
396 .channel_offset = 0x1c,
397 .timer_bit = 2,
398};
399
400static struct resource tmu8_resources[] = {
401 [0] = {
402 .start = 0xffdc0020,
403 .end = 0xffdc002b,
404 .flags = IORESOURCE_MEM,
405 },
406 [1] = {
407 .start = evt2irq(0x7a0),
408 .flags = IORESOURCE_IRQ,
409 },
410};
411
412static struct platform_device tmu8_device = {
413 .name = "sh_tmu",
414 .id = 8,
415 .dev = {
416 .platform_data = &tmu8_platform_data,
417 },
418 .resource = tmu8_resources,
419 .num_resources = ARRAY_SIZE(tmu8_resources),
420};
421
422static struct sh_timer_config tmu9_platform_data = {
423 .channel_offset = 0x04,
424 .timer_bit = 0,
425};
426
427static struct resource tmu9_resources[] = {
428 [0] = {
429 .start = 0xffde0008,
430 .end = 0xffde0013,
431 .flags = IORESOURCE_MEM,
432 },
433 [1] = {
434 .start = evt2irq(0x7c0),
435 .flags = IORESOURCE_IRQ,
436 },
437};
438
439static struct platform_device tmu9_device = {
440 .name = "sh_tmu",
441 .id = 9,
442 .dev = {
443 .platform_data = &tmu9_platform_data,
444 },
445 .resource = tmu9_resources,
446 .num_resources = ARRAY_SIZE(tmu9_resources),
447};
448
449static struct sh_timer_config tmu10_platform_data = {
450 .channel_offset = 0x10,
451 .timer_bit = 1,
452};
453
454static struct resource tmu10_resources[] = {
455 [0] = {
456 .start = 0xffde0014,
457 .end = 0xffde001f,
458 .flags = IORESOURCE_MEM,
459 },
460 [1] = {
461 .start = evt2irq(0x7c0),
462 .flags = IORESOURCE_IRQ,
463 },
464};
465
466static struct platform_device tmu10_device = {
467 .name = "sh_tmu",
468 .id = 10,
469 .dev = {
470 .platform_data = &tmu10_platform_data,
471 },
472 .resource = tmu10_resources,
473 .num_resources = ARRAY_SIZE(tmu10_resources),
474};
475
476static struct sh_timer_config tmu11_platform_data = {
477 .channel_offset = 0x1c,
478 .timer_bit = 2,
479};
480
481static struct resource tmu11_resources[] = {
482 [0] = {
483 .start = 0xffde0020,
484 .end = 0xffde002b,
485 .flags = IORESOURCE_MEM,
486 },
487 [1] = {
488 .start = evt2irq(0x7c0),
489 .flags = IORESOURCE_IRQ,
490 },
491};
492
493static struct platform_device tmu11_device = {
494 .name = "sh_tmu",
495 .id = 11,
496 .dev = {
497 .platform_data = &tmu11_platform_data,
498 },
499 .resource = tmu11_resources,
500 .num_resources = ARRAY_SIZE(tmu11_resources),
501};
502
503static const struct sh_dmae_channel dmac0_channels[] = { 261static const struct sh_dmae_channel dmac0_channels[] = {
504 { 262 {
505 .offset = 0, 263 .offset = 0,
@@ -641,15 +399,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = {
641 &tmu0_device, 399 &tmu0_device,
642 &tmu1_device, 400 &tmu1_device,
643 &tmu2_device, 401 &tmu2_device,
644 &tmu3_device,
645 &tmu4_device,
646 &tmu5_device,
647 &tmu6_device,
648 &tmu7_device,
649 &tmu8_device,
650 &tmu9_device,
651 &tmu10_device,
652 &tmu11_device,
653}; 402};
654 403
655static struct platform_device *sh7786_devices[] __initdata = { 404static struct platform_device *sh7786_devices[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 0856bcbb1da0..a78c5feb4e3b 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -100,25 +100,18 @@ static struct platform_device scif2_device = {
100}; 100};
101 101
102static struct sh_timer_config tmu0_platform_data = { 102static struct sh_timer_config tmu0_platform_data = {
103 .channel_offset = 0x04, 103 .channels_mask = 7,
104 .timer_bit = 0,
105 .clockevent_rating = 200,
106}; 104};
107 105
108static struct resource tmu0_resources[] = { 106static struct resource tmu0_resources[] = {
109 [0] = { 107 DEFINE_RES_MEM(0xffc10000, 0x30),
110 .start = 0xffc10008, 108 DEFINE_RES_IRQ(evt2irq(0x400)),
111 .end = 0xffc10013, 109 DEFINE_RES_IRQ(evt2irq(0x420)),
112 .flags = IORESOURCE_MEM, 110 DEFINE_RES_IRQ(evt2irq(0x440)),
113 },
114 [1] = {
115 .start = evt2irq(0x400),
116 .flags = IORESOURCE_IRQ,
117 },
118}; 111};
119 112
120static struct platform_device tmu0_device = { 113static struct platform_device tmu0_device = {
121 .name = "sh_tmu", 114 .name = "sh-tmu",
122 .id = 0, 115 .id = 0,
123 .dev = { 116 .dev = {
124 .platform_data = &tmu0_platform_data, 117 .platform_data = &tmu0_platform_data,
@@ -128,25 +121,18 @@ static struct platform_device tmu0_device = {
128}; 121};
129 122
130static struct sh_timer_config tmu1_platform_data = { 123static struct sh_timer_config tmu1_platform_data = {
131 .channel_offset = 0x10, 124 .channels_mask = 7,
132 .timer_bit = 1,
133 .clocksource_rating = 200,
134}; 125};
135 126
136static struct resource tmu1_resources[] = { 127static struct resource tmu1_resources[] = {
137 [0] = { 128 DEFINE_RES_MEM(0xffc20000, 0x2c),
138 .start = 0xffc10014, 129 DEFINE_RES_IRQ(evt2irq(0x460)),
139 .end = 0xffc1001f, 130 DEFINE_RES_IRQ(evt2irq(0x480)),
140 .flags = IORESOURCE_MEM, 131 DEFINE_RES_IRQ(evt2irq(0x4a0)),
141 },
142 [1] = {
143 .start = evt2irq(0x420),
144 .flags = IORESOURCE_IRQ,
145 },
146}; 132};
147 133
148static struct platform_device tmu1_device = { 134static struct platform_device tmu1_device = {
149 .name = "sh_tmu", 135 .name = "sh-tmu",
150 .id = 1, 136 .id = 1,
151 .dev = { 137 .dev = {
152 .platform_data = &tmu1_platform_data, 138 .platform_data = &tmu1_platform_data,
@@ -155,124 +141,12 @@ static struct platform_device tmu1_device = {
155 .num_resources = ARRAY_SIZE(tmu1_resources), 141 .num_resources = ARRAY_SIZE(tmu1_resources),
156}; 142};
157 143
158static struct sh_timer_config tmu2_platform_data = {
159 .channel_offset = 0x1c,
160 .timer_bit = 2,
161};
162
163static struct resource tmu2_resources[] = {
164 [0] = {
165 .start = 0xffc10020,
166 .end = 0xffc1002f,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = evt2irq(0x440),
171 .flags = IORESOURCE_IRQ,
172 },
173};
174
175static struct platform_device tmu2_device = {
176 .name = "sh_tmu",
177 .id = 2,
178 .dev = {
179 .platform_data = &tmu2_platform_data,
180 },
181 .resource = tmu2_resources,
182 .num_resources = ARRAY_SIZE(tmu2_resources),
183};
184
185static struct sh_timer_config tmu3_platform_data = {
186 .channel_offset = 0x04,
187 .timer_bit = 0,
188};
189
190static struct resource tmu3_resources[] = {
191 [0] = {
192 .start = 0xffc20008,
193 .end = 0xffc20013,
194 .flags = IORESOURCE_MEM,
195 },
196 [1] = {
197 .start = evt2irq(0x460),
198 .flags = IORESOURCE_IRQ,
199 },
200};
201
202static struct platform_device tmu3_device = {
203 .name = "sh_tmu",
204 .id = 3,
205 .dev = {
206 .platform_data = &tmu3_platform_data,
207 },
208 .resource = tmu3_resources,
209 .num_resources = ARRAY_SIZE(tmu3_resources),
210};
211
212static struct sh_timer_config tmu4_platform_data = {
213 .channel_offset = 0x10,
214 .timer_bit = 1,
215};
216
217static struct resource tmu4_resources[] = {
218 [0] = {
219 .start = 0xffc20014,
220 .end = 0xffc2001f,
221 .flags = IORESOURCE_MEM,
222 },
223 [1] = {
224 .start = evt2irq(0x480),
225 .flags = IORESOURCE_IRQ,
226 },
227};
228
229static struct platform_device tmu4_device = {
230 .name = "sh_tmu",
231 .id = 4,
232 .dev = {
233 .platform_data = &tmu4_platform_data,
234 },
235 .resource = tmu4_resources,
236 .num_resources = ARRAY_SIZE(tmu4_resources),
237};
238
239static struct sh_timer_config tmu5_platform_data = {
240 .channel_offset = 0x1c,
241 .timer_bit = 2,
242};
243
244static struct resource tmu5_resources[] = {
245 [0] = {
246 .start = 0xffc20020,
247 .end = 0xffc2002b,
248 .flags = IORESOURCE_MEM,
249 },
250 [1] = {
251 .start = evt2irq(0x4a0),
252 .flags = IORESOURCE_IRQ,
253 },
254};
255
256static struct platform_device tmu5_device = {
257 .name = "sh_tmu",
258 .id = 5,
259 .dev = {
260 .platform_data = &tmu5_platform_data,
261 },
262 .resource = tmu5_resources,
263 .num_resources = ARRAY_SIZE(tmu5_resources),
264};
265
266static struct platform_device *shx3_early_devices[] __initdata = { 144static struct platform_device *shx3_early_devices[] __initdata = {
267 &scif0_device, 145 &scif0_device,
268 &scif1_device, 146 &scif1_device,
269 &scif2_device, 147 &scif2_device,
270 &tmu0_device, 148 &tmu0_device,
271 &tmu1_device, 149 &tmu1_device,
272 &tmu2_device,
273 &tmu3_device,
274 &tmu4_device,
275 &tmu5_device,
276}; 150};
277 151
278static int __init shx3_devices_setup(void) 152static int __init shx3_devices_setup(void)
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c
index 14d68213d16b..1bf0b2cf6652 100644
--- a/arch/sh/kernel/cpu/sh5/setup-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c
@@ -71,30 +71,20 @@ static struct platform_device rtc_device = {
71 71
72#define TMU_BLOCK_OFF 0x01020000 72#define TMU_BLOCK_OFF 0x01020000
73#define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF 73#define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
74#define TMU0_BASE (TMU_BASE + 0x8 + (0xc * 0x0))
75#define TMU1_BASE (TMU_BASE + 0x8 + (0xc * 0x1))
76#define TMU2_BASE (TMU_BASE + 0x8 + (0xc * 0x2))
77 74
78static struct sh_timer_config tmu0_platform_data = { 75static struct sh_timer_config tmu0_platform_data = {
79 .channel_offset = 0x04, 76 .channels_mask = 7,
80 .timer_bit = 0,
81 .clockevent_rating = 200,
82}; 77};
83 78
84static struct resource tmu0_resources[] = { 79static struct resource tmu0_resources[] = {
85 [0] = { 80 DEFINE_RES_MEM(TMU_BASE, 0x30),
86 .start = TMU0_BASE, 81 DEFINE_RES_IRQ(IRQ_TUNI0),
87 .end = TMU0_BASE + 0xc - 1, 82 DEFINE_RES_IRQ(IRQ_TUNI1),
88 .flags = IORESOURCE_MEM, 83 DEFINE_RES_IRQ(IRQ_TUNI2),
89 },
90 [1] = {
91 .start = IRQ_TUNI0,
92 .flags = IORESOURCE_IRQ,
93 },
94}; 84};
95 85
96static struct platform_device tmu0_device = { 86static struct platform_device tmu0_device = {
97 .name = "sh_tmu", 87 .name = "sh-tmu",
98 .id = 0, 88 .id = 0,
99 .dev = { 89 .dev = {
100 .platform_data = &tmu0_platform_data, 90 .platform_data = &tmu0_platform_data,
@@ -103,66 +93,9 @@ static struct platform_device tmu0_device = {
103 .num_resources = ARRAY_SIZE(tmu0_resources), 93 .num_resources = ARRAY_SIZE(tmu0_resources),
104}; 94};
105 95
106static struct sh_timer_config tmu1_platform_data = {
107 .channel_offset = 0x10,
108 .timer_bit = 1,
109 .clocksource_rating = 200,
110};
111
112static struct resource tmu1_resources[] = {
113 [0] = {
114 .start = TMU1_BASE,
115 .end = TMU1_BASE + 0xc - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = IRQ_TUNI1,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static struct platform_device tmu1_device = {
125 .name = "sh_tmu",
126 .id = 1,
127 .dev = {
128 .platform_data = &tmu1_platform_data,
129 },
130 .resource = tmu1_resources,
131 .num_resources = ARRAY_SIZE(tmu1_resources),
132};
133
134static struct sh_timer_config tmu2_platform_data = {
135 .channel_offset = 0x1c,
136 .timer_bit = 2,
137};
138
139static struct resource tmu2_resources[] = {
140 [0] = {
141 .start = TMU2_BASE,
142 .end = TMU2_BASE + 0xc - 1,
143 .flags = IORESOURCE_MEM,
144 },
145 [1] = {
146 .start = IRQ_TUNI2,
147 .flags = IORESOURCE_IRQ,
148 },
149};
150
151static struct platform_device tmu2_device = {
152 .name = "sh_tmu",
153 .id = 2,
154 .dev = {
155 .platform_data = &tmu2_platform_data,
156 },
157 .resource = tmu2_resources,
158 .num_resources = ARRAY_SIZE(tmu2_resources),
159};
160
161static struct platform_device *sh5_early_devices[] __initdata = { 96static struct platform_device *sh5_early_devices[] __initdata = {
162 &scif0_device, 97 &scif0_device,
163 &tmu0_device, 98 &tmu0_device,
164 &tmu1_device,
165 &tmu2_device,
166}; 99};
167 100
168static struct platform_device *sh5_devices[] __initdata = { 101static struct platform_device *sh5_devices[] __initdata = {