ARM: kirkwood: DT board setup for Seagate FreeAgent Dockstar
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tue, 14 Aug 2012 20:43:41 +0000 (22:43 +0200)
committerJason Cooper <jason@lakedaemon.net>
Fri, 21 Sep 2012 15:12:59 +0000 (15:12 +0000)
This add a DT compatible board specific setup for the Seagate
FreeAgent Dockstar.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-kirkwood/Kconfig
arch/arm/mach-kirkwood/Makefile
arch/arm/mach-kirkwood/board-dockstar.c [new file with mode: 0644]
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/common.h

index 76bc8473f1a1d6f46a089717b21940a43f92c05c..d033b7acead7148737b6600b857dd9b108b02500 100644 (file)
@@ -94,6 +94,13 @@ config MACH_TS219_DT
          or MV6282. If you have the wrong one, the buttons will not
          work.
 
+config MACH_DOCKSTAR_DT
+       bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
+       select ARCH_KIRKWOOD_DT
+       help
+         Say 'Y' here if you want your kernel to support the
+         Seagate FreeAgent Dockstar (Flattened Device Tree).
+
 config MACH_GOFLEXNET_DT
        bool "Seagate GoFlex Net (Flattened Device Tree)"
        select ARCH_KIRKWOOD_DT
index f5484dcca9fc0fcbdb41896dc8c2efbd630f9be7..d809cd542a00749fde67d7aa1596ae9a5a454a63 100644 (file)
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_ICONNECT_DT)                += board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)   += board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)           += board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)            += board-ts219.o tsx1x-common.o
+obj-$(CONFIG_MACH_DOCKSTAR_DT)         += board-dockstar.o
 obj-$(CONFIG_MACH_GOFLEXNET_DT)                += board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)             += board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)   += board-iomega_ix2_200.o
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
new file mode 100644 (file)
index 0000000..6beff21
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * arch/arm/mach-kirkwood/board-dockstar.c
+ *
+ * Seagate FreeAgent Dockstar Board Init for drivers not converted to
+ * flattened device tree yet.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ *
+ * Copied and modified for Seagate GoFlex Net support by
+ * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
+ * GoFlex kernel patches.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct mv643xx_eth_platform_data dockstar_ge00_data = {
+       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
+};
+
+static unsigned int dockstar_mpp_config[] __initdata = {
+       MPP29_GPIO,     /* USB Power Enable */
+       MPP46_GPIO,     /* LED green */
+       MPP47_GPIO,     /* LED orange */
+       0
+};
+
+void __init dockstar_dt_init(void)
+{
+       /*
+        * Basic setup. Needs to be called early.
+        */
+       kirkwood_mpp_conf(dockstar_mpp_config);
+
+       if (gpio_request(29, "USB Power Enable") != 0 ||
+           gpio_direction_output(29, 1) != 0)
+               pr_err("can't setup GPIO 29 (USB Power Enable)\n");
+       kirkwood_ehci_init();
+
+       kirkwood_ge00_init(&dockstar_ge00_data);
+}
index 9b3ec175e40bc455e13022330e781dd622662aa9..30a4caa2b76c49343124dfefd7099fcf6fbc2ad4 100644 (file)
@@ -81,6 +81,9 @@ static void __init kirkwood_dt_init(void)
        if (of_machine_is_compatible("qnap,ts219"))
                qnap_dt_ts219_init();
 
+       if (of_machine_is_compatible("seagate,dockstar"))
+               dockstar_dt_init();
+
        if (of_machine_is_compatible("seagate,goflexnet"))
                goflexnet_init();
 
@@ -101,6 +104,7 @@ static const char *kirkwood_dt_board_compat[] = {
        "iom,iconnect",
        "raidsonic,ib-nas62x0",
        "qnap,ts219",
+       "seagate,dockstar",
        "seagate,goflexnet",
        "buffalo,lsxl",
        "iom,ix2-200",
index d5d406469b74d4e5850571a612a2030df95c4a78..8f2520fa0562d3429456e0c69bd48aae589d4dd8 100644 (file)
@@ -82,6 +82,12 @@ void ib62x0_init(void);
 static inline void ib62x0_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_DOCKSTAR_DT
+void dockstar_dt_init(void);
+#else
+static inline void dockstar_dt_init(void) {};
+#endif
+
 #ifdef CONFIG_MACH_GOFLEXNET_DT
 void goflexnet_init(void);
 #else