powerpc/86xx: add MMC SPI support for MPC8610HPCD boards
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Thu, 18 Jun 2009 23:49:02 +0000 (16:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Jun 2009 23:46:04 +0000 (16:46 -0700)
This patch adds spi and mmc-spi-slot nodes, plus a gpio-controller for
PIXIS' sdcsr bank that is used for managing SPI chip-select and for
reading card's states.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/boot/dts/mpc8610_hpcd.dts
arch/powerpc/platforms/86xx/mpc8610_hpcd.c

index cfc2c60..f468d21 100644 (file)
                };
 
                board-control@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                        compatible = "fsl,fpga-pixis";
                        reg = <3 0 0x20>;
+                       ranges = <0 3 0 0x20>;
+
+                       sdcsr_pio: gpio-controller@a {
+                               #gpio-cells = <2>;
+                               compatible = "fsl,fpga-pixis-gpio-bank";
+                               reg = <0xa 1>;
+                               gpio-controller;
+                       };
                };
        };
 
                        interrupt-parent = <&mpic>;
                };
 
+               spi@7000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "fsl,mpc8610-spi", "fsl,spi";
+                       reg = <0x7000 0x40>;
+                       cell-index = <0>;
+                       interrupts = <59 2>;
+                       interrupt-parent = <&mpic>;
+                       mode = "cpu";
+                       gpios = <&sdcsr_pio 7 0>;
+
+                       mmc-slot@0 {
+                               compatible = "fsl,mpc8610hpcd-mmc-slot",
+                                            "mmc-spi-slot";
+                               reg = <0>;
+                               gpios = <&sdcsr_pio 0 1   /* nCD */
+                                        &sdcsr_pio 1 0>; /*  WP */
+                               voltage-ranges = <3300 3300>;
+                               spi-max-frequency = <50000000>;
+                       };
+               };
+
                display@2c000 {
                        compatible = "fsl,diu";
                        reg = <0x2c000 100>;
index 51eec0c..627908a 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/of_platform.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/simple_gpio.h>
 
 #include "mpc86xx.h"
 
@@ -51,6 +52,9 @@ static struct of_device_id __initdata mpc8610_ids[] = {
 
 static int __init mpc8610_declare_of_platform_devices(void)
 {
+       /* Firstly, register PIXIS GPIOs. */
+       simple_gpiochip_init("fsl,fpga-pixis-gpio-bank");
+
        /* Without this call, the SSI device driver won't get probed. */
        of_platform_bus_probe(NULL, mpc8610_ids, NULL);