aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh3
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 /arch/sh/kernel/cpu/sh3
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>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-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
4 files changed, 24 insertions, 288 deletions
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)