diff options
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r-- | arch/arm/plat-orion/common.c | 47 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/common.h | 6 |
2 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index bcc1734c91a..2afe79d1a27 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
19 | #include <net/dsa.h> | 19 | #include <net/dsa.h> |
20 | #include <linux/spi/orion_spi.h> | ||
20 | 21 | ||
21 | /* Fill in the resources structure and link it into the platform | 22 | /* Fill in the resources structure and link it into the platform |
22 | device structure. There is always a memory region, and nearly | 23 | device structure. There is always a memory region, and nearly |
@@ -517,3 +518,49 @@ void __init orion_i2c_1_init(unsigned long mapbase, | |||
517 | SZ_32 - 1, irq); | 518 | SZ_32 - 1, irq); |
518 | platform_device_register(&orion_i2c_1); | 519 | platform_device_register(&orion_i2c_1); |
519 | } | 520 | } |
521 | |||
522 | /***************************************************************************** | ||
523 | * SPI | ||
524 | ****************************************************************************/ | ||
525 | static struct orion_spi_info orion_spi_plat_data; | ||
526 | static struct resource orion_spi_resources; | ||
527 | |||
528 | static struct platform_device orion_spi = { | ||
529 | .name = "orion_spi", | ||
530 | .id = 0, | ||
531 | .dev = { | ||
532 | .platform_data = &orion_spi_plat_data, | ||
533 | }, | ||
534 | }; | ||
535 | |||
536 | static struct orion_spi_info orion_spi_1_plat_data; | ||
537 | static struct resource orion_spi_1_resources; | ||
538 | |||
539 | static struct platform_device orion_spi_1 = { | ||
540 | .name = "orion_spi", | ||
541 | .id = 1, | ||
542 | .dev = { | ||
543 | .platform_data = &orion_spi_1_plat_data, | ||
544 | }, | ||
545 | }; | ||
546 | |||
547 | /* Note: The SPI silicon core does have interrupts. However the | ||
548 | * current Linux software driver does not use interrupts. */ | ||
549 | |||
550 | void __init orion_spi_init(unsigned long mapbase, | ||
551 | unsigned long tclk) | ||
552 | { | ||
553 | orion_spi_plat_data.tclk = tclk; | ||
554 | fill_resources(&orion_spi, &orion_spi_resources, | ||
555 | mapbase, SZ_512 - 1, NO_IRQ); | ||
556 | platform_device_register(&orion_spi); | ||
557 | } | ||
558 | |||
559 | void __init orion_spi_1_init(unsigned long mapbase, | ||
560 | unsigned long tclk) | ||
561 | { | ||
562 | orion_spi_1_plat_data.tclk = tclk; | ||
563 | fill_resources(&orion_spi_1, &orion_spi_1_resources, | ||
564 | mapbase, SZ_512 - 1, NO_IRQ); | ||
565 | platform_device_register(&orion_spi_1); | ||
566 | } | ||
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index d107c62d391..e72c1466d6c 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h | |||
@@ -73,4 +73,10 @@ void __init orion_i2c_init(unsigned long mapbase, | |||
73 | void __init orion_i2c_1_init(unsigned long mapbase, | 73 | void __init orion_i2c_1_init(unsigned long mapbase, |
74 | unsigned long irq, | 74 | unsigned long irq, |
75 | unsigned long freq_m); | 75 | unsigned long freq_m); |
76 | |||
77 | void __init orion_spi_init(unsigned long mapbase, | ||
78 | unsigned long tclk); | ||
79 | |||
80 | void __init orion_spi_1_init(unsigned long mapbase, | ||
81 | unsigned long tclk); | ||
76 | #endif | 82 | #endif |