]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/linux-2.6.32.45-arm_kirkwood_setups.patch
Add recently changed files to core update.
[people/teissler/ipfire-2.x.git] / src / patches / linux-2.6.32.45-arm_kirkwood_setups.patch
CommitLineData
1a1cdab0 1diff -Naur linux-2.6.32.45.org/arch/arm/mach-kirkwood/dreamplug-setup.c linux-2.6.32.45/arch/arm/mach-kirkwood/dreamplug-setup.c
c05f6df0
AF
2--- linux-2.6.32.45.org/arch/arm/mach-kirkwood/dreamplug-setup.c 1970-01-01 01:00:00.000000000 +0100
3+++ linux-2.6.32.45/arch/arm/mach-kirkwood/dreamplug-setup.c 2011-10-11 15:35:37.000000000 +0200
1a1cdab0
AF
4@@ -0,0 +1,140 @@
5+/*
6+ * arch/arm/mach-kirkwood/dreamplug-setup.c
7+ *
8+ * Marvell DreamPlug Reference Board Setup
9+ *
10+ * This file is licensed under the terms of the GNU General Public
11+ * License version 2. This program is licensed "as is" without any
12+ * warranty of any kind, whether express or implied.
13+ */
14+
15+#include <linux/kernel.h>
16+#include <linux/init.h>
17+#include <linux/platform_device.h>
18+#include <linux/mtd/partitions.h>
19+#include <linux/ata_platform.h>
20+#include <linux/mv643xx_eth.h>
21+#include <linux/gpio.h>
22+#include <linux/leds.h>
23+#include <linux/spi/flash.h>
24+#include <linux/spi/spi.h>
25+#include <linux/spi/orion_spi.h>
26+#include <asm/mach-types.h>
27+#include <asm/mach/arch.h>
28+#include <mach/kirkwood.h>
29+#include <plat/mvsdio.h>
30+#include "common.h"
31+#include "mpp.h"
32+
33+static const struct flash_platform_data dreamplug_spi_slave_data = {
34+ .type = "mx25l1606e",
35+};
36+
37+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
38+ {
39+ .modalias = "m25p80",
40+ .platform_data = &dreamplug_spi_slave_data,
41+ .irq = -1,
42+ .max_speed_hz = 50000000,
43+ .bus_num = 0,
44+ .chip_select = 0,
45+ },
46+};
47+
48+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
49+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
50+};
51+
52+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
53+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
54+};
55+
56+static struct mv_sata_platform_data dreamplug_sata_data = {
57+ .n_ports = 1,
58+};
59+
60+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
61+ /* unfortunately the CD signal has not been connected */
62+};
63+
64+static struct gpio_led dreamplug_led_pins[] = {
65+ {
66+ .name = "dreamplug:blue:bluetooth",
67+ .gpio = 47,
68+ .active_low = 1,
69+ },
70+ {
71+ .name = "dreamplug:green:wlan",
72+ .gpio = 48,
73+ .active_low = 1,
74+ },
75+ {
76+ .name = "dreamplug:blue:wlanap",
77+ .gpio = 49,
78+ .active_low = 1,
79+ },
80+};
81+
82+static struct gpio_led_platform_data dreamplug_led_data = {
83+ .leds = dreamplug_led_pins,
84+ .num_leds = ARRAY_SIZE(dreamplug_led_pins),
85+};
86+
87+static struct platform_device dreamplug_leds = {
88+ .name = "leds-gpio",
89+ .id = -1,
90+ .dev = {
91+ .platform_data = &dreamplug_led_data,
92+ }
93+};
94+
95+static unsigned int dreamplug_mpp_config[] __initdata = {
96+ MPP0_SPI_SCn,
97+ MPP1_SPI_MOSI,
98+ MPP2_SPI_SCK,
99+ MPP3_SPI_MISO,
100+ MPP4_GPIO,
101+ MPP5_GPO,
102+ MPP7_GPO,
103+ MPP18_GPO,
104+ MPP19_GPO,
105+ MPP47_GPIO, /* B_BLED */
106+ MPP48_GPIO, /* W_GLED */
107+ MPP49_GPIO, /* W_BLED */
108+ 0
109+};
110+
111+static void __init dreamplug_init(void)
112+{
113+ /*
114+ * Basic setup. Needs to be called early.
115+ */
116+ kirkwood_init();
117+ kirkwood_mpp_conf(dreamplug_mpp_config);
118+
119+ kirkwood_uart0_init();
120+
121+ spi_register_board_info(dreamplug_spi_slave_info,
122+ ARRAY_SIZE(dreamplug_spi_slave_info));
123+
124+ kirkwood_spi_init();
125+ kirkwood_ehci_init();
126+
127+ kirkwood_ge00_init(&dreamplug_ge00_data);
128+ kirkwood_ge01_init(&dreamplug_ge01_data);
129+ kirkwood_sata_init(&dreamplug_sata_data);
130+ kirkwood_sdio_init(&dreamplug_mvsdio_data);
131+
132+ platform_device_register(&dreamplug_leds);
133+}
134+
135+MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
136+ /* Maintainer: Siddarth Gore <gores <at> marvell.com> */
137+ .phys_io = KIRKWOOD_REGS_PHYS_BASE,
138+ .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
139+ .boot_params = 0x00000100,
140+ .init_machine = dreamplug_init,
141+ .map_io = kirkwood_map_io,
142+ .init_irq = kirkwood_init_irq,
143+ .timer = &kirkwood_timer,
144+MACHINE_END
c84d6e62 145diff -Naur linux-2.6.32.45.org/arch/arm/mach-kirkwood/guruplug-setup.c linux-2.6.32.45/arch/arm/mach-kirkwood/guruplug-setup.c
c05f6df0
AF
146--- linux-2.6.32.45.org/arch/arm/mach-kirkwood/guruplug-setup.c 1970-01-01 01:00:00.000000000 +0100
147+++ linux-2.6.32.45/arch/arm/mach-kirkwood/guruplug-setup.c 2011-10-11 15:35:37.000000000 +0200
c84d6e62
AF
148@@ -0,0 +1,131 @@
149+/*
150+ * arch/arm/mach-kirkwood/guruplug-setup.c
151+ *
152+ * Marvell GuruPlug Reference Board Setup
153+ *
154+ * This file is licensed under the terms of the GNU General Public
155+ * License version 2. This program is licensed "as is" without any
156+ * warranty of any kind, whether express or implied.
157+ */
158+
159+#include <linux/kernel.h>
160+#include <linux/init.h>
161+#include <linux/platform_device.h>
162+#include <linux/mtd/partitions.h>
163+#include <linux/ata_platform.h>
164+#include <linux/mv643xx_eth.h>
165+#include <linux/gpio.h>
166+#include <linux/leds.h>
167+#include <asm/mach-types.h>
168+#include <asm/mach/arch.h>
169+#include <mach/kirkwood.h>
170+#include <plat/mvsdio.h>
171+#include "common.h"
172+#include "mpp.h"
173+
174+static struct mtd_partition guruplug_nand_parts[] = {
175+ {
176+ .name = "u-boot",
177+ .offset = 0,
178+ .size = SZ_1M
179+ }, {
180+ .name = "uImage",
181+ .offset = MTDPART_OFS_NXTBLK,
182+ .size = SZ_4M
183+ }, {
184+ .name = "root",
185+ .offset = MTDPART_OFS_NXTBLK,
186+ .size = MTDPART_SIZ_FULL
187+ },
188+};
189+
190+static struct mv643xx_eth_platform_data guruplug_ge00_data = {
191+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
192+};
193+
194+static struct mv643xx_eth_platform_data guruplug_ge01_data = {
195+ .phy_addr = MV643XX_ETH_PHY_ADDR(1),
196+};
197+
198+static struct mv_sata_platform_data guruplug_sata_data = {
199+ .n_ports = 1,
200+};
201+
202+static struct mvsdio_platform_data guruplug_mvsdio_data = {
203+ /* unfortunately the CD signal has not been connected */
204+};
205+
206+static struct gpio_led guruplug_led_pins[] = {
207+ {
208+ .name = "guruplug:red:health",
209+ .gpio = 46,
210+ .active_low = 1,
211+ },
212+ {
213+ .name = "guruplug:green:health",
214+ .gpio = 47,
215+ .active_low = 1,
216+ },
217+ {
218+ .name = "guruplug:red:wmode",
219+ .gpio = 48,
220+ .active_low = 1,
221+ },
222+ {
223+ .name = "guruplug:green:wmode",
224+ .gpio = 49,
225+ .active_low = 1,
226+ },
227+};
228+
229+static struct gpio_led_platform_data guruplug_led_data = {
230+ .leds = guruplug_led_pins,
231+ .num_leds = ARRAY_SIZE(guruplug_led_pins),
232+};
233+
234+static struct platform_device guruplug_leds = {
235+ .name = "leds-gpio",
236+ .id = -1,
237+ .dev = {
238+ .platform_data = &guruplug_led_data,
239+ }
240+};
241+
242+static unsigned int guruplug_mpp_config[] __initdata = {
243+ MPP46_GPIO, /* M_RLED */
244+ MPP47_GPIO, /* M_GLED */
245+ MPP48_GPIO, /* B_RLED */
246+ MPP49_GPIO, /* B_GLED */
247+ 0
248+};
249+
250+static void __init guruplug_init(void)
251+{
252+ /*
253+ * Basic setup. Needs to be called early.
254+ */
255+ kirkwood_init();
256+ kirkwood_mpp_conf(guruplug_mpp_config);
257+
258+ kirkwood_uart0_init();
259+ kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
260+
261+ kirkwood_ehci_init();
262+ kirkwood_ge00_init(&guruplug_ge00_data);
263+ kirkwood_ge01_init(&guruplug_ge01_data);
264+ kirkwood_sata_init(&guruplug_sata_data);
265+ kirkwood_sdio_init(&guruplug_mvsdio_data);
266+
267+ platform_device_register(&guruplug_leds);
268+}
269+
270+MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
271+ /* Maintainer: Siddarth Gore <gores@marvell.com> */
272+ .phys_io = KIRKWOOD_REGS_PHYS_BASE,
273+ .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
274+ .boot_params = 0x00000100,
275+ .init_machine = guruplug_init,
276+ .map_io = kirkwood_map_io,
277+ .init_irq = kirkwood_init_irq,
278+ .timer = &kirkwood_timer,
279+MACHINE_END
1a1cdab0 280diff -Naur linux-2.6.32.45.org/arch/arm/mach-kirkwood/Kconfig linux-2.6.32.45/arch/arm/mach-kirkwood/Kconfig
c05f6df0
AF
281--- linux-2.6.32.45.org/arch/arm/mach-kirkwood/Kconfig 2011-08-16 03:57:37.000000000 +0200
282+++ linux-2.6.32.45/arch/arm/mach-kirkwood/Kconfig 2011-10-15 17:06:55.816070291 +0200
c84d6e62 283@@ -32,6 +32,18 @@
1a1cdab0
AF
284 Say 'Y' here if you want your kernel to support the
285 Marvell SheevaPlug Reference Board.
286
287+config MACH_DREAMPLUG
288+ bool "Marvell DreamPlug Reference Board"
289+ help
290+ Say 'Y' here if you want your kernel to support the
291+ Marvell DreamPlug Reference Board.
c84d6e62
AF
292+
293+config MACH_GURUPLUG
294+ bool "Marvell GuruPlug Reference Board"
295+ help
296+ Say 'Y' here if you want your kernel to support the
297+ Marvell GuruPlug Reference Board.
1a1cdab0
AF
298+
299 config MACH_TS219
300 bool "QNAP TS-119 and TS-219 Turbo NAS"
301 help
c05f6df0
AF
302@@ -44,6 +56,12 @@
303 Say 'Y' here if you want your kernel to support the
304 Marvell OpenRD Base Board.
305
306+config MACH_NAS6210
307+ bool "RaidSonic ICY BOX IB-NAS62x0"
308+ help
309+ Say 'Y' here if you want your kernel to support the
310+ RaidSonic ICY BOX IB-NAS62x0 device.
311+
312 endmenu
313
314 endif
1a1cdab0 315diff -Naur linux-2.6.32.45.org/arch/arm/mach-kirkwood/Makefile linux-2.6.32.45/arch/arm/mach-kirkwood/Makefile
c05f6df0
AF
316--- linux-2.6.32.45.org/arch/arm/mach-kirkwood/Makefile 2011-08-16 03:57:37.000000000 +0200
317+++ linux-2.6.32.45/arch/arm/mach-kirkwood/Makefile 2011-10-15 17:07:16.346068829 +0200
318@@ -5,7 +5,10 @@
1a1cdab0
AF
319 obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
320 obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
321 obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
c84d6e62 322+obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
1a1cdab0
AF
323+obj-$(CONFIG_MACH_DREAMPLUG) += dreamplug-setup.o
324 obj-$(CONFIG_MACH_TS219) += ts219-setup.o
325 obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
c05f6df0 326+obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
1a1cdab0 327
c05f6df0
AF
328 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
329diff -Naur linux-2.6.32.45.org/arch/arm/mach-kirkwood/nas6210-setup.c linux-2.6.32.45/arch/arm/mach-kirkwood/nas6210-setup.c
330--- linux-2.6.32.45.org/arch/arm/mach-kirkwood/nas6210-setup.c 1970-01-01 01:00:00.000000000 +0100
331+++ linux-2.6.32.45/arch/arm/mach-kirkwood/nas6210-setup.c 2011-10-16 09:57:35.268409525 +0200
332@@ -0,0 +1,180 @@
333+/*
334+ * arch/arm/mach-kirkwood/nas6210-setup.c
335+ *
336+ * Raidsonic ICYBOX NAS6210 and 6220 Board Setup
337+ *
338+ * This file is licensed under the terms of the GNU General Public
339+ * License version 2. This program is licensed "as is" without any
340+ * warranty of any kind, whether express or implied.
341+ */
342+
343+#include <linux/kernel.h>
344+#include <linux/init.h>
345+#include <linux/platform_device.h>
346+#include <linux/mtd/partitions.h>
347+#include <linux/ata_platform.h>
348+#include <linux/mv643xx_eth.h>
349+#include <linux/gpio.h>
350+#include <linux/gpio_keys.h>
351+#include <linux/input.h>
352+#include <linux/leds.h>
353+#include <asm/mach-types.h>
354+#include <asm/mach/arch.h>
355+#include <mach/kirkwood.h>
356+#include "common.h"
357+#include "mpp.h"
358+
359+#define NAS6210_GPIO_POWER_OFF 24
360+
361+static struct mtd_partition nas6210_nand_parts[] = {
362+ {
363+ .name = "u-boot",
364+ .offset = 0,
365+ .size = SZ_1M
366+ }, {
367+ .name = "uImage",
368+ .offset = MTDPART_OFS_NXTBLK,
369+ .size = (SZ_1M*6)
370+ }, {
371+ .name = "root",
372+ .offset = MTDPART_OFS_NXTBLK,
373+ .size = MTDPART_SIZ_FULL
374+ },
375+};
376+
377+static struct mv643xx_eth_platform_data nas6210_ge00_data = {
378+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
379+};
380+
381+static struct mv_sata_platform_data nas6210_sata_data = {
382+ .n_ports = 2,
383+};
384+
385+static struct gpio_led nas6210_led_pins[] = {
386+ {
387+ .name = "nas6210:green:power",
388+ .default_trigger = "default-on",
389+ .gpio = 25,
390+ .active_low = 0,
391+ },
392+ {
393+ .name = "nas6210:red:power",
394+ .default_trigger = "none",
395+ .gpio = 22,
396+ .active_low = 0,
397+ },
398+ {
399+ .name = "nas6210:red:usb_copy",
400+ .default_trigger = "none",
401+ .gpio = 27,
402+ .active_low = 0,
403+ },
404+};
405+
406+static struct gpio_led_platform_data nas6210_led_data = {
407+ .leds = nas6210_led_pins,
408+ .num_leds = ARRAY_SIZE(nas6210_led_pins),
409+};
410+
411+static struct platform_device nas6210_leds = {
412+ .name = "leds-gpio",
413+ .id = -1,
414+ .dev = {
415+ .platform_data = &nas6210_led_data,
416+ }
417+};
418+
419+static struct gpio_keys_button nas6210_buttons[] = {
420+ {
421+ .code = KEY_COPY,
422+ .gpio = 29,
423+ .desc = "USB Copy",
424+ .active_low = 1,
425+ },
426+ {
427+ .code = KEY_RESTART,
428+ .gpio = 28,
429+ .desc = "Reset",
430+ .active_low = 1,
431+ },
432+};
433+
434+static struct gpio_keys_platform_data nas6210_button_data = {
435+ .buttons = nas6210_buttons,
436+ .nbuttons = ARRAY_SIZE(nas6210_buttons),
437+};
438+
439+static struct platform_device nas6210_button_device = {
440+ .name = "gpio-keys",
441+ .id = -1,
442+ .num_resources = 0,
443+ .dev = {
444+ .platform_data = &nas6210_button_data,
445+ }
446+};
447+
448+static unsigned int nas6210_mpp_config[] __initdata = {
449+ MPP0_NF_IO2,
450+ MPP1_NF_IO3,
451+ MPP2_NF_IO4,
452+ MPP3_NF_IO5,
453+ MPP4_NF_IO6,
454+ MPP5_NF_IO7,
455+ MPP18_NF_IO0,
456+ MPP19_NF_IO1,
457+ MPP22_GPIO, /* Power LED red */
458+ MPP24_GPIO, /* Power off */
459+ MPP25_GPIO, /* Power LED green */
460+ MPP27_GPIO, /* USB transfer LED */
461+ MPP28_GPIO, /* Reset button */
462+ MPP29_GPIO, /* USB Copy button */
463+ 0
464+};
465+
466+void nas6210_power_off(void)
467+{
468+ gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
469+ while(1);
470+}
471+
472+static void __init nas6210_init(void)
473+{
474+ /*
475+ * Basic setup. Needs to be called early.
476+ */
477+ kirkwood_init();
478+ kirkwood_mpp_conf(nas6210_mpp_config);
479+
480+ kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
481+ kirkwood_ehci_init();
482+ kirkwood_ge00_init(&nas6210_ge00_data);
483+ kirkwood_sata_init(&nas6210_sata_data);
484+ kirkwood_uart0_init();
485+ platform_device_register(&nas6210_leds);
486+ platform_device_register(&nas6210_button_device);
487+
488+ if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
489+ gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
490+ pm_power_off = nas6210_power_off;
491+
492+ else
493+ pr_err("nas6210: failed to configure power-off gpio pin");
494+}
495+
496+static int __init nas6210_pci_init(void)
497+{
498+ if (machine_is_nas6210()) {
499+ kirkwood_pcie_init();
500+ }
501+ return 0;
502+}
503+subsys_initcall(nas6210_pci_init);
504+
505+MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS62x0")
506+ /* Maintainer: Arne Fitzenreiter <arne_f@ipfire.org> */
507+ .boot_params = 0x00000100,
508+ .init_machine = nas6210_init,
509+ .map_io = kirkwood_map_io,
510+ .init_irq = kirkwood_init_irq,
511+ .timer = &kirkwood_timer,
512+MACHINE_END
1a1cdab0 513diff -Naur linux-2.6.32.45.org/arch/arm/tools/mach-types linux-2.6.32.45/arch/arm/tools/mach-types
c05f6df0
AF
514--- linux-2.6.32.45.org/arch/arm/tools/mach-types 2011-08-16 03:57:37.000000000 +0200
515+++ linux-2.6.32.45/arch/arm/tools/mach-types 2011-10-15 17:05:46.486069811 +0200
516@@ -2536,3 +2536,6 @@
1a1cdab0
AF
517 mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
518 esyx MACH_ESYX ESYX 2551
519 bulldog MACH_BULLDOG BULLDOG 2553
c84d6e62 520+guruplug MACH_GURUPLUG GURUPLUG 2601
1a1cdab0 521+dreamplug MACH_DREAMPLUG DREAMPLUG 2659
c05f6df0 522+nas6210 MACH_NAS6210 NAS6210 3104