aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood/board-goflexnet.c
diff options
context:
space:
mode:
authorJosh Coombs <josh.coombs@gmail.com>2012-07-16 05:52:50 -0400
committerAndrew Lunn <andrew@lunn.ch>2012-07-27 10:49:01 -0400
commit5136b2aa622844fcff9fecf1f2c57670b890227f (patch)
tree64c5e672cf6650f396c2e00f3e5420fc55f814b1 /arch/arm/mach-kirkwood/board-goflexnet.c
parent9eb61f473601c047a4c0c84269d0c25493e45277 (diff)
ARM: Kirkwood: Initial DTS support for Kirkwood GoFlex Net
This patch supplies the necessary DTS and supporting files to boot up a Seagate GoFlex Net with 3.5.0-rc3. Signed-off-by: Joshua Coombs <josh.coombs@gmail.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'arch/arm/mach-kirkwood/board-goflexnet.c')
-rw-r--r--arch/arm/mach-kirkwood/board-goflexnet.c155
1 files changed, 155 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
new file mode 100644
index 000000000000..3957ece46d36
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-goflexnet.c
@@ -0,0 +1,155 @@
1/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-kirkwood/board-goflexnet.c
5 *
6 * Seagate GoFlext Net Board Init for drivers not converted to
7 * flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 *
13 * Copied and modified for Seagate GoFlex Net support by
14 * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
15 * GoFlex kernel patches.
16 *
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <linux/ata_platform.h>
23#include <linux/mv643xx_eth.h>
24#include <linux/of.h>
25#include <linux/of_address.h>
26#include <linux/of_fdt.h>
27#include <linux/of_irq.h>
28#include <linux/of_platform.h>
29#include <linux/gpio.h>
30#include <linux/leds.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <mach/kirkwood.h>
35#include <mach/bridge-regs.h>
36#include <plat/mvsdio.h>
37#include "common.h"
38#include "mpp.h"
39
40static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
41 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
42};
43
44static struct mv_sata_platform_data goflexnet_sata_data = {
45 .n_ports = 2,
46};
47
48static struct gpio_led goflexnet_led_pins[] = {
49 {
50 .name = "status:green:health",
51 .default_trigger = "default-on",
52 .gpio = 46,
53 .active_low = 1,
54 },
55 {
56 .name = "status:orange:fault",
57 .default_trigger = "none",
58 .gpio = 47,
59 .active_low = 1,
60 },
61 {
62 .name = "status:white:left0",
63 .default_trigger = "none",
64 .gpio = 42,
65 .active_low = 0,
66 },
67 {
68 .name = "status:white:left1",
69 .default_trigger = "none",
70 .gpio = 43,
71 .active_low = 0,
72 },
73 {
74 .name = "status:white:left2",
75 .default_trigger = "none",
76 .gpio = 44,
77 .active_low = 0,
78 },
79 {
80 .name = "status:white:left3",
81 .default_trigger = "none",
82 .gpio = 45,
83 .active_low = 0,
84 },
85 {
86 .name = "status:white:right0",
87 .default_trigger = "none",
88 .gpio = 38,
89 .active_low = 0,
90 },
91 {
92 .name = "status:white:right1",
93 .default_trigger = "none",
94 .gpio = 39,
95 .active_low = 0,
96 },
97 {
98 .name = "status:white:right2",
99 .default_trigger = "none",
100 .gpio = 40,
101 .active_low = 0,
102 },
103 {
104 .name = "status:white:right3",
105 .default_trigger = "none",
106 .gpio = 41,
107 .active_low = 0,
108 },
109};
110
111static struct gpio_led_platform_data goflexnet_led_data = {
112 .leds = goflexnet_led_pins,
113 .num_leds = ARRAY_SIZE(goflexnet_led_pins),
114};
115
116static struct platform_device goflexnet_leds = {
117 .name = "leds-gpio",
118 .id = -1,
119 .dev = {
120 .platform_data = &goflexnet_led_data,
121 }
122};
123
124static unsigned int goflexnet_mpp_config[] __initdata = {
125 MPP29_GPIO, /* USB Power Enable */
126 MPP47_GPIO, /* LED Orange */
127 MPP46_GPIO, /* LED Green */
128 MPP45_GPIO, /* LED Left Capacity 3 */
129 MPP44_GPIO, /* LED Left Capacity 2 */
130 MPP43_GPIO, /* LED Left Capacity 1 */
131 MPP42_GPIO, /* LED Left Capacity 0 */
132 MPP41_GPIO, /* LED Right Capacity 3 */
133 MPP40_GPIO, /* LED Right Capacity 2 */
134 MPP39_GPIO, /* LED Right Capacity 1 */
135 MPP38_GPIO, /* LED Right Capacity 0 */
136 0
137};
138
139void __init goflexnet_init(void)
140{
141 /*
142 * Basic setup. Needs to be called early.
143 */
144 kirkwood_mpp_conf(goflexnet_mpp_config);
145
146 if (gpio_request(29, "USB Power Enable") != 0 ||
147 gpio_direction_output(29, 1) != 0)
148 pr_err("can't setup GPIO 29 (USB Power Enable)\n");
149 kirkwood_ehci_init();
150
151 kirkwood_ge00_init(&goflexnet_ge00_data);
152 kirkwood_sata_init(&goflexnet_sata_data);
153
154 platform_device_register(&goflexnet_leds);
155}