ARM: u300: add SPI PL022 to the device tree
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 19 Apr 2013 12:56:46 +0000 (14:56 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 17 Jun 2013 11:54:28 +0000 (13:54 +0200)
This registers the PL022 PrimeCell from the U300 device
tree. We make a new copy of the platform data for the
device tree boot path, as the old platform data is in an
older file which will be going away.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/boot/dts/ste-u300.dts
arch/arm/mach-u300/core.c

index 4dc9f26c8b48d411f969d256b12966ccacdb452a..355ac60369c2ba59e2a3c99ddb0eaefb6dc7b5e8 100644 (file)
                        dmas = <&dmac 14>;
                        dma-names = "rx";
                };
+
+               spi: ssp@c0006000 {
+                       compatible = "arm,pl022", "arm,primecell";
+                       reg = <0xc0006000 0x1000>;
+                       interrupt-parent = <&vica>;
+                       interrupts = <23>;
+                       dmas = <&dmac 27 &dmac 28>;
+                       dma-names = "tx", "rx";
+                       num-cs = <3>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
        };
 };
index 7866f54a4eaa927e1b2c3787e21048802c3e2e6b..d102cb501f8dce90dfa35f1e9e74bace3c2e6da8 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/dmaengine.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/amba/serial.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -704,6 +705,22 @@ MACHINE_END
 
 #ifdef CONFIG_OF
 
+static struct pl022_ssp_controller spi_plat_data = {
+       /* If you have several SPI buses this varies, we have only bus 0 */
+       .bus_id = 0,
+       /*
+        * On the APP CPU GPIO 4, 5 and 6 are connected as generic
+        * chip selects for SPI. (Same on U330, U335 and U365.)
+        * TODO: make sure the GPIO driver can select these properly
+        * and do padmuxing accordingly too.
+        */
+       .num_chipselect = 3,
+       .enable_dma = 1,
+       .dma_filter = coh901318_filter_id,
+       .dma_rx_param = (void *) U300_DMA_SPI_RX,
+       .dma_tx_param = (void *) U300_DMA_SPI_TX,
+};
+
 /* These are mostly to get the right device names for the clock lookups */
 static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE,
@@ -720,6 +737,8 @@ static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = {
                "uart0", &uart0_plat_data),
        OF_DEV_AUXDATA("arm,primecell", U300_UART1_BASE,
                "uart1", &uart1_plat_data),
+       OF_DEV_AUXDATA("arm,primecell", U300_SPI_BASE,
+               "pl022", &spi_plat_data),
        OF_DEV_AUXDATA("st,ddci2c", U300_I2C0_BASE,
                "stu300.0", NULL),
        OF_DEV_AUXDATA("st,ddci2c", U300_I2C1_BASE,