diff options
author | Saeed Bishara <saeed@marvell.com> | 2008-06-17 06:25:12 -0400 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-08-09 09:17:28 -0400 |
commit | 1d5a1a6e92abb1ecb011a673e637146c4e232f1e (patch) | |
tree | 66a608528e39e0c49645e8cafbed00d4dc761e55 /arch/arm/mach-orion5x/common.c | |
parent | 3af6b0440f7b318af3f6a4c4ce251753377dba3a (diff) |
[ARM] Orion: Instantiate mv_xor driver for 5182
Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion5x/common.c')
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 8f2146bd8a94..7b11e552bc5a 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <mach/orion5x.h> | 28 | #include <mach/orion5x.h> |
29 | #include <plat/ehci-orion.h> | 29 | #include <plat/ehci-orion.h> |
30 | #include <plat/mv_xor.h> | ||
30 | #include <plat/orion_nand.h> | 31 | #include <plat/orion_nand.h> |
31 | #include <plat/time.h> | 32 | #include <plat/time.h> |
32 | #include "common.h" | 33 | #include "common.h" |
@@ -355,6 +356,103 @@ void __init orion5x_uart1_init(void) | |||
355 | 356 | ||
356 | 357 | ||
357 | /***************************************************************************** | 358 | /***************************************************************************** |
359 | * XOR engine | ||
360 | ****************************************************************************/ | ||
361 | static struct resource orion5x_xor_shared_resources[] = { | ||
362 | { | ||
363 | .name = "xor low", | ||
364 | .start = ORION5X_XOR_PHYS_BASE, | ||
365 | .end = ORION5X_XOR_PHYS_BASE + 0xff, | ||
366 | .flags = IORESOURCE_MEM, | ||
367 | }, { | ||
368 | .name = "xor high", | ||
369 | .start = ORION5X_XOR_PHYS_BASE + 0x200, | ||
370 | .end = ORION5X_XOR_PHYS_BASE + 0x2ff, | ||
371 | .flags = IORESOURCE_MEM, | ||
372 | }, | ||
373 | }; | ||
374 | |||
375 | static struct platform_device orion5x_xor_shared = { | ||
376 | .name = MV_XOR_SHARED_NAME, | ||
377 | .id = 0, | ||
378 | .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources), | ||
379 | .resource = orion5x_xor_shared_resources, | ||
380 | }; | ||
381 | |||
382 | static u64 orion5x_xor_dmamask = DMA_32BIT_MASK; | ||
383 | |||
384 | static struct resource orion5x_xor0_resources[] = { | ||
385 | [0] = { | ||
386 | .start = IRQ_ORION5X_XOR0, | ||
387 | .end = IRQ_ORION5X_XOR0, | ||
388 | .flags = IORESOURCE_IRQ, | ||
389 | }, | ||
390 | }; | ||
391 | |||
392 | static struct mv_xor_platform_data orion5x_xor0_data = { | ||
393 | .shared = &orion5x_xor_shared, | ||
394 | .hw_id = 0, | ||
395 | .pool_size = PAGE_SIZE, | ||
396 | }; | ||
397 | |||
398 | static struct platform_device orion5x_xor0_channel = { | ||
399 | .name = MV_XOR_NAME, | ||
400 | .id = 0, | ||
401 | .num_resources = ARRAY_SIZE(orion5x_xor0_resources), | ||
402 | .resource = orion5x_xor0_resources, | ||
403 | .dev = { | ||
404 | .dma_mask = &orion5x_xor_dmamask, | ||
405 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
406 | .platform_data = (void *)&orion5x_xor0_data, | ||
407 | }, | ||
408 | }; | ||
409 | |||
410 | static struct resource orion5x_xor1_resources[] = { | ||
411 | [0] = { | ||
412 | .start = IRQ_ORION5X_XOR1, | ||
413 | .end = IRQ_ORION5X_XOR1, | ||
414 | .flags = IORESOURCE_IRQ, | ||
415 | }, | ||
416 | }; | ||
417 | |||
418 | static struct mv_xor_platform_data orion5x_xor1_data = { | ||
419 | .shared = &orion5x_xor_shared, | ||
420 | .hw_id = 1, | ||
421 | .pool_size = PAGE_SIZE, | ||
422 | }; | ||
423 | |||
424 | static struct platform_device orion5x_xor1_channel = { | ||
425 | .name = MV_XOR_NAME, | ||
426 | .id = 1, | ||
427 | .num_resources = ARRAY_SIZE(orion5x_xor1_resources), | ||
428 | .resource = orion5x_xor1_resources, | ||
429 | .dev = { | ||
430 | .dma_mask = &orion5x_xor_dmamask, | ||
431 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
432 | .platform_data = (void *)&orion5x_xor1_data, | ||
433 | }, | ||
434 | }; | ||
435 | |||
436 | void __init orion5x_xor_init(void) | ||
437 | { | ||
438 | platform_device_register(&orion5x_xor_shared); | ||
439 | |||
440 | /* | ||
441 | * two engines can't do memset simultaneously, this limitation | ||
442 | * satisfied by removing memset support from one of the engines. | ||
443 | */ | ||
444 | dma_cap_set(DMA_MEMCPY, orion5x_xor0_data.cap_mask); | ||
445 | dma_cap_set(DMA_XOR, orion5x_xor0_data.cap_mask); | ||
446 | platform_device_register(&orion5x_xor0_channel); | ||
447 | |||
448 | dma_cap_set(DMA_MEMCPY, orion5x_xor1_data.cap_mask); | ||
449 | dma_cap_set(DMA_MEMSET, orion5x_xor1_data.cap_mask); | ||
450 | dma_cap_set(DMA_XOR, orion5x_xor1_data.cap_mask); | ||
451 | platform_device_register(&orion5x_xor1_channel); | ||
452 | } | ||
453 | |||
454 | |||
455 | /***************************************************************************** | ||
358 | * Time handling | 456 | * Time handling |
359 | ****************************************************************************/ | 457 | ****************************************************************************/ |
360 | static void orion5x_timer_init(void) | 458 | static void orion5x_timer_init(void) |