diff options
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 247 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/irq.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/rd88f6281-setup.c | 2 |
7 files changed, 281 insertions, 7 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) |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5dee2f6b40a5..69cd113af03a 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -33,8 +33,11 @@ void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); | |||
33 | void kirkwood_pcie_init(void); | 33 | void kirkwood_pcie_init(void); |
34 | void kirkwood_rtc_init(void); | 34 | 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_spi_init(void); | ||
36 | void kirkwood_uart0_init(void); | 37 | void kirkwood_uart0_init(void); |
37 | void kirkwood_uart1_init(void); | 38 | void kirkwood_uart1_init(void); |
39 | void kirkwood_xor0_init(void); | ||
40 | void kirkwood_xor1_init(void); | ||
38 | 41 | ||
39 | extern struct sys_timer kirkwood_timer; | 42 | extern struct sys_timer kirkwood_timer; |
40 | 43 | ||
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/irq.c b/arch/arm/mach-kirkwood/irq.c index 302bb2cf6669..5790643ffe07 100644 --- a/arch/arm/mach-kirkwood/irq.c +++ b/arch/arm/mach-kirkwood/irq.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/plat-orion/irq.h> | 15 | #include <plat/irq.h> |
16 | #include "common.h" | 16 | #include "common.h" |
17 | 17 | ||
18 | void __init kirkwood_init_irq(void) | 18 | void __init kirkwood_init_irq(void) |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 8282d0ff84bf..2195fa31f6b7 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
15 | #include <asm/plat-orion/pcie.h> | 15 | #include <plat/pcie.h> |
16 | #include "common.h" | 16 | #include "common.h" |
17 | 17 | ||
18 | 18 | ||
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c index 182230a5d198..a3012d445971 100644 --- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | |||
@@ -18,6 +18,9 @@ | |||
18 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
19 | #include <linux/ata_platform.h> | 19 | #include <linux/ata_platform.h> |
20 | #include <linux/mv643xx_eth.h> | 20 | #include <linux/mv643xx_eth.h> |
21 | #include <linux/spi/flash.h> | ||
22 | #include <linux/spi/spi.h> | ||
23 | #include <linux/spi/orion_spi.h> | ||
21 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/pci.h> | 26 | #include <asm/mach/pci.h> |
@@ -34,6 +37,21 @@ static struct mv_sata_platform_data rd88f6192_sata_data = { | |||
34 | .n_ports = 2, | 37 | .n_ports = 2, |
35 | }; | 38 | }; |
36 | 39 | ||
40 | static const struct flash_platform_data rd88F6192_spi_slave_data = { | ||
41 | .type = "m25p128", | ||
42 | }; | ||
43 | |||
44 | static struct spi_board_info __initdata rd88F6192_spi_slave_info[] = { | ||
45 | { | ||
46 | .modalias = "m25p80", | ||
47 | .platform_data = &rd88F6192_spi_slave_data, | ||
48 | .irq = -1, | ||
49 | .max_speed_hz = 20000000, | ||
50 | .bus_num = 0, | ||
51 | .chip_select = 0, | ||
52 | }, | ||
53 | }; | ||
54 | |||
37 | static void __init rd88f6192_init(void) | 55 | static void __init rd88f6192_init(void) |
38 | { | 56 | { |
39 | /* | 57 | /* |
@@ -45,7 +63,12 @@ static void __init rd88f6192_init(void) | |||
45 | kirkwood_ge00_init(&rd88f6192_ge00_data); | 63 | kirkwood_ge00_init(&rd88f6192_ge00_data); |
46 | kirkwood_rtc_init(); | 64 | kirkwood_rtc_init(); |
47 | kirkwood_sata_init(&rd88f6192_sata_data); | 65 | kirkwood_sata_init(&rd88f6192_sata_data); |
66 | spi_register_board_info(rd88F6192_spi_slave_info, | ||
67 | ARRAY_SIZE(rd88F6192_spi_slave_info)); | ||
68 | kirkwood_spi_init(); | ||
48 | kirkwood_uart0_init(); | 69 | kirkwood_uart0_init(); |
70 | kirkwood_xor0_init(); | ||
71 | kirkwood_xor1_init(); | ||
49 | } | 72 | } |
50 | 73 | ||
51 | static int __init rd88f6192_pci_init(void) | 74 | static int __init rd88f6192_pci_init(void) |
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c index d8a43018c7d3..d96487a0f18b 100644 --- a/arch/arm/mach-kirkwood/rd88f6281-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/pci.h> | 24 | #include <asm/mach/pci.h> |
25 | #include <mach/kirkwood.h> | 25 | #include <mach/kirkwood.h> |
26 | #include <asm/plat-orion/orion_nand.h> | 26 | #include <plat/orion_nand.h> |
27 | #include "common.h" | 27 | #include "common.h" |
28 | 28 | ||
29 | static struct mtd_partition rd88f6281_nand_parts[] = { | 29 | static struct mtd_partition rd88f6281_nand_parts[] = { |