diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7705.c | 108 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh770x.c | 108 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7710.c | 108 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7720.c | 270 |
4 files changed, 594 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); |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index a74f960b5e79..9412d915b84e 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/serial.h> | 19 | #include <linux/serial.h> |
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | ||
21 | 22 | ||
22 | enum { | 23 | enum { |
23 | UNUSED = 0, | 24 | UNUSED = 0, |
@@ -144,7 +145,102 @@ static struct platform_device sci_device = { | |||
144 | }, | 145 | }, |
145 | }; | 146 | }; |
146 | 147 | ||
148 | static struct sh_timer_config tmu0_platform_data = { | ||
149 | .name = "TMU0", | ||
150 | .channel_offset = 0x02, | ||
151 | .timer_bit = 0, | ||
152 | .clk = "module_clk", | ||
153 | .clockevent_rating = 200, | ||
154 | }; | ||
155 | |||
156 | static struct resource tmu0_resources[] = { | ||
157 | [0] = { | ||
158 | .name = "TMU0", | ||
159 | .start = 0xfffffe94, | ||
160 | .end = 0xfffffe9f, | ||
161 | .flags = IORESOURCE_MEM, | ||
162 | }, | ||
163 | [1] = { | ||
164 | .start = 16, | ||
165 | .flags = IORESOURCE_IRQ, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device tmu0_device = { | ||
170 | .name = "sh_tmu", | ||
171 | .id = 0, | ||
172 | .dev = { | ||
173 | .platform_data = &tmu0_platform_data, | ||
174 | }, | ||
175 | .resource = tmu0_resources, | ||
176 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
177 | }; | ||
178 | |||
179 | static struct sh_timer_config tmu1_platform_data = { | ||
180 | .name = "TMU1", | ||
181 | .channel_offset = 0xe, | ||
182 | .timer_bit = 1, | ||
183 | .clk = "module_clk", | ||
184 | .clocksource_rating = 200, | ||
185 | }; | ||
186 | |||
187 | static struct resource tmu1_resources[] = { | ||
188 | [0] = { | ||
189 | .name = "TMU1", | ||
190 | .start = 0xfffffea0, | ||
191 | .end = 0xfffffeab, | ||
192 | .flags = IORESOURCE_MEM, | ||
193 | }, | ||
194 | [1] = { | ||
195 | .start = 17, | ||
196 | .flags = IORESOURCE_IRQ, | ||
197 | }, | ||
198 | }; | ||
199 | |||
200 | static struct platform_device tmu1_device = { | ||
201 | .name = "sh_tmu", | ||
202 | .id = 1, | ||
203 | .dev = { | ||
204 | .platform_data = &tmu1_platform_data, | ||
205 | }, | ||
206 | .resource = tmu1_resources, | ||
207 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
208 | }; | ||
209 | |||
210 | static struct sh_timer_config tmu2_platform_data = { | ||
211 | .name = "TMU2", | ||
212 | .channel_offset = 0x1a, | ||
213 | .timer_bit = 2, | ||
214 | .clk = "module_clk", | ||
215 | }; | ||
216 | |||
217 | static struct resource tmu2_resources[] = { | ||
218 | [0] = { | ||
219 | .name = "TMU2", | ||
220 | .start = 0xfffffeac, | ||
221 | .end = 0xfffffebb, | ||
222 | .flags = IORESOURCE_MEM, | ||
223 | }, | ||
224 | [1] = { | ||
225 | .start = 18, | ||
226 | .flags = IORESOURCE_IRQ, | ||
227 | }, | ||
228 | }; | ||
229 | |||
230 | static struct platform_device tmu2_device = { | ||
231 | .name = "sh_tmu", | ||
232 | .id = 2, | ||
233 | .dev = { | ||
234 | .platform_data = &tmu2_platform_data, | ||
235 | }, | ||
236 | .resource = tmu2_resources, | ||
237 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
238 | }; | ||
239 | |||
147 | static struct platform_device *sh770x_devices[] __initdata = { | 240 | static struct platform_device *sh770x_devices[] __initdata = { |
241 | &tmu0_device, | ||
242 | &tmu1_device, | ||
243 | &tmu2_device, | ||
148 | &sci_device, | 244 | &sci_device, |
149 | &rtc_device, | 245 | &rtc_device, |
150 | }; | 246 | }; |
@@ -156,6 +252,18 @@ static int __init sh770x_devices_setup(void) | |||
156 | } | 252 | } |
157 | __initcall(sh770x_devices_setup); | 253 | __initcall(sh770x_devices_setup); |
158 | 254 | ||
255 | static struct platform_device *sh770x_early_devices[] __initdata = { | ||
256 | &tmu0_device, | ||
257 | &tmu1_device, | ||
258 | &tmu2_device, | ||
259 | }; | ||
260 | |||
261 | void __init plat_early_device_setup(void) | ||
262 | { | ||
263 | early_platform_add_devices(sh770x_early_devices, | ||
264 | ARRAY_SIZE(sh770x_early_devices)); | ||
265 | } | ||
266 | |||
159 | void __init plat_irq_setup(void) | 267 | void __init plat_irq_setup(void) |
160 | { | 268 | { |
161 | register_intc_controller(&intc_desc); | 269 | register_intc_controller(&intc_desc); |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 335098b66e2f..07ff38d055a7 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.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 { |
@@ -120,7 +121,102 @@ static struct platform_device sci_device = { | |||
120 | }, | 121 | }, |
121 | }; | 122 | }; |
122 | 123 | ||
124 | static struct sh_timer_config tmu0_platform_data = { | ||
125 | .name = "TMU0", | ||
126 | .channel_offset = 0x02, | ||
127 | .timer_bit = 0, | ||
128 | .clk = "module_clk", | ||
129 | .clockevent_rating = 200, | ||
130 | }; | ||
131 | |||
132 | static struct resource tmu0_resources[] = { | ||
133 | [0] = { | ||
134 | .name = "TMU0", | ||
135 | .start = 0xa412fe94, | ||
136 | .end = 0xa412fe9f, | ||
137 | .flags = IORESOURCE_MEM, | ||
138 | }, | ||
139 | [1] = { | ||
140 | .start = 16, | ||
141 | .flags = IORESOURCE_IRQ, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | static struct platform_device tmu0_device = { | ||
146 | .name = "sh_tmu", | ||
147 | .id = 0, | ||
148 | .dev = { | ||
149 | .platform_data = &tmu0_platform_data, | ||
150 | }, | ||
151 | .resource = tmu0_resources, | ||
152 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
153 | }; | ||
154 | |||
155 | static struct sh_timer_config tmu1_platform_data = { | ||
156 | .name = "TMU1", | ||
157 | .channel_offset = 0xe, | ||
158 | .timer_bit = 1, | ||
159 | .clk = "module_clk", | ||
160 | .clocksource_rating = 200, | ||
161 | }; | ||
162 | |||
163 | static struct resource tmu1_resources[] = { | ||
164 | [0] = { | ||
165 | .name = "TMU1", | ||
166 | .start = 0xa412fea0, | ||
167 | .end = 0xa412feab, | ||
168 | .flags = IORESOURCE_MEM, | ||
169 | }, | ||
170 | [1] = { | ||
171 | .start = 17, | ||
172 | .flags = IORESOURCE_IRQ, | ||
173 | }, | ||
174 | }; | ||
175 | |||
176 | static struct platform_device tmu1_device = { | ||
177 | .name = "sh_tmu", | ||
178 | .id = 1, | ||
179 | .dev = { | ||
180 | .platform_data = &tmu1_platform_data, | ||
181 | }, | ||
182 | .resource = tmu1_resources, | ||
183 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
184 | }; | ||
185 | |||
186 | static struct sh_timer_config tmu2_platform_data = { | ||
187 | .name = "TMU2", | ||
188 | .channel_offset = 0x1a, | ||
189 | .timer_bit = 2, | ||
190 | .clk = "module_clk", | ||
191 | }; | ||
192 | |||
193 | static struct resource tmu2_resources[] = { | ||
194 | [0] = { | ||
195 | .name = "TMU2", | ||
196 | .start = 0xa412feac, | ||
197 | .end = 0xa412feb5, | ||
198 | .flags = IORESOURCE_MEM, | ||
199 | }, | ||
200 | [1] = { | ||
201 | .start = 18, | ||
202 | .flags = IORESOURCE_IRQ, | ||
203 | }, | ||
204 | }; | ||
205 | |||
206 | static struct platform_device tmu2_device = { | ||
207 | .name = "sh_tmu", | ||
208 | .id = 2, | ||
209 | .dev = { | ||
210 | .platform_data = &tmu2_platform_data, | ||
211 | }, | ||
212 | .resource = tmu2_resources, | ||
213 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
214 | }; | ||
215 | |||
123 | static struct platform_device *sh7710_devices[] __initdata = { | 216 | static struct platform_device *sh7710_devices[] __initdata = { |
217 | &tmu0_device, | ||
218 | &tmu1_device, | ||
219 | &tmu2_device, | ||
124 | &sci_device, | 220 | &sci_device, |
125 | &rtc_device, | 221 | &rtc_device, |
126 | }; | 222 | }; |
@@ -132,6 +228,18 @@ static int __init sh7710_devices_setup(void) | |||
132 | } | 228 | } |
133 | __initcall(sh7710_devices_setup); | 229 | __initcall(sh7710_devices_setup); |
134 | 230 | ||
231 | static struct platform_device *sh7710_early_devices[] __initdata = { | ||
232 | &tmu0_device, | ||
233 | &tmu1_device, | ||
234 | &tmu2_device, | ||
235 | }; | ||
236 | |||
237 | void __init plat_early_device_setup(void) | ||
238 | { | ||
239 | early_platform_add_devices(sh7710_early_devices, | ||
240 | ARRAY_SIZE(sh7710_early_devices)); | ||
241 | } | ||
242 | |||
135 | void __init plat_irq_setup(void) | 243 | void __init plat_irq_setup(void) |
136 | { | 244 | { |
137 | register_intc_controller(&intc_desc); | 245 | register_intc_controller(&intc_desc); |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index 003874a2fd2a..d8b46f5dff60 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/serial.h> | 18 | #include <linux/serial.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | ||
21 | #include <asm/rtc.h> | 22 | #include <asm/rtc.h> |
22 | 23 | ||
23 | static struct resource rtc_resources[] = { | 24 | static struct resource rtc_resources[] = { |
@@ -123,7 +124,259 @@ static struct platform_device usbf_device = { | |||
123 | .resource = usbf_resources, | 124 | .resource = usbf_resources, |
124 | }; | 125 | }; |
125 | 126 | ||
127 | static struct sh_timer_config cmt0_platform_data = { | ||
128 | .name = "CMT0", | ||
129 | .channel_offset = 0x10, | ||
130 | .timer_bit = 0, | ||
131 | .clk = "module_clk", | ||
132 | .clockevent_rating = 125, | ||
133 | .clocksource_rating = 125, | ||
134 | }; | ||
135 | |||
136 | static struct resource cmt0_resources[] = { | ||
137 | [0] = { | ||
138 | .name = "CMT0", | ||
139 | .start = 0x044a0010, | ||
140 | .end = 0x044a001b, | ||
141 | .flags = IORESOURCE_MEM, | ||
142 | }, | ||
143 | [1] = { | ||
144 | .start = 104, | ||
145 | .flags = IORESOURCE_IRQ, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | static struct platform_device cmt0_device = { | ||
150 | .name = "sh_cmt", | ||
151 | .id = 0, | ||
152 | .dev = { | ||
153 | .platform_data = &cmt0_platform_data, | ||
154 | }, | ||
155 | .resource = cmt0_resources, | ||
156 | .num_resources = ARRAY_SIZE(cmt0_resources), | ||
157 | }; | ||
158 | |||
159 | static struct sh_timer_config cmt1_platform_data = { | ||
160 | .name = "CMT1", | ||
161 | .channel_offset = 0x20, | ||
162 | .timer_bit = 1, | ||
163 | .clk = "module_clk", | ||
164 | }; | ||
165 | |||
166 | static struct resource cmt1_resources[] = { | ||
167 | [0] = { | ||
168 | .name = "CMT1", | ||
169 | .start = 0x044a0020, | ||
170 | .end = 0x044a002b, | ||
171 | .flags = IORESOURCE_MEM, | ||
172 | }, | ||
173 | [1] = { | ||
174 | .start = 104, | ||
175 | .flags = IORESOURCE_IRQ, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct platform_device cmt1_device = { | ||
180 | .name = "sh_cmt", | ||
181 | .id = 1, | ||
182 | .dev = { | ||
183 | .platform_data = &cmt1_platform_data, | ||
184 | }, | ||
185 | .resource = cmt1_resources, | ||
186 | .num_resources = ARRAY_SIZE(cmt1_resources), | ||
187 | }; | ||
188 | |||
189 | static struct sh_timer_config cmt2_platform_data = { | ||
190 | .name = "CMT2", | ||
191 | .channel_offset = 0x30, | ||
192 | .timer_bit = 2, | ||
193 | .clk = "module_clk", | ||
194 | }; | ||
195 | |||
196 | static struct resource cmt2_resources[] = { | ||
197 | [0] = { | ||
198 | .name = "CMT2", | ||
199 | .start = 0x044a0030, | ||
200 | .end = 0x044a003b, | ||
201 | .flags = IORESOURCE_MEM, | ||
202 | }, | ||
203 | [1] = { | ||
204 | .start = 104, | ||
205 | .flags = IORESOURCE_IRQ, | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | static struct platform_device cmt2_device = { | ||
210 | .name = "sh_cmt", | ||
211 | .id = 2, | ||
212 | .dev = { | ||
213 | .platform_data = &cmt2_platform_data, | ||
214 | }, | ||
215 | .resource = cmt2_resources, | ||
216 | .num_resources = ARRAY_SIZE(cmt2_resources), | ||
217 | }; | ||
218 | |||
219 | static struct sh_timer_config cmt3_platform_data = { | ||
220 | .name = "CMT3", | ||
221 | .channel_offset = 0x40, | ||
222 | .timer_bit = 3, | ||
223 | .clk = "module_clk", | ||
224 | }; | ||
225 | |||
226 | static struct resource cmt3_resources[] = { | ||
227 | [0] = { | ||
228 | .name = "CMT3", | ||
229 | .start = 0x044a0040, | ||
230 | .end = 0x044a004b, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, | ||
233 | [1] = { | ||
234 | .start = 104, | ||
235 | .flags = IORESOURCE_IRQ, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct platform_device cmt3_device = { | ||
240 | .name = "sh_cmt", | ||
241 | .id = 3, | ||
242 | .dev = { | ||
243 | .platform_data = &cmt3_platform_data, | ||
244 | }, | ||
245 | .resource = cmt3_resources, | ||
246 | .num_resources = ARRAY_SIZE(cmt3_resources), | ||
247 | }; | ||
248 | |||
249 | static struct sh_timer_config cmt4_platform_data = { | ||
250 | .name = "CMT4", | ||
251 | .channel_offset = 0x50, | ||
252 | .timer_bit = 4, | ||
253 | .clk = "module_clk", | ||
254 | }; | ||
255 | |||
256 | static struct resource cmt4_resources[] = { | ||
257 | [0] = { | ||
258 | .name = "CMT4", | ||
259 | .start = 0x044a0050, | ||
260 | .end = 0x044a005b, | ||
261 | .flags = IORESOURCE_MEM, | ||
262 | }, | ||
263 | [1] = { | ||
264 | .start = 104, | ||
265 | .flags = IORESOURCE_IRQ, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static struct platform_device cmt4_device = { | ||
270 | .name = "sh_cmt", | ||
271 | .id = 4, | ||
272 | .dev = { | ||
273 | .platform_data = &cmt4_platform_data, | ||
274 | }, | ||
275 | .resource = cmt4_resources, | ||
276 | .num_resources = ARRAY_SIZE(cmt4_resources), | ||
277 | }; | ||
278 | |||
279 | static struct sh_timer_config tmu0_platform_data = { | ||
280 | .name = "TMU0", | ||
281 | .channel_offset = 0x02, | ||
282 | .timer_bit = 0, | ||
283 | .clk = "module_clk", | ||
284 | .clockevent_rating = 200, | ||
285 | }; | ||
286 | |||
287 | static struct resource tmu0_resources[] = { | ||
288 | [0] = { | ||
289 | .name = "TMU0", | ||
290 | .start = 0xa412fe94, | ||
291 | .end = 0xa412fe9f, | ||
292 | .flags = IORESOURCE_MEM, | ||
293 | }, | ||
294 | [1] = { | ||
295 | .start = 16, | ||
296 | .flags = IORESOURCE_IRQ, | ||
297 | }, | ||
298 | }; | ||
299 | |||
300 | static struct platform_device tmu0_device = { | ||
301 | .name = "sh_tmu", | ||
302 | .id = 0, | ||
303 | .dev = { | ||
304 | .platform_data = &tmu0_platform_data, | ||
305 | }, | ||
306 | .resource = tmu0_resources, | ||
307 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
308 | }; | ||
309 | |||
310 | static struct sh_timer_config tmu1_platform_data = { | ||
311 | .name = "TMU1", | ||
312 | .channel_offset = 0xe, | ||
313 | .timer_bit = 1, | ||
314 | .clk = "module_clk", | ||
315 | .clocksource_rating = 200, | ||
316 | }; | ||
317 | |||
318 | static struct resource tmu1_resources[] = { | ||
319 | [0] = { | ||
320 | .name = "TMU1", | ||
321 | .start = 0xa412fea0, | ||
322 | .end = 0xa412feab, | ||
323 | .flags = IORESOURCE_MEM, | ||
324 | }, | ||
325 | [1] = { | ||
326 | .start = 17, | ||
327 | .flags = IORESOURCE_IRQ, | ||
328 | }, | ||
329 | }; | ||
330 | |||
331 | static struct platform_device tmu1_device = { | ||
332 | .name = "sh_tmu", | ||
333 | .id = 1, | ||
334 | .dev = { | ||
335 | .platform_data = &tmu1_platform_data, | ||
336 | }, | ||
337 | .resource = tmu1_resources, | ||
338 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
339 | }; | ||
340 | |||
341 | static struct sh_timer_config tmu2_platform_data = { | ||
342 | .name = "TMU2", | ||
343 | .channel_offset = 0x1a, | ||
344 | .timer_bit = 2, | ||
345 | .clk = "module_clk", | ||
346 | }; | ||
347 | |||
348 | static struct resource tmu2_resources[] = { | ||
349 | [0] = { | ||
350 | .name = "TMU2", | ||
351 | .start = 0xa412feac, | ||
352 | .end = 0xa412feb5, | ||
353 | .flags = IORESOURCE_MEM, | ||
354 | }, | ||
355 | [1] = { | ||
356 | .start = 18, | ||
357 | .flags = IORESOURCE_IRQ, | ||
358 | }, | ||
359 | }; | ||
360 | |||
361 | static struct platform_device tmu2_device = { | ||
362 | .name = "sh_tmu", | ||
363 | .id = 2, | ||
364 | .dev = { | ||
365 | .platform_data = &tmu2_platform_data, | ||
366 | }, | ||
367 | .resource = tmu2_resources, | ||
368 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
369 | }; | ||
370 | |||
126 | static struct platform_device *sh7720_devices[] __initdata = { | 371 | static struct platform_device *sh7720_devices[] __initdata = { |
372 | &cmt0_device, | ||
373 | &cmt1_device, | ||
374 | &cmt2_device, | ||
375 | &cmt3_device, | ||
376 | &cmt4_device, | ||
377 | &tmu0_device, | ||
378 | &tmu1_device, | ||
379 | &tmu2_device, | ||
127 | &rtc_device, | 380 | &rtc_device, |
128 | &sci_device, | 381 | &sci_device, |
129 | &usb_ohci_device, | 382 | &usb_ohci_device, |
@@ -137,6 +390,23 @@ static int __init sh7720_devices_setup(void) | |||
137 | } | 390 | } |
138 | __initcall(sh7720_devices_setup); | 391 | __initcall(sh7720_devices_setup); |
139 | 392 | ||
393 | static struct platform_device *sh7720_early_devices[] __initdata = { | ||
394 | &cmt0_device, | ||
395 | &cmt1_device, | ||
396 | &cmt2_device, | ||
397 | &cmt3_device, | ||
398 | &cmt4_device, | ||
399 | &tmu0_device, | ||
400 | &tmu1_device, | ||
401 | &tmu2_device, | ||
402 | }; | ||
403 | |||
404 | void __init plat_early_device_setup(void) | ||
405 | { | ||
406 | early_platform_add_devices(sh7720_early_devices, | ||
407 | ARRAY_SIZE(sh7720_early_devices)); | ||
408 | } | ||
409 | |||
140 | enum { | 410 | enum { |
141 | UNUSED = 0, | 411 | UNUSED = 0, |
142 | 412 | ||