aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/Kconfig70
-rw-r--r--arch/arm/mach-kirkwood/Makefile9
-rw-r--r--arch/arm/mach-kirkwood/board-dnskw.c54
-rw-r--r--arch/arm/mach-kirkwood/board-dockstar.c16
-rw-r--r--arch/arm/mach-kirkwood/board-dreamplug.c15
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c30
-rw-r--r--arch/arm/mach-kirkwood/board-goflexnet.c24
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c35
-rw-r--r--arch/arm/mach-kirkwood/board-iconnect.c18
-rw-r--r--arch/arm/mach-kirkwood/board-iomega_ix2_200.c26
-rw-r--r--arch/arm/mach-kirkwood/board-km_kirkwood.c13
-rw-r--r--arch/arm/mach-kirkwood/board-lsxl.c75
-rw-r--r--arch/arm/mach-kirkwood/board-mplcec4.c44
-rw-r--r--arch/arm/mach-kirkwood/board-ns2.c86
-rw-r--r--arch/arm/mach-kirkwood/board-nsa310.c101
-rw-r--r--arch/arm/mach-kirkwood/board-openblocks_a6.c70
-rw-r--r--arch/arm/mach-kirkwood/board-ts219.c26
-rw-r--r--arch/arm/mach-kirkwood/board-usi_topkick.c81
-rw-r--r--arch/arm/mach-kirkwood/common.c1
-rw-r--r--arch/arm/mach-kirkwood/common.h34
20 files changed, 526 insertions, 302 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 50bca5032b7e..503d7dd944ff 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -46,6 +46,11 @@ config MACH_GURUPLUG
46 46
47config ARCH_KIRKWOOD_DT 47config ARCH_KIRKWOOD_DT
48 bool "Marvell Kirkwood Flattened Device Tree" 48 bool "Marvell Kirkwood Flattened Device Tree"
49 select POWER_SUPPLY
50 select POWER_RESET
51 select POWER_RESET_GPIO
52 select REGULATOR
53 select REGULATOR_FIXED_VOLTAGE
49 select USE_OF 54 select USE_OF
50 help 55 help
51 Say 'Y' here if you want your kernel to support the 56 Say 'Y' here if you want your kernel to support the
@@ -130,6 +135,63 @@ config MACH_KM_KIRKWOOD_DT
130 Say 'Y' here if you want your kernel to support the 135 Say 'Y' here if you want your kernel to support the
131 Keymile Kirkwood Reference Desgin, using Flattened Device Tree. 136 Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
132 137
138config MACH_INETSPACE_V2_DT
139 bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
140 select ARCH_KIRKWOOD_DT
141 help
142 Say 'Y' here if you want your kernel to support the LaCie
143 Internet Space v2 NAS, using Flattened Device Tree.
144
145config MACH_MPLCEC4_DT
146 bool "MPL CEC4 (Flattened Device Tree)"
147 select ARCH_KIRKWOOD_DT
148 help
149 Say 'Y' here if you want your kernel to support the
150 MPL CEC4 (Flattened Device Tree).
151
152config MACH_NETSPACE_V2_DT
153 bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
154 select ARCH_KIRKWOOD_DT
155 help
156 Say 'Y' here if you want your kernel to support the LaCie
157 Network Space v2 NAS, using Flattened Device Tree.
158
159config MACH_NETSPACE_MAX_V2_DT
160 bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
161 select ARCH_KIRKWOOD_DT
162 help
163 Say 'Y' here if you want your kernel to support the LaCie
164 Network Space Max v2 NAS, using Flattened Device Tree.
165
166config MACH_NETSPACE_LITE_V2_DT
167 bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
168 select ARCH_KIRKWOOD_DT
169 help
170 Say 'Y' here if you want your kernel to support the LaCie
171 Network Space Lite v2 NAS, using Flattened Device Tree.
172
173config MACH_NETSPACE_MINI_V2_DT
174 bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
175 select ARCH_KIRKWOOD_DT
176 help
177 Say 'Y' here if you want your kernel to support the LaCie
178 Network Space Mini v2 NAS (aka SafeBox), using Flattened
179 Device Tree.
180
181config MACH_OPENBLOCKS_A6_DT
182 bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
183 select ARCH_KIRKWOOD_DT
184 help
185 Say 'Y' here if you want your kernel to support the
186 Plat'Home OpenBlocks A6 (Flattened Device Tree).
187
188config MACH_TOPKICK_DT
189 bool "USI Topkick (Flattened Device Tree)"
190 select ARCH_KIRKWOOD_DT
191 help
192 Say 'Y' here if you want your kernel to support the
193 USI Topkick, using Flattened Device Tree
194
133config MACH_TS219 195config MACH_TS219
134 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 196 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
135 help 197 help
@@ -216,6 +278,14 @@ config MACH_T5325
216 Say 'Y' here if you want your kernel to support the 278 Say 'Y' here if you want your kernel to support the
217 HP t5325 Thin Client. 279 HP t5325 Thin Client.
218 280
281config MACH_NSA310_DT
282 bool "ZyXEL NSA-310 (Flattened Device Tree)"
283 select ARCH_KIRKWOOD_DT
284 select ARM_ATAG_DTB_COMPAT
285 help
286 Say 'Y' here if you want your kernel to support the
287 ZyXEL NSA-310 board (Flattened Device Tree).
288
219endmenu 289endmenu
220 290
221endif 291endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 294779f892d9..8d2e5a96247c 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -31,3 +31,12 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o
31obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o 31obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o
32obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o 32obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o
33obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o 33obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o
34obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o
35obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o
36obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o
37obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o
38obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o
39obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o
40obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o
41obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o
42obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 43d16d6714b8..a1aa87f09180 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -17,51 +17,11 @@
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include "common.h" 19#include "common.h"
20#include "mpp.h"
21 20
22static struct mv643xx_eth_platform_data dnskw_ge00_data = { 21static struct mv643xx_eth_platform_data dnskw_ge00_data = {
23 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 22 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
24}; 23};
25 24
26static unsigned int dnskw_mpp_config[] __initdata = {
27 MPP13_UART1_TXD, /* Custom ... */
28 MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */
29 MPP20_SATA1_ACTn, /* LED: White Right HDD */
30 MPP21_SATA0_ACTn, /* LED: White Left HDD */
31 MPP24_GPIO,
32 MPP25_GPIO,
33 MPP26_GPIO, /* LED: Power */
34 MPP27_GPIO, /* LED: Red Right HDD */
35 MPP28_GPIO, /* LED: Red Left HDD */
36 MPP29_GPIO, /* LED: Red USB (DNS-325 only) */
37 MPP30_GPIO,
38 MPP31_GPIO,
39 MPP32_GPIO,
40 MPP33_GPO,
41 MPP34_GPIO, /* Button: Front power */
42 MPP35_GPIO, /* LED: Red USB (DNS-320 only) */
43 MPP36_GPIO, /* Power: Turn off board */
44 MPP37_GPIO, /* Power: Turn back on after power failure */
45 MPP38_GPIO,
46 MPP39_GPIO, /* Power: SATA0 */
47 MPP40_GPIO, /* Power: SATA1 */
48 MPP41_GPIO, /* SATA0 present */
49 MPP42_GPIO, /* SATA1 present */
50 MPP43_GPIO, /* LED: White USB */
51 MPP44_GPIO, /* Fan: Tachometer Pin */
52 MPP45_GPIO, /* Fan: high speed */
53 MPP46_GPIO, /* Fan: low speed */
54 MPP47_GPIO, /* Button: Back unmount */
55 MPP48_GPIO, /* Button: Back reset */
56 MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */
57 0
58};
59
60static void dnskw_power_off(void)
61{
62 gpio_set_value(36, 1);
63}
64
65/* Register any GPIO for output and set the value */ 25/* Register any GPIO for output and set the value */
66static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) 26static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
67{ 27{
@@ -76,22 +36,8 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
76 36
77void __init dnskw_init(void) 37void __init dnskw_init(void)
78{ 38{
79 kirkwood_mpp_conf(dnskw_mpp_config);
80
81 kirkwood_ehci_init();
82 kirkwood_ge00_init(&dnskw_ge00_data); 39 kirkwood_ge00_init(&dnskw_ge00_data);
83 40
84 /* Register power-off GPIO. */
85 if (gpio_request(36, "dnskw:power:off") == 0
86 && gpio_direction_output(36, 0) == 0)
87 pm_power_off = dnskw_power_off;
88 else
89 pr_err("dnskw: failed to configure power-off GPIO\n");
90
91 /* Ensure power is supplied to both HDDs */
92 dnskw_gpio_register(39, "dnskw:power:sata0", 1);
93 dnskw_gpio_register(40, "dnskw:power:sata1", 1);
94
95 /* Set NAS to turn back on after a power failure */ 41 /* Set NAS to turn back on after a power failure */
96 dnskw_gpio_register(37, "dnskw:power:recover", 1); 42 dnskw_gpio_register(37, "dnskw:power:recover", 1);
97} 43}
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
index 6912882b0aa9..d7196db33984 100644
--- a/arch/arm/mach-kirkwood/board-dockstar.c
+++ b/arch/arm/mach-kirkwood/board-dockstar.c
@@ -17,32 +17,16 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/mv643xx_eth.h> 19#include <linux/mv643xx_eth.h>
20#include <linux/gpio.h>
21#include "common.h" 20#include "common.h"
22#include "mpp.h"
23 21
24static struct mv643xx_eth_platform_data dockstar_ge00_data = { 22static struct mv643xx_eth_platform_data dockstar_ge00_data = {
25 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 23 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
26}; 24};
27 25
28static unsigned int dockstar_mpp_config[] __initdata = {
29 MPP29_GPIO, /* USB Power Enable */
30 MPP46_GPIO, /* LED green */
31 MPP47_GPIO, /* LED orange */
32 0
33};
34
35void __init dockstar_dt_init(void) 26void __init dockstar_dt_init(void)
36{ 27{
37 /* 28 /*
38 * Basic setup. Needs to be called early. 29 * Basic setup. Needs to be called early.
39 */ 30 */
40 kirkwood_mpp_conf(dockstar_mpp_config);
41
42 if (gpio_request(29, "USB Power Enable") != 0 ||
43 gpio_direction_output(29, 1) != 0)
44 pr_err("can't setup GPIO 29 (USB Power Enable)\n");
45 kirkwood_ehci_init();
46
47 kirkwood_ge00_init(&dockstar_ge00_data); 31 kirkwood_ge00_init(&dockstar_ge00_data);
48} 32}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 8a8ebe09e512..08248e24ffcd 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -17,7 +17,6 @@
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/platform_data/mmc-mvsdio.h> 18#include <linux/platform_data/mmc-mvsdio.h>
19#include "common.h" 19#include "common.h"
20#include "mpp.h"
21 20
22static struct mv643xx_eth_platform_data dreamplug_ge00_data = { 21static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
23 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 22 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
@@ -31,25 +30,11 @@ static struct mvsdio_platform_data dreamplug_mvsdio_data = {
31 /* unfortunately the CD signal has not been connected */ 30 /* unfortunately the CD signal has not been connected */
32}; 31};
33 32
34static unsigned int dreamplug_mpp_config[] __initdata = {
35 MPP0_SPI_SCn,
36 MPP1_SPI_MOSI,
37 MPP2_SPI_SCK,
38 MPP3_SPI_MISO,
39 MPP47_GPIO, /* Bluetooth LED */
40 MPP48_GPIO, /* Wifi LED */
41 MPP49_GPIO, /* Wifi AP LED */
42 0
43};
44
45void __init dreamplug_init(void) 33void __init dreamplug_init(void)
46{ 34{
47 /* 35 /*
48 * Basic setup. Needs to be called early. 36 * Basic setup. Needs to be called early.
49 */ 37 */
50 kirkwood_mpp_conf(dreamplug_mpp_config);
51
52 kirkwood_ehci_init();
53 kirkwood_ge00_init(&dreamplug_ge00_data); 38 kirkwood_ge00_init(&dreamplug_ge00_data);
54 kirkwood_ge01_init(&dreamplug_ge01_data); 39 kirkwood_ge01_init(&dreamplug_ge01_data);
55 kirkwood_sdio_init(&dreamplug_mvsdio_data); 40 kirkwood_sdio_init(&dreamplug_mvsdio_data);
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e75fbdb533de..375f7d88551c 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -30,6 +30,8 @@ static struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
30 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), 30 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
31 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", 31 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
32 NULL), 32 NULL),
33 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011100, "mv64xxx_i2c.1",
34 NULL),
33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 35 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 36 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
35 OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), 37 OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
@@ -94,6 +96,25 @@ static void __init kirkwood_dt_init(void)
94 if (of_machine_is_compatible("keymile,km_kirkwood")) 96 if (of_machine_is_compatible("keymile,km_kirkwood"))
95 km_kirkwood_init(); 97 km_kirkwood_init();
96 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 of_machine_is_compatible("lacie,netspace_lite_v2") ||
103 of_machine_is_compatible("lacie,netspace_mini_v2"))
104 ns2_init();
105
106 if (of_machine_is_compatible("mpl,cec4"))
107 mplcec4_init();
108
109 if (of_machine_is_compatible("plathome,openblocks-a6"))
110 openblocks_a6_init();
111
112 if (of_machine_is_compatible("usi,topkick"))
113 usi_topkick_init();
114
115 if (of_machine_is_compatible("zyxel,nsa310"))
116 nsa310_init();
117
97 of_platform_populate(NULL, kirkwood_dt_match_table, 118 of_platform_populate(NULL, kirkwood_dt_match_table,
98 kirkwood_auxdata_lookup, NULL); 119 kirkwood_auxdata_lookup, NULL);
99} 120}
@@ -110,6 +131,15 @@ static const char * const kirkwood_dt_board_compat[] = {
110 "buffalo,lsxl", 131 "buffalo,lsxl",
111 "iom,ix2-200", 132 "iom,ix2-200",
112 "keymile,km_kirkwood", 133 "keymile,km_kirkwood",
134 "lacie,inetspace_v2",
135 "lacie,netspace_max_v2",
136 "lacie,netspace_v2",
137 "lacie,netspace_lite_v2",
138 "lacie,netspace_mini_v2",
139 "mpl,cec4",
140 "plathome,openblocks-a6",
141 "usi,topkick",
142 "zyxel,nsa310",
113 NULL 143 NULL
114}; 144};
115 145
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
index 5dcd0d62aa42..9db979aec82e 100644
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ b/arch/arm/mach-kirkwood/board-goflexnet.c
@@ -19,40 +19,16 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/mv643xx_eth.h> 21#include <linux/mv643xx_eth.h>
22#include <linux/gpio.h>
23#include "common.h" 22#include "common.h"
24#include "mpp.h"
25 23
26static struct mv643xx_eth_platform_data goflexnet_ge00_data = { 24static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
27 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 25 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
28}; 26};
29 27
30static unsigned int goflexnet_mpp_config[] __initdata = {
31 MPP29_GPIO, /* USB Power Enable */
32 MPP47_GPIO, /* LED Orange */
33 MPP46_GPIO, /* LED Green */
34 MPP45_GPIO, /* LED Left Capacity 3 */
35 MPP44_GPIO, /* LED Left Capacity 2 */
36 MPP43_GPIO, /* LED Left Capacity 1 */
37 MPP42_GPIO, /* LED Left Capacity 0 */
38 MPP41_GPIO, /* LED Right Capacity 3 */
39 MPP40_GPIO, /* LED Right Capacity 2 */
40 MPP39_GPIO, /* LED Right Capacity 1 */
41 MPP38_GPIO, /* LED Right Capacity 0 */
42 0
43};
44
45void __init goflexnet_init(void) 28void __init goflexnet_init(void)
46{ 29{
47 /* 30 /*
48 * Basic setup. Needs to be called early. 31 * Basic setup. Needs to be called early.
49 */ 32 */
50 kirkwood_mpp_conf(goflexnet_mpp_config);
51
52 if (gpio_request(29, "USB Power Enable") != 0 ||
53 gpio_direction_output(29, 1) != 0)
54 pr_err("can't setup GPIO 29 (USB Power Enable)\n");
55 kirkwood_ehci_init();
56
57 kirkwood_ge00_init(&goflexnet_ge00_data); 33 kirkwood_ge00_init(&goflexnet_ge00_data);
58} 34}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index 6d3a56421142..9f6f496380d8 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -14,52 +14,17 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h>
18#include <linux/input.h> 17#include <linux/input.h>
19#include "common.h" 18#include "common.h"
20#include "mpp.h"
21
22#define IB62X0_GPIO_POWER_OFF 24
23 19
24static struct mv643xx_eth_platform_data ib62x0_ge00_data = { 20static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
25 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 21 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
26}; 22};
27 23
28static unsigned int ib62x0_mpp_config[] __initdata = {
29 MPP0_NF_IO2,
30 MPP1_NF_IO3,
31 MPP2_NF_IO4,
32 MPP3_NF_IO5,
33 MPP4_NF_IO6,
34 MPP5_NF_IO7,
35 MPP18_NF_IO0,
36 MPP19_NF_IO1,
37 MPP22_GPIO, /* OS LED red */
38 MPP24_GPIO, /* Power off device */
39 MPP25_GPIO, /* OS LED green */
40 MPP27_GPIO, /* USB transfer LED */
41 MPP28_GPIO, /* Reset button */
42 MPP29_GPIO, /* USB Copy button */
43 0
44};
45
46static void ib62x0_power_off(void)
47{
48 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
49}
50
51void __init ib62x0_init(void) 24void __init ib62x0_init(void)
52{ 25{
53 /* 26 /*
54 * Basic setup. Needs to be called early. 27 * Basic setup. Needs to be called early.
55 */ 28 */
56 kirkwood_mpp_conf(ib62x0_mpp_config);
57
58 kirkwood_ehci_init();
59 kirkwood_ge00_init(&ib62x0_ge00_data); 29 kirkwood_ge00_init(&ib62x0_ge00_data);
60 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
61 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
62 pm_power_off = ib62x0_power_off;
63 else
64 pr_err("board-ib62x0: failed to configure power-off GPIO\n");
65} 30}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index 24f5aa7f698b..c8ebde4919e2 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -13,31 +13,13 @@
13#include <linux/of.h> 13#include <linux/of.h>
14#include <linux/mv643xx_eth.h> 14#include <linux/mv643xx_eth.h>
15#include "common.h" 15#include "common.h"
16#include "mpp.h"
17 16
18static struct mv643xx_eth_platform_data iconnect_ge00_data = { 17static struct mv643xx_eth_platform_data iconnect_ge00_data = {
19 .phy_addr = MV643XX_ETH_PHY_ADDR(11), 18 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
20}; 19};
21 20
22static unsigned int iconnect_mpp_config[] __initdata = {
23 MPP12_GPIO,
24 MPP35_GPIO,
25 MPP41_GPIO,
26 MPP42_GPIO,
27 MPP43_GPIO,
28 MPP44_GPIO,
29 MPP45_GPIO,
30 MPP46_GPIO,
31 MPP47_GPIO,
32 MPP48_GPIO,
33 0
34};
35
36void __init iconnect_init(void) 21void __init iconnect_init(void)
37{ 22{
38 kirkwood_mpp_conf(iconnect_mpp_config);
39
40 kirkwood_ehci_init();
41 kirkwood_ge00_init(&iconnect_ge00_data); 23 kirkwood_ge00_init(&iconnect_ge00_data);
42} 24}
43 25
diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
index e4ed62c28f54..f655b2637b0e 100644
--- a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
+++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
@@ -13,7 +13,6 @@
13#include <linux/mv643xx_eth.h> 13#include <linux/mv643xx_eth.h>
14#include <linux/ethtool.h> 14#include <linux/ethtool.h>
15#include "common.h" 15#include "common.h"
16#include "mpp.h"
17 16
18static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { 17static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
19 .phy_addr = MV643XX_ETH_PHY_NONE, 18 .phy_addr = MV643XX_ETH_PHY_NONE,
@@ -21,35 +20,10 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
21 .duplex = DUPLEX_FULL, 20 .duplex = DUPLEX_FULL,
22}; 21};
23 22
24static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
25 MPP12_GPIO, /* Reset Button */
26 MPP14_GPIO, /* Power Button */
27 MPP15_GPIO, /* Backup LED (blue) */
28 MPP16_GPIO, /* Power LED (white) */
29 MPP35_GPIO, /* OTB Button */
30 MPP36_GPIO, /* Rebuild LED (white) */
31 MPP37_GPIO, /* Health LED (red) */
32 MPP38_GPIO, /* SATA LED brightness control 1 */
33 MPP39_GPIO, /* SATA LED brightness control 2 */
34 MPP40_GPIO, /* Backup LED brightness control 1 */
35 MPP41_GPIO, /* Backup LED brightness control 2 */
36 MPP42_GPIO, /* Power LED brightness control 1 */
37 MPP43_GPIO, /* Power LED brightness control 2 */
38 MPP44_GPIO, /* Health LED brightness control 1 */
39 MPP45_GPIO, /* Health LED brightness control 2 */
40 MPP46_GPIO, /* Rebuild LED brightness control 1 */
41 MPP47_GPIO, /* Rebuild LED brightness control 2 */
42 0
43};
44
45void __init iomega_ix2_200_init(void) 23void __init iomega_ix2_200_init(void)
46{ 24{
47 /* 25 /*
48 * Basic setup. Needs to be called early. 26 * Basic setup. Needs to be called early.
49 */ 27 */
50 kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
51
52 kirkwood_ehci_init();
53
54 kirkwood_ge01_init(&iomega_ix2_200_ge00_data); 28 kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
55} 29}
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c
index f7d32834b757..44e4605ba0bf 100644
--- a/arch/arm/mach-kirkwood/board-km_kirkwood.c
+++ b/arch/arm/mach-kirkwood/board-km_kirkwood.c
@@ -18,27 +18,15 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/clk-private.h> 19#include <linux/clk-private.h>
20#include "common.h" 20#include "common.h"
21#include "mpp.h"
22 21
23static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = { 22static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 23 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
25}; 24};
26 25
27static unsigned int km_kirkwood_mpp_config[] __initdata = {
28 MPP8_GPIO, /* I2C SDA */
29 MPP9_GPIO, /* I2C SCL */
30 0
31};
32
33void __init km_kirkwood_init(void) 26void __init km_kirkwood_init(void)
34{ 27{
35 struct clk *sata_clk; 28 struct clk *sata_clk;
36 /* 29 /*
37 * Basic setup. Needs to be called early.
38 */
39 kirkwood_mpp_conf(km_kirkwood_mpp_config);
40
41 /*
42 * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing 30 * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
43 * SATA bits (14-15) of the Clock Gating Control Register. Since these 31 * SATA bits (14-15) of the Clock Gating Control Register. Since these
44 * devices are also not present in this variant, their clocks get 32 * devices are also not present in this variant, their clocks get
@@ -52,6 +40,5 @@ void __init km_kirkwood_init(void)
52 if (!IS_ERR(sata_clk)) 40 if (!IS_ERR(sata_clk))
53 sata_clk->flags |= CLK_IGNORE_UNUSED; 41 sata_clk->flags |= CLK_IGNORE_UNUSED;
54 42
55 kirkwood_ehci_init();
56 kirkwood_ge00_init(&km_kirkwood_ge00_data); 43 kirkwood_ge00_init(&km_kirkwood_ge00_data);
57} 44}
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
index 64e5cc6b6d5f..4ec8b7ae784a 100644
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ b/arch/arm/mach-kirkwood/board-lsxl.c
@@ -15,10 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/gpio.h>
19#include <linux/gpio-fan.h>
20#include "common.h" 18#include "common.h"
21#include "mpp.h"
22 19
23static struct mv643xx_eth_platform_data lsxl_ge00_data = { 20static struct mv643xx_eth_platform_data lsxl_ge00_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 21 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
@@ -28,68 +25,6 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = {
28 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 25 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
29}; 26};
30 27
31static unsigned int lsxl_mpp_config[] __initdata = {
32 MPP10_GPO, /* HDD Power Enable */
33 MPP11_GPIO, /* USB Vbus Enable */
34 MPP18_GPO, /* FAN High Enable# */
35 MPP19_GPO, /* FAN Low Enable# */
36 MPP36_GPIO, /* Function Blue LED */
37 MPP37_GPIO, /* Alarm LED */
38 MPP38_GPIO, /* Info LED */
39 MPP39_GPIO, /* Power LED */
40 MPP40_GPIO, /* Fan Lock */
41 MPP41_GPIO, /* Function Button */
42 MPP42_GPIO, /* Power Switch */
43 MPP43_GPIO, /* Power Auto Switch */
44 MPP48_GPIO, /* Function Red LED */
45 0
46};
47
48#define LSXL_GPIO_FAN_HIGH 18
49#define LSXL_GPIO_FAN_LOW 19
50#define LSXL_GPIO_FAN_LOCK 40
51
52static struct gpio_fan_alarm lsxl_alarm = {
53 .gpio = LSXL_GPIO_FAN_LOCK,
54};
55
56static struct gpio_fan_speed lsxl_speeds[] = {
57 {
58 .rpm = 0,
59 .ctrl_val = 3,
60 }, {
61 .rpm = 1500,
62 .ctrl_val = 1,
63 }, {
64 .rpm = 3250,
65 .ctrl_val = 2,
66 }, {
67 .rpm = 5000,
68 .ctrl_val = 0,
69 }
70};
71
72static int lsxl_gpio_list[] = {
73 LSXL_GPIO_FAN_HIGH, LSXL_GPIO_FAN_LOW,
74};
75
76static struct gpio_fan_platform_data lsxl_fan_data = {
77 .num_ctrl = ARRAY_SIZE(lsxl_gpio_list),
78 .ctrl = lsxl_gpio_list,
79 .alarm = &lsxl_alarm,
80 .num_speed = ARRAY_SIZE(lsxl_speeds),
81 .speed = lsxl_speeds,
82};
83
84static struct platform_device lsxl_fan_device = {
85 .name = "gpio-fan",
86 .id = -1,
87 .num_resources = 0,
88 .dev = {
89 .platform_data = &lsxl_fan_data,
90 },
91};
92
93/* 28/*
94 * On the LS-XHL/LS-CHLv2, the shutdown process is following: 29 * On the LS-XHL/LS-CHLv2, the shutdown process is following:
95 * - Userland monitors key events until the power switch goes to off position 30 * - Userland monitors key events until the power switch goes to off position
@@ -103,24 +38,14 @@ static void lsxl_power_off(void)
103 kirkwood_restart('h', NULL); 38 kirkwood_restart('h', NULL);
104} 39}
105 40
106#define LSXL_GPIO_HDD_POWER 10
107#define LSXL_GPIO_USB_POWER 11
108
109void __init lsxl_init(void) 41void __init lsxl_init(void)
110{ 42{
111 /* 43 /*
112 * Basic setup. Needs to be called early. 44 * Basic setup. Needs to be called early.
113 */ 45 */
114 kirkwood_mpp_conf(lsxl_mpp_config);
115
116 /* usb and sata power on */
117 gpio_set_value(LSXL_GPIO_USB_POWER, 1);
118 gpio_set_value(LSXL_GPIO_HDD_POWER, 1);
119 46
120 kirkwood_ehci_init();
121 kirkwood_ge00_init(&lsxl_ge00_data); 47 kirkwood_ge00_init(&lsxl_ge00_data);
122 kirkwood_ge01_init(&lsxl_ge01_data); 48 kirkwood_ge01_init(&lsxl_ge01_data);
123 platform_device_register(&lsxl_fan_device);
124 49
125 /* register power-off method */ 50 /* register power-off method */
126 pm_power_off = lsxl_power_off; 51 pm_power_off = lsxl_power_off;
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
new file mode 100644
index 000000000000..56bfe5a1605a
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2012 MPL AG, Switzerland
3 * Stefan Peter <s.peter@mpl.ch>
4 *
5 * arch/arm/mach-kirkwood/board-mplcec4.c
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/mv643xx_eth.h>
15#include <linux/platform_data/mmc-mvsdio.h>
16#include "common.h"
17#include "mpp.h"
18
19static struct mv643xx_eth_platform_data mplcec4_ge00_data = {
20 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
21};
22
23static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(2),
25};
26
27static struct mvsdio_platform_data mplcec4_mvsdio_data = {
28 .gpio_card_detect = 47, /* MPP47 used as SD card detect */
29};
30
31
32void __init mplcec4_init(void)
33{
34 /*
35 * Basic setup. Needs to be called early.
36 */
37 kirkwood_ge00_init(&mplcec4_ge00_data);
38 kirkwood_ge01_init(&mplcec4_ge01_data);
39 kirkwood_sdio_init(&mplcec4_mvsdio_data);
40 kirkwood_pcie_init(KW_PCIE0);
41}
42
43
44
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
new file mode 100644
index 000000000000..8821720ab5a4
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ns2.c
@@ -0,0 +1,86 @@
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 <linux/of.h>
20#include "common.h"
21#include "mpp.h"
22
23static struct mv643xx_eth_platform_data ns2_ge00_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
25};
26
27static unsigned int ns2_mpp_config[] __initdata = {
28 MPP0_SPI_SCn,
29 MPP1_SPI_MOSI,
30 MPP2_SPI_SCK,
31 MPP3_SPI_MISO,
32 MPP4_NF_IO6,
33 MPP5_NF_IO7,
34 MPP6_SYSRST_OUTn,
35 MPP7_GPO, /* Fan speed (bit 1) */
36 MPP8_TW0_SDA,
37 MPP9_TW0_SCK,
38 MPP10_UART0_TXD,
39 MPP11_UART0_RXD,
40 MPP12_GPO, /* Red led */
41 MPP14_GPIO, /* USB fuse */
42 MPP16_GPIO, /* SATA 0 power */
43 MPP17_GPIO, /* SATA 1 power */
44 MPP18_NF_IO0,
45 MPP19_NF_IO1,
46 MPP20_SATA1_ACTn,
47 MPP21_SATA0_ACTn,
48 MPP22_GPIO, /* Fan speed (bit 0) */
49 MPP23_GPIO, /* Fan power */
50 MPP24_GPIO, /* USB mode select */
51 MPP25_GPIO, /* Fan rotation fail */
52 MPP26_GPIO, /* USB device vbus */
53 MPP28_GPIO, /* USB enable host vbus */
54 MPP29_GPIO, /* Blue led (slow register) */
55 MPP30_GPIO, /* Blue led (command register) */
56 MPP31_GPIO, /* Board power off */
57 MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */
58 MPP33_GPO, /* Fan speed (bit 2) */
59 0
60};
61
62#define NS2_GPIO_POWER_OFF 31
63
64static void ns2_power_off(void)
65{
66 gpio_set_value(NS2_GPIO_POWER_OFF, 1);
67}
68
69void __init ns2_init(void)
70{
71 /*
72 * Basic setup. Needs to be called early.
73 */
74 kirkwood_mpp_conf(ns2_mpp_config);
75
76 if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
77 of_machine_is_compatible("lacie,netspace_mini_v2"))
78 ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
79 kirkwood_ge00_init(&ns2_ge00_data);
80
81 if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
82 gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0)
83 pm_power_off = ns2_power_off;
84 else
85 pr_err("ns2: failed to configure power-off GPIO\n");
86}
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
new file mode 100644
index 000000000000..f58d2e1a4042
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -0,0 +1,101 @@
1/*
2 * arch/arm/mach-kirkwood/nsa-310-setup.c
3 *
4 * ZyXEL NSA-310 Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/i2c.h>
14#include <linux/gpio.h>
15
16#include <asm/mach-types.h>
17#include <asm/mach/arch.h>
18#include <mach/kirkwood.h>
19#include "common.h"
20#include "mpp.h"
21
22#define NSA310_GPIO_USB_POWER_OFF 21
23#define NSA310_GPIO_POWER_OFF 48
24
25static unsigned int nsa310_mpp_config[] __initdata = {
26 MPP12_GPIO, /* led esata green */
27 MPP13_GPIO, /* led esata red */
28 MPP15_GPIO, /* led usb green */
29 MPP16_GPIO, /* led usb red */
30 MPP21_GPIO, /* control usb power off */
31 MPP28_GPIO, /* led sys green */
32 MPP29_GPIO, /* led sys red */
33 MPP36_GPIO, /* key reset */
34 MPP37_GPIO, /* key copy */
35 MPP39_GPIO, /* led copy green */
36 MPP40_GPIO, /* led copy red */
37 MPP41_GPIO, /* led hdd green */
38 MPP42_GPIO, /* led hdd red */
39 MPP44_GPIO, /* ?? */
40 MPP46_GPIO, /* key power */
41 MPP48_GPIO, /* control power off */
42 0
43};
44
45static struct i2c_board_info __initdata nsa310_i2c_info[] = {
46 { I2C_BOARD_INFO("adt7476", 0x2e) },
47};
48
49static void nsa310_power_off(void)
50{
51 gpio_set_value(NSA310_GPIO_POWER_OFF, 1);
52}
53
54static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags,
55 const char *label)
56{
57 int err;
58
59 err = gpio_request_one(gpio, flags, label);
60 if (err)
61 pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n",
62 gpio, label, err);
63
64 return err;
65}
66
67static void __init nsa310_gpio_init(void)
68{
69 int err;
70
71 err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW,
72 "Power Off");
73 if (!err)
74 pm_power_off = nsa310_power_off;
75
76 nsa310_gpio_request(NSA310_GPIO_USB_POWER_OFF, GPIOF_OUT_INIT_LOW,
77 "USB Power Off");
78}
79
80void __init nsa310_init(void)
81{
82 u32 dev, rev;
83
84 kirkwood_mpp_conf(nsa310_mpp_config);
85
86 nsa310_gpio_init();
87
88 kirkwood_pcie_id(&dev, &rev);
89
90 i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
91}
92
93static int __init nsa310_pci_init(void)
94{
95 if (of_machine_is_compatible("zyxel,nsa310"))
96 kirkwood_pcie_init(KW_PCIE0);
97
98 return 0;
99}
100
101subsys_initcall(nsa310_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
new file mode 100644
index 000000000000..815fc6451d52
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-openblocks_a6.c
@@ -0,0 +1,70 @@
1/*
2 * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 *
4 * arch/arm/mach-kirkwood/board-openblocks_a6.c
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mv643xx_eth.h>
14#include <linux/clk.h>
15#include <linux/clk-private.h>
16#include "common.h"
17#include "mpp.h"
18
19static struct mv643xx_eth_platform_data openblocks_ge00_data = {
20 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
21};
22
23static unsigned int openblocks_a6_mpp_config[] __initdata = {
24 MPP0_NF_IO2,
25 MPP1_NF_IO3,
26 MPP2_NF_IO4,
27 MPP3_NF_IO5,
28 MPP4_NF_IO6,
29 MPP5_NF_IO7,
30 MPP6_SYSRST_OUTn,
31 MPP8_UART1_RTS,
32 MPP9_UART1_CTS,
33 MPP10_UART0_TXD,
34 MPP11_UART0_RXD,
35 MPP13_UART1_TXD,
36 MPP14_UART1_RXD,
37 MPP15_UART0_RTS,
38 MPP16_UART0_CTS,
39 MPP18_NF_IO0,
40 MPP19_NF_IO1,
41 MPP20_GPIO, /* DIP SW0 */
42 MPP21_GPIO, /* DIP SW1 */
43 MPP22_GPIO, /* DIP SW2 */
44 MPP23_GPIO, /* DIP SW3 */
45 MPP24_GPIO, /* GPIO 0 */
46 MPP25_GPIO, /* GPIO 1 */
47 MPP26_GPIO, /* GPIO 2 */
48 MPP27_GPIO, /* GPIO 3 */
49 MPP28_GPIO, /* GPIO 4 */
50 MPP29_GPIO, /* GPIO 5 */
51 MPP30_GPIO, /* GPIO 6 */
52 MPP31_GPIO, /* GPIO 7 */
53 MPP36_TW1_SDA,
54 MPP37_TW1_SCK,
55 MPP38_GPIO, /* INIT */
56 MPP39_GPIO, /* USB OC */
57 MPP41_GPIO, /* LED: Red */
58 MPP42_GPIO, /* LED: Green */
59 MPP43_GPIO, /* LED: Yellow */
60 0,
61};
62
63void __init openblocks_a6_init(void)
64{
65 /*
66 * Basic setup. Needs to be called early.
67 */
68 kirkwood_mpp_conf(openblocks_a6_mpp_config);
69 kirkwood_ge00_init(&openblocks_ge00_data);
70}
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index f3bfedae3a20..acb0187c7ee1 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -23,47 +23,21 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <mach/kirkwood.h> 24#include <mach/kirkwood.h>
25#include "common.h" 25#include "common.h"
26#include "mpp.h"
27#include "tsx1x-common.h" 26#include "tsx1x-common.h"
28 27
29static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { 28static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
30 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 29 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
31}; 30};
32 31
33static unsigned int qnap_ts219_mpp_config[] __initdata = {
34 MPP0_SPI_SCn,
35 MPP1_SPI_MOSI,
36 MPP2_SPI_SCK,
37 MPP3_SPI_MISO,
38 MPP4_SATA1_ACTn,
39 MPP5_SATA0_ACTn,
40 MPP8_TW0_SDA,
41 MPP9_TW0_SCK,
42 MPP10_UART0_TXD,
43 MPP11_UART0_RXD,
44 MPP13_UART1_TXD, /* PIC controller */
45 MPP14_UART1_RXD, /* PIC controller */
46 MPP15_GPIO, /* USB Copy button (on devices with 88F6281) */
47 MPP16_GPIO, /* Reset button (on devices with 88F6281) */
48 MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */
49 MPP37_GPIO, /* Reset button (on devices with 88F6282) */
50 MPP43_GPIO, /* USB Copy button (on devices with 88F6282) */
51 MPP44_GPIO, /* Board ID: 0: TS-11x, 1: TS-21x */
52 0
53};
54
55void __init qnap_dt_ts219_init(void) 32void __init qnap_dt_ts219_init(void)
56{ 33{
57 u32 dev, rev; 34 u32 dev, rev;
58 35
59 kirkwood_mpp_conf(qnap_ts219_mpp_config);
60
61 kirkwood_pcie_id(&dev, &rev); 36 kirkwood_pcie_id(&dev, &rev);
62 if (dev == MV88F6282_DEV_ID) 37 if (dev == MV88F6282_DEV_ID)
63 qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); 38 qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
64 39
65 kirkwood_ge00_init(&qnap_ts219_ge00_data); 40 kirkwood_ge00_init(&qnap_ts219_ge00_data);
66 kirkwood_ehci_init();
67 41
68 pm_power_off = qnap_tsx1x_power_off; 42 pm_power_off = qnap_tsx1x_power_off;
69} 43}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
new file mode 100644
index 000000000000..15e69fcde9f4
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -0,0 +1,81 @@
1/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-kirkwood/board-usi_topkick.c
5 *
6 * USI Topkick Init for drivers not converted to flattened device tree yet.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mv643xx_eth.h>
16#include <linux/gpio.h>
17#include <linux/platform_data/mmc-mvsdio.h>
18#include "common.h"
19#include "mpp.h"
20
21static struct mv643xx_eth_platform_data topkick_ge00_data = {
22 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
23};
24
25static struct mvsdio_platform_data topkick_mvsdio_data = {
26 /* unfortunately the CD signal has not been connected */
27};
28
29/*
30 * GPIO LED layout
31 *
32 * /-SYS_LED(2)
33 * |
34 * | /-DISK_LED
35 * | |
36 * | | /-WLAN_LED(2)
37 * | | |
38 * [SW] [*] [*] [*]
39 */
40
41/*
42 * Switch positions
43 *
44 * /-SW_LEFT
45 * |
46 * | /-SW_IDLE
47 * | |
48 * | | /-SW_RIGHT
49 * | | |
50 * PS [L] [I] [R] LEDS
51 */
52
53static unsigned int topkick_mpp_config[] __initdata = {
54 MPP21_GPIO, /* DISK_LED (low active) - yellow */
55 MPP36_GPIO, /* SATA0 power enable (high active) */
56 MPP37_GPIO, /* SYS_LED2 (low active) - red */
57 MPP38_GPIO, /* SYS_LED (low active) - blue */
58 MPP39_GPIO, /* WLAN_LED (low active) - green */
59 MPP43_GPIO, /* SW_LEFT (low active) */
60 MPP44_GPIO, /* SW_RIGHT (low active) */
61 MPP45_GPIO, /* SW_IDLE (low active) */
62 MPP46_GPIO, /* SW_LEFT (low active) */
63 MPP48_GPIO, /* WLAN_LED2 (low active) - yellow */
64 0
65};
66
67#define TOPKICK_SATA0_PWR_ENABLE 36
68
69void __init usi_topkick_init(void)
70{
71 /*
72 * Basic setup. Needs to be called early.
73 */
74 kirkwood_mpp_conf(topkick_mpp_config);
75
76 /* SATA0 power enable */
77 gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
78
79 kirkwood_ge00_init(&topkick_ge00_data);
80 kirkwood_sdio_init(&topkick_mvsdio_data);
81}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f0fc25bd3ffe..5303be62b311 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -266,6 +266,7 @@ void __init kirkwood_clk_init(void)
266 orion_clkdev_add("1", "pcie", pex1); 266 orion_clkdev_add("1", "pcie", pex1);
267 orion_clkdev_add(NULL, "kirkwood-i2s", audio); 267 orion_clkdev_add(NULL, "kirkwood-i2s", audio);
268 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); 268 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit);
269 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit);
269 270
270 /* Marvell says runit is used by SPI, UART, NAND, TWSI, ..., 271 /* Marvell says runit is used by SPI, UART, NAND, TWSI, ...,
271 * so should never be gated. 272 * so should never be gated.
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 6088e9227889..5ffa57f08c80 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -113,6 +113,40 @@ void km_kirkwood_init(void);
113static inline void km_kirkwood_init(void) {}; 113static inline void km_kirkwood_init(void) {};
114#endif 114#endif
115 115
116#ifdef CONFIG_MACH_MPLCEC4_DT
117void mplcec4_init(void);
118#else
119static inline void mplcec4_init(void) {};
120#endif
121
122#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
123 defined(CONFIG_MACH_NETSPACE_V2_DT) || \
124 defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
125 defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
126 defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
127void ns2_init(void);
128#else
129static inline void ns2_init(void) {};
130#endif
131
132#ifdef CONFIG_MACH_NSA310_DT
133void nsa310_init(void);
134#else
135static inline void nsa310_init(void) {};
136#endif
137
138#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
139void openblocks_a6_init(void);
140#else
141static inline void openblocks_a6_init(void) {};
142#endif
143
144#ifdef CONFIG_MACH_TOPKICK_DT
145void usi_topkick_init(void);
146#else
147static inline void usi_topkick_init(void) {};
148#endif
149
116/* early init functions not converted to fdt yet */ 150/* early init functions not converted to fdt yet */
117char *kirkwood_id(void); 151char *kirkwood_id(void);
118void kirkwood_l2_init(void); 152void kirkwood_l2_init(void);