diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 207 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | 2 |
4 files changed, 220 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 02edd0dccc4d..693dc32b606b 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <mach/kirkwood.h> | 22 | #include <mach/kirkwood.h> |
23 | #include <plat/cache-feroceon-l2.h> | 23 | #include <plat/cache-feroceon-l2.h> |
24 | #include <plat/ehci-orion.h> | 24 | #include <plat/ehci-orion.h> |
25 | #include <plat/mv_xor.h> | ||
25 | #include <plat/orion_nand.h> | 26 | #include <plat/orion_nand.h> |
26 | #include <plat/time.h> | 27 | #include <plat/time.h> |
27 | #include "common.h" | 28 | #include "common.h" |
@@ -284,6 +285,212 @@ void __init kirkwood_uart1_init(void) | |||
284 | 285 | ||
285 | 286 | ||
286 | /***************************************************************************** | 287 | /***************************************************************************** |
288 | * XOR | ||
289 | ****************************************************************************/ | ||
290 | static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = { | ||
291 | .dram = &kirkwood_mbus_dram_info, | ||
292 | }; | ||
293 | |||
294 | static u64 kirkwood_xor_dmamask = DMA_32BIT_MASK; | ||
295 | |||
296 | |||
297 | /***************************************************************************** | ||
298 | * XOR0 | ||
299 | ****************************************************************************/ | ||
300 | static struct resource kirkwood_xor0_shared_resources[] = { | ||
301 | { | ||
302 | .name = "xor 0 low", | ||
303 | .start = XOR0_PHYS_BASE, | ||
304 | .end = XOR0_PHYS_BASE + 0xff, | ||
305 | .flags = IORESOURCE_MEM, | ||
306 | }, { | ||
307 | .name = "xor 0 high", | ||
308 | .start = XOR0_HIGH_PHYS_BASE, | ||
309 | .end = XOR0_HIGH_PHYS_BASE + 0xff, | ||
310 | .flags = IORESOURCE_MEM, | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static struct platform_device kirkwood_xor0_shared = { | ||
315 | .name = MV_XOR_SHARED_NAME, | ||
316 | .id = 0, | ||
317 | .dev = { | ||
318 | .platform_data = &kirkwood_xor_shared_data, | ||
319 | }, | ||
320 | .num_resources = ARRAY_SIZE(kirkwood_xor0_shared_resources), | ||
321 | .resource = kirkwood_xor0_shared_resources, | ||
322 | }; | ||
323 | |||
324 | static struct resource kirkwood_xor00_resources[] = { | ||
325 | [0] = { | ||
326 | .start = IRQ_KIRKWOOD_XOR_00, | ||
327 | .end = IRQ_KIRKWOOD_XOR_00, | ||
328 | .flags = IORESOURCE_IRQ, | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | static struct mv_xor_platform_data kirkwood_xor00_data = { | ||
333 | .shared = &kirkwood_xor0_shared, | ||
334 | .hw_id = 0, | ||
335 | .pool_size = PAGE_SIZE, | ||
336 | }; | ||
337 | |||
338 | static struct platform_device kirkwood_xor00_channel = { | ||
339 | .name = MV_XOR_NAME, | ||
340 | .id = 0, | ||
341 | .num_resources = ARRAY_SIZE(kirkwood_xor00_resources), | ||
342 | .resource = kirkwood_xor00_resources, | ||
343 | .dev = { | ||
344 | .dma_mask = &kirkwood_xor_dmamask, | ||
345 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
346 | .platform_data = (void *)&kirkwood_xor00_data, | ||
347 | }, | ||
348 | }; | ||
349 | |||
350 | static struct resource kirkwood_xor01_resources[] = { | ||
351 | [0] = { | ||
352 | .start = IRQ_KIRKWOOD_XOR_01, | ||
353 | .end = IRQ_KIRKWOOD_XOR_01, | ||
354 | .flags = IORESOURCE_IRQ, | ||
355 | }, | ||
356 | }; | ||
357 | |||
358 | static struct mv_xor_platform_data kirkwood_xor01_data = { | ||
359 | .shared = &kirkwood_xor0_shared, | ||
360 | .hw_id = 1, | ||
361 | .pool_size = PAGE_SIZE, | ||
362 | }; | ||
363 | |||
364 | static struct platform_device kirkwood_xor01_channel = { | ||
365 | .name = MV_XOR_NAME, | ||
366 | .id = 1, | ||
367 | .num_resources = ARRAY_SIZE(kirkwood_xor01_resources), | ||
368 | .resource = kirkwood_xor01_resources, | ||
369 | .dev = { | ||
370 | .dma_mask = &kirkwood_xor_dmamask, | ||
371 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
372 | .platform_data = (void *)&kirkwood_xor01_data, | ||
373 | }, | ||
374 | }; | ||
375 | |||
376 | void __init kirkwood_xor0_init(void) | ||
377 | { | ||
378 | platform_device_register(&kirkwood_xor0_shared); | ||
379 | |||
380 | /* | ||
381 | * two engines can't do memset simultaneously, this limitation | ||
382 | * satisfied by removing memset support from one of the engines. | ||
383 | */ | ||
384 | dma_cap_set(DMA_MEMCPY, kirkwood_xor00_data.cap_mask); | ||
385 | dma_cap_set(DMA_XOR, kirkwood_xor00_data.cap_mask); | ||
386 | platform_device_register(&kirkwood_xor00_channel); | ||
387 | |||
388 | dma_cap_set(DMA_MEMCPY, kirkwood_xor01_data.cap_mask); | ||
389 | dma_cap_set(DMA_MEMSET, kirkwood_xor01_data.cap_mask); | ||
390 | dma_cap_set(DMA_XOR, kirkwood_xor01_data.cap_mask); | ||
391 | platform_device_register(&kirkwood_xor01_channel); | ||
392 | } | ||
393 | |||
394 | |||
395 | /***************************************************************************** | ||
396 | * XOR1 | ||
397 | ****************************************************************************/ | ||
398 | static struct resource kirkwood_xor1_shared_resources[] = { | ||
399 | { | ||
400 | .name = "xor 1 low", | ||
401 | .start = XOR1_PHYS_BASE, | ||
402 | .end = XOR1_PHYS_BASE + 0xff, | ||
403 | .flags = IORESOURCE_MEM, | ||
404 | }, { | ||
405 | .name = "xor 1 high", | ||
406 | .start = XOR1_HIGH_PHYS_BASE, | ||
407 | .end = XOR1_HIGH_PHYS_BASE + 0xff, | ||
408 | .flags = IORESOURCE_MEM, | ||
409 | }, | ||
410 | }; | ||
411 | |||
412 | static struct platform_device kirkwood_xor1_shared = { | ||
413 | .name = MV_XOR_SHARED_NAME, | ||
414 | .id = 1, | ||
415 | .dev = { | ||
416 | .platform_data = &kirkwood_xor_shared_data, | ||
417 | }, | ||
418 | .num_resources = ARRAY_SIZE(kirkwood_xor1_shared_resources), | ||
419 | .resource = kirkwood_xor1_shared_resources, | ||
420 | }; | ||
421 | |||
422 | static struct resource kirkwood_xor10_resources[] = { | ||
423 | [0] = { | ||
424 | .start = IRQ_KIRKWOOD_XOR_10, | ||
425 | .end = IRQ_KIRKWOOD_XOR_10, | ||
426 | .flags = IORESOURCE_IRQ, | ||
427 | }, | ||
428 | }; | ||
429 | |||
430 | static struct mv_xor_platform_data kirkwood_xor10_data = { | ||
431 | .shared = &kirkwood_xor1_shared, | ||
432 | .hw_id = 0, | ||
433 | .pool_size = PAGE_SIZE, | ||
434 | }; | ||
435 | |||
436 | static struct platform_device kirkwood_xor10_channel = { | ||
437 | .name = MV_XOR_NAME, | ||
438 | .id = 2, | ||
439 | .num_resources = ARRAY_SIZE(kirkwood_xor10_resources), | ||
440 | .resource = kirkwood_xor10_resources, | ||
441 | .dev = { | ||
442 | .dma_mask = &kirkwood_xor_dmamask, | ||
443 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
444 | .platform_data = (void *)&kirkwood_xor10_data, | ||
445 | }, | ||
446 | }; | ||
447 | |||
448 | static struct resource kirkwood_xor11_resources[] = { | ||
449 | [0] = { | ||
450 | .start = IRQ_KIRKWOOD_XOR_11, | ||
451 | .end = IRQ_KIRKWOOD_XOR_11, | ||
452 | .flags = IORESOURCE_IRQ, | ||
453 | }, | ||
454 | }; | ||
455 | |||
456 | static struct mv_xor_platform_data kirkwood_xor11_data = { | ||
457 | .shared = &kirkwood_xor1_shared, | ||
458 | .hw_id = 1, | ||
459 | .pool_size = PAGE_SIZE, | ||
460 | }; | ||
461 | |||
462 | static struct platform_device kirkwood_xor11_channel = { | ||
463 | .name = MV_XOR_NAME, | ||
464 | .id = 3, | ||
465 | .num_resources = ARRAY_SIZE(kirkwood_xor11_resources), | ||
466 | .resource = kirkwood_xor11_resources, | ||
467 | .dev = { | ||
468 | .dma_mask = &kirkwood_xor_dmamask, | ||
469 | .coherent_dma_mask = DMA_64BIT_MASK, | ||
470 | .platform_data = (void *)&kirkwood_xor11_data, | ||
471 | }, | ||
472 | }; | ||
473 | |||
474 | void __init kirkwood_xor1_init(void) | ||
475 | { | ||
476 | platform_device_register(&kirkwood_xor1_shared); | ||
477 | |||
478 | /* | ||
479 | * two engines can't do memset simultaneously, this limitation | ||
480 | * satisfied by removing memset support from one of the engines. | ||
481 | */ | ||
482 | dma_cap_set(DMA_MEMCPY, kirkwood_xor10_data.cap_mask); | ||
483 | dma_cap_set(DMA_XOR, kirkwood_xor10_data.cap_mask); | ||
484 | platform_device_register(&kirkwood_xor10_channel); | ||
485 | |||
486 | dma_cap_set(DMA_MEMCPY, kirkwood_xor11_data.cap_mask); | ||
487 | dma_cap_set(DMA_MEMSET, kirkwood_xor11_data.cap_mask); | ||
488 | dma_cap_set(DMA_XOR, kirkwood_xor11_data.cap_mask); | ||
489 | platform_device_register(&kirkwood_xor11_channel); | ||
490 | } | ||
491 | |||
492 | |||
493 | /***************************************************************************** | ||
287 | * Time handling | 494 | * Time handling |
288 | ****************************************************************************/ | 495 | ****************************************************************************/ |
289 | static void kirkwood_timer_init(void) | 496 | static void kirkwood_timer_init(void) |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5dee2f6b40a5..6f94cda81de6 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -35,6 +35,8 @@ void kirkwood_rtc_init(void); | |||
35 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); | 35 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); |
36 | void kirkwood_uart0_init(void); | 36 | void kirkwood_uart0_init(void); |
37 | void kirkwood_uart1_init(void); | 37 | void kirkwood_uart1_init(void); |
38 | void kirkwood_xor0_init(void); | ||
39 | void kirkwood_xor1_init(void); | ||
38 | 40 | ||
39 | extern struct sys_timer kirkwood_timer; | 41 | extern struct sys_timer kirkwood_timer; |
40 | 42 | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index d1336b41f0fb..5c69992295e8 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -88,6 +88,15 @@ | |||
88 | 88 | ||
89 | #define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) | 89 | #define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) |
90 | 90 | ||
91 | #define XOR0_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60800) | ||
92 | #define XOR0_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60800) | ||
93 | #define XOR1_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60900) | ||
94 | #define XOR1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60900) | ||
95 | #define XOR0_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60A00) | ||
96 | #define XOR0_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60A00) | ||
97 | #define XOR1_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60B00) | ||
98 | #define XOR1_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60B00) | ||
99 | |||
91 | #define GE00_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x70000) | 100 | #define GE00_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x70000) |
92 | #define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) | 101 | #define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) |
93 | 102 | ||
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c index 182230a5d198..062c3216b8aa 100644 --- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | |||
@@ -46,6 +46,8 @@ static void __init rd88f6192_init(void) | |||
46 | kirkwood_rtc_init(); | 46 | kirkwood_rtc_init(); |
47 | kirkwood_sata_init(&rd88f6192_sata_data); | 47 | kirkwood_sata_init(&rd88f6192_sata_data); |
48 | kirkwood_uart0_init(); | 48 | kirkwood_uart0_init(); |
49 | kirkwood_xor0_init(); | ||
50 | kirkwood_xor1_init(); | ||
49 | } | 51 | } |
50 | 52 | ||
51 | static int __init rd88f6192_pci_init(void) | 53 | static int __init rd88f6192_pci_init(void) |