diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-16 19:48:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-16 19:48:45 -0400 |
commit | 9c0d2a20fe331946c1a65a5865faf56e93255c5c (patch) | |
tree | 9d47a9239b6249a5dd4244195ec4cc1e55fda3cd /arch/arm/mach-kirkwood/common.c | |
parent | 5e6b83ed8c00f2e2ae5b2413c5907bed735b600d (diff) | |
parent | 66bfa2f03191aec2e2958414b1dfb80a56637133 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: (38 commits)
[ARM] 5191/1: ARM: remove CVS keywords
[ARM] pxafb: fix the warning of incorrect lccr when lcd_conn is specified
[ARM] pxafb: add flag to specify output format on LDD pins when base is RGBT16
[ARM] pxafb: fix the incorrect configuration of GPIO77 as ACBIAS for TFT LCD
[ARM] 5198/1: PalmTX: PCMCIA fixes
[ARM] Fix a pile of broken watchdog drivers
[ARM] update mach-types
[ARM] 5196/1: fix inline asm constraints for preload
[ARM] 5194/1: update .gitignore
[ARM] add proc-macros.S include to proc-arm940 and proc-arm946
[ARM] 5192/1: ARM TLB: add v7wbi_{possible,always}_flags to {possible,always}_tlb_flags
[ARM] 5193/1: Wire up missing syscalls
[ARM] traps: don't call undef hook functions with spinlock held
[ARM] 5183/2: Provide Poodle LoCoMo GPIO names
[ARM] dma-mapping: provide sync_range APIs
[ARM] dma-mapping: improve type-safeness of DMA translations
[ARM] Kirkwood: instantiate the orion_spi driver in the platform code
[ARM] prevent crashing when too much RAM installed
[ARM] Kirkwood: Instantiate mv_xor driver
[ARM] Orion: Instantiate mv_xor driver for 5182
...
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 247 |
1 files changed, 243 insertions, 4 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 0e509b8ad56e..189f16f3619d 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -15,15 +15,17 @@ | |||
15 | #include <linux/mbus.h> | 15 | #include <linux/mbus.h> |
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/ata_platform.h> | 17 | #include <linux/ata_platform.h> |
18 | #include <linux/spi/orion_spi.h> | ||
18 | #include <asm/page.h> | 19 | #include <asm/page.h> |
19 | #include <asm/timex.h> | 20 | #include <asm/timex.h> |
20 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
21 | #include <asm/mach/time.h> | 22 | #include <asm/mach/time.h> |
22 | #include <mach/kirkwood.h> | 23 | #include <mach/kirkwood.h> |
23 | #include <asm/plat-orion/cache-feroceon-l2.h> | 24 | #include <plat/cache-feroceon-l2.h> |
24 | #include <asm/plat-orion/ehci-orion.h> | 25 | #include <plat/ehci-orion.h> |
25 | #include <asm/plat-orion/orion_nand.h> | 26 | #include <plat/mv_xor.h> |
26 | #include <asm/plat-orion/time.h> | 27 | #include <plat/orion_nand.h> |
28 | #include <plat/time.h> | ||
27 | #include "common.h" | 29 | #include "common.h" |
28 | 30 | ||
29 | /***************************************************************************** | 31 | /***************************************************************************** |
@@ -196,6 +198,37 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
196 | 198 | ||
197 | 199 | ||
198 | /***************************************************************************** | 200 | /***************************************************************************** |
201 | * SPI | ||
202 | ****************************************************************************/ | ||
203 | static struct orion_spi_info kirkwood_spi_plat_data = { | ||
204 | .tclk = KIRKWOOD_TCLK, | ||
205 | }; | ||
206 | |||
207 | static struct resource kirkwood_spi_resources[] = { | ||
208 | { | ||
209 | .start = SPI_PHYS_BASE, | ||
210 | .end = SPI_PHYS_BASE + SZ_512 - 1, | ||
211 | .flags = IORESOURCE_MEM, | ||
212 | }, | ||
213 | }; | ||
214 | |||
215 | static struct platform_device kirkwood_spi = { | ||
216 | .name = "orion_spi", | ||
217 | .id = 0, | ||
218 | .resource = kirkwood_spi_resources, | ||
219 | .dev = { | ||
220 | .platform_data = &kirkwood_spi_plat_data, | ||
221 | }, | ||
222 | .num_resources = ARRAY_SIZE(kirkwood_spi_resources), | ||
223 | }; | ||
224 | |||
225 | void __init kirkwood_spi_init() | ||
226 | { | ||
227 | platform_device_register(&kirkwood_spi); | ||
228 | } | ||
229 | |||
230 | |||
231 | /***************************************************************************** | ||
199 | * UART0 | 232 | * UART0 |
200 | ****************************************************************************/ | 233 | ****************************************************************************/ |
201 | static struct plat_serial8250_port kirkwood_uart0_data[] = { | 234 | static struct plat_serial8250_port kirkwood_uart0_data[] = { |
@@ -284,6 +317,212 @@ void __init kirkwood_uart1_init(void) | |||
284 | 317 | ||
285 | 318 | ||
286 | /***************************************************************************** | 319 | /***************************************************************************** |
320 | * XOR | ||
321 | ****************************************************************************/ | ||
322 | static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = { | ||
323 | .dram = &kirkwood_mbus_dram_info, | ||
324 | }; | ||
325 | |||
326 | static u64 kirkwood_xor_dmamask = DMA_32BIT_MASK; | ||
327 | |||
328 | |||
329 | /***************************************************************************** | ||
330 | * XOR0 | ||
331 | ****************************************************************************/ | ||
332 | static struct resource kirkwood_xor0_shared_resources[] = { | ||
333 | { | ||
334 | .name = "xor 0 low", | ||
335 | .start = XOR0_PHYS_BASE, | ||
336 | .end = XOR0_PHYS_BASE + 0xff, | ||
337 | .flags = IORESOURCE_MEM, | ||
338 | }, { | ||
339 | .name = "xor 0 high", | ||
340 | .start = XOR0_HIGH_PHYS_BASE, | ||
341 | .end = XOR0_HIGH_PHYS_BASE + 0xff, | ||
342 | .flags = IORESOURCE_MEM, | ||
343 | }, | ||
344 | }; | ||
345 | |||
346 | static struct platform_device kirkwood_xor0_shared = { | ||
347 | .name = MV_XOR_SHARED_NAME, | ||
348 | .id = 0, | ||
349 | .dev = { | ||
350 | .platform_data = &kirkwood_xor_shared_data, | ||
351 | }, | ||
352 | .num_resources = ARRAY_SIZE(kirkwood_xor0_shared_resources), | ||
353 | .resource = kirkwood_xor0_shared_resources, | ||
354 | }; | ||
355 | |||
356 | static struct resource kirkwood_xor00_resources[] = { | ||
357 | [0] = { | ||
358 | .start = IRQ_KIRKWOOD_XOR_00, | ||
359 | .end = IRQ_KIRKWOOD_XOR_00, | ||
360 | .flags = IORESOURCE_IRQ, | ||
361 | }, | ||
362 | }; | ||
363 | |||
364 | static struct mv_xor_platform_data kirkwood_xor00_data = { | ||
365 | .shared = &kirkwood_xor0_shared, | ||
366 | .hw_id = 0, | ||
367 | .pool_size = PAGE_SIZE, | ||
368 | }; | ||
369 | |||
370 | static struct platform_device kirkwood_xor00_channel = { | ||
371 | .name = MV_XOR_NAME, | ||
372 | .id = 0, | ||
373 | .num_resources = ARRAY_SIZE(kirkwood_xor00_resources), | ||
374 | .resource = kirkwood_xor00_resources, | ||
375 | .dev = { | ||
376 | .dma_mask = &kirkwood_xor_dmamask, | ||
377 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
378 | .platform_data = (void *)&kirkwood_xor00_data, | ||
379 | }, | ||
380 | }; | ||
381 | |||
382 | static struct resource kirkwood_xor01_resources[] = { | ||
383 | [0] = { | ||
384 | .start = IRQ_KIRKWOOD_XOR_01, | ||
385 | .end = IRQ_KIRKWOOD_XOR_01, | ||
386 | .flags = IORESOURCE_IRQ, | ||
387 | }, | ||
388 | }; | ||
389 | |||
390 | static struct mv_xor_platform_data kirkwood_xor01_data = { | ||
391 | .shared = &kirkwood_xor0_shared, | ||
392 | .hw_id = 1, | ||
393 | .pool_size = PAGE_SIZE, | ||
394 | }; | ||
395 | |||
396 | static struct platform_device kirkwood_xor01_channel = { | ||
397 | .name = MV_XOR_NAME, | ||
398 | .id = 1, | ||
399 | .num_resources = ARRAY_SIZE(kirkwood_xor01_resources), | ||
400 | .resource = kirkwood_xor01_resources, | ||
401 | .dev = { | ||
402 | .dma_mask = &kirkwood_xor_dmamask, | ||
403 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
404 | .platform_data = (void *)&kirkwood_xor01_data, | ||
405 | }, | ||
406 | }; | ||
407 | |||
408 | void __init kirkwood_xor0_init(void) | ||
409 | { | ||
410 | platform_device_register(&kirkwood_xor0_shared); | ||
411 | |||
412 | /* | ||
413 | * two engines can't do memset simultaneously, this limitation | ||
414 | * satisfied by removing memset support from one of the engines. | ||
415 | */ | ||
416 | dma_cap_set(DMA_MEMCPY, kirkwood_xor00_data.cap_mask); | ||
417 | dma_cap_set(DMA_XOR, kirkwood_xor00_data.cap_mask); | ||
418 | platform_device_register(&kirkwood_xor00_channel); | ||
419 | |||
420 | dma_cap_set(DMA_MEMCPY, kirkwood_xor01_data.cap_mask); | ||
421 | dma_cap_set(DMA_MEMSET, kirkwood_xor01_data.cap_mask); | ||
422 | dma_cap_set(DMA_XOR, kirkwood_xor01_data.cap_mask); | ||
423 | platform_device_register(&kirkwood_xor01_channel); | ||
424 | } | ||
425 | |||
426 | |||
427 | /***************************************************************************** | ||
428 | * XOR1 | ||
429 | ****************************************************************************/ | ||
430 | static struct resource kirkwood_xor1_shared_resources[] = { | ||
431 | { | ||
432 | .name = "xor 1 low", | ||
433 | .start = XOR1_PHYS_BASE, | ||
434 | .end = XOR1_PHYS_BASE + 0xff, | ||
435 | .flags = IORESOURCE_MEM, | ||
436 | }, { | ||
437 | .name = "xor 1 high", | ||
438 | .start = XOR1_HIGH_PHYS_BASE, | ||
439 | .end = XOR1_HIGH_PHYS_BASE + 0xff, | ||
440 | .flags = IORESOURCE_MEM, | ||
441 | }, | ||
442 | }; | ||
443 | |||
444 | static struct platform_device kirkwood_xor1_shared = { | ||
445 | .name = MV_XOR_SHARED_NAME, | ||
446 | .id = 1, | ||
447 | .dev = { | ||
448 | .platform_data = &kirkwood_xor_shared_data, | ||
449 | }, | ||
450 | .num_resources = ARRAY_SIZE(kirkwood_xor1_shared_resources), | ||
451 | .resource = kirkwood_xor1_shared_resources, | ||
452 | }; | ||
453 | |||
454 | static struct resource kirkwood_xor10_resources[] = { | ||
455 | [0] = { | ||
456 | .start = IRQ_KIRKWOOD_XOR_10, | ||
457 | .end = IRQ_KIRKWOOD_XOR_10, | ||
458 | .flags = IORESOURCE_IRQ, | ||
459 | }, | ||
460 | }; | ||
461 | |||
462 | static struct mv_xor_platform_data kirkwood_xor10_data = { | ||
463 | .shared = &kirkwood_xor1_shared, | ||
464 | .hw_id = 0, | ||
465 | .pool_size = PAGE_SIZE, | ||
466 | }; | ||
467 | |||
468 | static struct platform_device kirkwood_xor10_channel = { | ||
469 | .name = MV_XOR_NAME, | ||
470 | .id = 2, | ||
471 | .num_resources = ARRAY_SIZE(kirkwood_xor10_resources), | ||
472 | .resource = kirkwood_xor10_resources, | ||
473 | .dev = { | ||
474 | .dma_mask = &kirkwood_xor_dmamask, | ||
475 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
476 | .platform_data = (void *)&kirkwood_xor10_data, | ||
477 | }, | ||
478 | }; | ||
479 | |||
480 | static struct resource kirkwood_xor11_resources[] = { | ||
481 | [0] = { | ||
482 | .start = IRQ_KIRKWOOD_XOR_11, | ||
483 | .end = IRQ_KIRKWOOD_XOR_11, | ||
484 | .flags = IORESOURCE_IRQ, | ||
485 | }, | ||
486 | }; | ||
487 | |||
488 | static struct mv_xor_platform_data kirkwood_xor11_data = { | ||
489 | .shared = &kirkwood_xor1_shared, | ||
490 | .hw_id = 1, | ||
491 | .pool_size = PAGE_SIZE, | ||
492 | }; | ||
493 | |||
494 | static struct platform_device kirkwood_xor11_channel = { | ||
495 | .name = MV_XOR_NAME, | ||
496 | .id = 3, | ||
497 | .num_resources = ARRAY_SIZE(kirkwood_xor11_resources), | ||
498 | .resource = kirkwood_xor11_resources, | ||
499 | .dev = { | ||
500 | .dma_mask = &kirkwood_xor_dmamask, | ||
501 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
502 | .platform_data = (void *)&kirkwood_xor11_data, | ||
503 | }, | ||
504 | }; | ||
505 | |||
506 | void __init kirkwood_xor1_init(void) | ||
507 | { | ||
508 | platform_device_register(&kirkwood_xor1_shared); | ||
509 | |||
510 | /* | ||
511 | * two engines can't do memset simultaneously, this limitation | ||
512 | * satisfied by removing memset support from one of the engines. | ||
513 | */ | ||
514 | dma_cap_set(DMA_MEMCPY, kirkwood_xor10_data.cap_mask); | ||
515 | dma_cap_set(DMA_XOR, kirkwood_xor10_data.cap_mask); | ||
516 | platform_device_register(&kirkwood_xor10_channel); | ||
517 | |||
518 | dma_cap_set(DMA_MEMCPY, kirkwood_xor11_data.cap_mask); | ||
519 | dma_cap_set(DMA_MEMSET, kirkwood_xor11_data.cap_mask); | ||
520 | dma_cap_set(DMA_XOR, kirkwood_xor11_data.cap_mask); | ||
521 | platform_device_register(&kirkwood_xor11_channel); | ||
522 | } | ||
523 | |||
524 | |||
525 | /***************************************************************************** | ||
287 | * Time handling | 526 | * Time handling |
288 | ****************************************************************************/ | 527 | ****************************************************************************/ |
289 | static void kirkwood_timer_init(void) | 528 | static void kirkwood_timer_init(void) |