diff options
-rw-r--r-- | arch/powerpc/boot/dts/mpc832x_rdb.dts | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_rdb.c | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts index cdc4a94e9c28..388c8a7012e1 100644 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts | |||
@@ -175,7 +175,7 @@ | |||
175 | reg = <4c0 40>; | 175 | reg = <4c0 40>; |
176 | interrupts = <2>; | 176 | interrupts = <2>; |
177 | interrupt-parent = <&qeic>; | 177 | interrupt-parent = <&qeic>; |
178 | mode = "cpu"; | 178 | mode = "cpu-qe"; |
179 | }; | 179 | }; |
180 | 180 | ||
181 | spi@500 { | 181 | spi@500 { |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index e6c1760f36ef..24a790c79ec0 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/pci.h> | 17 | #include <linux/pci.h> |
18 | #include <linux/spi/spi.h> | ||
18 | 19 | ||
19 | #include <asm/of_platform.h> | 20 | #include <asm/of_platform.h> |
20 | #include <asm/time.h> | 21 | #include <asm/time.h> |
@@ -22,6 +23,7 @@ | |||
22 | #include <asm/udbg.h> | 23 | #include <asm/udbg.h> |
23 | #include <asm/qe.h> | 24 | #include <asm/qe.h> |
24 | #include <asm/qe_ic.h> | 25 | #include <asm/qe_ic.h> |
26 | #include <sysdev/fsl_soc.h> | ||
25 | 27 | ||
26 | #include "mpc83xx.h" | 28 | #include "mpc83xx.h" |
27 | 29 | ||
@@ -32,6 +34,50 @@ | |||
32 | #define DBG(fmt...) | 34 | #define DBG(fmt...) |
33 | #endif | 35 | #endif |
34 | 36 | ||
37 | static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity) | ||
38 | { | ||
39 | pr_debug("%s %d %d\n", __func__, cs, polarity); | ||
40 | par_io_data_set(3, 13, polarity); | ||
41 | } | ||
42 | |||
43 | static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity) | ||
44 | { | ||
45 | pr_debug("%s %d %d\n", __func__, cs, polarity); | ||
46 | par_io_data_set(3, 13, !polarity); | ||
47 | } | ||
48 | |||
49 | static struct spi_board_info mpc832x_spi_boardinfo = { | ||
50 | .bus_num = 0x4c0, | ||
51 | .chip_select = 0, | ||
52 | .max_speed_hz = 50000000, | ||
53 | /* | ||
54 | * XXX: This is spidev (spi in userspace) stub, should | ||
55 | * be replaced by "mmc_spi" when mmc_spi will hit mainline. | ||
56 | */ | ||
57 | .modalias = "spidev", | ||
58 | }; | ||
59 | |||
60 | static int __init mpc832x_spi_init(void) | ||
61 | { | ||
62 | if (!machine_is(mpc832x_rdb)) | ||
63 | return 0; | ||
64 | |||
65 | par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */ | ||
66 | par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */ | ||
67 | par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */ | ||
68 | par_io_config_pin(3, 3, 2, 0, 1, 0); /* SPI1 SEL, I */ | ||
69 | |||
70 | par_io_config_pin(3, 13, 1, 0, 0, 0); /* !SD_CS, O */ | ||
71 | par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */ | ||
72 | par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */ | ||
73 | |||
74 | return fsl_spi_init(&mpc832x_spi_boardinfo, 1, | ||
75 | mpc83xx_spi_activate_cs, | ||
76 | mpc83xx_spi_deactivate_cs); | ||
77 | } | ||
78 | |||
79 | device_initcall(mpc832x_spi_init); | ||
80 | |||
35 | /* ************************************************************************ | 81 | /* ************************************************************************ |
36 | * | 82 | * |
37 | * Setup the architecture | 83 | * Setup the architecture |