]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sh: mach-sdk7786: mode pins support.
authorPaul Mundt <lethal@linux-sh.org>
Fri, 15 Jan 2010 07:31:04 +0000 (16:31 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 15 Jan 2010 07:31:04 +0000 (16:31 +0900)
This wires up the mode pins support on the SDK7786. The pins are
standard SH7786 pins, and all are fixed in software. Needed for the
clock framework, PCIe, and so forth.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/boards/mach-sdk7786/setup.c

index f2d4b75bf31ca49f11ea39484ddd02dd485cb0a1..c38c6cc293b50a2cde2b230c73feac39572a2a3a 100644 (file)
@@ -218,6 +218,23 @@ static void __init init_sdk7786_IRQ(void)
        plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
 }
 
+#define MODSWR_REGS    0x07fff830
+
+static int sdk7786_mode_pins(void)
+{
+       void __iomem *modswr;
+       int pin_states;
+
+       modswr = ioremap_nocache(MODSWR_REGS, SZ_16);
+       if (!modswr)
+               return -ENXIO;
+
+       pin_states = ioread16(modswr);
+       iounmap(modswr);
+
+       return pin_states;
+}
+
 /* Initialize the board */
 static void __init sdk7786_setup(char **cmdline_p)
 {
@@ -230,5 +247,6 @@ static void __init sdk7786_setup(char **cmdline_p)
 static struct sh_machine_vector mv_sdk7786 __initmv = {
        .mv_name                = "SDK7786",
        .mv_setup               = sdk7786_setup,
+       .mv_mode_pins           = sdk7786_mode_pins,
        .mv_init_irq            = init_sdk7786_IRQ,
 };