diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 06:01:01 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:52:39 -0400 |
commit | acd664ab54a449a7257dcb3c7ef9cd1e310b4c4f (patch) | |
tree | 8008b545322fd97be968a1991da829afa5b76763 /arch/sh/kernel | |
parent | 6a3501b63d30643120566cc1efba5acd0e64b12d (diff) |
sh: TMU platform data for sh7705
This patch adds TMU platform data for sh7705. Both clockevent
and clocksource support is enabled.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7705.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index 63b67badd67e..39513664d5d7 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/sh_timer.h> | ||
16 | #include <asm/rtc.h> | 17 | #include <asm/rtc.h> |
17 | 18 | ||
18 | enum { | 19 | enum { |
@@ -116,7 +117,102 @@ static struct platform_device rtc_device = { | |||
116 | }, | 117 | }, |
117 | }; | 118 | }; |
118 | 119 | ||
120 | static struct sh_timer_config tmu0_platform_data = { | ||
121 | .name = "TMU0", | ||
122 | .channel_offset = 0x02, | ||
123 | .timer_bit = 0, | ||
124 | .clk = "module_clk", | ||
125 | .clockevent_rating = 200, | ||
126 | }; | ||
127 | |||
128 | static struct resource tmu0_resources[] = { | ||
129 | [0] = { | ||
130 | .name = "TMU0", | ||
131 | .start = 0xfffffe94, | ||
132 | .end = 0xfffffe9f, | ||
133 | .flags = IORESOURCE_MEM, | ||
134 | }, | ||
135 | [1] = { | ||
136 | .start = 16, | ||
137 | .flags = IORESOURCE_IRQ, | ||
138 | }, | ||
139 | }; | ||
140 | |||
141 | static struct platform_device tmu0_device = { | ||
142 | .name = "sh_tmu", | ||
143 | .id = 0, | ||
144 | .dev = { | ||
145 | .platform_data = &tmu0_platform_data, | ||
146 | }, | ||
147 | .resource = tmu0_resources, | ||
148 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
149 | }; | ||
150 | |||
151 | static struct sh_timer_config tmu1_platform_data = { | ||
152 | .name = "TMU1", | ||
153 | .channel_offset = 0xe, | ||
154 | .timer_bit = 1, | ||
155 | .clk = "module_clk", | ||
156 | .clocksource_rating = 200, | ||
157 | }; | ||
158 | |||
159 | static struct resource tmu1_resources[] = { | ||
160 | [0] = { | ||
161 | .name = "TMU1", | ||
162 | .start = 0xfffffea0, | ||
163 | .end = 0xfffffeab, | ||
164 | .flags = IORESOURCE_MEM, | ||
165 | }, | ||
166 | [1] = { | ||
167 | .start = 17, | ||
168 | .flags = IORESOURCE_IRQ, | ||
169 | }, | ||
170 | }; | ||
171 | |||
172 | static struct platform_device tmu1_device = { | ||
173 | .name = "sh_tmu", | ||
174 | .id = 1, | ||
175 | .dev = { | ||
176 | .platform_data = &tmu1_platform_data, | ||
177 | }, | ||
178 | .resource = tmu1_resources, | ||
179 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
180 | }; | ||
181 | |||
182 | static struct sh_timer_config tmu2_platform_data = { | ||
183 | .name = "TMU2", | ||
184 | .channel_offset = 0x1a, | ||
185 | .timer_bit = 2, | ||
186 | .clk = "module_clk", | ||
187 | }; | ||
188 | |||
189 | static struct resource tmu2_resources[] = { | ||
190 | [0] = { | ||
191 | .name = "TMU2", | ||
192 | .start = 0xfffffeac, | ||
193 | .end = 0xfffffebb, | ||
194 | .flags = IORESOURCE_MEM, | ||
195 | }, | ||
196 | [1] = { | ||
197 | .start = 18, | ||
198 | .flags = IORESOURCE_IRQ, | ||
199 | }, | ||
200 | }; | ||
201 | |||
202 | static struct platform_device tmu2_device = { | ||
203 | .name = "sh_tmu", | ||
204 | .id = 2, | ||
205 | .dev = { | ||
206 | .platform_data = &tmu2_platform_data, | ||
207 | }, | ||
208 | .resource = tmu2_resources, | ||
209 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
210 | }; | ||
211 | |||
119 | static struct platform_device *sh7705_devices[] __initdata = { | 212 | static struct platform_device *sh7705_devices[] __initdata = { |
213 | &tmu0_device, | ||
214 | &tmu1_device, | ||
215 | &tmu2_device, | ||
120 | &sci_device, | 216 | &sci_device, |
121 | &rtc_device, | 217 | &rtc_device, |
122 | }; | 218 | }; |
@@ -128,6 +224,18 @@ static int __init sh7705_devices_setup(void) | |||
128 | } | 224 | } |
129 | __initcall(sh7705_devices_setup); | 225 | __initcall(sh7705_devices_setup); |
130 | 226 | ||
227 | static struct platform_device *sh7705_early_devices[] __initdata = { | ||
228 | &tmu0_device, | ||
229 | &tmu1_device, | ||
230 | &tmu2_device, | ||
231 | }; | ||
232 | |||
233 | void __init plat_early_device_setup(void) | ||
234 | { | ||
235 | early_platform_add_devices(sh7705_early_devices, | ||
236 | ARRAY_SIZE(sh7705_early_devices)); | ||
237 | } | ||
238 | |||
131 | void __init plat_irq_setup(void) | 239 | void __init plat_irq_setup(void) |
132 | { | 240 | { |
133 | register_intc_controller(&intc_desc); | 241 | register_intc_controller(&intc_desc); |