diff options
author | Simon Guinot <simon.guinot@sequanux.org> | 2012-10-17 06:09:04 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2012-11-21 15:58:35 -0500 |
commit | ecee1e47ab42ba3907d6bde7b2981e1006382071 (patch) | |
tree | 1d16d46cfe8a80ece1c824dd473302c40a680e9d | |
parent | 72052fcc10263817031dd96ea438c1f49eb39dd3 (diff) |
ARM: kirkwood: DT board setup for Network Space v2 and parents
This patch adds DT board setup for LaCie Network Space v2 and parents,
based on the Marvell Kirkwood 6281 SoC. This includes Network Space v2
(Max) and Internet Space v2.
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r-- | arch/arm/boot/dts/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood-is2.dts | 30 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 63 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood-ns2.dts | 30 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood-ns2max.dts | 49 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Kconfig | 21 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dt.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-ns2.c | 83 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 8 | ||||
-rw-r--r-- | drivers/leds/Kconfig | 4 |
11 files changed, 301 insertions, 1 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f37cf9fa5fa0..e566943cc5d8 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -36,9 +36,12 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ | |||
36 | kirkwood-ib62x0.dtb \ | 36 | kirkwood-ib62x0.dtb \ |
37 | kirkwood-iconnect.dtb \ | 37 | kirkwood-iconnect.dtb \ |
38 | kirkwood-iomega_ix2_200.dtb \ | 38 | kirkwood-iomega_ix2_200.dtb \ |
39 | kirkwood-is2.dtb \ | ||
39 | kirkwood-km_kirkwood.dtb \ | 40 | kirkwood-km_kirkwood.dtb \ |
40 | kirkwood-lschlv2.dtb \ | 41 | kirkwood-lschlv2.dtb \ |
41 | kirkwood-lsxhl.dtb \ | 42 | kirkwood-lsxhl.dtb \ |
43 | kirkwood-ns2.dtb \ | ||
44 | kirkwood-ns2max.dtb \ | ||
42 | kirkwood-ts219-6281.dtb \ | 45 | kirkwood-ts219-6281.dtb \ |
43 | kirkwood-ts219-6282.dtb | 46 | kirkwood-ts219-6282.dtb |
44 | dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ | 47 | dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ |
diff --git a/arch/arm/boot/dts/kirkwood-is2.dts b/arch/arm/boot/dts/kirkwood-is2.dts new file mode 100644 index 000000000000..0bdce0ad7277 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-is2.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Internet Space v2"; | ||
7 | compatible = "lacie,inetspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x8000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | ns2-leds { | ||
22 | compatible = "lacie,ns2-leds"; | ||
23 | |||
24 | blue-sata { | ||
25 | label = "ns2:blue:sata"; | ||
26 | slow-gpio = <&gpio0 29 0>; | ||
27 | cmd-gpio = <&gpio0 30 0>; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi new file mode 100644 index 000000000000..9bc6785ad228 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi | |||
@@ -0,0 +1,63 @@ | |||
1 | /include/ "kirkwood.dtsi" | ||
2 | |||
3 | / { | ||
4 | chosen { | ||
5 | bootargs = "console=ttyS0,115200n8"; | ||
6 | }; | ||
7 | |||
8 | ocp@f1000000 { | ||
9 | serial@12000 { | ||
10 | clock-frequency = <166666667>; | ||
11 | status = "okay"; | ||
12 | }; | ||
13 | |||
14 | spi@10600 { | ||
15 | status = "okay"; | ||
16 | |||
17 | flash@0 { | ||
18 | #address-cells = <1>; | ||
19 | #size-cells = <1>; | ||
20 | compatible = "mx25l4005a"; | ||
21 | reg = <0>; | ||
22 | spi-max-frequency = <20000000>; | ||
23 | mode = <0>; | ||
24 | |||
25 | partition@0 { | ||
26 | reg = <0x0 0x80000>; | ||
27 | label = "u-boot"; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | i2c@11000 { | ||
33 | status = "okay"; | ||
34 | |||
35 | eeprom@50 { | ||
36 | compatible = "at,24c04"; | ||
37 | pagesize = <16>; | ||
38 | reg = <0x50>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | |||
43 | gpio_keys { | ||
44 | compatible = "gpio-keys"; | ||
45 | #address-cells = <1>; | ||
46 | #size-cells = <0>; | ||
47 | |||
48 | button@1 { | ||
49 | label = "Power push button"; | ||
50 | linux,code = <116>; | ||
51 | gpios = <&gpio1 0 0>; | ||
52 | }; | ||
53 | }; | ||
54 | |||
55 | gpio-leds { | ||
56 | compatible = "gpio-leds"; | ||
57 | |||
58 | red-fail { | ||
59 | label = "ns2:red:fail"; | ||
60 | gpios = <&gpio0 12 0>; | ||
61 | }; | ||
62 | }; | ||
63 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2.dts b/arch/arm/boot/dts/kirkwood-ns2.dts new file mode 100644 index 000000000000..f2d36ecf36d8 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space v2"; | ||
7 | compatible = "lacie,netspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | ns2-leds { | ||
22 | compatible = "lacie,ns2-leds"; | ||
23 | |||
24 | blue-sata { | ||
25 | label = "ns2:blue:sata"; | ||
26 | slow-gpio = <&gpio0 29 0>; | ||
27 | cmd-gpio = <&gpio0 30 0>; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2max.dts b/arch/arm/boot/dts/kirkwood-ns2max.dts new file mode 100644 index 000000000000..bcec4d6cada7 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2max.dts | |||
@@ -0,0 +1,49 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space Max v2"; | ||
7 | compatible = "lacie,netspace_max_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <2>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | gpio_fan { | ||
22 | compatible = "gpio-fan"; | ||
23 | gpios = <&gpio0 22 1 | ||
24 | &gpio0 7 1 | ||
25 | &gpio1 1 1 | ||
26 | &gpio0 23 1>; | ||
27 | gpio-fan,speed-map = | ||
28 | < 0 0 | ||
29 | 1500 15 | ||
30 | 1700 14 | ||
31 | 1800 13 | ||
32 | 2100 12 | ||
33 | 3100 11 | ||
34 | 3300 10 | ||
35 | 4300 9 | ||
36 | 5500 8>; | ||
37 | alarm-gpios = <&gpio0 25 1>; | ||
38 | }; | ||
39 | |||
40 | ns2-leds { | ||
41 | compatible = "lacie,ns2-leds"; | ||
42 | |||
43 | blue-sata { | ||
44 | label = "ns2:blue:sata"; | ||
45 | slow-gpio = <&gpio0 29 0>; | ||
46 | cmd-gpio = <&gpio0 30 0>; | ||
47 | }; | ||
48 | }; | ||
49 | }; | ||
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 50bca5032b7e..847e0c2bf672 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT | |||
130 | Say 'Y' here if you want your kernel to support the | 130 | Say 'Y' here if you want your kernel to support the |
131 | Keymile Kirkwood Reference Desgin, using Flattened Device Tree. | 131 | Keymile Kirkwood Reference Desgin, using Flattened Device Tree. |
132 | 132 | ||
133 | config MACH_INETSPACE_V2_DT | ||
134 | bool "LaCie Internet Space v2 NAS (Flattened Device Tree)" | ||
135 | select ARCH_KIRKWOOD_DT | ||
136 | help | ||
137 | Say 'Y' here if you want your kernel to support the LaCie | ||
138 | Internet Space v2 NAS, using Flattened Device Tree. | ||
139 | |||
140 | config MACH_NETSPACE_V2_DT | ||
141 | bool "LaCie Network Space v2 NAS (Flattened Device Tree)" | ||
142 | select ARCH_KIRKWOOD_DT | ||
143 | help | ||
144 | Say 'Y' here if you want your kernel to support the LaCie | ||
145 | Network Space v2 NAS, using Flattened Device Tree. | ||
146 | |||
147 | config MACH_NETSPACE_MAX_V2_DT | ||
148 | bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)" | ||
149 | select ARCH_KIRKWOOD_DT | ||
150 | help | ||
151 | Say 'Y' here if you want your kernel to support the LaCie | ||
152 | Network Space Max v2 NAS, using Flattened Device Tree. | ||
153 | |||
133 | config MACH_TS219 | 154 | config MACH_TS219 |
134 | bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" | 155 | bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" |
135 | help | 156 | help |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 294779f892d9..1f63d804b494 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o | |||
31 | obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o | 31 | obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o |
32 | obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o | 32 | obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o |
33 | obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o | 33 | obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o |
34 | obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o | ||
35 | obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o | ||
36 | obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index ecbb26f438ea..0270a145716f 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -96,6 +96,11 @@ static void __init kirkwood_dt_init(void) | |||
96 | if (of_machine_is_compatible("keymile,km_kirkwood")) | 96 | if (of_machine_is_compatible("keymile,km_kirkwood")) |
97 | km_kirkwood_init(); | 97 | km_kirkwood_init(); |
98 | 98 | ||
99 | if (of_machine_is_compatible("lacie,inetspace_v2") || | ||
100 | of_machine_is_compatible("lacie,netspace_v2") || | ||
101 | of_machine_is_compatible("lacie,netspace_max_v2")) | ||
102 | ns2_init(); | ||
103 | |||
99 | of_platform_populate(NULL, kirkwood_dt_match_table, | 104 | of_platform_populate(NULL, kirkwood_dt_match_table, |
100 | kirkwood_auxdata_lookup, NULL); | 105 | kirkwood_auxdata_lookup, NULL); |
101 | } | 106 | } |
@@ -112,6 +117,9 @@ static const char *kirkwood_dt_board_compat[] = { | |||
112 | "buffalo,lsxl", | 117 | "buffalo,lsxl", |
113 | "iom,ix2-200", | 118 | "iom,ix2-200", |
114 | "keymile,km_kirkwood", | 119 | "keymile,km_kirkwood", |
120 | "lacie,inetspace_v2", | ||
121 | "lacie,netspace_max_v2", | ||
122 | "lacie,netspace_v2", | ||
115 | NULL | 123 | NULL |
116 | }; | 124 | }; |
117 | 125 | ||
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c new file mode 100644 index 000000000000..b36c55cba78b --- /dev/null +++ b/arch/arm/mach-kirkwood/board-ns2.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org> | ||
3 | * | ||
4 | * arch/arm/mach-kirkwood/board-ns2.c | ||
5 | * | ||
6 | * LaCie Network Space v2 board (and parents) initialization for drivers | ||
7 | * not converted to 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 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/mv643xx_eth.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include "common.h" | ||
20 | #include "mpp.h" | ||
21 | |||
22 | static struct mv643xx_eth_platform_data ns2_ge00_data = { | ||
23 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
24 | }; | ||
25 | |||
26 | static unsigned int ns2_mpp_config[] __initdata = { | ||
27 | MPP0_SPI_SCn, | ||
28 | MPP1_SPI_MOSI, | ||
29 | MPP2_SPI_SCK, | ||
30 | MPP3_SPI_MISO, | ||
31 | MPP4_NF_IO6, | ||
32 | MPP5_NF_IO7, | ||
33 | MPP6_SYSRST_OUTn, | ||
34 | MPP7_GPO, /* Fan speed (bit 1) */ | ||
35 | MPP8_TW0_SDA, | ||
36 | MPP9_TW0_SCK, | ||
37 | MPP10_UART0_TXD, | ||
38 | MPP11_UART0_RXD, | ||
39 | MPP12_GPO, /* Red led */ | ||
40 | MPP14_GPIO, /* USB fuse */ | ||
41 | MPP16_GPIO, /* SATA 0 power */ | ||
42 | MPP17_GPIO, /* SATA 1 power */ | ||
43 | MPP18_NF_IO0, | ||
44 | MPP19_NF_IO1, | ||
45 | MPP20_SATA1_ACTn, | ||
46 | MPP21_SATA0_ACTn, | ||
47 | MPP22_GPIO, /* Fan speed (bit 0) */ | ||
48 | MPP23_GPIO, /* Fan power */ | ||
49 | MPP24_GPIO, /* USB mode select */ | ||
50 | MPP25_GPIO, /* Fan rotation fail */ | ||
51 | MPP26_GPIO, /* USB device vbus */ | ||
52 | MPP28_GPIO, /* USB enable host vbus */ | ||
53 | MPP29_GPIO, /* Blue led (slow register) */ | ||
54 | MPP30_GPIO, /* Blue led (command register) */ | ||
55 | MPP31_GPIO, /* Board power off */ | ||
56 | MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */ | ||
57 | MPP33_GPO, /* Fan speed (bit 2) */ | ||
58 | 0 | ||
59 | }; | ||
60 | |||
61 | #define NS2_GPIO_POWER_OFF 31 | ||
62 | |||
63 | static void ns2_power_off(void) | ||
64 | { | ||
65 | gpio_set_value(NS2_GPIO_POWER_OFF, 1); | ||
66 | } | ||
67 | |||
68 | void __init ns2_init(void) | ||
69 | { | ||
70 | /* | ||
71 | * Basic setup. Needs to be called early. | ||
72 | */ | ||
73 | kirkwood_mpp_conf(ns2_mpp_config); | ||
74 | |||
75 | kirkwood_ehci_init(); | ||
76 | kirkwood_ge00_init(&ns2_ge00_data); | ||
77 | |||
78 | if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 && | ||
79 | gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0) | ||
80 | pm_power_off = ns2_power_off; | ||
81 | else | ||
82 | pr_err("ns2: failed to configure power-off GPIO\n"); | ||
83 | } | ||
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index bcffd7ca1ca2..2f75f3f7c858 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -112,6 +112,14 @@ void km_kirkwood_init(void); | |||
112 | static inline void km_kirkwood_init(void) {}; | 112 | static inline void km_kirkwood_init(void) {}; |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ | ||
116 | defined(CONFIG_MACH_NETSPACE_V2_DT) || \ | ||
117 | defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) | ||
118 | void ns2_init(void); | ||
119 | #else | ||
120 | static inline void ns2_init(void) {}; | ||
121 | #endif | ||
122 | |||
115 | /* early init functions not converted to fdt yet */ | 123 | /* early init functions not converted to fdt yet */ |
116 | char *kirkwood_id(void); | 124 | char *kirkwood_id(void); |
117 | void kirkwood_l2_init(void); | 125 | void kirkwood_l2_init(void); |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index f508defc0d96..e455c0869378 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -379,7 +379,9 @@ config LEDS_NS2 | |||
379 | tristate "LED support for Network Space v2 GPIO LEDs" | 379 | tristate "LED support for Network Space v2 GPIO LEDs" |
380 | depends on LEDS_CLASS | 380 | depends on LEDS_CLASS |
381 | depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \ | 381 | depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \ |
382 | MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 | 382 | MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 || \ |
383 | MACH_NETSPACE_V2_DT || MACH_INETSPACE_V2_DT || \ | ||
384 | MACH_NETSPACE_MAX_V2_DT | ||
383 | default y | 385 | default y |
384 | help | 386 | help |
385 | This option enable support for the dual-GPIO LED found on the | 387 | This option enable support for the dual-GPIO LED found on the |