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/Kconfig65
-rw-r--r--arch/arm/mach-kirkwood/Makefile9
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c30
-rw-r--r--arch/arm/mach-kirkwood/board-lsxl.c47
-rw-r--r--arch/arm/mach-kirkwood/board-mplcec4.c80
-rw-r--r--arch/arm/mach-kirkwood/board-ns2.c87
-rw-r--r--arch/arm/mach-kirkwood/board-nsa310.c105
-rw-r--r--arch/arm/mach-kirkwood/board-openblocks_a6.c71
-rw-r--r--arch/arm/mach-kirkwood/board-usi_topkick.c82
-rw-r--r--arch/arm/mach-kirkwood/common.c1
-rw-r--r--arch/arm/mach-kirkwood/common.h34
11 files changed, 564 insertions, 47 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 50bca5032b7e..d018ad4bcc3c 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -130,6 +130,63 @@ 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
133config 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
140config MACH_MPLCEC4_DT
141 bool "MPL CEC4 (Flattened Device Tree)"
142 select ARCH_KIRKWOOD_DT
143 help
144 Say 'Y' here if you want your kernel to support the
145 MPL CEC4 (Flattened Device Tree).
146
147config MACH_NETSPACE_V2_DT
148 bool "LaCie Network Space 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 v2 NAS, using Flattened Device Tree.
153
154config MACH_NETSPACE_MAX_V2_DT
155 bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
156 select ARCH_KIRKWOOD_DT
157 help
158 Say 'Y' here if you want your kernel to support the LaCie
159 Network Space Max v2 NAS, using Flattened Device Tree.
160
161config MACH_NETSPACE_LITE_V2_DT
162 bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
163 select ARCH_KIRKWOOD_DT
164 help
165 Say 'Y' here if you want your kernel to support the LaCie
166 Network Space Lite v2 NAS, using Flattened Device Tree.
167
168config MACH_NETSPACE_MINI_V2_DT
169 bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
170 select ARCH_KIRKWOOD_DT
171 help
172 Say 'Y' here if you want your kernel to support the LaCie
173 Network Space Mini v2 NAS (aka SafeBox), using Flattened
174 Device Tree.
175
176config MACH_OPENBLOCKS_A6_DT
177 bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
178 select ARCH_KIRKWOOD_DT
179 help
180 Say 'Y' here if you want your kernel to support the
181 Plat'Home OpenBlocks A6 (Flattened Device Tree).
182
183config MACH_TOPKICK_DT
184 bool "USI Topkick (Flattened Device Tree)"
185 select ARCH_KIRKWOOD_DT
186 help
187 Say 'Y' here if you want your kernel to support the
188 USI Topkick, using Flattened Device Tree
189
133config MACH_TS219 190config MACH_TS219
134 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 191 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
135 help 192 help
@@ -216,6 +273,14 @@ config MACH_T5325
216 Say 'Y' here if you want your kernel to support the 273 Say 'Y' here if you want your kernel to support the
217 HP t5325 Thin Client. 274 HP t5325 Thin Client.
218 275
276config MACH_NSA310_DT
277 bool "ZyXEL NSA-310 (Flattened Device Tree)"
278 select ARCH_KIRKWOOD_DT
279 select ARM_ATAG_DTB_COMPAT
280 help
281 Say 'Y' here if you want your kernel to support the
282 ZyXEL NSA-310 board (Flattened Device Tree).
283
219endmenu 284endmenu
220 285
221endif 286endif
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-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-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
index 64e5cc6b6d5f..7e18cad9b796 100644
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ b/arch/arm/mach-kirkwood/board-lsxl.c
@@ -16,7 +16,6 @@
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> 18#include <linux/gpio.h>
19#include <linux/gpio-fan.h>
20#include "common.h" 19#include "common.h"
21#include "mpp.h" 20#include "mpp.h"
22 21
@@ -45,51 +44,6 @@ static unsigned int lsxl_mpp_config[] __initdata = {
45 0 44 0
46}; 45};
47 46
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/* 47/*
94 * On the LS-XHL/LS-CHLv2, the shutdown process is following: 48 * On the LS-XHL/LS-CHLv2, the shutdown process is following:
95 * - Userland monitors key events until the power switch goes to off position 49 * - Userland monitors key events until the power switch goes to off position
@@ -120,7 +74,6 @@ void __init lsxl_init(void)
120 kirkwood_ehci_init(); 74 kirkwood_ehci_init();
121 kirkwood_ge00_init(&lsxl_ge00_data); 75 kirkwood_ge00_init(&lsxl_ge00_data);
122 kirkwood_ge01_init(&lsxl_ge01_data); 76 kirkwood_ge01_init(&lsxl_ge01_data);
123 platform_device_register(&lsxl_fan_device);
124 77
125 /* register power-off method */ 78 /* register power-off method */
126 pm_power_off = lsxl_power_off; 79 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..e78a227468e6
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -0,0 +1,80 @@
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 unsigned int mplcec4_mpp_config[] __initdata = {
28 MPP0_NF_IO2,
29 MPP1_NF_IO3,
30 MPP2_NF_IO4,
31 MPP3_NF_IO5,
32 MPP4_NF_IO6,
33 MPP5_NF_IO7,
34 MPP6_SYSRST_OUTn,
35 MPP7_GPO, /* Status LED Green High Active */
36 MPP10_UART0_TXD,
37 MPP11_UART0_RXD,
38 MPP12_SD_CLK,
39 MPP13_SD_CMD, /* Alt UART1_TXD */
40 MPP14_SD_D0, /* Alt UART1_RXD */
41 MPP15_SD_D1,
42 MPP16_SD_D2,
43 MPP17_SD_D3,
44 MPP18_NF_IO0,
45 MPP19_NF_IO1,
46 MPP28_GPIO, /* Input SYS_POR_DET (active High) */
47 MPP29_GPIO, /* Input SYS_RTC_INT (active High) */
48 MPP34_SATA1_ACTn,
49 MPP35_SATA0_ACTn,
50 MPP40_GPIO, /* LED User1 orange */
51 MPP41_GPIO, /* LED User1 green */
52 MPP44_GPIO, /* LED User0 orange */
53 MPP45_GPIO, /* LED User0 green */
54 MPP46_GPIO, /* Status LED Yellow High Active */
55 MPP47_GPIO, /* SD_CD# (in/IRQ)*/
56 0
57};
58
59
60static struct mvsdio_platform_data mplcec4_mvsdio_data = {
61 .gpio_card_detect = 47, /* MPP47 used as SD card detect */
62};
63
64
65
66void __init mplcec4_init(void)
67{
68 /*
69 * Basic setup. Needs to be called early.
70 */
71 kirkwood_mpp_conf(mplcec4_mpp_config);
72 kirkwood_ehci_init();
73 kirkwood_ge00_init(&mplcec4_ge00_data);
74 kirkwood_ge01_init(&mplcec4_ge01_data);
75 kirkwood_sdio_init(&mplcec4_mvsdio_data);
76 kirkwood_pcie_init(KW_PCIE0);
77}
78
79
80
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
new file mode 100644
index 000000000000..78596c4f76d2
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ns2.c
@@ -0,0 +1,87 @@
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 kirkwood_ehci_init();
77 if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
78 of_machine_is_compatible("lacie,netspace_mini_v2"))
79 ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
80 kirkwood_ge00_init(&ns2_ge00_data);
81
82 if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
83 gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0)
84 pm_power_off = ns2_power_off;
85 else
86 pr_err("ns2: failed to configure power-off GPIO\n");
87}
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
new file mode 100644
index 000000000000..027ce83f3fe5
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -0,0 +1,105 @@
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 /* this can be removed once the mainline kirkwood.dtsi gets
89 * the ehci configuration by default */
90 kirkwood_ehci_init();
91
92 kirkwood_pcie_id(&dev, &rev);
93
94 i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
95}
96
97static int __init nsa310_pci_init(void)
98{
99 if (of_machine_is_compatible("zyxel,nsa310"))
100 kirkwood_pcie_init(KW_PCIE0);
101
102 return 0;
103}
104
105subsys_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..e807e8cfdd44
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-openblocks_a6.c
@@ -0,0 +1,71 @@
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: Yellow */
59 MPP43_GPIO, /* LED: Green */
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_ehci_init();
70 kirkwood_ge00_init(&openblocks_ge00_data);
71}
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..e2ec9d891fe3
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -0,0 +1,82 @@
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_ehci_init();
80 kirkwood_ge00_init(&topkick_ge00_data);
81 kirkwood_sdio_init(&topkick_mvsdio_data);
82}
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);