]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/linux-3.2.25-arm_kirkwood_setups.patch
kernel: add arm (versatile and kirkwood) cfg for 3.2.x.
[people/teissler/ipfire-2.x.git] / src / patches / linux-3.2.25-arm_kirkwood_setups.patch
CommitLineData
cc7e3a98
AF
1diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/dreamplug-setup.c linux-3.2.25/arch/arm/mach-kirkwood/dreamplug-setup.c
2--- linux-3.2.25.org/arch/arm/mach-kirkwood/dreamplug-setup.c 1970-01-01 01:00:00.000000000 +0100
3+++ linux-3.2.25/arch/arm/mach-kirkwood/dreamplug-setup.c 2012-08-05 19:04:12.000000000 +0200
4@@ -0,0 +1,139 @@
1a1cdab0
AF
5+/*
6+ * arch/arm/mach-kirkwood/dreamplug-setup.c
7+ *
8+ * Marvell DreamPlug Reference Board Setup
9+ *
10+ * This file is licensed under the terms of the GNU General Public
11+ * License version 2. This program is licensed "as is" without any
12+ * warranty of any kind, whether express or implied.
13+ */
14+
15+#include <linux/kernel.h>
16+#include <linux/init.h>
17+#include <linux/platform_device.h>
18+#include <linux/mtd/partitions.h>
19+#include <linux/ata_platform.h>
20+#include <linux/mv643xx_eth.h>
21+#include <linux/gpio.h>
22+#include <linux/leds.h>
23+#include <linux/spi/flash.h>
24+#include <linux/spi/spi.h>
25+#include <linux/spi/orion_spi.h>
26+#include <asm/mach-types.h>
27+#include <asm/mach/arch.h>
28+#include <mach/kirkwood.h>
29+#include <plat/mvsdio.h>
30+#include "common.h"
31+#include "mpp.h"
32+
33+static const struct flash_platform_data dreamplug_spi_slave_data = {
34+ .type = "mx25l1606e",
35+};
36+
37+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
38+ {
39+ .modalias = "m25p80",
40+ .platform_data = &dreamplug_spi_slave_data,
41+ .irq = -1,
42+ .max_speed_hz = 50000000,
43+ .bus_num = 0,
44+ .chip_select = 0,
45+ },
46+};
47+
48+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
49+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
50+};
51+
52+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
53+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
54+};
55+
56+static struct mv_sata_platform_data dreamplug_sata_data = {
57+ .n_ports = 1,
58+};
59+
60+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
61+ /* unfortunately the CD signal has not been connected */
62+};
63+
64+static struct gpio_led dreamplug_led_pins[] = {
65+ {
66+ .name = "dreamplug:blue:bluetooth",
67+ .gpio = 47,
68+ .active_low = 1,
69+ },
70+ {
71+ .name = "dreamplug:green:wlan",
72+ .gpio = 48,
73+ .active_low = 1,
74+ },
75+ {
76+ .name = "dreamplug:blue:wlanap",
77+ .gpio = 49,
78+ .active_low = 1,
79+ },
80+};
81+
82+static struct gpio_led_platform_data dreamplug_led_data = {
83+ .leds = dreamplug_led_pins,
84+ .num_leds = ARRAY_SIZE(dreamplug_led_pins),
85+};
86+
87+static struct platform_device dreamplug_leds = {
88+ .name = "leds-gpio",
89+ .id = -1,
90+ .dev = {
91+ .platform_data = &dreamplug_led_data,
92+ }
93+};
94+
95+static unsigned int dreamplug_mpp_config[] __initdata = {
96+ MPP0_SPI_SCn,
97+ MPP1_SPI_MOSI,
98+ MPP2_SPI_SCK,
99+ MPP3_SPI_MISO,
100+ MPP4_GPIO,
101+ MPP5_GPO,
102+ MPP7_GPO,
103+ MPP18_GPO,
104+ MPP19_GPO,
105+ MPP47_GPIO, /* B_BLED */
106+ MPP48_GPIO, /* W_GLED */
107+ MPP49_GPIO, /* W_BLED */
108+ 0
109+};
110+
111+static void __init dreamplug_init(void)
112+{
113+ /*
114+ * Basic setup. Needs to be called early.
115+ */
116+ kirkwood_init();
117+ kirkwood_mpp_conf(dreamplug_mpp_config);
118+
119+ kirkwood_uart0_init();
120+
121+ spi_register_board_info(dreamplug_spi_slave_info,
122+ ARRAY_SIZE(dreamplug_spi_slave_info));
123+
124+ kirkwood_spi_init();
125+ kirkwood_ehci_init();
126+
127+ kirkwood_ge00_init(&dreamplug_ge00_data);
128+ kirkwood_ge01_init(&dreamplug_ge01_data);
129+ kirkwood_sata_init(&dreamplug_sata_data);
130+ kirkwood_sdio_init(&dreamplug_mvsdio_data);
131+
132+ platform_device_register(&dreamplug_leds);
133+}
134+
135+MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
136+ /* Maintainer: Siddarth Gore <gores <at> marvell.com> */
cc7e3a98 137+ .atag_offset = 0x100,
1a1cdab0
AF
138+ .init_machine = dreamplug_init,
139+ .map_io = kirkwood_map_io,
cc7e3a98 140+ .init_early = kirkwood_init_early,
1a1cdab0
AF
141+ .init_irq = kirkwood_init_irq,
142+ .timer = &kirkwood_timer,
143+MACHINE_END
cc7e3a98
AF
144diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/guruplug-setup.c linux-3.2.25/arch/arm/mach-kirkwood/guruplug-setup.c
145--- linux-3.2.25.org/arch/arm/mach-kirkwood/guruplug-setup.c 2012-08-02 15:38:04.000000000 +0200
146+++ linux-3.2.25/arch/arm/mach-kirkwood/guruplug-setup.c 2012-08-05 19:05:22.000000000 +0200
147@@ -11,6 +11,7 @@
148 #include <linux/kernel.h>
149 #include <linux/init.h>
150 #include <linux/platform_device.h>
5ca1c0b9 151+#include <linux/mtd/mtd.h>
cc7e3a98
AF
152 #include <linux/mtd/partitions.h>
153 #include <linux/ata_platform.h>
154 #include <linux/mv643xx_eth.h>
155@@ -27,15 +28,16 @@
156 {
157 .name = "u-boot",
158 .offset = 0,
159- .size = SZ_1M
5ca1c0b9
AF
160+ .size = SZ_1M,
161+ .mask_flags = MTD_WRITEABLE, /* read only */
cc7e3a98
AF
162 }, {
163 .name = "uImage",
164 .offset = MTDPART_OFS_NXTBLK,
165- .size = SZ_4M
5ca1c0b9 166+ .size = SZ_4M,
cc7e3a98
AF
167 }, {
168 .name = "root",
169 .offset = MTDPART_OFS_NXTBLK,
170- .size = MTDPART_SIZ_FULL
5ca1c0b9 171+ .size = MTDPART_SIZ_FULL,
cc7e3a98
AF
172 },
173 };
174
175diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/iconnect-setup.c linux-3.2.25/arch/arm/mach-kirkwood/iconnect-setup.c
176--- linux-3.2.25.org/arch/arm/mach-kirkwood/iconnect-setup.c 1970-01-01 01:00:00.000000000 +0100
177+++ linux-3.2.25/arch/arm/mach-kirkwood/iconnect-setup.c 2012-08-05 19:06:06.000000000 +0200
178@@ -0,0 +1,212 @@
5ca1c0b9
AF
179+/*
180+ * arch/arm/mach-kirkwood/iconnect-setup.c
181+ *
182+ * Iomega iConnect Wireless Data Station Board Setup
183+ *
184+ * This file is licensed under the terms of the GNU General Public
185+ * License version 2. This program is licensed "as is" without any
186+ * warranty of any kind, whether express or implied.
187+ */
188+
189+#include <linux/kernel.h>
190+#include <linux/init.h>
191+#include <linux/platform_device.h>
192+#include <linux/mtd/mtd.h>
193+#include <linux/mtd/partitions.h>
194+#include <linux/ata_platform.h>
195+#include <linux/mv643xx_eth.h>
196+#include <linux/gpio.h>
197+#include <linux/gpio_keys.h>
198+#include <linux/i2c.h>
199+#include <linux/input.h>
200+#include <linux/leds.h>
201+#include <asm/mach-types.h>
202+#include <asm/mach/arch.h>
203+#include <mach/kirkwood.h>
204+#include "common.h"
205+#include "mpp.h"
206+
207+static struct mtd_partition iconnect_nand_parts[] = {
208+ {
209+ .name = "u-boot",
210+ .offset = 0,
211+ .size = SZ_1M,
212+ .mask_flags = MTD_WRITEABLE, /* read only */
213+ }, {
214+ .name = "uImage",
215+ .offset = MTDPART_OFS_NXTBLK,
216+ .size = 0x440000,
217+ }, {
218+ .name = "uInit",
219+ .offset = MTDPART_OFS_NXTBLK,
220+ .size = 0x440000,
221+ }, {
222+ .name = "root",
223+ .offset = MTDPART_OFS_NXTBLK,
224+ .size = MTDPART_SIZ_FULL,
225+ },
226+};
227+
228+static struct mv643xx_eth_platform_data iconnect_ge00_data = {
229+ .phy_addr = MV643XX_ETH_PHY_ADDR(0xB),
230+};
231+
232+static struct gpio_led iconnect_led_pins[] = {
233+ {
234+ .name = "iconnect:led_level",
235+ .default_trigger = "default-on",
236+ .gpio = 41,
237+ .active_low = 0,
238+ },
239+
240+ {
241+ .name = "iconnect:blue:power",
242+ .default_trigger = "default-on",
243+ .gpio = 42,
244+ .active_low = 0,
245+ },
246+ {
247+ .name = "iconnect:red:power",
248+ .default_trigger = "none",
249+ .gpio = 43,
250+ .active_low = 0,
251+ },
252+ {
253+ .name = "iconnect:blue:usb_1",
254+ .default_trigger = "none",
255+ .gpio = 44,
256+ .active_low = 0,
257+ },
258+ {
259+ .name = "iconnect:blue:usb_2",
260+ .default_trigger = "none",
261+ .gpio = 45,
262+ .active_low = 0,
263+ },
264+ {
265+ .name = "iconnect:blue:usb_3",
266+ .default_trigger = "none",
267+ .gpio = 46,
268+ .active_low = 0,
269+ },
270+ {
271+ .name = "iconnect:blue:usb_4",
272+ .default_trigger = "none",
273+ .gpio = 47,
274+ .active_low = 0,
275+ },
276+ {
277+ .name = "iconnect:blue:otb",
278+ .default_trigger = "none",
279+ .gpio = 48,
280+ .active_low = 0,
281+ },
282+};
283+
284+static struct gpio_led_platform_data iconnect_led_data = {
285+ .leds = iconnect_led_pins,
286+ .num_leds = ARRAY_SIZE(iconnect_led_pins),
287+};
288+
289+static struct platform_device iconnect_leds = {
290+ .name = "leds-gpio",
291+ .id = -1,
292+ .dev = {
293+ .platform_data = &iconnect_led_data,
294+ }
295+};
296+
297+static struct gpio_keys_button iconnect_buttons[] = {
298+ {
299+ .code = KEY_COPY,
300+ .gpio = 35,
301+ .desc = "OTB Button",
302+ .active_low = 1,
303+ },
304+ {
305+ .code = KEY_RESTART,
306+ .gpio = 12,
307+ .desc = "Reset",
308+ .active_low = 1,
309+ },
310+};
311+
312+static struct gpio_keys_platform_data iconnect_button_data = {
313+ .buttons = iconnect_buttons,
314+ .nbuttons = ARRAY_SIZE(iconnect_buttons),
315+};
316+
317+static struct platform_device iconnect_button_device = {
318+ .name = "gpio-keys",
319+ .id = -1,
320+ .num_resources = 0,
321+ .dev = {
322+ .platform_data = &iconnect_button_data,
323+ }
324+};
325+
326+static unsigned int iconnect_mpp_config[] __initdata = {
327+ MPP0_NF_IO2,
328+ MPP1_NF_IO3,
329+ MPP2_NF_IO4,
330+ MPP3_NF_IO5,
331+ MPP4_NF_IO6,
332+ MPP5_NF_IO7,
333+ MPP18_NF_IO0,
334+ MPP19_NF_IO1,
335+ MPP12_GPIO, /* Reset Button */
336+ MPP35_GPIO, /* OTB Button */
337+
338+ MPP41_GPIO, /* LED Level */
339+ MPP42_GPIO, /* Power LED blue */
340+ MPP43_GPIO, /* Power LED red */
341+ MPP44_GPIO, /* USB LED 1 */
342+ MPP45_GPIO, /* USB LED 2 */
343+ MPP46_GPIO, /* USB LED 3 */
344+ MPP47_GPIO, /* USB LED 4 */
345+ MPP48_GPIO, /* OTB LED */
346+ 0
347+};
348+
349+static struct i2c_board_info __initdata iconnect_i2c = {
350+ I2C_BOARD_INFO("lm63", 0x4c),
351+};
352+
353+static void __init iconnect_init(void)
354+{
355+ /*
356+ * Basic setup. Needs to be called early.
357+ */
358+ kirkwood_init();
359+ kirkwood_mpp_conf(iconnect_mpp_config);
360+
361+ kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
362+ kirkwood_ehci_init();
363+ kirkwood_ge00_init(&iconnect_ge00_data);
364+
365+ kirkwood_uart0_init();
366+ platform_device_register(&iconnect_leds);
367+ platform_device_register(&iconnect_button_device);
368+
369+ kirkwood_i2c_init();
370+ i2c_register_board_info(0, &iconnect_i2c,1);
371+}
372+
373+static int __init iconnect_pci_init(void)
374+{
375+ if (machine_is_iconnect()) {
cc7e3a98 376+ kirkwood_pcie_init(KW_PCIE0);
5ca1c0b9
AF
377+ }
378+ return 0;
379+}
380+subsys_initcall(iconnect_pci_init);
381+
382+MACHINE_START(ICONNECT, "Iomega iConnect Wireless Data Station")
383+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
cc7e3a98 384+ .atag_offset = 0x100,
5ca1c0b9
AF
385+ .init_machine = iconnect_init,
386+ .map_io = kirkwood_map_io,
cc7e3a98 387+ .init_early = kirkwood_init_early,
5ca1c0b9
AF
388+ .init_irq = kirkwood_init_irq,
389+ .timer = &kirkwood_timer,
390+MACHINE_END
cc7e3a98
AF
391diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/Kconfig linux-3.2.25/arch/arm/mach-kirkwood/Kconfig
392--- linux-3.2.25.org/arch/arm/mach-kirkwood/Kconfig 2012-08-02 15:38:04.000000000 +0200
393+++ linux-3.2.25/arch/arm/mach-kirkwood/Kconfig 2012-08-05 18:45:22.015253501 +0200
394@@ -44,6 +44,12 @@
1a1cdab0 395 Say 'Y' here if you want your kernel to support the
cc7e3a98 396 Marvell GuruPlug Reference Board.
1a1cdab0
AF
397
398+config MACH_DREAMPLUG
399+ bool "Marvell DreamPlug Reference Board"
400+ help
401+ Say 'Y' here if you want your kernel to support the
402+ Marvell DreamPlug Reference Board.
403+
404 config MACH_TS219
cc7e3a98 405 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
1a1cdab0 406 help
cc7e3a98 407@@ -130,6 +136,18 @@
c05f6df0 408 Say 'Y' here if you want your kernel to support the
cc7e3a98 409 HP t5325 Thin Client.
c05f6df0 410
5ca1c0b9
AF
411+config MACH_ICONNECT
412+ bool "Iomega iConnect Wireless Data Station"
413+ help
414+ Say 'Y' here if you want your kernel to support the
415+ Iomega iConnect Wireless Data Station.
416+
c05f6df0 417+config MACH_NAS6210
cc7e3a98 418+ bool "Raidsonic ICY BOX IB-62x0"
c05f6df0
AF
419+ help
420+ Say 'Y' here if you want your kernel to support the
cc7e3a98 421+ Raidsonic ICY BOX IB-62x0.
c05f6df0
AF
422+
423 endmenu
424
425 endif
cc7e3a98
AF
426diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/Makefile linux-3.2.25/arch/arm/mach-kirkwood/Makefile
427--- linux-3.2.25.org/arch/arm/mach-kirkwood/Makefile 2012-08-02 15:38:04.000000000 +0200
428+++ linux-3.2.25/arch/arm/mach-kirkwood/Makefile 2012-08-05 18:46:49.015253501 +0200
429@@ -7,6 +7,7 @@
1a1cdab0 430 obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
cc7e3a98
AF
431 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
432 obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
1a1cdab0 433+obj-$(CONFIG_MACH_DREAMPLUG) += dreamplug-setup.o
cc7e3a98
AF
434 obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
435 obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
436 obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
437@@ -18,5 +19,7 @@
438 obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
439 obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
440 obj-$(CONFIG_MACH_T5325) += t5325-setup.o
5ca1c0b9 441+obj-$(CONFIG_MACH_ICONNECT) += iconnect-setup.o
c05f6df0 442+obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
1a1cdab0 443
c05f6df0 444 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
cc7e3a98
AF
445diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/mpp.h linux-3.2.25/arch/arm/mach-kirkwood/mpp.h
446--- linux-3.2.25.org/arch/arm/mach-kirkwood/mpp.h 2012-08-02 15:38:04.000000000 +0200
447+++ linux-3.2.25/arch/arm/mach-kirkwood/mpp.h 2012-08-05 19:08:23.835566001 +0200
448@@ -102,6 +102,7 @@
449 #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 0, 0, 1, 1, 1, 1 )
5ca1c0b9 450
cc7e3a98
AF
451 #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1, 1 )
452+#define MPP12_GPIO MPP( 12, 0x0, 1, 1, 1, 1, 1, 1, 1 )
453 #define MPP12_SD_CLK MPP( 12, 0x1, 0, 0, 1, 1, 1, 1, 1 )
454 #define MPP12_AU_SPDIF0 MPP( 12, 0xa, 0, 0, 0, 0, 0, 0, 1 )
455 #define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 0, 0, 0, 0, 0, 1 )
456diff -Naur linux-3.2.25.org/arch/arm/mach-kirkwood/nas6210-setup.c linux-3.2.25/arch/arm/mach-kirkwood/nas6210-setup.c
457--- linux-3.2.25.org/arch/arm/mach-kirkwood/nas6210-setup.c 1970-01-01 01:00:00.000000000 +0100
458+++ linux-3.2.25/arch/arm/mach-kirkwood/nas6210-setup.c 2012-08-05 19:06:40.000000000 +0200
459@@ -0,0 +1,184 @@
c05f6df0
AF
460+/*
461+ * arch/arm/mach-kirkwood/nas6210-setup.c
462+ *
463+ * Raidsonic ICYBOX NAS6210 and 6220 Board Setup
464+ *
465+ * This file is licensed under the terms of the GNU General Public
466+ * License version 2. This program is licensed "as is" without any
467+ * warranty of any kind, whether express or implied.
468+ */
469+
470+#include <linux/kernel.h>
471+#include <linux/init.h>
472+#include <linux/platform_device.h>
5ca1c0b9 473+#include <linux/mtd/mtd.h>
c05f6df0
AF
474+#include <linux/mtd/partitions.h>
475+#include <linux/ata_platform.h>
476+#include <linux/mv643xx_eth.h>
477+#include <linux/gpio.h>
478+#include <linux/gpio_keys.h>
5ca1c0b9 479+#include <linux/i2c.h>
c05f6df0
AF
480+#include <linux/input.h>
481+#include <linux/leds.h>
482+#include <asm/mach-types.h>
483+#include <asm/mach/arch.h>
484+#include <mach/kirkwood.h>
485+#include "common.h"
486+#include "mpp.h"
487+
488+#define NAS6210_GPIO_POWER_OFF 24
489+
490+static struct mtd_partition nas6210_nand_parts[] = {
491+ {
492+ .name = "u-boot",
493+ .offset = 0,
5ca1c0b9
AF
494+ .size = SZ_1M,
495+ .mask_flags = MTD_WRITEABLE, /* read only */
c05f6df0
AF
496+ }, {
497+ .name = "uImage",
498+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 499+ .size = (SZ_1M*6),
c05f6df0
AF
500+ }, {
501+ .name = "root",
502+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 503+ .size = MTDPART_SIZ_FULL,
c05f6df0
AF
504+ },
505+};
506+
507+static struct mv643xx_eth_platform_data nas6210_ge00_data = {
508+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
509+};
510+
511+static struct mv_sata_platform_data nas6210_sata_data = {
512+ .n_ports = 2,
513+};
514+
515+static struct gpio_led nas6210_led_pins[] = {
516+ {
517+ .name = "nas6210:green:power",
518+ .default_trigger = "default-on",
519+ .gpio = 25,
520+ .active_low = 0,
521+ },
522+ {
523+ .name = "nas6210:red:power",
524+ .default_trigger = "none",
525+ .gpio = 22,
526+ .active_low = 0,
527+ },
528+ {
529+ .name = "nas6210:red:usb_copy",
530+ .default_trigger = "none",
531+ .gpio = 27,
532+ .active_low = 0,
533+ },
534+};
535+
536+static struct gpio_led_platform_data nas6210_led_data = {
537+ .leds = nas6210_led_pins,
538+ .num_leds = ARRAY_SIZE(nas6210_led_pins),
539+};
540+
541+static struct platform_device nas6210_leds = {
542+ .name = "leds-gpio",
543+ .id = -1,
544+ .dev = {
545+ .platform_data = &nas6210_led_data,
546+ }
547+};
548+
549+static struct gpio_keys_button nas6210_buttons[] = {
550+ {
551+ .code = KEY_COPY,
552+ .gpio = 29,
553+ .desc = "USB Copy",
554+ .active_low = 1,
555+ },
556+ {
557+ .code = KEY_RESTART,
558+ .gpio = 28,
559+ .desc = "Reset",
560+ .active_low = 1,
561+ },
562+};
563+
564+static struct gpio_keys_platform_data nas6210_button_data = {
565+ .buttons = nas6210_buttons,
566+ .nbuttons = ARRAY_SIZE(nas6210_buttons),
567+};
568+
569+static struct platform_device nas6210_button_device = {
570+ .name = "gpio-keys",
571+ .id = -1,
572+ .num_resources = 0,
573+ .dev = {
574+ .platform_data = &nas6210_button_data,
575+ }
576+};
577+
578+static unsigned int nas6210_mpp_config[] __initdata = {
579+ MPP0_NF_IO2,
580+ MPP1_NF_IO3,
581+ MPP2_NF_IO4,
582+ MPP3_NF_IO5,
583+ MPP4_NF_IO6,
584+ MPP5_NF_IO7,
585+ MPP18_NF_IO0,
586+ MPP19_NF_IO1,
587+ MPP22_GPIO, /* Power LED red */
588+ MPP24_GPIO, /* Power off */
589+ MPP25_GPIO, /* Power LED green */
590+ MPP27_GPIO, /* USB transfer LED */
591+ MPP28_GPIO, /* Reset button */
592+ MPP29_GPIO, /* USB Copy button */
593+ 0
594+};
595+
596+void nas6210_power_off(void)
597+{
598+ gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
599+ while(1);
600+}
601+
602+static void __init nas6210_init(void)
603+{
604+ /*
605+ * Basic setup. Needs to be called early.
606+ */
607+ kirkwood_init();
608+ kirkwood_mpp_conf(nas6210_mpp_config);
609+
610+ kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
611+ kirkwood_ehci_init();
612+ kirkwood_ge00_init(&nas6210_ge00_data);
613+ kirkwood_sata_init(&nas6210_sata_data);
614+ kirkwood_uart0_init();
615+ platform_device_register(&nas6210_leds);
616+ platform_device_register(&nas6210_button_device);
617+
618+ if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
619+ gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
620+ pm_power_off = nas6210_power_off;
621+
622+ else
623+ pr_err("nas6210: failed to configure power-off gpio pin");
624+}
625+
626+static int __init nas6210_pci_init(void)
627+{
628+ if (machine_is_nas6210()) {
cc7e3a98 629+ kirkwood_pcie_init(KW_PCIE0);
c05f6df0
AF
630+ }
631+ return 0;
632+}
633+subsys_initcall(nas6210_pci_init);
634+
635+MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS62x0")
636+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
cc7e3a98 637+ .atag_offset = 0x00000100,
c05f6df0
AF
638+ .init_machine = nas6210_init,
639+ .map_io = kirkwood_map_io,
cc7e3a98 640+ .init_early = kirkwood_init_early,
c05f6df0
AF
641+ .init_irq = kirkwood_init_irq,
642+ .timer = &kirkwood_timer,
643+MACHINE_END
cc7e3a98
AF
644diff -Naur linux-3.2.25.org/arch/arm/tools/mach-types linux-3.2.25/arch/arm/tools/mach-types
645--- linux-3.2.25.org/arch/arm/tools/mach-types 2012-08-02 15:38:04.000000000 +0200
646+++ linux-3.2.25/arch/arm/tools/mach-types 2012-08-05 18:39:17.218378501 +0200
647@@ -455,9 +455,9 @@
648 mx23evk MACH_MX23EVK MX23EVK 2629
649 ap4evb MACH_AP4EVB AP4EVB 2630
650 mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650
651-guruplug MACH_GURUPLUG GURUPLUG 2659
1a1cdab0 652+dreamplug MACH_DREAMPLUG DREAMPLUG 2659
cc7e3a98
AF
653 spear310 MACH_SPEAR310 SPEAR310 2660
654-spear320 MACH_SPEAR320 SPEAR320 2661
655+guruplug MACH_GURUPLUG GURUPLUG 2661
656 aquila MACH_AQUILA AQUILA 2676
657 sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
658 msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679