aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
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
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')
-rw-r--r--arch/arm/boot/dts/kirkwood-goflexnet.dts49
-rw-r--r--arch/arm/mach-kirkwood/Kconfig7
-rw-r--r--arch/arm/mach-kirkwood/Makefile1
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot1
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c5
-rw-r--r--arch/arm/mach-kirkwood/board-goflexnet.c155
-rw-r--r--arch/arm/mach-kirkwood/common.h6
7 files changed, 224 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
new file mode 100644
index 000000000000..c5d5a4e9f11e
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -0,0 +1,49 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Seagate GoFlex Net";
7 compatible = "seagate,goflexnet", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x8000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "ok";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 read-only;
31 };
32
33 partition@100000 {
34 label = "uImage";
35 reg = <0x0100000 0x400000>;
36 };
37
38 partition@500000 {
39 label = "pogoplug";
40 reg = <0x0500000 0x2000000>;
41 };
42
43 partition@2500000 {
44 label = "root";
45 reg = <0x02500000 0xd800000>;
46 };
47 };
48 };
49};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 8e62fa745b98..cb636d05f4f3 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -94,6 +94,13 @@ config MACH_TS219_DT
94 or MV6282. If you have the wrong one, the buttons will not 94 or MV6282. If you have the wrong one, the buttons will not
95 work. 95 work.
96 96
97config MACH_GOFLEXNET_DT
98 bool "Seagate GoFlex Net (Flattened Device Tree)"
99 select ARCH_KIRKWOOD_DT
100 help
101 Say 'Y' here if you want your kernel to support the
102 Seagate GoFlex Net (Flattened Device Tree).
103
97config MACH_TS219 104config MACH_TS219
98 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 105 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
99 help 106 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 8b023281ec72..7153a24c3024 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -26,3 +26,4 @@ obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o
26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o 26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o 27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
28obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o 28obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o
29obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 4a1f66a020b0..c6eba8f114a9 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -8,3 +8,4 @@ dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb 8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb 9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
10dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-qnap-ts219.dtb 10dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-qnap-ts219.dtb
11dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index d0ad25036558..87538182d3da 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -32,6 +32,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
32 NULL), 32 NULL),
33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
35 OF_DEV_AUXDATA("mrvl,orion-nand", 0xf4000000, "orion_nand", NULL),
35 {}, 36 {},
36}; 37};
37 38
@@ -80,6 +81,9 @@ static void __init kirkwood_dt_init(void)
80 if (of_machine_is_compatible("qnap,ts219")) 81 if (of_machine_is_compatible("qnap,ts219"))
81 qnap_dt_ts219_init(); 82 qnap_dt_ts219_init();
82 83
84 if (of_machine_is_compatible("seagate,goflexnet"))
85 goflexnet_init();
86
83 of_platform_populate(NULL, kirkwood_dt_match_table, 87 of_platform_populate(NULL, kirkwood_dt_match_table,
84 kirkwood_auxdata_lookup, NULL); 88 kirkwood_auxdata_lookup, NULL);
85} 89}
@@ -91,6 +95,7 @@ static const char *kirkwood_dt_board_compat[] = {
91 "iom,iconnect", 95 "iom,iconnect",
92 "raidsonic,ib-nas62x0", 96 "raidsonic,ib-nas62x0",
93 "qnap,ts219", 97 "qnap,ts219",
98 "seagate,goflexnet",
94 NULL 99 NULL
95}; 100};
96 101
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}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index e0c23245a73c..2fd03adbd711 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -82,6 +82,12 @@ void ib62x0_init(void);
82static inline void ib62x0_init(void) {}; 82static inline void ib62x0_init(void) {};
83#endif 83#endif
84 84
85#ifdef CONFIG_MACH_GOFLEXNET_DT
86void goflexnet_init(void);
87#else
88static inline void goflexnet_init(void) {};
89#endif
90
85/* early init functions not converted to fdt yet */ 91/* early init functions not converted to fdt yet */
86char *kirkwood_id(void); 92char *kirkwood_id(void);
87void kirkwood_l2_init(void); 93void kirkwood_l2_init(void);