]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/linux-3.14.22-kirkwood_legacy_boot.patch
Merge remote-tracking branch 'origin/seventeen' into seventeen
[ipfire-2.x.git] / src / patches / linux-3.14.22-kirkwood_legacy_boot.patch
1 diff -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
3 +++ linux-3.14.22/arch/arm/mach-kirkwood/db88f6281-bp-setup.c 2014-10-15 08:32:29.000000000 +0200
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
113 diff -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
115 +++ linux-3.14.22/arch/arm/mach-kirkwood/dockstar-setup.c 2014-10-15 08:32:29.000000000 +0200
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
228 diff -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
230 +++ linux-3.14.22/arch/arm/mach-kirkwood/dreamplug-setup.c 2014-11-04 00:25:48.383688273 +0100
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
383 diff -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
385 +++ linux-3.14.22/arch/arm/mach-kirkwood/guruplug-setup.c 2014-11-04 00:25:48.383688273 +0100
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
522 diff -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
524 +++ linux-3.14.22/arch/arm/mach-kirkwood/iconnect-setup.c 2014-11-04 00:25:48.383688273 +0100
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
740 diff -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
742 +++ linux-3.14.22/arch/arm/mach-kirkwood/Kconfig 2014-11-04 01:10:52.950526196 +0100
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
841 diff -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
843 +++ linux-3.14.22/arch/arm/mach-kirkwood/Makefile 2014-11-04 01:11:13.009019440 +0100
844 @@ -2,6 +2,14 @@
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
852 +obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o
853 +obj-$(CONFIG_MACH_NETSPACE_MAX_V2) += netspace_v2-setup.o lacie_v2-common.o
854 +obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o
855 +obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
856 obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
857 obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
858 obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
859 @@ -11,6 +19,8 @@
860 obj-$(CONFIG_MACH_T5325) += t5325-setup.o
861 obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
862 obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
863 +obj-$(CONFIG_MACH_ICONNECT) += iconnect-setup.o
864 +obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
865
866 obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
867 obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
868 diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/nas6210-setup.c linux-3.14.22/arch/arm/mach-kirkwood/nas6210-setup.c
869 --- linux-3.14.22.org/arch/arm/mach-kirkwood/nas6210-setup.c 1970-01-01 01:00:00.000000000 +0100
870 +++ linux-3.14.22/arch/arm/mach-kirkwood/nas6210-setup.c 2014-11-04 00:25:48.393687522 +0100
871 @@ -0,0 +1,185 @@
872 +/*
873 + * arch/arm/mach-kirkwood/nas6210-setup.c
874 + *
875 + * Raidsonic ICYBOX NAS6210 and 6220 Board Setup
876 + *
877 + * This file is licensed under the terms of the GNU General Public
878 + * License version 2. This program is licensed "as is" without any
879 + * warranty of any kind, whether express or implied.
880 + */
881 +
882 +#include <linux/kernel.h>
883 +#include <linux/init.h>
884 +#include <linux/platform_device.h>
885 +#include <linux/mtd/mtd.h>
886 +#include <linux/mtd/partitions.h>
887 +#include <linux/ata_platform.h>
888 +#include <linux/mv643xx_eth.h>
889 +#include <linux/gpio.h>
890 +#include <linux/gpio_keys.h>
891 +#include <linux/i2c.h>
892 +#include <linux/input.h>
893 +#include <linux/leds.h>
894 +#include <asm/mach-types.h>
895 +#include <asm/mach/arch.h>
896 +#include <mach/kirkwood.h>
897 +#include "common.h"
898 +#include "mpp.h"
899 +
900 +#define NAS6210_GPIO_POWER_OFF 24
901 +
902 +static struct mtd_partition nas6210_nand_parts[] = {
903 + {
904 + .name = "u-boot",
905 + .offset = 0,
906 + .size = SZ_1M,
907 + .mask_flags = MTD_WRITEABLE, /* read only */
908 + }, {
909 + .name = "uImage",
910 + .offset = MTDPART_OFS_NXTBLK,
911 + .size = (SZ_1M*6),
912 + }, {
913 + .name = "root",
914 + .offset = MTDPART_OFS_NXTBLK,
915 + .size = MTDPART_SIZ_FULL,
916 + },
917 +};
918 +
919 +static struct mv643xx_eth_platform_data nas6210_ge00_data = {
920 + .phy_addr = MV643XX_ETH_PHY_ADDR(8),
921 +};
922 +
923 +static struct mv_sata_platform_data nas6210_sata_data = {
924 + .n_ports = 2,
925 +};
926 +
927 +static struct gpio_led nas6210_led_pins[] = {
928 + {
929 + .name = "nas6210:green:power",
930 + .default_trigger = "default-on",
931 + .gpio = 25,
932 + .active_low = 0,
933 + },
934 + {
935 + .name = "nas6210:red:power",
936 + .default_trigger = "none",
937 + .gpio = 22,
938 + .active_low = 0,
939 + },
940 + {
941 + .name = "nas6210:red:usb_copy",
942 + .default_trigger = "none",
943 + .gpio = 27,
944 + .active_low = 0,
945 + },
946 +};
947 +
948 +static struct gpio_led_platform_data nas6210_led_data = {
949 + .leds = nas6210_led_pins,
950 + .num_leds = ARRAY_SIZE(nas6210_led_pins),
951 +};
952 +
953 +static struct platform_device nas6210_leds = {
954 + .name = "leds-gpio",
955 + .id = -1,
956 + .dev = {
957 + .platform_data = &nas6210_led_data,
958 + }
959 +};
960 +
961 +static struct gpio_keys_button nas6210_buttons[] = {
962 + {
963 + .code = KEY_COPY,
964 + .gpio = 29,
965 + .desc = "USB Copy",
966 + .active_low = 1,
967 + },
968 + {
969 + .code = KEY_RESTART,
970 + .gpio = 28,
971 + .desc = "Reset",
972 + .active_low = 1,
973 + },
974 +};
975 +
976 +static struct gpio_keys_platform_data nas6210_button_data = {
977 + .buttons = nas6210_buttons,
978 + .nbuttons = ARRAY_SIZE(nas6210_buttons),
979 +};
980 +
981 +static struct platform_device nas6210_button_device = {
982 + .name = "gpio-keys",
983 + .id = -1,
984 + .num_resources = 0,
985 + .dev = {
986 + .platform_data = &nas6210_button_data,
987 + }
988 +};
989 +
990 +static unsigned int nas6210_mpp_config[] __initdata = {
991 + MPP0_NF_IO2,
992 + MPP1_NF_IO3,
993 + MPP2_NF_IO4,
994 + MPP3_NF_IO5,
995 + MPP4_NF_IO6,
996 + MPP5_NF_IO7,
997 + MPP18_NF_IO0,
998 + MPP19_NF_IO1,
999 + MPP22_GPIO, /* Power LED red */
1000 + MPP24_GPIO, /* Power off */
1001 + MPP25_GPIO, /* Power LED green */
1002 + MPP27_GPIO, /* USB transfer LED */
1003 + MPP28_GPIO, /* Reset button */
1004 + MPP29_GPIO, /* USB Copy button */
1005 + 0
1006 +};
1007 +
1008 +void nas6210_power_off(void)
1009 +{
1010 + gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
1011 + while(1);
1012 +}
1013 +
1014 +static void __init nas6210_init(void)
1015 +{
1016 + /*
1017 + * Basic setup. Needs to be called early.
1018 + */
1019 + kirkwood_init();
1020 + kirkwood_mpp_conf(nas6210_mpp_config);
1021 +
1022 + kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
1023 + kirkwood_ehci_init();
1024 + kirkwood_ge00_init(&nas6210_ge00_data);
1025 + kirkwood_sata_init(&nas6210_sata_data);
1026 + kirkwood_uart0_init();
1027 + platform_device_register(&nas6210_leds);
1028 + platform_device_register(&nas6210_button_device);
1029 +
1030 + if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
1031 + gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
1032 + pm_power_off = nas6210_power_off;
1033 +
1034 + else
1035 + pr_err("nas6210: failed to configure power-off gpio pin");
1036 +}
1037 +
1038 +static int __init nas6210_pci_init(void)
1039 +{
1040 + if (machine_is_nas6210()) {
1041 + kirkwood_pcie_init(KW_PCIE0);
1042 + }
1043 + return 0;
1044 +}
1045 +subsys_initcall(nas6210_pci_init);
1046 +
1047 +MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS62x0")
1048 + /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
1049 + .atag_offset = 0x00000100,
1050 + .init_machine = nas6210_init,
1051 + .map_io = kirkwood_map_io,
1052 + .init_early = kirkwood_init_early,
1053 + .init_irq = kirkwood_init_irq,
1054 + .init_time = kirkwood_timer_init,
1055 + .restart = kirkwood_restart,
1056 +MACHINE_END
1057 diff -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
1058 --- linux-3.14.22.org/arch/arm/mach-kirkwood/netspace_v2-setup.c 1970-01-01 01:00:00.000000000 +0100
1059 +++ linux-3.14.22/arch/arm/mach-kirkwood/netspace_v2-setup.c 2014-10-15 08:32:29.000000000 +0200
1060 @@ -0,0 +1,293 @@
1061 +/*
1062 + * arch/arm/mach-kirkwood/netspace_v2-setup.c
1063 + *
1064 + * LaCie Network Space v2 board setup
1065 + *
1066 + * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
1067 + * Copyright (C) 2009 Benoît Canet <benoit.canet@gmail.com>
1068 + *
1069 + * This program is free software; you can redistribute it and/or modify
1070 + * it under the terms of the GNU General Public License as published by
1071 + * the Free Software Foundation; either version 2 of the License, or
1072 + * (at your option) any later version.
1073 + *
1074 + * This program is distributed in the hope that it will be useful,
1075 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1076 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1077 + * GNU General Public License for more details.
1078 + *
1079 + * You should have received a copy of the GNU General Public License
1080 + * along with this program; if not, write to the Free Software
1081 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1082 + */
1083 +
1084 +#include <linux/kernel.h>
1085 +#include <linux/init.h>
1086 +#include <linux/platform_device.h>
1087 +#include <linux/ata_platform.h>
1088 +#include <linux/mv643xx_eth.h>
1089 +#include <linux/input.h>
1090 +#include <linux/gpio.h>
1091 +#include <linux/gpio_keys.h>
1092 +#include <linux/leds.h>
1093 +#include <linux/gpio-fan.h>
1094 +#include <asm/mach-types.h>
1095 +#include <asm/mach/arch.h>
1096 +#include <mach/kirkwood.h>
1097 +#include <linux/platform_data/leds-kirkwood-ns2.h>
1098 +#include "common.h"
1099 +#include "mpp.h"
1100 +#include "lacie_v2-common.h"
1101 +
1102 +/*****************************************************************************
1103 + * Ethernet
1104 + ****************************************************************************/
1105 +
1106 +static struct mv643xx_eth_platform_data netspace_v2_ge00_data = {
1107 + .phy_addr = MV643XX_ETH_PHY_ADDR(8),
1108 +};
1109 +
1110 +/*****************************************************************************
1111 + * SATA
1112 + ****************************************************************************/
1113 +
1114 +static struct mv_sata_platform_data netspace_v2_sata_data = {
1115 + .n_ports = 2,
1116 +};
1117 +
1118 +/*****************************************************************************
1119 + * GPIO keys
1120 + ****************************************************************************/
1121 +
1122 +#define NETSPACE_V2_PUSH_BUTTON 32
1123 +
1124 +static struct gpio_keys_button netspace_v2_buttons[] = {
1125 + [0] = {
1126 + .code = KEY_POWER,
1127 + .gpio = NETSPACE_V2_PUSH_BUTTON,
1128 + .desc = "Power push button",
1129 + .active_low = 0,
1130 + },
1131 +};
1132 +
1133 +static struct gpio_keys_platform_data netspace_v2_button_data = {
1134 + .buttons = netspace_v2_buttons,
1135 + .nbuttons = ARRAY_SIZE(netspace_v2_buttons),
1136 +};
1137 +
1138 +static struct platform_device netspace_v2_gpio_buttons = {
1139 + .name = "gpio-keys",
1140 + .id = -1,
1141 + .dev = {
1142 + .platform_data = &netspace_v2_button_data,
1143 + },
1144 +};
1145 +
1146 +/*****************************************************************************
1147 + * GPIO LEDs
1148 + ****************************************************************************/
1149 +
1150 +#define NETSPACE_V2_GPIO_RED_LED 12
1151 +
1152 +static struct gpio_led netspace_v2_gpio_led_pins[] = {
1153 + {
1154 + .name = "ns_v2:red:fail",
1155 + .gpio = NETSPACE_V2_GPIO_RED_LED,
1156 + },
1157 +};
1158 +
1159 +static struct gpio_led_platform_data netspace_v2_gpio_leds_data = {
1160 + .num_leds = ARRAY_SIZE(netspace_v2_gpio_led_pins),
1161 + .leds = netspace_v2_gpio_led_pins,
1162 +};
1163 +
1164 +static struct platform_device netspace_v2_gpio_leds = {
1165 + .name = "leds-gpio",
1166 + .id = -1,
1167 + .dev = {
1168 + .platform_data = &netspace_v2_gpio_leds_data,
1169 + },
1170 +};
1171 +
1172 +/*****************************************************************************
1173 + * Dual-GPIO CPLD LEDs
1174 + ****************************************************************************/
1175 +
1176 +#define NETSPACE_V2_GPIO_BLUE_LED_SLOW 29
1177 +#define NETSPACE_V2_GPIO_BLUE_LED_CMD 30
1178 +
1179 +static struct ns2_led netspace_v2_led_pins[] = {
1180 + {
1181 + .name = "ns_v2:blue:sata",
1182 + .cmd = NETSPACE_V2_GPIO_BLUE_LED_CMD,
1183 + .slow = NETSPACE_V2_GPIO_BLUE_LED_SLOW,
1184 + },
1185 +};
1186 +
1187 +static struct ns2_led_platform_data netspace_v2_leds_data = {
1188 + .num_leds = ARRAY_SIZE(netspace_v2_led_pins),
1189 + .leds = netspace_v2_led_pins,
1190 +};
1191 +
1192 +static struct platform_device netspace_v2_leds = {
1193 + .name = "leds-ns2",
1194 + .id = -1,
1195 + .dev = {
1196 + .platform_data = &netspace_v2_leds_data,
1197 + },
1198 +};
1199 +
1200 +/*****************************************************************************
1201 + * GPIO fan
1202 + ****************************************************************************/
1203 +
1204 +/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm@12v */
1205 +static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
1206 + { 0, 0 },
1207 + { 1500, 15 },
1208 + { 1700, 14 },
1209 + { 1800, 13 },
1210 + { 2100, 12 },
1211 + { 3100, 11 },
1212 + { 3300, 10 },
1213 + { 4300, 9 },
1214 + { 5500, 8 },
1215 +};
1216 +
1217 +static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
1218 +
1219 +static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
1220 + .gpio = 25,
1221 + .active_low = 1,
1222 +};
1223 +
1224 +static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
1225 + .num_ctrl = ARRAY_SIZE(netspace_max_v2_fan_ctrl),
1226 + .ctrl = netspace_max_v2_fan_ctrl,
1227 + .alarm = &netspace_max_v2_fan_alarm,
1228 + .num_speed = ARRAY_SIZE(netspace_max_v2_fan_speed),
1229 + .speed = netspace_max_v2_fan_speed,
1230 +};
1231 +
1232 +static struct platform_device netspace_max_v2_gpio_fan = {
1233 + .name = "gpio-fan",
1234 + .id = -1,
1235 + .dev = {
1236 + .platform_data = &netspace_max_v2_fan_data,
1237 + },
1238 +};
1239 +
1240 +/*****************************************************************************
1241 + * General Setup
1242 + ****************************************************************************/
1243 +
1244 +static unsigned int netspace_v2_mpp_config[] __initdata = {
1245 + MPP0_SPI_SCn,
1246 + MPP1_SPI_MOSI,
1247 + MPP2_SPI_SCK,
1248 + MPP3_SPI_MISO,
1249 + MPP4_NF_IO6,
1250 + MPP5_NF_IO7,
1251 + MPP6_SYSRST_OUTn,
1252 + MPP7_GPO, /* Fan speed (bit 1) */
1253 + MPP8_TW0_SDA,
1254 + MPP9_TW0_SCK,
1255 + MPP10_UART0_TXD,
1256 + MPP11_UART0_RXD,
1257 + MPP12_GPO, /* Red led */
1258 + MPP14_GPIO, /* USB fuse */
1259 + MPP16_GPIO, /* SATA 0 power */
1260 + MPP17_GPIO, /* SATA 1 power */
1261 + MPP18_NF_IO0,
1262 + MPP19_NF_IO1,
1263 + MPP20_SATA1_ACTn,
1264 + MPP21_SATA0_ACTn,
1265 + MPP22_GPIO, /* Fan speed (bit 0) */
1266 + MPP23_GPIO, /* Fan power */
1267 + MPP24_GPIO, /* USB mode select */
1268 + MPP25_GPIO, /* Fan rotation fail */
1269 + MPP26_GPIO, /* USB device vbus */
1270 + MPP28_GPIO, /* USB enable host vbus */
1271 + MPP29_GPIO, /* Blue led (slow register) */
1272 + MPP30_GPIO, /* Blue led (command register) */
1273 + MPP31_GPIO, /* Board power off */
1274 + MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */
1275 + MPP33_GPO, /* Fan speed (bit 2) */
1276 + 0
1277 +};
1278 +
1279 +#define NETSPACE_V2_GPIO_POWER_OFF 31
1280 +
1281 +static void netspace_v2_power_off(void)
1282 +{
1283 + gpio_set_value(NETSPACE_V2_GPIO_POWER_OFF, 1);
1284 +}
1285 +
1286 +static void __init netspace_v2_init(void)
1287 +{
1288 + /*
1289 + * Basic setup. Needs to be called early.
1290 + */
1291 + kirkwood_init();
1292 + kirkwood_mpp_conf(netspace_v2_mpp_config);
1293 +
1294 + if (machine_is_netspace_max_v2())
1295 + lacie_v2_hdd_power_init(2);
1296 + else
1297 + lacie_v2_hdd_power_init(1);
1298 +
1299 + kirkwood_ehci_init();
1300 + kirkwood_ge00_init(&netspace_v2_ge00_data);
1301 + kirkwood_sata_init(&netspace_v2_sata_data);
1302 + kirkwood_uart0_init();
1303 + lacie_v2_register_flash();
1304 + lacie_v2_register_i2c_devices();
1305 +
1306 + platform_device_register(&netspace_v2_leds);
1307 + platform_device_register(&netspace_v2_gpio_leds);
1308 + platform_device_register(&netspace_v2_gpio_buttons);
1309 + if (machine_is_netspace_max_v2())
1310 + platform_device_register(&netspace_max_v2_gpio_fan);
1311 +
1312 + if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
1313 + gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
1314 + pm_power_off = netspace_v2_power_off;
1315 + else
1316 + pr_err("netspace_v2: failed to configure power-off GPIO\n");
1317 +}
1318 +
1319 +#ifdef CONFIG_MACH_NETSPACE_V2
1320 +MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
1321 + .atag_offset = 0x100,
1322 + .init_machine = netspace_v2_init,
1323 + .map_io = kirkwood_map_io,
1324 + .init_early = kirkwood_init_early,
1325 + .init_irq = kirkwood_init_irq,
1326 + .init_time = kirkwood_timer_init,
1327 + .restart = kirkwood_restart,
1328 +MACHINE_END
1329 +#endif
1330 +
1331 +#ifdef CONFIG_MACH_INETSPACE_V2
1332 +MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
1333 + .atag_offset = 0x100,
1334 + .init_machine = netspace_v2_init,
1335 + .map_io = kirkwood_map_io,
1336 + .init_early = kirkwood_init_early,
1337 + .init_irq = kirkwood_init_irq,
1338 + .init_time = kirkwood_timer_init,
1339 + .restart = kirkwood_restart,
1340 +MACHINE_END
1341 +#endif
1342 +
1343 +#ifdef CONFIG_MACH_NETSPACE_MAX_V2
1344 +MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
1345 + .atag_offset = 0x100,
1346 + .init_machine = netspace_v2_init,
1347 + .map_io = kirkwood_map_io,
1348 + .init_early = kirkwood_init_early,
1349 + .init_irq = kirkwood_init_irq,
1350 + .init_time = kirkwood_timer_init,
1351 + .restart = kirkwood_restart,
1352 +MACHINE_END
1353 +#endif
1354 diff -Naur linux-3.14.22.org/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-3.14.22/arch/arm/mach-kirkwood/sheevaplug-setup.c
1355 --- linux-3.14.22.org/arch/arm/mach-kirkwood/sheevaplug-setup.c 1970-01-01 01:00:00.000000000 +0100
1356 +++ linux-3.14.22/arch/arm/mach-kirkwood/sheevaplug-setup.c 2014-10-15 08:32:29.000000000 +0200
1357 @@ -0,0 +1,161 @@
1358 +/*
1359 + * arch/arm/mach-kirkwood/sheevaplug-setup.c
1360 + *
1361 + * Marvell SheevaPlug Reference Board Setup
1362 + *
1363 + * This file is licensed under the terms of the GNU General Public
1364 + * License version 2. This program is licensed "as is" without any
1365 + * warranty of any kind, whether express or implied.
1366 + */
1367 +
1368 +#include <linux/kernel.h>
1369 +#include <linux/init.h>
1370 +#include <linux/platform_device.h>
1371 +#include <linux/ata_platform.h>
1372 +#include <linux/mtd/partitions.h>
1373 +#include <linux/mv643xx_eth.h>
1374 +#include <linux/gpio.h>
1375 +#include <linux/leds.h>
1376 +#include <asm/mach-types.h>
1377 +#include <asm/mach/arch.h>
1378 +#include <mach/kirkwood.h>
1379 +#include <linux/platform_data/mmc-mvsdio.h>
1380 +#include "common.h"
1381 +#include "mpp.h"
1382 +
1383 +static struct mtd_partition sheevaplug_nand_parts[] = {
1384 + {
1385 + .name = "u-boot",
1386 + .offset = 0,
1387 + .size = SZ_1M
1388 + }, {
1389 + .name = "uImage",
1390 + .offset = MTDPART_OFS_NXTBLK,
1391 + .size = SZ_4M
1392 + }, {
1393 + .name = "root",
1394 + .offset = MTDPART_OFS_NXTBLK,
1395 + .size = MTDPART_SIZ_FULL
1396 + },
1397 +};
1398 +
1399 +static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
1400 + .phy_addr = MV643XX_ETH_PHY_ADDR(0),
1401 +};
1402 +
1403 +static struct mv_sata_platform_data sheeva_esata_sata_data = {
1404 + .n_ports = 2,
1405 +};
1406 +
1407 +static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
1408 + /* unfortunately the CD signal has not been connected */
1409 +};
1410 +
1411 +static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
1412 + .gpio_write_protect = 44, /* MPP44 used as SD write protect */
1413 + .gpio_card_detect = 47, /* MPP47 used as SD card detect */
1414 +};
1415 +
1416 +static struct gpio_led sheevaplug_led_pins[] = {
1417 + {
1418 + .name = "plug:red:misc",
1419 + .default_trigger = "none",
1420 + .gpio = 46,
1421 + .active_low = 1,
1422 + },
1423 + {
1424 + .name = "plug:green:health",
1425 + .default_trigger = "default-on",
1426 + .gpio = 49,
1427 + .active_low = 1,
1428 + },
1429 +};
1430 +
1431 +static struct gpio_led_platform_data sheevaplug_led_data = {
1432 + .leds = sheevaplug_led_pins,
1433 + .num_leds = ARRAY_SIZE(sheevaplug_led_pins),
1434 +};
1435 +
1436 +static struct platform_device sheevaplug_leds = {
1437 + .name = "leds-gpio",
1438 + .id = -1,
1439 + .dev = {
1440 + .platform_data = &sheevaplug_led_data,
1441 + }
1442 +};
1443 +
1444 +static unsigned int sheevaplug_mpp_config[] __initdata = {
1445 + MPP29_GPIO, /* USB Power Enable */
1446 + MPP46_GPIO, /* LED Red */
1447 + MPP49_GPIO, /* LED */
1448 + 0
1449 +};
1450 +
1451 +static unsigned int sheeva_esata_mpp_config[] __initdata = {
1452 + MPP29_GPIO, /* USB Power Enable */
1453 + MPP44_GPIO, /* SD Write Protect */
1454 + MPP47_GPIO, /* SD Card Detect */
1455 + MPP49_GPIO, /* LED Green */
1456 + 0
1457 +};
1458 +
1459 +static void __init sheevaplug_init(void)
1460 +{
1461 + /*
1462 + * Basic setup. Needs to be called early.
1463 + */
1464 + kirkwood_init();
1465 +
1466 + /* setup gpio pin select */
1467 + if (machine_is_esata_sheevaplug())
1468 + kirkwood_mpp_conf(sheeva_esata_mpp_config);
1469 + else
1470 + kirkwood_mpp_conf(sheevaplug_mpp_config);
1471 +
1472 + kirkwood_uart0_init();
1473 + kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
1474 +
1475 + if (gpio_request(29, "USB Power Enable") != 0 ||
1476 + gpio_direction_output(29, 1) != 0)
1477 + pr_err("can't set up GPIO 29 (USB Power Enable)\n");
1478 + kirkwood_ehci_init();
1479 +
1480 + kirkwood_ge00_init(&sheevaplug_ge00_data);
1481 +
1482 + /* honor lower power consumption for plugs with out eSATA */
1483 + if (machine_is_esata_sheevaplug())
1484 + kirkwood_sata_init(&sheeva_esata_sata_data);
1485 +
1486 + /* enable sd wp and sd cd on plugs with esata */
1487 + if (machine_is_esata_sheevaplug())
1488 + kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
1489 + else
1490 + kirkwood_sdio_init(&sheevaplug_mvsdio_data);
1491 +
1492 + platform_device_register(&sheevaplug_leds);
1493 +}
1494 +
1495 +#ifdef CONFIG_MACH_SHEEVAPLUG
1496 +MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
1497 + /* Maintainer: shadi Ammouri <shadi@marvell.com> */
1498 + .atag_offset = 0x100,
1499 + .init_machine = sheevaplug_init,
1500 + .map_io = kirkwood_map_io,
1501 + .init_early = kirkwood_init_early,
1502 + .init_irq = kirkwood_init_irq,
1503 + .init_time = kirkwood_timer_init,
1504 + .restart = kirkwood_restart,
1505 +MACHINE_END
1506 +#endif
1507 +
1508 +#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG
1509 +MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
1510 + .atag_offset = 0x100,
1511 + .init_machine = sheevaplug_init,
1512 + .map_io = kirkwood_map_io,
1513 + .init_early = kirkwood_init_early,
1514 + .init_irq = kirkwood_init_irq,
1515 + .init_time = kirkwood_timer_init,
1516 + .restart = kirkwood_restart,
1517 +MACHINE_END
1518 +#endif
1519 diff -Naur linux-3.14.22.org/arch/arm/tools/mach-types linux-3.14.22/arch/arm/tools/mach-types
1520 --- linux-3.14.22.org/arch/arm/tools/mach-types 2014-10-15 08:42:04.000000000 +0200
1521 +++ linux-3.14.22/arch/arm/tools/mach-types 2014-11-04 00:25:48.393687522 +0100
1522 @@ -447,6 +447,7 @@
1523 smartq5 MACH_SMARTQ5 SMARTQ5 2534
1524 davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
1525 mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
1526 +guruplug MACH_GURUPLUG GURUPLUG 2601
1527 capc7117 MACH_CAPC7117 CAPC7117 2612
1528 icontrol MACH_ICONTROL ICONTROL 2624
1529 gplugd MACH_GPLUGD GPLUGD 2625
1530 @@ -454,7 +455,7 @@
1531 mx23evk MACH_MX23EVK MX23EVK 2629
1532 ap4evb MACH_AP4EVB AP4EVB 2630
1533 mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650
1534 -guruplug MACH_GURUPLUG GURUPLUG 2659
1535 +dreamplug1 MACH_DREAMPLUG1 DREAMPLUG1 2659
1536 spear310 MACH_SPEAR310 SPEAR310 2660
1537 spear320 MACH_SPEAR320 SPEAR320 2661
1538 aquila MACH_AQUILA AQUILA 2676
1539 @@ -491,6 +492,7 @@
1540 t5325 MACH_T5325 T5325 2846
1541 income MACH_INCOME INCOME 2849
1542 goni MACH_GONI GONI 2862
1543 +iconnect MACH_ICONNECT ICONNECT 2870
1544 bv07 MACH_BV07 BV07 2882
1545 openrd_ultimate MACH_OPENRD_ULTIMATE OPENRD_ULTIMATE 2884
1546 devixp MACH_DEVIXP DEVIXP 2885
1547 @@ -520,6 +522,7 @@
1548 vpr200 MACH_VPR200 VPR200 3087
1549 torbreck MACH_TORBRECK TORBRECK 3090
1550 prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
1551 +nas6210 MACH_NAS6210 NAS6210 3104
1552 paz00 MACH_PAZ00 PAZ00 3128
1553 acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
1554 ag5evm MACH_AG5EVM AG5EVM 3189
1555 @@ -544,6 +547,7 @@
1556 nspire MACH_NSPIRE NSPIRE 3503
1557 nokia_rm696 MACH_NOKIA_RM696 NOKIA_RM696 3522
1558 mikrap_x168 MACH_MIKRAP_X168 MIKRAP_X168 3543
1559 +dreamplug MACH_DREAMPLUG DREAMPLUG 3550
1560 deto_macarm9 MACH_DETO_MACARM9 DETO_MACARM9 3568
1561 m28evk MACH_M28EVK M28EVK 3613
1562 kota2 MACH_KOTA2 KOTA2 3616