]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/linux-2.6.32.57-arm_kirkwood_setups.patch
Merge remote-tracking branch 'origin/next' into kernel-update
[people/teissler/ipfire-2.x.git] / src / patches / linux-2.6.32.57-arm_kirkwood_setups.patch
CommitLineData
5ca1c0b9
AF
1diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/dreamplug-setup.c linux-2.6.32.57/arch/arm/mach-kirkwood/dreamplug-setup.c
2--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/dreamplug-setup.c 1970-01-01 01:00:00.000000000 +0100
3+++ linux-2.6.32.57/arch/arm/mach-kirkwood/dreamplug-setup.c 2012-03-02 09:22:40.107199269 +0100
1a1cdab0
AF
4@@ -0,0 +1,140 @@
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> */
137+ .phys_io = KIRKWOOD_REGS_PHYS_BASE,
138+ .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
139+ .boot_params = 0x00000100,
140+ .init_machine = dreamplug_init,
141+ .map_io = kirkwood_map_io,
142+ .init_irq = kirkwood_init_irq,
143+ .timer = &kirkwood_timer,
144+MACHINE_END
5ca1c0b9
AF
145diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/guruplug-setup.c linux-2.6.32.57/arch/arm/mach-kirkwood/guruplug-setup.c
146--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/guruplug-setup.c 1970-01-01 01:00:00.000000000 +0100
147+++ linux-2.6.32.57/arch/arm/mach-kirkwood/guruplug-setup.c 2012-03-02 23:36:51.627514981 +0100
148@@ -0,0 +1,133 @@
c84d6e62
AF
149+/*
150+ * arch/arm/mach-kirkwood/guruplug-setup.c
151+ *
152+ * Marvell GuruPlug Reference Board Setup
153+ *
154+ * This file is licensed under the terms of the GNU General Public
155+ * License version 2. This program is licensed "as is" without any
156+ * warranty of any kind, whether express or implied.
157+ */
158+
159+#include <linux/kernel.h>
160+#include <linux/init.h>
161+#include <linux/platform_device.h>
5ca1c0b9 162+#include <linux/mtd/mtd.h>
c84d6e62
AF
163+#include <linux/mtd/partitions.h>
164+#include <linux/ata_platform.h>
165+#include <linux/mv643xx_eth.h>
166+#include <linux/gpio.h>
167+#include <linux/leds.h>
168+#include <asm/mach-types.h>
169+#include <asm/mach/arch.h>
170+#include <mach/kirkwood.h>
171+#include <plat/mvsdio.h>
172+#include "common.h"
173+#include "mpp.h"
174+
175+static struct mtd_partition guruplug_nand_parts[] = {
176+ {
177+ .name = "u-boot",
178+ .offset = 0,
5ca1c0b9
AF
179+ .size = SZ_1M,
180+ .mask_flags = MTD_WRITEABLE, /* read only */
c84d6e62
AF
181+ }, {
182+ .name = "uImage",
183+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 184+ .size = SZ_4M,
c84d6e62
AF
185+ }, {
186+ .name = "root",
187+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 188+ .size = MTDPART_SIZ_FULL,
c84d6e62
AF
189+ },
190+};
191+
192+static struct mv643xx_eth_platform_data guruplug_ge00_data = {
193+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
194+};
195+
196+static struct mv643xx_eth_platform_data guruplug_ge01_data = {
197+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
198+};
199+
200+static struct mv_sata_platform_data guruplug_sata_data = {
201+ .n_ports = 1,
202+};
203+
204+static struct mvsdio_platform_data guruplug_mvsdio_data = {
205+ /* unfortunately the CD signal has not been connected */
206+};
207+
208+static struct gpio_led guruplug_led_pins[] = {
209+ {
210+ .name = "guruplug:red:health",
211+ .gpio = 46,
212+ .active_low = 1,
213+ },
214+ {
215+ .name = "guruplug:green:health",
216+ .gpio = 47,
217+ .active_low = 1,
218+ },
219+ {
220+ .name = "guruplug:red:wmode",
221+ .gpio = 48,
222+ .active_low = 1,
223+ },
224+ {
225+ .name = "guruplug:green:wmode",
226+ .gpio = 49,
227+ .active_low = 1,
228+ },
229+};
230+
231+static struct gpio_led_platform_data guruplug_led_data = {
232+ .leds = guruplug_led_pins,
233+ .num_leds = ARRAY_SIZE(guruplug_led_pins),
234+};
235+
236+static struct platform_device guruplug_leds = {
237+ .name = "leds-gpio",
238+ .id = -1,
239+ .dev = {
240+ .platform_data = &guruplug_led_data,
241+ }
242+};
243+
244+static unsigned int guruplug_mpp_config[] __initdata = {
245+ MPP46_GPIO, /* M_RLED */
246+ MPP47_GPIO, /* M_GLED */
247+ MPP48_GPIO, /* B_RLED */
248+ MPP49_GPIO, /* B_GLED */
249+ 0
250+};
251+
252+static void __init guruplug_init(void)
253+{
254+ /*
255+ * Basic setup. Needs to be called early.
256+ */
257+ kirkwood_init();
258+ kirkwood_mpp_conf(guruplug_mpp_config);
259+
260+ kirkwood_uart0_init();
261+ kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
262+
263+ kirkwood_ehci_init();
264+ kirkwood_ge00_init(&guruplug_ge00_data);
265+ kirkwood_ge01_init(&guruplug_ge01_data);
266+ kirkwood_sata_init(&guruplug_sata_data);
267+ kirkwood_sdio_init(&guruplug_mvsdio_data);
268+
269+ platform_device_register(&guruplug_leds);
270+}
271+
272+MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
273+ /* Maintainer: Siddarth Gore <gores@marvell.com> */
274+ .phys_io = KIRKWOOD_REGS_PHYS_BASE,
275+ .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
276+ .boot_params = 0x00000100,
277+ .init_machine = guruplug_init,
278+ .map_io = kirkwood_map_io,
279+ .init_irq = kirkwood_init_irq,
280+ .timer = &kirkwood_timer,
281+MACHINE_END
5ca1c0b9
AF
282diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/iconnect-setup.c linux-2.6.32.57/arch/arm/mach-kirkwood/iconnect-setup.c
283--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/iconnect-setup.c 1970-01-01 01:00:00.000000000 +0100
284+++ linux-2.6.32.57/arch/arm/mach-kirkwood/iconnect-setup.c 2012-03-03 00:15:42.757514706 +0100
285@@ -0,0 +1,211 @@
286+/*
287+ * arch/arm/mach-kirkwood/iconnect-setup.c
288+ *
289+ * Iomega iConnect Wireless Data Station Board Setup
290+ *
291+ * This file is licensed under the terms of the GNU General Public
292+ * License version 2. This program is licensed "as is" without any
293+ * warranty of any kind, whether express or implied.
294+ */
295+
296+#include <linux/kernel.h>
297+#include <linux/init.h>
298+#include <linux/platform_device.h>
299+#include <linux/mtd/mtd.h>
300+#include <linux/mtd/partitions.h>
301+#include <linux/ata_platform.h>
302+#include <linux/mv643xx_eth.h>
303+#include <linux/gpio.h>
304+#include <linux/gpio_keys.h>
305+#include <linux/i2c.h>
306+#include <linux/input.h>
307+#include <linux/leds.h>
308+#include <asm/mach-types.h>
309+#include <asm/mach/arch.h>
310+#include <mach/kirkwood.h>
311+#include "common.h"
312+#include "mpp.h"
313+
314+static struct mtd_partition iconnect_nand_parts[] = {
315+ {
316+ .name = "u-boot",
317+ .offset = 0,
318+ .size = SZ_1M,
319+ .mask_flags = MTD_WRITEABLE, /* read only */
320+ }, {
321+ .name = "uImage",
322+ .offset = MTDPART_OFS_NXTBLK,
323+ .size = 0x440000,
324+ }, {
325+ .name = "uInit",
326+ .offset = MTDPART_OFS_NXTBLK,
327+ .size = 0x440000,
328+ }, {
329+ .name = "root",
330+ .offset = MTDPART_OFS_NXTBLK,
331+ .size = MTDPART_SIZ_FULL,
332+ },
333+};
334+
335+static struct mv643xx_eth_platform_data iconnect_ge00_data = {
336+ .phy_addr = MV643XX_ETH_PHY_ADDR(0xB),
337+};
338+
339+static struct gpio_led iconnect_led_pins[] = {
340+ {
341+ .name = "iconnect:led_level",
342+ .default_trigger = "default-on",
343+ .gpio = 41,
344+ .active_low = 0,
345+ },
346+
347+ {
348+ .name = "iconnect:blue:power",
349+ .default_trigger = "default-on",
350+ .gpio = 42,
351+ .active_low = 0,
352+ },
353+ {
354+ .name = "iconnect:red:power",
355+ .default_trigger = "none",
356+ .gpio = 43,
357+ .active_low = 0,
358+ },
359+ {
360+ .name = "iconnect:blue:usb_1",
361+ .default_trigger = "none",
362+ .gpio = 44,
363+ .active_low = 0,
364+ },
365+ {
366+ .name = "iconnect:blue:usb_2",
367+ .default_trigger = "none",
368+ .gpio = 45,
369+ .active_low = 0,
370+ },
371+ {
372+ .name = "iconnect:blue:usb_3",
373+ .default_trigger = "none",
374+ .gpio = 46,
375+ .active_low = 0,
376+ },
377+ {
378+ .name = "iconnect:blue:usb_4",
379+ .default_trigger = "none",
380+ .gpio = 47,
381+ .active_low = 0,
382+ },
383+ {
384+ .name = "iconnect:blue:otb",
385+ .default_trigger = "none",
386+ .gpio = 48,
387+ .active_low = 0,
388+ },
389+};
390+
391+static struct gpio_led_platform_data iconnect_led_data = {
392+ .leds = iconnect_led_pins,
393+ .num_leds = ARRAY_SIZE(iconnect_led_pins),
394+};
395+
396+static struct platform_device iconnect_leds = {
397+ .name = "leds-gpio",
398+ .id = -1,
399+ .dev = {
400+ .platform_data = &iconnect_led_data,
401+ }
402+};
403+
404+static struct gpio_keys_button iconnect_buttons[] = {
405+ {
406+ .code = KEY_COPY,
407+ .gpio = 35,
408+ .desc = "OTB Button",
409+ .active_low = 1,
410+ },
411+ {
412+ .code = KEY_RESTART,
413+ .gpio = 12,
414+ .desc = "Reset",
415+ .active_low = 1,
416+ },
417+};
418+
419+static struct gpio_keys_platform_data iconnect_button_data = {
420+ .buttons = iconnect_buttons,
421+ .nbuttons = ARRAY_SIZE(iconnect_buttons),
422+};
423+
424+static struct platform_device iconnect_button_device = {
425+ .name = "gpio-keys",
426+ .id = -1,
427+ .num_resources = 0,
428+ .dev = {
429+ .platform_data = &iconnect_button_data,
430+ }
431+};
432+
433+static unsigned int iconnect_mpp_config[] __initdata = {
434+ MPP0_NF_IO2,
435+ MPP1_NF_IO3,
436+ MPP2_NF_IO4,
437+ MPP3_NF_IO5,
438+ MPP4_NF_IO6,
439+ MPP5_NF_IO7,
440+ MPP18_NF_IO0,
441+ MPP19_NF_IO1,
442+ MPP12_GPIO, /* Reset Button */
443+ MPP35_GPIO, /* OTB Button */
444+
445+ MPP41_GPIO, /* LED Level */
446+ MPP42_GPIO, /* Power LED blue */
447+ MPP43_GPIO, /* Power LED red */
448+ MPP44_GPIO, /* USB LED 1 */
449+ MPP45_GPIO, /* USB LED 2 */
450+ MPP46_GPIO, /* USB LED 3 */
451+ MPP47_GPIO, /* USB LED 4 */
452+ MPP48_GPIO, /* OTB LED */
453+ 0
454+};
455+
456+static struct i2c_board_info __initdata iconnect_i2c = {
457+ I2C_BOARD_INFO("lm63", 0x4c),
458+};
459+
460+static void __init iconnect_init(void)
461+{
462+ /*
463+ * Basic setup. Needs to be called early.
464+ */
465+ kirkwood_init();
466+ kirkwood_mpp_conf(iconnect_mpp_config);
467+
468+ kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
469+ kirkwood_ehci_init();
470+ kirkwood_ge00_init(&iconnect_ge00_data);
471+
472+ kirkwood_uart0_init();
473+ platform_device_register(&iconnect_leds);
474+ platform_device_register(&iconnect_button_device);
475+
476+ kirkwood_i2c_init();
477+ i2c_register_board_info(0, &iconnect_i2c,1);
478+}
479+
480+static int __init iconnect_pci_init(void)
481+{
482+ if (machine_is_iconnect()) {
483+ kirkwood_pcie_init();
484+ }
485+ return 0;
486+}
487+subsys_initcall(iconnect_pci_init);
488+
489+MACHINE_START(ICONNECT, "Iomega iConnect Wireless Data Station")
490+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
491+ .boot_params = 0x00000100,
492+ .init_machine = iconnect_init,
493+ .map_io = kirkwood_map_io,
494+ .init_irq = kirkwood_init_irq,
495+ .timer = &kirkwood_timer,
496+MACHINE_END
497diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/Kconfig linux-2.6.32.57/arch/arm/mach-kirkwood/Kconfig
498--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/Kconfig 2012-02-13 20:29:11.000000000 +0100
499+++ linux-2.6.32.57/arch/arm/mach-kirkwood/Kconfig 2012-03-02 09:28:49.387192309 +0100
c84d6e62 500@@ -32,6 +32,18 @@
1a1cdab0
AF
501 Say 'Y' here if you want your kernel to support the
502 Marvell SheevaPlug Reference Board.
503
504+config MACH_DREAMPLUG
505+ bool "Marvell DreamPlug Reference Board"
506+ help
507+ Say 'Y' here if you want your kernel to support the
508+ Marvell DreamPlug Reference Board.
c84d6e62
AF
509+
510+config MACH_GURUPLUG
511+ bool "Marvell GuruPlug Reference Board"
512+ help
513+ Say 'Y' here if you want your kernel to support the
514+ Marvell GuruPlug Reference Board.
1a1cdab0
AF
515+
516 config MACH_TS219
517 bool "QNAP TS-119 and TS-219 Turbo NAS"
518 help
5ca1c0b9 519@@ -44,6 +56,18 @@
c05f6df0
AF
520 Say 'Y' here if you want your kernel to support the
521 Marvell OpenRD Base Board.
522
5ca1c0b9
AF
523+config MACH_ICONNECT
524+ bool "Iomega iConnect Wireless Data Station"
525+ help
526+ Say 'Y' here if you want your kernel to support the
527+ Iomega iConnect Wireless Data Station.
528+
c05f6df0
AF
529+config MACH_NAS6210
530+ bool "RaidSonic ICY BOX IB-NAS62x0"
531+ help
532+ Say 'Y' here if you want your kernel to support the
533+ RaidSonic ICY BOX IB-NAS62x0 device.
534+
535 endmenu
536
537 endif
5ca1c0b9
AF
538diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/Makefile linux-2.6.32.57/arch/arm/mach-kirkwood/Makefile
539--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/Makefile 2012-02-13 20:29:11.000000000 +0100
540+++ linux-2.6.32.57/arch/arm/mach-kirkwood/Makefile 2012-03-02 09:26:39.447195212 +0100
541@@ -5,7 +5,11 @@
1a1cdab0
AF
542 obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
543 obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
544 obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
c84d6e62 545+obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
1a1cdab0
AF
546+obj-$(CONFIG_MACH_DREAMPLUG) += dreamplug-setup.o
547 obj-$(CONFIG_MACH_TS219) += ts219-setup.o
548 obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
5ca1c0b9 549+obj-$(CONFIG_MACH_ICONNECT) += iconnect-setup.o
c05f6df0 550+obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
1a1cdab0 551
c05f6df0 552 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
5ca1c0b9
AF
553diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/mpp.h linux-2.6.32.57/arch/arm/mach-kirkwood/mpp.h
554--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/mpp.h 2012-02-13 20:29:11.000000000 +0100
555+++ linux-2.6.32.57/arch/arm/mach-kirkwood/mpp.h 2012-03-02 10:26:53.987196429 +0100
556@@ -102,7 +102,9 @@
557 #define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 )
558 #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1 )
559
560+
561 #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1 )
562+#define MPP12_GPIO MPP( 12, 0x0, 1, 1, 1, 1, 1, 1 )
563 #define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1 )
564
565 #define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1 )
566diff -Naur linux-2.6.32.57.org/arch/arm/mach-kirkwood/nas6210-setup.c linux-2.6.32.57/arch/arm/mach-kirkwood/nas6210-setup.c
567--- linux-2.6.32.57.org/arch/arm/mach-kirkwood/nas6210-setup.c 1970-01-01 01:00:00.000000000 +0100
568+++ linux-2.6.32.57/arch/arm/mach-kirkwood/nas6210-setup.c 2012-03-02 23:37:35.077514152 +0100
569@@ -0,0 +1,183 @@
c05f6df0
AF
570+/*
571+ * arch/arm/mach-kirkwood/nas6210-setup.c
572+ *
573+ * Raidsonic ICYBOX NAS6210 and 6220 Board Setup
574+ *
575+ * This file is licensed under the terms of the GNU General Public
576+ * License version 2. This program is licensed "as is" without any
577+ * warranty of any kind, whether express or implied.
578+ */
579+
580+#include <linux/kernel.h>
581+#include <linux/init.h>
582+#include <linux/platform_device.h>
5ca1c0b9 583+#include <linux/mtd/mtd.h>
c05f6df0
AF
584+#include <linux/mtd/partitions.h>
585+#include <linux/ata_platform.h>
586+#include <linux/mv643xx_eth.h>
587+#include <linux/gpio.h>
588+#include <linux/gpio_keys.h>
5ca1c0b9 589+#include <linux/i2c.h>
c05f6df0
AF
590+#include <linux/input.h>
591+#include <linux/leds.h>
592+#include <asm/mach-types.h>
593+#include <asm/mach/arch.h>
594+#include <mach/kirkwood.h>
595+#include "common.h"
596+#include "mpp.h"
597+
598+#define NAS6210_GPIO_POWER_OFF 24
599+
600+static struct mtd_partition nas6210_nand_parts[] = {
601+ {
602+ .name = "u-boot",
603+ .offset = 0,
5ca1c0b9
AF
604+ .size = SZ_1M,
605+ .mask_flags = MTD_WRITEABLE, /* read only */
c05f6df0
AF
606+ }, {
607+ .name = "uImage",
608+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 609+ .size = (SZ_1M*6),
c05f6df0
AF
610+ }, {
611+ .name = "root",
612+ .offset = MTDPART_OFS_NXTBLK,
5ca1c0b9 613+ .size = MTDPART_SIZ_FULL,
c05f6df0
AF
614+ },
615+};
616+
617+static struct mv643xx_eth_platform_data nas6210_ge00_data = {
618+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
619+};
620+
621+static struct mv_sata_platform_data nas6210_sata_data = {
622+ .n_ports = 2,
623+};
624+
625+static struct gpio_led nas6210_led_pins[] = {
626+ {
627+ .name = "nas6210:green:power",
628+ .default_trigger = "default-on",
629+ .gpio = 25,
630+ .active_low = 0,
631+ },
632+ {
633+ .name = "nas6210:red:power",
634+ .default_trigger = "none",
635+ .gpio = 22,
636+ .active_low = 0,
637+ },
638+ {
639+ .name = "nas6210:red:usb_copy",
640+ .default_trigger = "none",
641+ .gpio = 27,
642+ .active_low = 0,
643+ },
644+};
645+
646+static struct gpio_led_platform_data nas6210_led_data = {
647+ .leds = nas6210_led_pins,
648+ .num_leds = ARRAY_SIZE(nas6210_led_pins),
649+};
650+
651+static struct platform_device nas6210_leds = {
652+ .name = "leds-gpio",
653+ .id = -1,
654+ .dev = {
655+ .platform_data = &nas6210_led_data,
656+ }
657+};
658+
659+static struct gpio_keys_button nas6210_buttons[] = {
660+ {
661+ .code = KEY_COPY,
662+ .gpio = 29,
663+ .desc = "USB Copy",
664+ .active_low = 1,
665+ },
666+ {
667+ .code = KEY_RESTART,
668+ .gpio = 28,
669+ .desc = "Reset",
670+ .active_low = 1,
671+ },
672+};
673+
674+static struct gpio_keys_platform_data nas6210_button_data = {
675+ .buttons = nas6210_buttons,
676+ .nbuttons = ARRAY_SIZE(nas6210_buttons),
677+};
678+
679+static struct platform_device nas6210_button_device = {
680+ .name = "gpio-keys",
681+ .id = -1,
682+ .num_resources = 0,
683+ .dev = {
684+ .platform_data = &nas6210_button_data,
685+ }
686+};
687+
688+static unsigned int nas6210_mpp_config[] __initdata = {
689+ MPP0_NF_IO2,
690+ MPP1_NF_IO3,
691+ MPP2_NF_IO4,
692+ MPP3_NF_IO5,
693+ MPP4_NF_IO6,
694+ MPP5_NF_IO7,
695+ MPP18_NF_IO0,
696+ MPP19_NF_IO1,
697+ MPP22_GPIO, /* Power LED red */
698+ MPP24_GPIO, /* Power off */
699+ MPP25_GPIO, /* Power LED green */
700+ MPP27_GPIO, /* USB transfer LED */
701+ MPP28_GPIO, /* Reset button */
702+ MPP29_GPIO, /* USB Copy button */
703+ 0
704+};
705+
706+void nas6210_power_off(void)
707+{
708+ gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
709+ while(1);
710+}
711+
712+static void __init nas6210_init(void)
713+{
714+ /*
715+ * Basic setup. Needs to be called early.
716+ */
717+ kirkwood_init();
718+ kirkwood_mpp_conf(nas6210_mpp_config);
719+
720+ kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
721+ kirkwood_ehci_init();
722+ kirkwood_ge00_init(&nas6210_ge00_data);
723+ kirkwood_sata_init(&nas6210_sata_data);
724+ kirkwood_uart0_init();
725+ platform_device_register(&nas6210_leds);
726+ platform_device_register(&nas6210_button_device);
727+
728+ if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
729+ gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
730+ pm_power_off = nas6210_power_off;
731+
732+ else
733+ pr_err("nas6210: failed to configure power-off gpio pin");
734+}
735+
736+static int __init nas6210_pci_init(void)
737+{
738+ if (machine_is_nas6210()) {
739+ kirkwood_pcie_init();
740+ }
741+ return 0;
742+}
743+subsys_initcall(nas6210_pci_init);
744+
745+MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS62x0")
746+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
747+ .boot_params = 0x00000100,
748+ .init_machine = nas6210_init,
749+ .map_io = kirkwood_map_io,
750+ .init_irq = kirkwood_init_irq,
751+ .timer = &kirkwood_timer,
752+MACHINE_END
5ca1c0b9
AF
753diff -Naur linux-2.6.32.57.org/arch/arm/tools/mach-types linux-2.6.32.57/arch/arm/tools/mach-types
754--- linux-2.6.32.57.org/arch/arm/tools/mach-types 2012-02-13 20:29:11.000000000 +0100
755+++ linux-2.6.32.57/arch/arm/tools/mach-types 2012-03-02 09:25:26.787196718 +0100
756@@ -2536,3 +2536,7 @@
1a1cdab0
AF
757 mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
758 esyx MACH_ESYX ESYX 2551
759 bulldog MACH_BULLDOG BULLDOG 2553
c84d6e62 760+guruplug MACH_GURUPLUG GURUPLUG 2601
1a1cdab0 761+dreamplug MACH_DREAMPLUG DREAMPLUG 2659
5ca1c0b9 762+iconnect MACH_ICONNECT ICONNECT 2870
c05f6df0 763+nas6210 MACH_NAS6210 NAS6210 3104