]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/linux-3.14.22-kirkwood_legacy_boot.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-suricata
[ipfire-2.x.git] / src / patches / linux-3.14.22-kirkwood_legacy_boot.patch
CommitLineData
21147a00
AF
1diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/db88f6281-bp-setup.c linux-3.14.22/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
2--- linux-3.14.22.org/arch/arm/mach-kirkwood/db88f6281-bp-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 3+++ linux-3.14.22/arch/arm/mach-kirkwood/db88f6281-bp-setup.c 2014-11-05 22:07:58.828714499 +0100
21147a00
AF
4@@ -0,0 +1,108 @@
5+/*
6+ * arch/arm/mach-kirkwood/db88f6281-bp-setup.c
7+ *
8+ * Marvell DB-88F6281-BP Development 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/sizes.h>
18+#include <linux/platform_device.h>
19+#include <linux/mtd/partitions.h>
20+#include <linux/ata_platform.h>
21+#include <linux/mv643xx_eth.h>
22+#include <asm/mach-types.h>
23+#include <asm/mach/arch.h>
24+#include <mach/kirkwood.h>
25+#include <linux/platform_data/mmc-mvsdio.h>
26+#include "common.h"
27+#include "mpp.h"
28+
29+static struct mtd_partition db88f6281_nand_parts[] = {
30+ {
31+ .name = "u-boot",
32+ .offset = 0,
33+ .size = SZ_1M
34+ }, {
35+ .name = "uImage",
36+ .offset = MTDPART_OFS_NXTBLK,
37+ .size = SZ_4M
38+ }, {
39+ .name = "root",
40+ .offset = MTDPART_OFS_NXTBLK,
41+ .size = MTDPART_SIZ_FULL
42+ },
43+};
44+
45+static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
46+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
47+};
48+
49+static struct mv_sata_platform_data db88f6281_sata_data = {
50+ .n_ports = 2,
51+};
52+
53+static struct mvsdio_platform_data db88f6281_mvsdio_data = {
54+ .gpio_write_protect = 37,
55+ .gpio_card_detect = 38,
56+};
57+
58+static unsigned int db88f6281_mpp_config[] __initdata = {
59+ MPP0_NF_IO2,
60+ MPP1_NF_IO3,
61+ MPP2_NF_IO4,
62+ MPP3_NF_IO5,
63+ MPP4_NF_IO6,
64+ MPP5_NF_IO7,
65+ MPP18_NF_IO0,
66+ MPP19_NF_IO1,
67+ MPP37_GPIO,
68+ MPP38_GPIO,
69+ 0
70+};
71+
72+static void __init db88f6281_init(void)
73+{
74+ /*
75+ * Basic setup. Needs to be called early.
76+ */
77+ kirkwood_init();
78+ kirkwood_mpp_conf(db88f6281_mpp_config);
79+
80+ kirkwood_nand_init(ARRAY_AND_SIZE(db88f6281_nand_parts), 25);
81+ kirkwood_ehci_init();
82+ kirkwood_ge00_init(&db88f6281_ge00_data);
83+ kirkwood_sata_init(&db88f6281_sata_data);
84+ kirkwood_uart0_init();
85+ kirkwood_sdio_init(&db88f6281_mvsdio_data);
86+}
87+
88+static int __init db88f6281_pci_init(void)
89+{
90+ if (machine_is_db88f6281_bp()) {
91+ u32 dev, rev;
92+
93+ kirkwood_pcie_id(&dev, &rev);
94+ if (dev == MV88F6282_DEV_ID)
95+ kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
96+ else
97+ kirkwood_pcie_init(KW_PCIE0);
98+ }
99+ return 0;
100+}
101+subsys_initcall(db88f6281_pci_init);
102+
103+MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
104+ /* Maintainer: Saeed Bishara <saeed@marvell.com> */
105+ .atag_offset = 0x100,
106+ .init_machine = db88f6281_init,
107+ .map_io = kirkwood_map_io,
108+ .init_early = kirkwood_init_early,
109+ .init_irq = kirkwood_init_irq,
110+ .init_time = kirkwood_timer_init,
111+ .restart = kirkwood_restart,
112+MACHINE_END
113diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/dockstar-setup.c linux-3.14.22/arch/arm/mach-kirkwood/dockstar-setup.c
114--- linux-3.14.22.org/arch/arm/mach-kirkwood/dockstar-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 115+++ linux-3.14.22/arch/arm/mach-kirkwood/dockstar-setup.c 2014-11-05 22:07:58.828714499 +0100
21147a00
AF
116@@ -0,0 +1,111 @@
117+/*
118+ * arch/arm/mach-kirkwood/dockstar-setup.c
119+ *
120+ * Seagate FreeAgent DockStar Setup
121+ *
122+ * This file is licensed under the terms of the GNU General Public
123+ * License version 2. This program is licensed "as is" without any
124+ * warranty of any kind, whether express or implied.
125+ */
126+
127+#include <linux/kernel.h>
128+#include <linux/init.h>
129+#include <linux/platform_device.h>
130+#include <linux/ata_platform.h>
131+#include <linux/mtd/partitions.h>
132+#include <linux/mv643xx_eth.h>
133+#include <linux/gpio.h>
134+#include <linux/leds.h>
135+#include <asm/mach-types.h>
136+#include <asm/mach/arch.h>
137+#include <mach/kirkwood.h>
138+#include "common.h"
139+#include "mpp.h"
140+
141+static struct mtd_partition dockstar_nand_parts[] = {
142+ {
143+ .name = "u-boot",
144+ .offset = 0,
145+ .size = SZ_1M
146+ }, {
147+ .name = "uImage",
148+ .offset = MTDPART_OFS_NXTBLK,
149+ .size = SZ_4M
150+ }, {
151+ .name = "root",
152+ .offset = MTDPART_OFS_NXTBLK,
153+ .size = MTDPART_SIZ_FULL
154+ },
155+};
156+
157+static struct mv643xx_eth_platform_data dockstar_ge00_data = {
158+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
159+};
160+
161+static struct gpio_led dockstar_led_pins[] = {
162+ {
163+ .name = "dockstar:green:health",
164+ .default_trigger = "default-on",
165+ .gpio = 46,
166+ .active_low = 1,
167+ },
168+ {
169+ .name = "dockstar:orange:misc",
170+ .default_trigger = "none",
171+ .gpio = 47,
172+ .active_low = 1,
173+ },
174+};
175+
176+static struct gpio_led_platform_data dockstar_led_data = {
177+ .leds = dockstar_led_pins,
178+ .num_leds = ARRAY_SIZE(dockstar_led_pins),
179+};
180+
181+static struct platform_device dockstar_leds = {
182+ .name = "leds-gpio",
183+ .id = -1,
184+ .dev = {
185+ .platform_data = &dockstar_led_data,
186+ }
187+};
188+
189+static unsigned int dockstar_mpp_config[] __initdata = {
190+ MPP29_GPIO, /* USB Power Enable */
191+ MPP46_GPIO, /* LED green */
192+ MPP47_GPIO, /* LED orange */
193+ 0
194+};
195+
196+static void __init dockstar_init(void)
197+{
198+ /*
199+ * Basic setup. Needs to be called early.
200+ */
201+ kirkwood_init();
202+
203+ /* setup gpio pin select */
204+ kirkwood_mpp_conf(dockstar_mpp_config);
205+
206+ kirkwood_uart0_init();
207+ kirkwood_nand_init(ARRAY_AND_SIZE(dockstar_nand_parts), 25);
208+
209+ if (gpio_request(29, "USB Power Enable") != 0 ||
210+ gpio_direction_output(29, 1) != 0)
211+ pr_err("can't set up GPIO 29 (USB Power Enable)\n");
212+ kirkwood_ehci_init();
213+
214+ kirkwood_ge00_init(&dockstar_ge00_data);
215+
216+ platform_device_register(&dockstar_leds);
217+}
218+
219+MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
220+ .atag_offset = 0x100,
221+ .init_machine = dockstar_init,
222+ .map_io = kirkwood_map_io,
223+ .init_early = kirkwood_init_early,
224+ .init_irq = kirkwood_init_irq,
225+ .init_time = kirkwood_timer_init,
226+ .restart = kirkwood_restart,
227+MACHINE_END
228diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/dreamplug-setup.c linux-3.14.22/arch/arm/mach-kirkwood/dreamplug-setup.c
229--- linux-3.14.22.org/arch/arm/mach-kirkwood/dreamplug-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 230+++ linux-3.14.22/arch/arm/mach-kirkwood/dreamplug-setup.c 2014-11-05 22:07:58.833714499 +0100
21147a00
AF
231@@ -0,0 +1,151 @@
232+/*
233+ * arch/arm/mach-kirkwood/dreamplug-setup.c
234+ *
235+ * Marvell DreamPlug Reference Board Setup
236+ *
237+ * This file is licensed under the terms of the GNU General Public
238+ * License version 2. This program is licensed "as is" without any
239+ * warranty of any kind, whether express or implied.
240+ */
241+
242+#include <linux/kernel.h>
243+#include <linux/init.h>
244+#include <linux/platform_device.h>
245+#include <linux/mtd/mtd.h>
246+#include <linux/mtd/partitions.h>
247+#include <linux/ata_platform.h>
248+#include <linux/mv643xx_eth.h>
249+#include <linux/gpio.h>
250+#include <linux/leds.h>
251+#include <linux/spi/flash.h>
252+#include <linux/spi/spi.h>
253+#include <asm/mach-types.h>
254+#include <asm/mach/arch.h>
255+#include <mach/kirkwood.h>
256+#include <linux/platform_data/mmc-mvsdio.h>
257+#include "common.h"
258+#include "mpp.h"
259+
260+static const struct flash_platform_data dreamplug_spi_slave_data = {
261+ .type = "mx25l1606e",
262+};
263+
264+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
265+ {
266+ .modalias = "m25p80",
267+ .platform_data = &dreamplug_spi_slave_data,
268+ .irq = -1,
269+ .max_speed_hz = 50000000,
270+ .bus_num = 0,
271+ .chip_select = 0,
272+ },
273+};
274+
275+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
276+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
277+};
278+
279+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
280+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
281+};
282+
283+static struct mv_sata_platform_data dreamplug_sata_data = {
284+ .n_ports = 1,
285+};
286+
287+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
288+ /* unfortunately the CD signal has not been connected */
289+};
290+
291+static struct gpio_led dreamplug_led_pins[] = {
292+ {
293+ .name = "dreamplug:blue:bluetooth",
294+ .gpio = 47,
295+ .active_low = 1,
296+ },
297+ {
298+ .name = "dreamplug:green:wlan",
299+ .gpio = 48,
300+ .active_low = 1,
301+ },
302+ {
303+ .name = "dreamplug:blue:wlanap",
304+ .gpio = 49,
305+ .active_low = 1,
306+ },
307+};
308+
309+static struct gpio_led_platform_data dreamplug_led_data = {
310+ .leds = dreamplug_led_pins,
311+ .num_leds = ARRAY_SIZE(dreamplug_led_pins),
312+};
313+
314+static struct platform_device dreamplug_leds = {
315+ .name = "leds-gpio",
316+ .id = -1,
317+ .dev = {
318+ .platform_data = &dreamplug_led_data,
319+ }
320+};
321+
322+static unsigned int dreamplug_mpp_config[] __initdata = {
323+ MPP0_SPI_SCn,
324+ MPP1_SPI_MOSI,
325+ MPP2_SPI_SCK,
326+ MPP3_SPI_MISO,
327+ MPP4_GPIO,
328+ MPP5_GPO,
329+ MPP7_GPO,
330+ MPP18_GPO,
331+ MPP19_GPO,
332+ MPP47_GPIO, /* B_BLED */
333+ MPP48_GPIO, /* W_GLED */
334+ MPP49_GPIO, /* W_BLED */
335+ 0
336+};
337+
338+static void __init dreamplug_legacy_init(void)
339+{
340+ /*
341+ * Basic setup. Needs to be called early.
342+ */
343+ kirkwood_init();
344+ kirkwood_mpp_conf(dreamplug_mpp_config);
345+
346+ kirkwood_uart0_init();
347+
348+ spi_register_board_info(dreamplug_spi_slave_info,
349+ ARRAY_SIZE(dreamplug_spi_slave_info));
350+
351+ kirkwood_spi_init();
352+ kirkwood_ehci_init();
353+
354+ kirkwood_ge00_init(&dreamplug_ge00_data);
355+ kirkwood_ge01_init(&dreamplug_ge01_data);
356+ kirkwood_sata_init(&dreamplug_sata_data);
357+ kirkwood_sdio_init(&dreamplug_mvsdio_data);
358+
359+ platform_device_register(&dreamplug_leds);
360+}
361+
362+MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
363+ /* Maintainer: Siddarth Gore <gores <at> marvell.com> */
364+ .atag_offset = 0x100,
365+ .init_machine = dreamplug_legacy_init,
366+ .map_io = kirkwood_map_io,
367+ .init_early = kirkwood_init_early,
368+ .init_irq = kirkwood_init_irq,
369+ .init_time = kirkwood_timer_init,
370+ .restart = kirkwood_restart,
371+MACHINE_END
372+
373+MACHINE_START(DREAMPLUG1, "Marvell DreamPlug Reference Board")
374+ .atag_offset = 0x100,
375+ .init_machine = dreamplug_legacy_init,
376+ .map_io = kirkwood_map_io,
377+ .init_early = kirkwood_init_early,
378+ .init_irq = kirkwood_init_irq,
379+ .init_time = kirkwood_timer_init,
380+ .restart = kirkwood_restart,
381+
382+MACHINE_END
383diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/guruplug-setup.c linux-3.14.22/arch/arm/mach-kirkwood/guruplug-setup.c
384--- linux-3.14.22.org/arch/arm/mach-kirkwood/guruplug-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 385+++ linux-3.14.22/arch/arm/mach-kirkwood/guruplug-setup.c 2014-11-05 22:07:58.838714499 +0100
21147a00
AF
386@@ -0,0 +1,135 @@
387+/*
388+ * arch/arm/mach-kirkwood/guruplug-setup.c
389+ *
390+ * Marvell GuruPlug Reference Board Setup
391+ *
392+ * This file is licensed under the terms of the GNU General Public
393+ * License version 2. This program is licensed "as is" without any
394+ * warranty of any kind, whether express or implied.
395+ */
396+
397+#include <linux/kernel.h>
398+#include <linux/init.h>
399+#include <linux/platform_device.h>
400+#include <linux/mtd/mtd.h>
401+#include <linux/mtd/partitions.h>
402+#include <linux/ata_platform.h>
403+#include <linux/mv643xx_eth.h>
404+#include <linux/gpio.h>
405+#include <linux/leds.h>
406+#include <asm/mach-types.h>
407+#include <asm/mach/arch.h>
408+#include <mach/kirkwood.h>
409+#include <linux/platform_data/mmc-mvsdio.h>
410+#include "common.h"
411+#include "mpp.h"
412+
413+static struct mtd_partition guruplug_nand_parts[] = {
414+ {
415+ .name = "u-boot",
416+ .offset = 0,
417+ .size = SZ_1M,
418+ .mask_flags = MTD_WRITEABLE, /* read only */
419+ }, {
420+ .name = "uImage",
421+ .offset = MTDPART_OFS_NXTBLK,
422+ .size = SZ_4M,
423+ }, {
424+ .name = "root",
425+ .offset = MTDPART_OFS_NXTBLK,
426+ .size = MTDPART_SIZ_FULL,
427+ },
428+};
429+
430+static struct mv643xx_eth_platform_data guruplug_ge00_data = {
431+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
432+};
433+
434+static struct mv643xx_eth_platform_data guruplug_ge01_data = {
435+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
436+};
437+
438+static struct mv_sata_platform_data guruplug_sata_data = {
439+ .n_ports = 1,
440+};
441+
442+static struct mvsdio_platform_data guruplug_mvsdio_data = {
443+ /* unfortunately the CD signal has not been connected */
444+ .gpio_card_detect = -1,
445+ .gpio_write_protect = -1,
446+};
447+
448+static struct gpio_led guruplug_led_pins[] = {
449+ {
450+ .name = "guruplug:red:health",
451+ .gpio = 46,
452+ .active_low = 1,
453+ },
454+ {
455+ .name = "guruplug:green:health",
456+ .gpio = 47,
457+ .active_low = 1,
458+ },
459+ {
460+ .name = "guruplug:red:wmode",
461+ .gpio = 48,
462+ .active_low = 1,
463+ },
464+ {
465+ .name = "guruplug:green:wmode",
466+ .gpio = 49,
467+ .active_low = 1,
468+ },
469+};
470+
471+static struct gpio_led_platform_data guruplug_led_data = {
472+ .leds = guruplug_led_pins,
473+ .num_leds = ARRAY_SIZE(guruplug_led_pins),
474+};
475+
476+static struct platform_device guruplug_leds = {
477+ .name = "leds-gpio",
478+ .id = -1,
479+ .dev = {
480+ .platform_data = &guruplug_led_data,
481+ }
482+};
483+
484+static unsigned int guruplug_mpp_config[] __initdata = {
485+ MPP46_GPIO, /* M_RLED */
486+ MPP47_GPIO, /* M_GLED */
487+ MPP48_GPIO, /* B_RLED */
488+ MPP49_GPIO, /* B_GLED */
489+ 0
490+};
491+
492+static void __init guruplug_init(void)
493+{
494+ /*
495+ * Basic setup. Needs to be called early.
496+ */
497+ kirkwood_init();
498+ kirkwood_mpp_conf(guruplug_mpp_config);
499+
500+ kirkwood_uart0_init();
501+ kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
502+
503+ kirkwood_ehci_init();
504+ kirkwood_ge00_init(&guruplug_ge00_data);
505+ kirkwood_ge01_init(&guruplug_ge01_data);
506+ kirkwood_sata_init(&guruplug_sata_data);
507+ kirkwood_sdio_init(&guruplug_mvsdio_data);
508+
509+ platform_device_register(&guruplug_leds);
510+}
511+
512+MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
513+ /* Maintainer: Siddarth Gore <gores@marvell.com> */
514+ .atag_offset = 0x100,
515+ .init_machine = guruplug_init,
516+ .map_io = kirkwood_map_io,
517+ .init_early = kirkwood_init_early,
518+ .init_irq = kirkwood_init_irq,
519+ .init_time = kirkwood_timer_init,
520+ .restart = kirkwood_restart,
521+MACHINE_END
522diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/iconnect-setup.c linux-3.14.22/arch/arm/mach-kirkwood/iconnect-setup.c
523--- linux-3.14.22.org/arch/arm/mach-kirkwood/iconnect-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 524+++ linux-3.14.22/arch/arm/mach-kirkwood/iconnect-setup.c 2014-11-05 22:07:58.843714499 +0100
21147a00
AF
525@@ -0,0 +1,214 @@
526+/*
527+ * arch/arm/mach-kirkwood/iconnect-setup.c
528+ *
529+ * Iomega iConnect Wireless Data Station Board Setup
530+ *
531+ * This file is licensed under the terms of the GNU General Public
532+ * License version 2. This program is licensed "as is" without any
533+ * warranty of any kind, whether express or implied.
534+ */
535+
536+#include <linux/kernel.h>
537+#include <linux/init.h>
538+#include <linux/platform_device.h>
539+#include <linux/mtd/mtd.h>
540+#include <linux/mtd/partitions.h>
541+#include <linux/ata_platform.h>
542+#include <linux/mv643xx_eth.h>
543+#include <linux/gpio.h>
544+#include <linux/gpio_keys.h>
545+#include <linux/i2c.h>
546+#include <linux/input.h>
547+#include <linux/leds.h>
548+#include <asm/mach-types.h>
549+#include <asm/mach/arch.h>
550+#include <mach/kirkwood.h>
551+#include "common.h"
552+#include "mpp.h"
553+
554+static struct mtd_partition iconnect_nand_parts[] = {
555+ {
556+ .name = "u-boot",
557+ .offset = 0,
558+ .size = SZ_1M,
559+ .mask_flags = MTD_WRITEABLE, /* read only */
560+ }, {
561+ .name = "uImage",
562+ .offset = MTDPART_OFS_NXTBLK,
563+ .size = 0x440000,
564+ }, {
565+ .name = "uInit",
566+ .offset = MTDPART_OFS_NXTBLK,
567+ .size = 0x440000,
568+ }, {
569+ .name = "root",
570+ .offset = MTDPART_OFS_NXTBLK,
571+ .size = MTDPART_SIZ_FULL,
572+ },
573+};
574+
575+static struct mv643xx_eth_platform_data iconnect_ge00_data = {
576+ .phy_addr = MV643XX_ETH_PHY_ADDR(0xB),
577+};
578+
579+static struct gpio_led iconnect_led_pins[] = {
580+ {
581+ .name = "iconnect:led_level",
582+ .default_trigger = "default-on",
583+ .gpio = 41,
584+ .active_low = 0,
585+ },
586+
587+ {
588+ .name = "iconnect:blue:power",
589+ .default_trigger = "default-on",
590+ .gpio = 42,
591+ .active_low = 0,
592+ },
593+ {
594+ .name = "iconnect:red:power",
595+ .default_trigger = "none",
596+ .gpio = 43,
597+ .active_low = 0,
598+ },
599+ {
600+ .name = "iconnect:blue:usb_1",
601+ .default_trigger = "none",
602+ .gpio = 44,
603+ .active_low = 0,
604+ },
605+ {
606+ .name = "iconnect:blue:usb_2",
607+ .default_trigger = "none",
608+ .gpio = 45,
609+ .active_low = 0,
610+ },
611+ {
612+ .name = "iconnect:blue:usb_3",
613+ .default_trigger = "none",
614+ .gpio = 46,
615+ .active_low = 0,
616+ },
617+ {
618+ .name = "iconnect:blue:usb_4",
619+ .default_trigger = "none",
620+ .gpio = 47,
621+ .active_low = 0,
622+ },
623+ {
624+ .name = "iconnect:blue:otb",
625+ .default_trigger = "none",
626+ .gpio = 48,
627+ .active_low = 0,
628+ },
629+};
630+
631+static struct gpio_led_platform_data iconnect_led_data = {
632+ .leds = iconnect_led_pins,
633+ .num_leds = ARRAY_SIZE(iconnect_led_pins),
634+};
635+
636+static struct platform_device iconnect_leds = {
637+ .name = "leds-gpio",
638+ .id = -1,
639+ .dev = {
640+ .platform_data = &iconnect_led_data,
641+ }
642+};
643+
644+static struct gpio_keys_button iconnect_buttons[] = {
645+ {
646+ .code = KEY_COPY,
647+ .gpio = 35,
648+ .desc = "OTB Button",
649+ .active_low = 1,
650+ },
651+ {
652+ .code = KEY_RESTART,
653+ .gpio = 12,
654+ .desc = "Reset",
655+ .active_low = 1,
656+ },
657+};
658+
659+static struct gpio_keys_platform_data iconnect_button_data = {
660+ .buttons = iconnect_buttons,
661+ .nbuttons = ARRAY_SIZE(iconnect_buttons),
662+};
663+
664+static struct platform_device iconnect_button_device = {
665+ .name = "gpio-keys",
666+ .id = -1,
667+ .num_resources = 0,
668+ .dev = {
669+ .platform_data = &iconnect_button_data,
670+ }
671+};
672+
673+static unsigned int iconnect_mpp_config[] __initdata = {
674+ MPP0_NF_IO2,
675+ MPP1_NF_IO3,
676+ MPP2_NF_IO4,
677+ MPP3_NF_IO5,
678+ MPP4_NF_IO6,
679+ MPP5_NF_IO7,
680+ MPP18_NF_IO0,
681+ MPP19_NF_IO1,
682+ MPP12_GPIO, /* Reset Button */
683+ MPP35_GPIO, /* OTB Button */
684+
685+ MPP41_GPIO, /* LED Level */
686+ MPP42_GPIO, /* Power LED blue */
687+ MPP43_GPIO, /* Power LED red */
688+ MPP44_GPIO, /* USB LED 1 */
689+ MPP45_GPIO, /* USB LED 2 */
690+ MPP46_GPIO, /* USB LED 3 */
691+ MPP47_GPIO, /* USB LED 4 */
692+ MPP48_GPIO, /* OTB LED */
693+ 0
694+};
695+
696+static struct i2c_board_info __initdata iconnect_i2c = {
697+ I2C_BOARD_INFO("lm63", 0x4c),
698+};
699+
700+static void __init iconnect_legacy_init(void)
701+{
702+ /*
703+ * Basic setup. Needs to be called early.
704+ */
705+ kirkwood_init();
706+ kirkwood_mpp_conf(iconnect_mpp_config);
707+
708+ kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
709+ kirkwood_ehci_init();
710+ kirkwood_ge00_init(&iconnect_ge00_data);
711+
712+ kirkwood_uart0_init();
713+ platform_device_register(&iconnect_leds);
714+ platform_device_register(&iconnect_button_device);
715+
716+ kirkwood_i2c_init();
717+ i2c_register_board_info(0, &iconnect_i2c,1);
718+}
719+
720+static int __init iconnect_pci_init(void)
721+{
722+ if (machine_is_iconnect()) {
723+ kirkwood_pcie_init(KW_PCIE0);
724+ }
725+ return 0;
726+}
727+subsys_initcall(iconnect_pci_init);
728+
729+MACHINE_START(ICONNECT, "Iomega iConnect Wireless Data Station")
730+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
731+ .atag_offset = 0x100,
732+ .init_machine = iconnect_legacy_init,
733+ .map_io = kirkwood_map_io,
734+ .init_early = kirkwood_init_early,
735+ .init_irq = kirkwood_init_irq,
736+ .init_time = kirkwood_timer_init,
737+ .restart = kirkwood_restart,
738+
739+MACHINE_END
740diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/Kconfig linux-3.14.22/arch/arm/mach-kirkwood/Kconfig
741--- linux-3.14.22.org/arch/arm/mach-kirkwood/Kconfig 2014-10-15 08:42:04.000000000 +0200
bcd7a757 742+++ linux-3.14.22/arch/arm/mach-kirkwood/Kconfig 2014-11-05 22:07:58.848714499 +0100
21147a00
AF
743@@ -1,3 +1,5 @@
744+
745+
746 if ARCH_KIRKWOOD
747
748 menu "Marvell Kirkwood Implementations"
749@@ -72,6 +74,83 @@
750 Say 'Y' here if you want your kernel to support the
751 HP t5325 Thin Client.
752
753+config MACH_DB88F6281_BP
754+ bool "Marvell DB-88F6281-BP Development Board"
755+ select KIRKWOOD_LEGACY
756+ help
757+ Say 'Y' here if you want your kernel to support the
758+ Marvell DB-88F6281-BP Development Board.
759+
760+config MACH_DOCKSTAR
761+ bool "Seagate FreeAgent DockStar"
762+ select KIRKWOOD_LEGACY
763+ help
764+ Say 'Y' here if you want your kernel to support the
765+ Seagate FreeAgent DockStar.
766+
767+config MACH_SHEEVAPLUG
768+ bool "Marvell SheevaPlug Reference Board"
769+ select KIRKWOOD_LEGACY
770+ help
771+ Say 'Y' here if you want your kernel to support the
772+ Marvell SheevaPlug Reference Board.
773+
774+config MACH_ESATA_SHEEVAPLUG
775+ bool "Marvell eSATA SheevaPlug Reference Board"
776+ select KIRKWOOD_LEGACY
777+ help
778+ Say 'Y' here if you want your kernel to support the
779+ Marvell eSATA SheevaPlug Reference Board.
780+
781+config MACH_GURUPLUG
782+ bool "Marvell GuruPlug Reference Board"
783+ select KIRKWOOD_LEGACY
784+ help
785+ Say 'Y' here if you want your kernel to support the
786+ Marvell GuruPlug Reference Board.
787+
788+config MACH_INETSPACE_V2
789+ bool "LaCie Internet Space v2 NAS Board"
790+ select KIRKWOOD_LEGACY
791+ help
792+ Say 'Y' here if you want your kernel to support the
793+ LaCie Internet Space v2 NAS.
794+
795+config MACH_NETSPACE_MAX_V2
796+ bool "LaCie Network Space Max v2 NAS Board"
797+ select KIRKWOOD_LEGACY
798+ help
799+ Say 'Y' here if you want your kernel to support the
800+ LaCie Network Space Max v2 NAS.
801+
802+config MACH_NETSPACE_V2
803+ bool "LaCie Network Space v2 NAS Board"
804+ select KIRKWOOD_LEGACY
805+ help
806+ Say 'Y' here if you want your kernel to support the
807+ LaCie Network Space v2 NAS.
808+
809+config MACH_DREAMPLUG
810+ select KIRKWOOD_LEGACY
811+ bool "Marvell DreamPlug Reference Board"
812+ help
813+ Say 'Y' here if you want your kernel to support the
814+ Marvell DreamPlug Reference Board.
815+
816+config MACH_ICONNECT
817+ select KIRKWOOD_LEGACY
818+ bool "Iomega iConnect Wireless Data Station"
819+ help
820+ Say 'Y' here if you want your kernel to support the
821+ Iomega iConnect Wireless Data Station.
822+
823+config MACH_NAS6210
824+ select KIRKWOOD_LEGACY
825+ bool "Raidsonic ICY BOX IB-62x0"
826+ help
827+ Say 'Y' here if you want your kernel to support the
828+ Raidsonic ICY BOX IB-62x0.
829+
830 config MACH_TS219
831 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
832 select KIRKWOOD_LEGACY
833@@ -113,6 +192,7 @@
834 Say 'Y' here if you want your kernel to support the
835 Marvell 88F6281 GTW GE Board (Flattened Device Tree).
836
837+
838 endmenu
839
840 endif
841diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/Makefile linux-3.14.22/arch/arm/mach-kirkwood/Makefile
842--- linux-3.14.22.org/arch/arm/mach-kirkwood/Makefile 2014-10-15 08:42:04.000000000 +0200
bcd7a757
AF
843+++ linux-3.14.22/arch/arm/mach-kirkwood/Makefile 2014-11-05 22:09:01.758714529 +0100
844@@ -2,6 +2,15 @@
21147a00
AF
845 obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o
846 obj-$(CONFIG_PM) += pm.o
847
848+obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
849+obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
850+obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
851+obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
bcd7a757 852+obj-$(CONFIG_MACH_DREAMPLUG) += dreamplug-setup.o
21147a00
AF
853+obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o
854+obj-$(CONFIG_MACH_NETSPACE_MAX_V2) += netspace_v2-setup.o lacie_v2-common.o
855+obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o
856+obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
857 obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
858 obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
859 obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
bcd7a757 860@@ -11,6 +20,8 @@
21147a00
AF
861 obj-$(CONFIG_MACH_T5325) += t5325-setup.o
862 obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
863 obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
864+obj-$(CONFIG_MACH_ICONNECT) += iconnect-setup.o
865+obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
866
867 obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
868 obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
869diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/nas6210-setup.c linux-3.14.22/arch/arm/mach-kirkwood/nas6210-setup.c
870--- linux-3.14.22.org/arch/arm/mach-kirkwood/nas6210-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 871+++ linux-3.14.22/arch/arm/mach-kirkwood/nas6210-setup.c 2014-11-05 22:07:58.858714499 +0100
21147a00
AF
872@@ -0,0 +1,185 @@
873+/*
874+ * arch/arm/mach-kirkwood/nas6210-setup.c
875+ *
876+ * Raidsonic ICYBOX NAS6210 and 6220 Board Setup
877+ *
878+ * This file is licensed under the terms of the GNU General Public
879+ * License version 2. This program is licensed "as is" without any
880+ * warranty of any kind, whether express or implied.
881+ */
882+
883+#include <linux/kernel.h>
884+#include <linux/init.h>
885+#include <linux/platform_device.h>
886+#include <linux/mtd/mtd.h>
887+#include <linux/mtd/partitions.h>
888+#include <linux/ata_platform.h>
889+#include <linux/mv643xx_eth.h>
890+#include <linux/gpio.h>
891+#include <linux/gpio_keys.h>
892+#include <linux/i2c.h>
893+#include <linux/input.h>
894+#include <linux/leds.h>
895+#include <asm/mach-types.h>
896+#include <asm/mach/arch.h>
897+#include <mach/kirkwood.h>
898+#include "common.h"
899+#include "mpp.h"
900+
901+#define NAS6210_GPIO_POWER_OFF 24
902+
903+static struct mtd_partition nas6210_nand_parts[] = {
904+ {
905+ .name = "u-boot",
906+ .offset = 0,
907+ .size = SZ_1M,
908+ .mask_flags = MTD_WRITEABLE, /* read only */
909+ }, {
910+ .name = "uImage",
911+ .offset = MTDPART_OFS_NXTBLK,
912+ .size = (SZ_1M*6),
913+ }, {
914+ .name = "root",
915+ .offset = MTDPART_OFS_NXTBLK,
916+ .size = MTDPART_SIZ_FULL,
917+ },
918+};
919+
920+static struct mv643xx_eth_platform_data nas6210_ge00_data = {
921+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
922+};
923+
924+static struct mv_sata_platform_data nas6210_sata_data = {
925+ .n_ports = 2,
926+};
927+
928+static struct gpio_led nas6210_led_pins[] = {
929+ {
930+ .name = "nas6210:green:power",
931+ .default_trigger = "default-on",
932+ .gpio = 25,
933+ .active_low = 0,
934+ },
935+ {
936+ .name = "nas6210:red:power",
937+ .default_trigger = "none",
938+ .gpio = 22,
939+ .active_low = 0,
940+ },
941+ {
942+ .name = "nas6210:red:usb_copy",
943+ .default_trigger = "none",
944+ .gpio = 27,
945+ .active_low = 0,
946+ },
947+};
948+
949+static struct gpio_led_platform_data nas6210_led_data = {
950+ .leds = nas6210_led_pins,
951+ .num_leds = ARRAY_SIZE(nas6210_led_pins),
952+};
953+
954+static struct platform_device nas6210_leds = {
955+ .name = "leds-gpio",
956+ .id = -1,
957+ .dev = {
958+ .platform_data = &nas6210_led_data,
959+ }
960+};
961+
962+static struct gpio_keys_button nas6210_buttons[] = {
963+ {
964+ .code = KEY_COPY,
965+ .gpio = 29,
966+ .desc = "USB Copy",
967+ .active_low = 1,
968+ },
969+ {
970+ .code = KEY_RESTART,
971+ .gpio = 28,
972+ .desc = "Reset",
973+ .active_low = 1,
974+ },
975+};
976+
977+static struct gpio_keys_platform_data nas6210_button_data = {
978+ .buttons = nas6210_buttons,
979+ .nbuttons = ARRAY_SIZE(nas6210_buttons),
980+};
981+
982+static struct platform_device nas6210_button_device = {
983+ .name = "gpio-keys",
984+ .id = -1,
985+ .num_resources = 0,
986+ .dev = {
987+ .platform_data = &nas6210_button_data,
988+ }
989+};
990+
991+static unsigned int nas6210_mpp_config[] __initdata = {
992+ MPP0_NF_IO2,
993+ MPP1_NF_IO3,
994+ MPP2_NF_IO4,
995+ MPP3_NF_IO5,
996+ MPP4_NF_IO6,
997+ MPP5_NF_IO7,
998+ MPP18_NF_IO0,
999+ MPP19_NF_IO1,
1000+ MPP22_GPIO, /* Power LED red */
1001+ MPP24_GPIO, /* Power off */
1002+ MPP25_GPIO, /* Power LED green */
1003+ MPP27_GPIO, /* USB transfer LED */
1004+ MPP28_GPIO, /* Reset button */
1005+ MPP29_GPIO, /* USB Copy button */
1006+ 0
1007+};
1008+
1009+void nas6210_power_off(void)
1010+{
1011+ gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
1012+ while(1);
1013+}
1014+
1015+static void __init nas6210_init(void)
1016+{
1017+ /*
1018+ * Basic setup. Needs to be called early.
1019+ */
1020+ kirkwood_init();
1021+ kirkwood_mpp_conf(nas6210_mpp_config);
1022+
1023+ kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
1024+ kirkwood_ehci_init();
1025+ kirkwood_ge00_init(&nas6210_ge00_data);
1026+ kirkwood_sata_init(&nas6210_sata_data);
1027+ kirkwood_uart0_init();
1028+ platform_device_register(&nas6210_leds);
1029+ platform_device_register(&nas6210_button_device);
1030+
1031+ if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
1032+ gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
1033+ pm_power_off = nas6210_power_off;
1034+
1035+ else
1036+ pr_err("nas6210: failed to configure power-off gpio pin");
1037+}
1038+
1039+static int __init nas6210_pci_init(void)
1040+{
1041+ if (machine_is_nas6210()) {
1042+ kirkwood_pcie_init(KW_PCIE0);
1043+ }
1044+ return 0;
1045+}
1046+subsys_initcall(nas6210_pci_init);
1047+
1048+MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS62x0")
1049+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
1050+ .atag_offset = 0x00000100,
1051+ .init_machine = nas6210_init,
1052+ .map_io = kirkwood_map_io,
1053+ .init_early = kirkwood_init_early,
1054+ .init_irq = kirkwood_init_irq,
1055+ .init_time = kirkwood_timer_init,
1056+ .restart = kirkwood_restart,
1057+MACHINE_END
1058diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/netspace_v2-setup.c linux-3.14.22/arch/arm/mach-kirkwood/netspace_v2-setup.c
1059--- linux-3.14.22.org/arch/arm/mach-kirkwood/netspace_v2-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 1060+++ linux-3.14.22/arch/arm/mach-kirkwood/netspace_v2-setup.c 2014-11-05 22:07:58.858714499 +0100
21147a00
AF
1061@@ -0,0 +1,293 @@
1062+/*
1063+ * arch/arm/mach-kirkwood/netspace_v2-setup.c
1064+ *
1065+ * LaCie Network Space v2 board setup
1066+ *
1067+ * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
1068+ * Copyright (C) 2009 Benoît Canet <benoit.canet@gmail.com>
1069+ *
1070+ * This program is free software; you can redistribute it and/or modify
1071+ * it under the terms of the GNU General Public License as published by
1072+ * the Free Software Foundation; either version 2 of the License, or
1073+ * (at your option) any later version.
1074+ *
1075+ * This program is distributed in the hope that it will be useful,
1076+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1077+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1078+ * GNU General Public License for more details.
1079+ *
1080+ * You should have received a copy of the GNU General Public License
1081+ * along with this program; if not, write to the Free Software
1082+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1083+ */
1084+
1085+#include <linux/kernel.h>
1086+#include <linux/init.h>
1087+#include <linux/platform_device.h>
1088+#include <linux/ata_platform.h>
1089+#include <linux/mv643xx_eth.h>
1090+#include <linux/input.h>
1091+#include <linux/gpio.h>
1092+#include <linux/gpio_keys.h>
1093+#include <linux/leds.h>
1094+#include <linux/gpio-fan.h>
1095+#include <asm/mach-types.h>
1096+#include <asm/mach/arch.h>
1097+#include <mach/kirkwood.h>
1098+#include <linux/platform_data/leds-kirkwood-ns2.h>
1099+#include "common.h"
1100+#include "mpp.h"
1101+#include "lacie_v2-common.h"
1102+
1103+/*****************************************************************************
1104+ * Ethernet
1105+ ****************************************************************************/
1106+
1107+static struct mv643xx_eth_platform_data netspace_v2_ge00_data = {
1108+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
1109+};
1110+
1111+/*****************************************************************************
1112+ * SATA
1113+ ****************************************************************************/
1114+
1115+static struct mv_sata_platform_data netspace_v2_sata_data = {
1116+ .n_ports = 2,
1117+};
1118+
1119+/*****************************************************************************
1120+ * GPIO keys
1121+ ****************************************************************************/
1122+
1123+#define NETSPACE_V2_PUSH_BUTTON 32
1124+
1125+static struct gpio_keys_button netspace_v2_buttons[] = {
1126+ [0] = {
1127+ .code = KEY_POWER,
1128+ .gpio = NETSPACE_V2_PUSH_BUTTON,
1129+ .desc = "Power push button",
1130+ .active_low = 0,
1131+ },
1132+};
1133+
1134+static struct gpio_keys_platform_data netspace_v2_button_data = {
1135+ .buttons = netspace_v2_buttons,
1136+ .nbuttons = ARRAY_SIZE(netspace_v2_buttons),
1137+};
1138+
1139+static struct platform_device netspace_v2_gpio_buttons = {
1140+ .name = "gpio-keys",
1141+ .id = -1,
1142+ .dev = {
1143+ .platform_data = &netspace_v2_button_data,
1144+ },
1145+};
1146+
1147+/*****************************************************************************
1148+ * GPIO LEDs
1149+ ****************************************************************************/
1150+
1151+#define NETSPACE_V2_GPIO_RED_LED 12
1152+
1153+static struct gpio_led netspace_v2_gpio_led_pins[] = {
1154+ {
1155+ .name = "ns_v2:red:fail",
1156+ .gpio = NETSPACE_V2_GPIO_RED_LED,
1157+ },
1158+};
1159+
1160+static struct gpio_led_platform_data netspace_v2_gpio_leds_data = {
1161+ .num_leds = ARRAY_SIZE(netspace_v2_gpio_led_pins),
1162+ .leds = netspace_v2_gpio_led_pins,
1163+};
1164+
1165+static struct platform_device netspace_v2_gpio_leds = {
1166+ .name = "leds-gpio",
1167+ .id = -1,
1168+ .dev = {
1169+ .platform_data = &netspace_v2_gpio_leds_data,
1170+ },
1171+};
1172+
1173+/*****************************************************************************
1174+ * Dual-GPIO CPLD LEDs
1175+ ****************************************************************************/
1176+
1177+#define NETSPACE_V2_GPIO_BLUE_LED_SLOW 29
1178+#define NETSPACE_V2_GPIO_BLUE_LED_CMD 30
1179+
1180+static struct ns2_led netspace_v2_led_pins[] = {
1181+ {
1182+ .name = "ns_v2:blue:sata",
1183+ .cmd = NETSPACE_V2_GPIO_BLUE_LED_CMD,
1184+ .slow = NETSPACE_V2_GPIO_BLUE_LED_SLOW,
1185+ },
1186+};
1187+
1188+static struct ns2_led_platform_data netspace_v2_leds_data = {
1189+ .num_leds = ARRAY_SIZE(netspace_v2_led_pins),
1190+ .leds = netspace_v2_led_pins,
1191+};
1192+
1193+static struct platform_device netspace_v2_leds = {
1194+ .name = "leds-ns2",
1195+ .id = -1,
1196+ .dev = {
1197+ .platform_data = &netspace_v2_leds_data,
1198+ },
1199+};
1200+
1201+/*****************************************************************************
1202+ * GPIO fan
1203+ ****************************************************************************/
1204+
1205+/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm@12v */
1206+static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
1207+ { 0, 0 },
1208+ { 1500, 15 },
1209+ { 1700, 14 },
1210+ { 1800, 13 },
1211+ { 2100, 12 },
1212+ { 3100, 11 },
1213+ { 3300, 10 },
1214+ { 4300, 9 },
1215+ { 5500, 8 },
1216+};
1217+
1218+static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
1219+
1220+static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
1221+ .gpio = 25,
1222+ .active_low = 1,
1223+};
1224+
1225+static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
1226+ .num_ctrl = ARRAY_SIZE(netspace_max_v2_fan_ctrl),
1227+ .ctrl = netspace_max_v2_fan_ctrl,
1228+ .alarm = &netspace_max_v2_fan_alarm,
1229+ .num_speed = ARRAY_SIZE(netspace_max_v2_fan_speed),
1230+ .speed = netspace_max_v2_fan_speed,
1231+};
1232+
1233+static struct platform_device netspace_max_v2_gpio_fan = {
1234+ .name = "gpio-fan",
1235+ .id = -1,
1236+ .dev = {
1237+ .platform_data = &netspace_max_v2_fan_data,
1238+ },
1239+};
1240+
1241+/*****************************************************************************
1242+ * General Setup
1243+ ****************************************************************************/
1244+
1245+static unsigned int netspace_v2_mpp_config[] __initdata = {
1246+ MPP0_SPI_SCn,
1247+ MPP1_SPI_MOSI,
1248+ MPP2_SPI_SCK,
1249+ MPP3_SPI_MISO,
1250+ MPP4_NF_IO6,
1251+ MPP5_NF_IO7,
1252+ MPP6_SYSRST_OUTn,
1253+ MPP7_GPO, /* Fan speed (bit 1) */
1254+ MPP8_TW0_SDA,
1255+ MPP9_TW0_SCK,
1256+ MPP10_UART0_TXD,
1257+ MPP11_UART0_RXD,
1258+ MPP12_GPO, /* Red led */
1259+ MPP14_GPIO, /* USB fuse */
1260+ MPP16_GPIO, /* SATA 0 power */
1261+ MPP17_GPIO, /* SATA 1 power */
1262+ MPP18_NF_IO0,
1263+ MPP19_NF_IO1,
1264+ MPP20_SATA1_ACTn,
1265+ MPP21_SATA0_ACTn,
1266+ MPP22_GPIO, /* Fan speed (bit 0) */
1267+ MPP23_GPIO, /* Fan power */
1268+ MPP24_GPIO, /* USB mode select */
1269+ MPP25_GPIO, /* Fan rotation fail */
1270+ MPP26_GPIO, /* USB device vbus */
1271+ MPP28_GPIO, /* USB enable host vbus */
1272+ MPP29_GPIO, /* Blue led (slow register) */
1273+ MPP30_GPIO, /* Blue led (command register) */
1274+ MPP31_GPIO, /* Board power off */
1275+ MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */
1276+ MPP33_GPO, /* Fan speed (bit 2) */
1277+ 0
1278+};
1279+
1280+#define NETSPACE_V2_GPIO_POWER_OFF 31
1281+
1282+static void netspace_v2_power_off(void)
1283+{
1284+ gpio_set_value(NETSPACE_V2_GPIO_POWER_OFF, 1);
1285+}
1286+
1287+static void __init netspace_v2_init(void)
1288+{
1289+ /*
1290+ * Basic setup. Needs to be called early.
1291+ */
1292+ kirkwood_init();
1293+ kirkwood_mpp_conf(netspace_v2_mpp_config);
1294+
1295+ if (machine_is_netspace_max_v2())
1296+ lacie_v2_hdd_power_init(2);
1297+ else
1298+ lacie_v2_hdd_power_init(1);
1299+
1300+ kirkwood_ehci_init();
1301+ kirkwood_ge00_init(&netspace_v2_ge00_data);
1302+ kirkwood_sata_init(&netspace_v2_sata_data);
1303+ kirkwood_uart0_init();
1304+ lacie_v2_register_flash();
1305+ lacie_v2_register_i2c_devices();
1306+
1307+ platform_device_register(&netspace_v2_leds);
1308+ platform_device_register(&netspace_v2_gpio_leds);
1309+ platform_device_register(&netspace_v2_gpio_buttons);
1310+ if (machine_is_netspace_max_v2())
1311+ platform_device_register(&netspace_max_v2_gpio_fan);
1312+
1313+ if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
1314+ gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
1315+ pm_power_off = netspace_v2_power_off;
1316+ else
1317+ pr_err("netspace_v2: failed to configure power-off GPIO\n");
1318+}
1319+
1320+#ifdef CONFIG_MACH_NETSPACE_V2
1321+MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
1322+ .atag_offset = 0x100,
1323+ .init_machine = netspace_v2_init,
1324+ .map_io = kirkwood_map_io,
1325+ .init_early = kirkwood_init_early,
1326+ .init_irq = kirkwood_init_irq,
1327+ .init_time = kirkwood_timer_init,
1328+ .restart = kirkwood_restart,
1329+MACHINE_END
1330+#endif
1331+
1332+#ifdef CONFIG_MACH_INETSPACE_V2
1333+MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
1334+ .atag_offset = 0x100,
1335+ .init_machine = netspace_v2_init,
1336+ .map_io = kirkwood_map_io,
1337+ .init_early = kirkwood_init_early,
1338+ .init_irq = kirkwood_init_irq,
1339+ .init_time = kirkwood_timer_init,
1340+ .restart = kirkwood_restart,
1341+MACHINE_END
1342+#endif
1343+
1344+#ifdef CONFIG_MACH_NETSPACE_MAX_V2
1345+MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
1346+ .atag_offset = 0x100,
1347+ .init_machine = netspace_v2_init,
1348+ .map_io = kirkwood_map_io,
1349+ .init_early = kirkwood_init_early,
1350+ .init_irq = kirkwood_init_irq,
1351+ .init_time = kirkwood_timer_init,
1352+ .restart = kirkwood_restart,
1353+MACHINE_END
1354+#endif
1355diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-3.14.22/arch/arm/mach-kirkwood/sheevaplug-setup.c
1356--- linux-3.14.22.org/arch/arm/mach-kirkwood/sheevaplug-setup.c 1970-01-01 01:00:00.000000000 +0100
bcd7a757 1357+++ linux-3.14.22/arch/arm/mach-kirkwood/sheevaplug-setup.c 2014-11-05 22:07:58.868714499 +0100
21147a00
AF
1358@@ -0,0 +1,161 @@
1359+/*
1360+ * arch/arm/mach-kirkwood/sheevaplug-setup.c
1361+ *
1362+ * Marvell SheevaPlug Reference Board Setup
1363+ *
1364+ * This file is licensed under the terms of the GNU General Public
1365+ * License version 2. This program is licensed "as is" without any
1366+ * warranty of any kind, whether express or implied.
1367+ */
1368+
1369+#include <linux/kernel.h>
1370+#include <linux/init.h>
1371+#include <linux/platform_device.h>
1372+#include <linux/ata_platform.h>
1373+#include <linux/mtd/partitions.h>
1374+#include <linux/mv643xx_eth.h>
1375+#include <linux/gpio.h>
1376+#include <linux/leds.h>
1377+#include <asm/mach-types.h>
1378+#include <asm/mach/arch.h>
1379+#include <mach/kirkwood.h>
1380+#include <linux/platform_data/mmc-mvsdio.h>
1381+#include "common.h"
1382+#include "mpp.h"
1383+
1384+static struct mtd_partition sheevaplug_nand_parts[] = {
1385+ {
1386+ .name = "u-boot",
1387+ .offset = 0,
1388+ .size = SZ_1M
1389+ }, {
1390+ .name = "uImage",
1391+ .offset = MTDPART_OFS_NXTBLK,
1392+ .size = SZ_4M
1393+ }, {
1394+ .name = "root",
1395+ .offset = MTDPART_OFS_NXTBLK,
1396+ .size = MTDPART_SIZ_FULL
1397+ },
1398+};
1399+
1400+static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
1401+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
1402+};
1403+
1404+static struct mv_sata_platform_data sheeva_esata_sata_data = {
1405+ .n_ports = 2,
1406+};
1407+
1408+static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
1409+ /* unfortunately the CD signal has not been connected */
1410+};
1411+
1412+static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
1413+ .gpio_write_protect = 44, /* MPP44 used as SD write protect */
1414+ .gpio_card_detect = 47, /* MPP47 used as SD card detect */
1415+};
1416+
1417+static struct gpio_led sheevaplug_led_pins[] = {
1418+ {
1419+ .name = "plug:red:misc",
1420+ .default_trigger = "none",
1421+ .gpio = 46,
1422+ .active_low = 1,
1423+ },
1424+ {
1425+ .name = "plug:green:health",
1426+ .default_trigger = "default-on",
1427+ .gpio = 49,
1428+ .active_low = 1,
1429+ },
1430+};
1431+
1432+static struct gpio_led_platform_data sheevaplug_led_data = {
1433+ .leds = sheevaplug_led_pins,
1434+ .num_leds = ARRAY_SIZE(sheevaplug_led_pins),
1435+};
1436+
1437+static struct platform_device sheevaplug_leds = {
1438+ .name = "leds-gpio",
1439+ .id = -1,
1440+ .dev = {
1441+ .platform_data = &sheevaplug_led_data,
1442+ }
1443+};
1444+
1445+static unsigned int sheevaplug_mpp_config[] __initdata = {
1446+ MPP29_GPIO, /* USB Power Enable */
1447+ MPP46_GPIO, /* LED Red */
1448+ MPP49_GPIO, /* LED */
1449+ 0
1450+};
1451+
1452+static unsigned int sheeva_esata_mpp_config[] __initdata = {
1453+ MPP29_GPIO, /* USB Power Enable */
1454+ MPP44_GPIO, /* SD Write Protect */
1455+ MPP47_GPIO, /* SD Card Detect */
1456+ MPP49_GPIO, /* LED Green */
1457+ 0
1458+};
1459+
1460+static void __init sheevaplug_init(void)
1461+{
1462+ /*
1463+ * Basic setup. Needs to be called early.
1464+ */
1465+ kirkwood_init();
1466+
1467+ /* setup gpio pin select */
1468+ if (machine_is_esata_sheevaplug())
1469+ kirkwood_mpp_conf(sheeva_esata_mpp_config);
1470+ else
1471+ kirkwood_mpp_conf(sheevaplug_mpp_config);
1472+
1473+ kirkwood_uart0_init();
1474+ kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
1475+
1476+ if (gpio_request(29, "USB Power Enable") != 0 ||
1477+ gpio_direction_output(29, 1) != 0)
1478+ pr_err("can't set up GPIO 29 (USB Power Enable)\n");
1479+ kirkwood_ehci_init();
1480+
1481+ kirkwood_ge00_init(&sheevaplug_ge00_data);
1482+
1483+ /* honor lower power consumption for plugs with out eSATA */
1484+ if (machine_is_esata_sheevaplug())
1485+ kirkwood_sata_init(&sheeva_esata_sata_data);
1486+
1487+ /* enable sd wp and sd cd on plugs with esata */
1488+ if (machine_is_esata_sheevaplug())
1489+ kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
1490+ else
1491+ kirkwood_sdio_init(&sheevaplug_mvsdio_data);
1492+
1493+ platform_device_register(&sheevaplug_leds);
1494+}
1495+
1496+#ifdef CONFIG_MACH_SHEEVAPLUG
1497+MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
1498+ /* Maintainer: shadi Ammouri <shadi@marvell.com> */
1499+ .atag_offset = 0x100,
1500+ .init_machine = sheevaplug_init,
1501+ .map_io = kirkwood_map_io,
1502+ .init_early = kirkwood_init_early,
1503+ .init_irq = kirkwood_init_irq,
1504+ .init_time = kirkwood_timer_init,
1505+ .restart = kirkwood_restart,
1506+MACHINE_END
1507+#endif
1508+
1509+#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG
1510+MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
1511+ .atag_offset = 0x100,
1512+ .init_machine = sheevaplug_init,
1513+ .map_io = kirkwood_map_io,
1514+ .init_early = kirkwood_init_early,
1515+ .init_irq = kirkwood_init_irq,
1516+ .init_time = kirkwood_timer_init,
1517+ .restart = kirkwood_restart,
1518+MACHINE_END
1519+#endif
1520diff -Naur linux-3.14.22.org/arch/arm/tools/mach-types linux-3.14.22/arch/arm/tools/mach-types
1521--- linux-3.14.22.org/arch/arm/tools/mach-types 2014-10-15 08:42:04.000000000 +0200
bcd7a757 1522+++ linux-3.14.22/arch/arm/tools/mach-types 2014-11-05 22:07:58.868714499 +0100
21147a00
AF
1523@@ -447,6 +447,7 @@
1524 smartq5 MACH_SMARTQ5 SMARTQ5 2534
1525 davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
1526 mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
1527+guruplug MACH_GURUPLUG GURUPLUG 2601
1528 capc7117 MACH_CAPC7117 CAPC7117 2612
1529 icontrol MACH_ICONTROL ICONTROL 2624
1530 gplugd MACH_GPLUGD GPLUGD 2625
1531@@ -454,7 +455,7 @@
1532 mx23evk MACH_MX23EVK MX23EVK 2629
1533 ap4evb MACH_AP4EVB AP4EVB 2630
1534 mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650
1535-guruplug MACH_GURUPLUG GURUPLUG 2659
1536+dreamplug1 MACH_DREAMPLUG1 DREAMPLUG1 2659
1537 spear310 MACH_SPEAR310 SPEAR310 2660
1538 spear320 MACH_SPEAR320 SPEAR320 2661
1539 aquila MACH_AQUILA AQUILA 2676
1540@@ -491,6 +492,7 @@
1541 t5325 MACH_T5325 T5325 2846
1542 income MACH_INCOME INCOME 2849
1543 goni MACH_GONI GONI 2862
1544+iconnect MACH_ICONNECT ICONNECT 2870
1545 bv07 MACH_BV07 BV07 2882
1546 openrd_ultimate MACH_OPENRD_ULTIMATE OPENRD_ULTIMATE 2884
1547 devixp MACH_DEVIXP DEVIXP 2885
1548@@ -520,6 +522,7 @@
1549 vpr200 MACH_VPR200 VPR200 3087
1550 torbreck MACH_TORBRECK TORBRECK 3090
1551 prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
1552+nas6210 MACH_NAS6210 NAS6210 3104
1553 paz00 MACH_PAZ00 PAZ00 3128
1554 acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
1555 ag5evm MACH_AG5EVM AG5EVM 3189
1556@@ -544,6 +547,7 @@
1557 nspire MACH_NSPIRE NSPIRE 3503
1558 nokia_rm696 MACH_NOKIA_RM696 NOKIA_RM696 3522
1559 mikrap_x168 MACH_MIKRAP_X168 MIKRAP_X168 3543
1560+dreamplug MACH_DREAMPLUG DREAMPLUG 3550
1561 deto_macarm9 MACH_DETO_MACARM9 DETO_MACARM9 3568
1562 m28evk MACH_M28EVK M28EVK 3613
1563 kota2 MACH_KOTA2 KOTA2 3616