diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-08-09 09:38:18 -0400 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-08-09 09:38:18 -0400 |
commit | 18365d181fe7fee8b52cd12482200d3a4c48d05e (patch) | |
tree | 012a7e80cea61239be59e366cbfd1deef3ae83c5 | |
parent | 60296c71f6c5063e3c1f1d2619ca0b60940162e7 (diff) |
[ARM] Kirkwood: instantiate the orion_spi driver in the platform code
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | 21 |
3 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 693dc32b606b..189f16f3619d 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -15,6 +15,7 @@ | |||
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> |
@@ -197,6 +198,37 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
197 | 198 | ||
198 | 199 | ||
199 | /***************************************************************************** | 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 | /***************************************************************************** | ||
200 | * UART0 | 232 | * UART0 |
201 | ****************************************************************************/ | 233 | ****************************************************************************/ |
202 | static struct plat_serial8250_port kirkwood_uart0_data[] = { | 234 | static struct plat_serial8250_port kirkwood_uart0_data[] = { |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 6f94cda81de6..69cd113af03a 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -33,6 +33,7 @@ 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); |
38 | void kirkwood_xor0_init(void); | 39 | void kirkwood_xor0_init(void); |
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c index 062c3216b8aa..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,6 +63,9 @@ 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(); |
49 | kirkwood_xor0_init(); | 70 | kirkwood_xor0_init(); |
50 | kirkwood_xor1_init(); | 71 | kirkwood_xor1_init(); |