diff options
Diffstat (limited to 'arch/arm/mach-sa1100/generic.c')
-rw-r--r-- | arch/arm/mach-sa1100/generic.c | 151 |
1 files changed, 64 insertions, 87 deletions
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 7c1ebf4a7920..1d0f71b17a26 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -14,18 +14,23 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/dma-mapping.h> | ||
17 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
18 | #include <linux/cpufreq.h> | 19 | #include <linux/cpufreq.h> |
19 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | 22 | ||
23 | #include <video/sa1100fb.h> | ||
24 | |||
22 | #include <asm/div64.h> | 25 | #include <asm/div64.h> |
23 | #include <mach/hardware.h> | ||
24 | #include <asm/system.h> | 26 | #include <asm/system.h> |
25 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
26 | #include <asm/mach/flash.h> | 28 | #include <asm/mach/flash.h> |
27 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
28 | 30 | ||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/irqs.h> | ||
33 | |||
29 | #include "generic.h" | 34 | #include "generic.h" |
30 | 35 | ||
31 | unsigned int reset_status; | 36 | unsigned int reset_status; |
@@ -149,16 +154,8 @@ static void sa11x0_register_device(struct platform_device *dev, void *data) | |||
149 | 154 | ||
150 | 155 | ||
151 | static struct resource sa11x0udc_resources[] = { | 156 | static struct resource sa11x0udc_resources[] = { |
152 | [0] = { | 157 | [0] = DEFINE_RES_MEM(__PREG(Ser0UDCCR), SZ_64K), |
153 | .start = __PREG(Ser0UDCCR), | 158 | [1] = DEFINE_RES_IRQ(IRQ_Ser0UDC), |
154 | .end = __PREG(Ser0UDCCR) + 0xffff, | ||
155 | .flags = IORESOURCE_MEM, | ||
156 | }, | ||
157 | [1] = { | ||
158 | .start = IRQ_Ser0UDC, | ||
159 | .end = IRQ_Ser0UDC, | ||
160 | .flags = IORESOURCE_IRQ, | ||
161 | }, | ||
162 | }; | 159 | }; |
163 | 160 | ||
164 | static u64 sa11x0udc_dma_mask = 0xffffffffUL; | 161 | static u64 sa11x0udc_dma_mask = 0xffffffffUL; |
@@ -175,16 +172,8 @@ static struct platform_device sa11x0udc_device = { | |||
175 | }; | 172 | }; |
176 | 173 | ||
177 | static struct resource sa11x0uart1_resources[] = { | 174 | static struct resource sa11x0uart1_resources[] = { |
178 | [0] = { | 175 | [0] = DEFINE_RES_MEM(__PREG(Ser1UTCR0), SZ_64K), |
179 | .start = __PREG(Ser1UTCR0), | 176 | [1] = DEFINE_RES_IRQ(IRQ_Ser1UART), |
180 | .end = __PREG(Ser1UTCR0) + 0xffff, | ||
181 | .flags = IORESOURCE_MEM, | ||
182 | }, | ||
183 | [1] = { | ||
184 | .start = IRQ_Ser1UART, | ||
185 | .end = IRQ_Ser1UART, | ||
186 | .flags = IORESOURCE_IRQ, | ||
187 | }, | ||
188 | }; | 177 | }; |
189 | 178 | ||
190 | static struct platform_device sa11x0uart1_device = { | 179 | static struct platform_device sa11x0uart1_device = { |
@@ -195,16 +184,8 @@ static struct platform_device sa11x0uart1_device = { | |||
195 | }; | 184 | }; |
196 | 185 | ||
197 | static struct resource sa11x0uart3_resources[] = { | 186 | static struct resource sa11x0uart3_resources[] = { |
198 | [0] = { | 187 | [0] = DEFINE_RES_MEM(__PREG(Ser3UTCR0), SZ_64K), |
199 | .start = __PREG(Ser3UTCR0), | 188 | [1] = DEFINE_RES_IRQ(IRQ_Ser3UART), |
200 | .end = __PREG(Ser3UTCR0) + 0xffff, | ||
201 | .flags = IORESOURCE_MEM, | ||
202 | }, | ||
203 | [1] = { | ||
204 | .start = IRQ_Ser3UART, | ||
205 | .end = IRQ_Ser3UART, | ||
206 | .flags = IORESOURCE_IRQ, | ||
207 | }, | ||
208 | }; | 189 | }; |
209 | 190 | ||
210 | static struct platform_device sa11x0uart3_device = { | 191 | static struct platform_device sa11x0uart3_device = { |
@@ -215,16 +196,9 @@ static struct platform_device sa11x0uart3_device = { | |||
215 | }; | 196 | }; |
216 | 197 | ||
217 | static struct resource sa11x0mcp_resources[] = { | 198 | static struct resource sa11x0mcp_resources[] = { |
218 | [0] = { | 199 | [0] = DEFINE_RES_MEM(__PREG(Ser4MCCR0), SZ_64K), |
219 | .start = __PREG(Ser4MCCR0), | 200 | [1] = DEFINE_RES_MEM(__PREG(Ser4MCCR1), 4), |
220 | .end = __PREG(Ser4MCCR0) + 0xffff, | 201 | [2] = DEFINE_RES_IRQ(IRQ_Ser4MCP), |
221 | .flags = IORESOURCE_MEM, | ||
222 | }, | ||
223 | [1] = { | ||
224 | .start = IRQ_Ser4MCP, | ||
225 | .end = IRQ_Ser4MCP, | ||
226 | .flags = IORESOURCE_IRQ, | ||
227 | }, | ||
228 | }; | 202 | }; |
229 | 203 | ||
230 | static u64 sa11x0mcp_dma_mask = 0xffffffffUL; | 204 | static u64 sa11x0mcp_dma_mask = 0xffffffffUL; |
@@ -240,22 +214,24 @@ static struct platform_device sa11x0mcp_device = { | |||
240 | .resource = sa11x0mcp_resources, | 214 | .resource = sa11x0mcp_resources, |
241 | }; | 215 | }; |
242 | 216 | ||
217 | void __init sa11x0_ppc_configure_mcp(void) | ||
218 | { | ||
219 | /* Setup the PPC unit for the MCP */ | ||
220 | PPDR &= ~PPC_RXD4; | ||
221 | PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM; | ||
222 | PSDR |= PPC_RXD4; | ||
223 | PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM); | ||
224 | PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM); | ||
225 | } | ||
226 | |||
243 | void sa11x0_register_mcp(struct mcp_plat_data *data) | 227 | void sa11x0_register_mcp(struct mcp_plat_data *data) |
244 | { | 228 | { |
245 | sa11x0_register_device(&sa11x0mcp_device, data); | 229 | sa11x0_register_device(&sa11x0mcp_device, data); |
246 | } | 230 | } |
247 | 231 | ||
248 | static struct resource sa11x0ssp_resources[] = { | 232 | static struct resource sa11x0ssp_resources[] = { |
249 | [0] = { | 233 | [0] = DEFINE_RES_MEM(0x80070000, SZ_64K), |
250 | .start = 0x80070000, | 234 | [1] = DEFINE_RES_IRQ(IRQ_Ser4SSP), |
251 | .end = 0x8007ffff, | ||
252 | .flags = IORESOURCE_MEM, | ||
253 | }, | ||
254 | [1] = { | ||
255 | .start = IRQ_Ser4SSP, | ||
256 | .end = IRQ_Ser4SSP, | ||
257 | .flags = IORESOURCE_IRQ, | ||
258 | }, | ||
259 | }; | 235 | }; |
260 | 236 | ||
261 | static u64 sa11x0ssp_dma_mask = 0xffffffffUL; | 237 | static u64 sa11x0ssp_dma_mask = 0xffffffffUL; |
@@ -272,16 +248,8 @@ static struct platform_device sa11x0ssp_device = { | |||
272 | }; | 248 | }; |
273 | 249 | ||
274 | static struct resource sa11x0fb_resources[] = { | 250 | static struct resource sa11x0fb_resources[] = { |
275 | [0] = { | 251 | [0] = DEFINE_RES_MEM(0xb0100000, SZ_64K), |
276 | .start = 0xb0100000, | 252 | [1] = DEFINE_RES_IRQ(IRQ_LCD), |
277 | .end = 0xb010ffff, | ||
278 | .flags = IORESOURCE_MEM, | ||
279 | }, | ||
280 | [1] = { | ||
281 | .start = IRQ_LCD, | ||
282 | .end = IRQ_LCD, | ||
283 | .flags = IORESOURCE_IRQ, | ||
284 | }, | ||
285 | }; | 253 | }; |
286 | 254 | ||
287 | static struct platform_device sa11x0fb_device = { | 255 | static struct platform_device sa11x0fb_device = { |
@@ -294,6 +262,11 @@ static struct platform_device sa11x0fb_device = { | |||
294 | .resource = sa11x0fb_resources, | 262 | .resource = sa11x0fb_resources, |
295 | }; | 263 | }; |
296 | 264 | ||
265 | void sa11x0_register_lcd(struct sa1100fb_mach_info *inf) | ||
266 | { | ||
267 | sa11x0_register_device(&sa11x0fb_device, inf); | ||
268 | } | ||
269 | |||
297 | static struct platform_device sa11x0pcmcia_device = { | 270 | static struct platform_device sa11x0pcmcia_device = { |
298 | .name = "sa11x0-pcmcia", | 271 | .name = "sa11x0-pcmcia", |
299 | .id = -1, | 272 | .id = -1, |
@@ -314,23 +287,10 @@ void sa11x0_register_mtd(struct flash_platform_data *flash, | |||
314 | } | 287 | } |
315 | 288 | ||
316 | static struct resource sa11x0ir_resources[] = { | 289 | static struct resource sa11x0ir_resources[] = { |
317 | { | 290 | DEFINE_RES_MEM(__PREG(Ser2UTCR0), 0x24), |
318 | .start = __PREG(Ser2UTCR0), | 291 | DEFINE_RES_MEM(__PREG(Ser2HSCR0), 0x1c), |
319 | .end = __PREG(Ser2UTCR0) + 0x24 - 1, | 292 | DEFINE_RES_MEM(__PREG(Ser2HSCR2), 0x04), |
320 | .flags = IORESOURCE_MEM, | 293 | DEFINE_RES_IRQ(IRQ_Ser2ICP), |
321 | }, { | ||
322 | .start = __PREG(Ser2HSCR0), | ||
323 | .end = __PREG(Ser2HSCR0) + 0x1c - 1, | ||
324 | .flags = IORESOURCE_MEM, | ||
325 | }, { | ||
326 | .start = __PREG(Ser2HSCR2), | ||
327 | .end = __PREG(Ser2HSCR2) + 0x04 - 1, | ||
328 | .flags = IORESOURCE_MEM, | ||
329 | }, { | ||
330 | .start = IRQ_Ser2ICP, | ||
331 | .end = IRQ_Ser2ICP, | ||
332 | .flags = IORESOURCE_IRQ, | ||
333 | } | ||
334 | }; | 294 | }; |
335 | 295 | ||
336 | static struct platform_device sa11x0ir_device = { | 296 | static struct platform_device sa11x0ir_device = { |
@@ -358,14 +318,37 @@ static struct platform_device sa11x0rtc_device = { | |||
358 | .resource = sa1100_rtc_resources, | 318 | .resource = sa1100_rtc_resources, |
359 | }; | 319 | }; |
360 | 320 | ||
321 | static struct resource sa11x0dma_resources[] = { | ||
322 | DEFINE_RES_MEM(DMA_PHYS, DMA_SIZE), | ||
323 | DEFINE_RES_IRQ(IRQ_DMA0), | ||
324 | DEFINE_RES_IRQ(IRQ_DMA1), | ||
325 | DEFINE_RES_IRQ(IRQ_DMA2), | ||
326 | DEFINE_RES_IRQ(IRQ_DMA3), | ||
327 | DEFINE_RES_IRQ(IRQ_DMA4), | ||
328 | DEFINE_RES_IRQ(IRQ_DMA5), | ||
329 | }; | ||
330 | |||
331 | static u64 sa11x0dma_dma_mask = DMA_BIT_MASK(32); | ||
332 | |||
333 | static struct platform_device sa11x0dma_device = { | ||
334 | .name = "sa11x0-dma", | ||
335 | .id = -1, | ||
336 | .dev = { | ||
337 | .dma_mask = &sa11x0dma_dma_mask, | ||
338 | .coherent_dma_mask = 0xffffffff, | ||
339 | }, | ||
340 | .num_resources = ARRAY_SIZE(sa11x0dma_resources), | ||
341 | .resource = sa11x0dma_resources, | ||
342 | }; | ||
343 | |||
361 | static struct platform_device *sa11x0_devices[] __initdata = { | 344 | static struct platform_device *sa11x0_devices[] __initdata = { |
362 | &sa11x0udc_device, | 345 | &sa11x0udc_device, |
363 | &sa11x0uart1_device, | 346 | &sa11x0uart1_device, |
364 | &sa11x0uart3_device, | 347 | &sa11x0uart3_device, |
365 | &sa11x0ssp_device, | 348 | &sa11x0ssp_device, |
366 | &sa11x0pcmcia_device, | 349 | &sa11x0pcmcia_device, |
367 | &sa11x0fb_device, | ||
368 | &sa11x0rtc_device, | 350 | &sa11x0rtc_device, |
351 | &sa11x0dma_device, | ||
369 | }; | 352 | }; |
370 | 353 | ||
371 | static int __init sa1100_init(void) | 354 | static int __init sa1100_init(void) |
@@ -376,12 +359,6 @@ static int __init sa1100_init(void) | |||
376 | 359 | ||
377 | arch_initcall(sa1100_init); | 360 | arch_initcall(sa1100_init); |
378 | 361 | ||
379 | void (*sa1100fb_backlight_power)(int on); | ||
380 | void (*sa1100fb_lcd_power)(int on); | ||
381 | |||
382 | EXPORT_SYMBOL(sa1100fb_backlight_power); | ||
383 | EXPORT_SYMBOL(sa1100fb_lcd_power); | ||
384 | |||
385 | 362 | ||
386 | /* | 363 | /* |
387 | * Common I/O mapping: | 364 | * Common I/O mapping: |
@@ -436,7 +413,7 @@ void __init sa1100_map_io(void) | |||
436 | * the MBGNT signal false to ensure the SA1111 doesn't own the | 413 | * the MBGNT signal false to ensure the SA1111 doesn't own the |
437 | * SDRAM bus. | 414 | * SDRAM bus. |
438 | */ | 415 | */ |
439 | void __init sa1110_mb_disable(void) | 416 | void sa1110_mb_disable(void) |
440 | { | 417 | { |
441 | unsigned long flags; | 418 | unsigned long flags; |
442 | 419 | ||
@@ -455,7 +432,7 @@ void __init sa1110_mb_disable(void) | |||
455 | * If the system is going to use the SA-1111 DMA engines, set up | 432 | * If the system is going to use the SA-1111 DMA engines, set up |
456 | * the memory bus request/grant pins. | 433 | * the memory bus request/grant pins. |
457 | */ | 434 | */ |
458 | void __devinit sa1110_mb_enable(void) | 435 | void sa1110_mb_enable(void) |
459 | { | 436 | { |
460 | unsigned long flags; | 437 | unsigned long flags; |
461 | 438 | ||