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 | |
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')
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 98 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/include/mach/orion5x.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/kurobox_pro-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/mss2-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/mv2120-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/rd88f5182-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/ts209-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/ts78xx-setup.c | 1 |
9 files changed, 109 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) |
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index f72cf0e77544..e75bd7004b94 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -32,6 +32,7 @@ void orion5x_i2c_init(void); | |||
32 | void orion5x_sata_init(struct mv_sata_platform_data *sata_data); | 32 | void orion5x_sata_init(struct mv_sata_platform_data *sata_data); |
33 | void orion5x_uart0_init(void); | 33 | void orion5x_uart0_init(void); |
34 | void orion5x_uart1_init(void); | 34 | void orion5x_uart1_init(void); |
35 | void orion5x_xor_init(void); | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * PCIe/PCI functions. | 38 | * PCIe/PCI functions. |
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h index 77978dbd5a92..61eb74a88862 100644 --- a/arch/arm/mach-orion5x/include/mach/orion5x.h +++ b/arch/arm/mach-orion5x/include/mach/orion5x.h | |||
@@ -106,6 +106,10 @@ | |||
106 | #define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000) | 106 | #define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000) |
107 | #define ORION5X_USB0_REG(x) (ORION5X_USB0_VIRT_BASE | (x)) | 107 | #define ORION5X_USB0_REG(x) (ORION5X_USB0_VIRT_BASE | (x)) |
108 | 108 | ||
109 | #define ORION5X_XOR_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x60900) | ||
110 | #define ORION5X_XOR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x60900) | ||
111 | #define ORION5X_XOR_REG(x) (ORION5X_XOR_VIRT_BASE | (x)) | ||
112 | |||
109 | #define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000) | 113 | #define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000) |
110 | #define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000) | 114 | #define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000) |
111 | #define ORION5X_ETH_REG(x) (ORION5X_ETH_VIRT_BASE | (x)) | 115 | #define ORION5X_ETH_REG(x) (ORION5X_ETH_VIRT_BASE | (x)) |
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c index 45dfc9f99d8d..cb72f1bb9cb7 100644 --- a/arch/arm/mach-orion5x/kurobox_pro-setup.c +++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c | |||
@@ -356,6 +356,7 @@ static void __init kurobox_pro_init(void) | |||
356 | orion5x_sata_init(&kurobox_pro_sata_data); | 356 | orion5x_sata_init(&kurobox_pro_sata_data); |
357 | orion5x_uart0_init(); | 357 | orion5x_uart0_init(); |
358 | orion5x_uart1_init(); | 358 | orion5x_uart1_init(); |
359 | orion5x_xor_init(); | ||
359 | 360 | ||
360 | orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE, | 361 | orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE, |
361 | KUROBOX_PRO_NOR_BOOT_SIZE); | 362 | KUROBOX_PRO_NOR_BOOT_SIZE); |
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c index 4403cc963d66..53ff1893b883 100644 --- a/arch/arm/mach-orion5x/mss2-setup.c +++ b/arch/arm/mach-orion5x/mss2-setup.c | |||
@@ -239,6 +239,7 @@ static void __init mss2_init(void) | |||
239 | orion5x_i2c_init(); | 239 | orion5x_i2c_init(); |
240 | orion5x_sata_init(&mss2_sata_data); | 240 | orion5x_sata_init(&mss2_sata_data); |
241 | orion5x_uart0_init(); | 241 | orion5x_uart0_init(); |
242 | orion5x_xor_init(); | ||
242 | 243 | ||
243 | orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE); | 244 | orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE); |
244 | platform_device_register(&mss2_nor_flash); | 245 | platform_device_register(&mss2_nor_flash); |
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c index 67b2c0df615f..978d4d599396 100644 --- a/arch/arm/mach-orion5x/mv2120-setup.c +++ b/arch/arm/mach-orion5x/mv2120-setup.c | |||
@@ -203,6 +203,7 @@ static void __init mv2120_init(void) | |||
203 | orion5x_i2c_init(); | 203 | orion5x_i2c_init(); |
204 | orion5x_sata_init(&mv2120_sata_data); | 204 | orion5x_sata_init(&mv2120_sata_data); |
205 | orion5x_uart0_init(); | 205 | orion5x_uart0_init(); |
206 | orion5x_xor_init(); | ||
206 | 207 | ||
207 | orion5x_setup_dev_boot_win(MV2120_NOR_BOOT_BASE, MV2120_NOR_BOOT_SIZE); | 208 | orion5x_setup_dev_boot_win(MV2120_NOR_BOOT_BASE, MV2120_NOR_BOOT_SIZE); |
208 | platform_device_register(&mv2120_nor_flash); | 209 | platform_device_register(&mv2120_nor_flash); |
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c index 8771cb76f0dc..4c3bcd76ac85 100644 --- a/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/arch/arm/mach-orion5x/rd88f5182-setup.c | |||
@@ -292,6 +292,7 @@ static void __init rd88f5182_init(void) | |||
292 | orion5x_i2c_init(); | 292 | orion5x_i2c_init(); |
293 | orion5x_sata_init(&rd88f5182_sata_data); | 293 | orion5x_sata_init(&rd88f5182_sata_data); |
294 | orion5x_uart0_init(); | 294 | orion5x_uart0_init(); |
295 | orion5x_xor_init(); | ||
295 | 296 | ||
296 | orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE, | 297 | orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE, |
297 | RD88F5182_NOR_BOOT_SIZE); | 298 | RD88F5182_NOR_BOOT_SIZE); |
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c index 1bb7de8a262b..dd657163cd8d 100644 --- a/arch/arm/mach-orion5x/ts209-setup.c +++ b/arch/arm/mach-orion5x/ts209-setup.c | |||
@@ -296,6 +296,7 @@ static void __init qnap_ts209_init(void) | |||
296 | orion5x_i2c_init(); | 296 | orion5x_i2c_init(); |
297 | orion5x_sata_init(&qnap_ts209_sata_data); | 297 | orion5x_sata_init(&qnap_ts209_sata_data); |
298 | orion5x_uart0_init(); | 298 | orion5x_uart0_init(); |
299 | orion5x_xor_init(); | ||
299 | 300 | ||
300 | orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE, | 301 | orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE, |
301 | QNAP_TS209_NOR_BOOT_SIZE); | 302 | QNAP_TS209_NOR_BOOT_SIZE); |
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index 014916a28fdc..ae0a5dccd2a1 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -256,6 +256,7 @@ static void __init ts78xx_init(void) | |||
256 | orion5x_sata_init(&ts78xx_sata_data); | 256 | orion5x_sata_init(&ts78xx_sata_data); |
257 | orion5x_uart0_init(); | 257 | orion5x_uart0_init(); |
258 | orion5x_uart1_init(); | 258 | orion5x_uart1_init(); |
259 | orion5x_xor_init(); | ||
259 | 260 | ||
260 | orion5x_setup_dev_boot_win(TS78XX_NOR_BOOT_BASE, | 261 | orion5x_setup_dev_boot_win(TS78XX_NOR_BOOT_BASE, |
261 | TS78XX_NOR_BOOT_SIZE); | 262 | TS78XX_NOR_BOOT_SIZE); |