aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-05-15 04:41:07 -0400
committerArnd Bergmann <arnd@arndb.de>2012-05-15 04:41:07 -0400
commit423b742bec02b6c8d4e060517ce05b4cd3fd91c1 (patch)
tree3d4e090581970646d0afc92166bd490cc4977021 /arch/arm
parentbe944f1e79063e4f27b46c74f10c86b2387afa9f (diff)
parentf5520363532690f56e12126029864d9383d5203f (diff)
Merge branch 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux into next/boards
* 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux: ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree kirkwood: Add iconnect support orion/kirkwood: create a generic function for gpio led blinking kirkwood/orion: fix orion_gpio_set_blink ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt kirkwood: Allow nand to be configured via. devicetree mtd: Add orion_nand devicetree bindings ARM: kirkwood: Basic support for DNS-320 and DNS-325 Includes an update to v3.4-rc7 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/kirkwood-dns320.dts64
-rw-r--r--arch/arm/boot/dts/kirkwood-dns325.dts59
-rw-r--r--arch/arm/boot/dts/kirkwood-ib62x0.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-iconnect.dts26
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi15
-rw-r--r--arch/arm/kernel/ptrace.c24
-rw-r--r--arch/arm/kernel/smp.c4
-rw-r--r--arch/arm/kernel/sys_arm.c2
-rw-r--r--arch/arm/mach-exynos/Kconfig3
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c2
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c4
-rw-r--r--arch/arm/mach-kirkwood/Kconfig22
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot4
-rw-r--r--arch/arm/mach-kirkwood/board-dnskw.c275
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c14
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c143
-rw-r--r--arch/arm/mach-kirkwood/board-iconnect.c165
-rw-r--r--arch/arm/mach-kirkwood/common.c12
-rw-r--r--arch/arm/mach-kirkwood/common.h18
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c2
-rw-r--r--arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h8
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c25
-rw-r--r--arch/arm/mach-orion5x/mpp.h4
-rw-r--r--arch/arm/plat-orion/gpio.c27
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h2
27 files changed, 919 insertions, 54 deletions
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
new file mode 100644
index 000000000000..dc09a735b04a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -0,0 +1,64 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-320 NAS (Rev A1)";
7 compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x8000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <166666667>;
21 status = "okay";
22 };
23
24 serial@12100 {
25 clock-frequency = <166666667>;
26 status = "okay";
27 };
28
29 nand@3000000 {
30 status = "okay";
31
32 partition@0 {
33 label = "u-boot";
34 reg = <0x0000000 0x100000>;
35 read-only;
36 };
37
38 partition@100000 {
39 label = "uImage";
40 reg = <0x0100000 0x500000>;
41 };
42
43 partition@600000 {
44 label = "ramdisk";
45 reg = <0x0600000 0x500000>;
46 };
47
48 partition@b00000 {
49 label = "image";
50 reg = <0x0b00000 0x6600000>;
51 };
52
53 partition@7100000 {
54 label = "mini firmware";
55 reg = <0x7100000 0xa00000>;
56 };
57
58 partition@7b00000 {
59 label = "config";
60 reg = <0x7b00000 0x500000>;
61 };
62 };
63 };
64};
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
new file mode 100644
index 000000000000..c2a5562525d2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -0,0 +1,59 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-325 NAS (Rev A1)";
7 compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 read-only;
31 };
32
33 partition@100000 {
34 label = "uImage";
35 reg = <0x0100000 0x500000>;
36 };
37
38 partition@600000 {
39 label = "ramdisk";
40 reg = <0x0600000 0x500000>;
41 };
42
43 partition@b00000 {
44 label = "image";
45 reg = <0x0b00000 0x6600000>;
46 };
47
48 partition@7100000 {
49 label = "mini firmware";
50 reg = <0x7100000 0xa00000>;
51 };
52
53 partition@7b00000 {
54 label = "config";
55 reg = <0x7b00000 0x500000>;
56 };
57 };
58 };
59};
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
new file mode 100644
index 000000000000..ada0f0c23085
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -0,0 +1,44 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
7 compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 };
31
32 partition@100000 {
33 label = "uImage";
34 reg = <0x0100000 0x600000>;
35 };
36
37 partition@700000 {
38 label = "root";
39 reg = <0x0700000 0xf900000>;
40 };
41
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
new file mode 100644
index 000000000000..1ba75d4adecc
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -0,0 +1,26 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Iomega Iconnect";
7 compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)";
16 linux,initrd-start = <0x4500040>;
17 linux,initrd-end = <0x4800000>;
18 };
19
20 ocp@f1000000 {
21 serial@12000 {
22 clock-frequency = <200000000>;
23 status = "ok";
24 };
25 };
26};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 3474ef890945..926528b81baa 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -5,7 +5,7 @@
5 5
6 ocp@f1000000 { 6 ocp@f1000000 {
7 compatible = "simple-bus"; 7 compatible = "simple-bus";
8 ranges = <0 0xf1000000 0x1000000>; 8 ranges = <0 0xf1000000 0x4000000>;
9 #address-cells = <1>; 9 #address-cells = <1>;
10 #size-cells = <1>; 10 #size-cells = <1>;
11 11
@@ -32,5 +32,18 @@
32 reg = <0x10300 0x20>; 32 reg = <0x10300 0x20>;
33 interrupts = <53>; 33 interrupts = <53>;
34 }; 34 };
35
36 nand@3000000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 cle = <0>;
40 ale = <1>;
41 bank-width = <1>;
42 compatible = "mrvl,orion-nand";
43 reg = <0x3000000 0x400>;
44 chip-delay = <25>;
45 /* set partition map and/or chip-delay in board dts */
46 status = "disabled";
47 };
35 }; 48 };
36}; 49};
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 80abafb9bf33..9650c143afc1 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request,
906 return ret; 906 return ret;
907} 907}
908 908
909#ifdef __ARMEB__
910#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
911#else
912#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
913#endif
914
915asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 909asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
916{ 910{
917 unsigned long ip; 911 unsigned long ip;
918 912
919 /* 913 if (why)
920 * Save IP. IP is used to denote syscall entry/exit:
921 * IP = 0 -> entry, = 1 -> exit
922 */
923 ip = regs->ARM_ip;
924 regs->ARM_ip = why;
925
926 if (!ip)
927 audit_syscall_exit(regs); 914 audit_syscall_exit(regs);
928 else 915 else
929 audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, 916 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
930 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 917 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
931 918
932 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 919 if (!test_thread_flag(TIF_SYSCALL_TRACE))
@@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
936 923
937 current_thread_info()->syscall = scno; 924 current_thread_info()->syscall = scno;
938 925
926 /*
927 * IP is used to denote syscall entry/exit:
928 * IP = 0 -> entry, =1 -> exit
929 */
930 ip = regs->ARM_ip;
931 regs->ARM_ip = why;
932
939 /* the 0x80 provides a way for the tracing parent to distinguish 933 /* the 0x80 provides a way for the tracing parent to distinguish
940 between a syscall stop and SIGTRAP delivery */ 934 between a syscall stop and SIGTRAP delivery */
941 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 935 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index f6a4d32b0421..8f4644659777 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
251 struct mm_struct *mm = &init_mm; 251 struct mm_struct *mm = &init_mm;
252 unsigned int cpu = smp_processor_id(); 252 unsigned int cpu = smp_processor_id();
253 253
254 printk("CPU%u: Booted secondary processor\n", cpu);
255
256 /* 254 /*
257 * All kernel threads share the same mm context; grab a 255 * All kernel threads share the same mm context; grab a
258 * reference and switch to it. 256 * reference and switch to it.
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
264 enter_lazy_tlb(mm, current); 262 enter_lazy_tlb(mm, current);
265 local_flush_tlb_all(); 263 local_flush_tlb_all();
266 264
265 printk("CPU%u: Booted secondary processor\n", cpu);
266
267 cpu_init(); 267 cpu_init();
268 preempt_disable(); 268 preempt_disable();
269 trace_hardirqs_off(); 269 trace_hardirqs_off();
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index d2b177905cdb..76cbb055dd05 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
115 "Ir" (THREAD_START_SP - sizeof(regs)), 115 "Ir" (THREAD_START_SP - sizeof(regs)),
116 "r" (&regs), 116 "r" (&regs),
117 "Ir" (sizeof(regs)) 117 "Ir" (sizeof(regs))
118 : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); 118 : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
119 119
120 out: 120 out:
121 return ret; 121 return ret;
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 366daff79458..2808e471cdcc 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -233,6 +233,9 @@ config MACH_ARMLEX4210
233config MACH_UNIVERSAL_C210 233config MACH_UNIVERSAL_C210
234 bool "Mobile UNIVERSAL_C210 Board" 234 bool "Mobile UNIVERSAL_C210 Board"
235 select CPU_EXYNOS4210 235 select CPU_EXYNOS4210
236 select S5P_HRT
237 select CLKSRC_MMIO
238 select HAVE_SCHED_CLOCK
236 select S5P_GPIO_INT 239 select S5P_GPIO_INT
237 select S5P_DEV_FIMC0 240 select S5P_DEV_FIMC0
238 select S5P_DEV_FIMC1 241 select S5P_DEV_FIMC1
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 5cd7a8b8868c..7ac6ff4c46bd 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -678,7 +678,7 @@ static struct clk exynos5_clk_pdma1 = {
678 .name = "dma", 678 .name = "dma",
679 .devname = "dma-pl330.1", 679 .devname = "dma-pl330.1",
680 .enable = exynos5_clk_ip_fsys_ctrl, 680 .enable = exynos5_clk_ip_fsys_ctrl,
681 .ctrlbit = (1 << 1), 681 .ctrlbit = (1 << 2),
682}; 682};
683 683
684static struct clk exynos5_clk_mdma1 = { 684static struct clk exynos5_clk_mdma1 = {
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index a6959bbfef89..08e5a8e45bdb 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -41,6 +41,7 @@
41#include <plat/pd.h> 41#include <plat/pd.h>
42#include <plat/regs-fb-v4.h> 42#include <plat/regs-fb-v4.h>
43#include <plat/fimc-core.h> 43#include <plat/fimc-core.h>
44#include <plat/s5p-time.h>
44#include <plat/camport.h> 45#include <plat/camport.h>
45#include <plat/mipi_csis.h> 46#include <plat/mipi_csis.h>
46 47
@@ -1091,6 +1092,7 @@ static void __init universal_map_io(void)
1091 exynos_init_io(NULL, 0); 1092 exynos_init_io(NULL, 0);
1092 s3c24xx_init_clocks(24000000); 1093 s3c24xx_init_clocks(24000000);
1093 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 1094 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
1095 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
1094} 1096}
1095 1097
1096static void s5p_tv_setup(void) 1098static void s5p_tv_setup(void)
@@ -1146,7 +1148,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1146 .map_io = universal_map_io, 1148 .map_io = universal_map_io,
1147 .handle_irq = gic_handle_irq, 1149 .handle_irq = gic_handle_irq,
1148 .init_machine = universal_machine_init, 1150 .init_machine = universal_machine_init,
1149 .timer = &exynos4_timer, 1151 .timer = &s5p_timer,
1150 .reserve = &universal_reserve, 1152 .reserve = &universal_reserve,
1151 .restart = exynos4_restart, 1153 .restart = exynos4_restart,
1152MACHINE_END 1154MACHINE_END
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 90ceab761929..199764fe0fb0 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,28 @@ config MACH_DREAMPLUG_DT
58 Say 'Y' here if you want your kernel to support the 58 Say 'Y' here if you want your kernel to support the
59 Marvell DreamPlug (Flattened Device Tree). 59 Marvell DreamPlug (Flattened Device Tree).
60 60
61config MACH_ICONNECT_DT
62 bool "Iomega Iconnect (Flattened Device Tree)"
63 select ARCH_KIRKWOOD_DT
64 help
65 Say 'Y' here to enable Iomega Iconnect support.
66
67config MACH_DLINK_KIRKWOOD_DT
68 bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
69 select ARCH_KIRKWOOD_DT
70 help
71 Say 'Y' here if you want your kernel to support the
72 Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
73 using Flattened Device Tree.
74
75config MACH_IB62X0_DT
76 bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
77 select ARCH_KIRKWOOD_DT
78 help
79 Say 'Y' here if you want your kernel to support the
80 RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
81 Flattened Device Tree.
82
61config MACH_TS219 83config MACH_TS219
62 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 84 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
63 help 85 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index e299a9576bf0..d2b05907b10e 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -22,3 +22,6 @@ obj-$(CONFIG_MACH_T5325) += t5325-setup.o
22obj-$(CONFIG_CPU_IDLE) += cpuidle.o 22obj-$(CONFIG_CPU_IDLE) += cpuidle.o
23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o
25obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o
26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 16f938522304..02edbdf5b065 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -3,3 +3,7 @@ params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4 4
5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb 5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
6dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb
7dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
new file mode 100644
index 000000000000..58c2d68f9443
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -0,0 +1,275 @@
1/*
2 * Copyright 2012 (C), Jamie Lentin <jm@lentin.co.uk>
3 *
4 * arch/arm/mach-kirkwood/board-dnskw.c
5 *
6 * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to
7 * flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/of.h>
21#include <linux/gpio.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <linux/gpio-fan.h>
25#include <linux/leds.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <mach/kirkwood.h>
30#include <mach/bridge-regs.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data dnskw_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
36};
37
38static struct mv_sata_platform_data dnskw_sata_data = {
39 .n_ports = 2,
40};
41
42static unsigned int dnskw_mpp_config[] __initdata = {
43 MPP13_UART1_TXD, /* Custom ... */
44 MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */
45 MPP20_SATA1_ACTn, /* LED: White Right HDD */
46 MPP21_SATA0_ACTn, /* LED: White Left HDD */
47 MPP24_GPIO,
48 MPP25_GPIO,
49 MPP26_GPIO, /* LED: Power */
50 MPP27_GPIO, /* LED: Red Right HDD */
51 MPP28_GPIO, /* LED: Red Left HDD */
52 MPP29_GPIO, /* LED: Red USB (DNS-325 only) */
53 MPP30_GPIO,
54 MPP31_GPIO,
55 MPP32_GPIO,
56 MPP33_GPO,
57 MPP34_GPIO, /* Button: Front power */
58 MPP35_GPIO, /* LED: Red USB (DNS-320 only) */
59 MPP36_GPIO, /* Power: Turn off board */
60 MPP37_GPIO, /* Power: Turn back on after power failure */
61 MPP38_GPIO,
62 MPP39_GPIO, /* Power: SATA0 */
63 MPP40_GPIO, /* Power: SATA1 */
64 MPP41_GPIO, /* SATA0 present */
65 MPP42_GPIO, /* SATA1 present */
66 MPP43_GPIO, /* LED: White USB */
67 MPP44_GPIO, /* Fan: Tachometer Pin */
68 MPP45_GPIO, /* Fan: high speed */
69 MPP46_GPIO, /* Fan: low speed */
70 MPP47_GPIO, /* Button: Back unmount */
71 MPP48_GPIO, /* Button: Back reset */
72 MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */
73 0
74};
75
76static struct gpio_led dns325_led_pins[] = {
77 {
78 .name = "dns325:white:power",
79 .gpio = 26,
80 .active_low = 1,
81 .default_trigger = "default-on",
82 },
83 {
84 .name = "dns325:white:usb",
85 .gpio = 43,
86 .active_low = 1,
87 },
88 {
89 .name = "dns325:red:l_hdd",
90 .gpio = 28,
91 .active_low = 1,
92 },
93 {
94 .name = "dns325:red:r_hdd",
95 .gpio = 27,
96 .active_low = 1,
97 },
98 {
99 .name = "dns325:red:usb",
100 .gpio = 29,
101 .active_low = 1,
102 },
103};
104
105static struct gpio_led_platform_data dns325_led_data = {
106 .num_leds = ARRAY_SIZE(dns325_led_pins),
107 .leds = dns325_led_pins,
108};
109
110static struct platform_device dns325_led_device = {
111 .name = "leds-gpio",
112 .id = -1,
113 .dev = {
114 .platform_data = &dns325_led_data,
115 },
116};
117
118static struct gpio_led dns320_led_pins[] = {
119 {
120 .name = "dns320:blue:power",
121 .gpio = 26,
122 .active_low = 1,
123 .default_trigger = "default-on",
124 },
125 {
126 .name = "dns320:blue:usb",
127 .gpio = 43,
128 .active_low = 1,
129 },
130 {
131 .name = "dns320:orange:l_hdd",
132 .gpio = 28,
133 .active_low = 1,
134 },
135 {
136 .name = "dns320:orange:r_hdd",
137 .gpio = 27,
138 .active_low = 1,
139 },
140 {
141 .name = "dns320:orange:usb",
142 .gpio = 35,
143 .active_low = 1,
144 },
145};
146
147static struct gpio_led_platform_data dns320_led_data = {
148 .num_leds = ARRAY_SIZE(dns320_led_pins),
149 .leds = dns320_led_pins,
150};
151
152static struct platform_device dns320_led_device = {
153 .name = "leds-gpio",
154 .id = -1,
155 .dev = {
156 .platform_data = &dns320_led_data,
157 },
158};
159
160static struct i2c_board_info dns325_i2c_board_info[] __initdata = {
161 {
162 I2C_BOARD_INFO("lm75", 0x48),
163 },
164 /* Something at 0x0c also */
165};
166
167static struct gpio_keys_button dnskw_button_pins[] = {
168 {
169 .code = KEY_POWER,
170 .gpio = 34,
171 .desc = "Power button",
172 .active_low = 1,
173 },
174 {
175 .code = KEY_EJECTCD,
176 .gpio = 47,
177 .desc = "USB unmount button",
178 .active_low = 1,
179 },
180 {
181 .code = KEY_RESTART,
182 .gpio = 48,
183 .desc = "Reset button",
184 .active_low = 1,
185 },
186};
187
188static struct gpio_keys_platform_data dnskw_button_data = {
189 .buttons = dnskw_button_pins,
190 .nbuttons = ARRAY_SIZE(dnskw_button_pins),
191};
192
193static struct platform_device dnskw_button_device = {
194 .name = "gpio-keys",
195 .id = -1,
196 .num_resources = 0,
197 .dev = {
198 .platform_data = &dnskw_button_data,
199 }
200};
201
202/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
203static struct gpio_fan_speed dnskw_fan_speed[] = {
204 { 0, 0 },
205 { 3000, 1 },
206 { 6000, 2 },
207};
208static unsigned dnskw_fan_pins[] = {46, 45};
209
210static struct gpio_fan_platform_data dnskw_fan_data = {
211 .num_ctrl = ARRAY_SIZE(dnskw_fan_pins),
212 .ctrl = dnskw_fan_pins,
213 .num_speed = ARRAY_SIZE(dnskw_fan_speed),
214 .speed = dnskw_fan_speed,
215};
216
217static struct platform_device dnskw_fan_device = {
218 .name = "gpio-fan",
219 .id = -1,
220 .dev = {
221 .platform_data = &dnskw_fan_data,
222 },
223};
224
225static void dnskw_power_off(void)
226{
227 gpio_set_value(36, 1);
228}
229
230/* Register any GPIO for output and set the value */
231static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
232{
233 if (gpio_request(gpio, name) == 0 &&
234 gpio_direction_output(gpio, 0) == 0) {
235 gpio_set_value(gpio, def);
236 if (gpio_export(gpio, 0) != 0)
237 pr_err("dnskw: Failed to export GPIO %s\n", name);
238 } else
239 pr_err("dnskw: Failed to register %s\n", name);
240}
241
242void __init dnskw_init(void)
243{
244 kirkwood_mpp_conf(dnskw_mpp_config);
245
246 kirkwood_ehci_init();
247 kirkwood_ge00_init(&dnskw_ge00_data);
248 kirkwood_sata_init(&dnskw_sata_data);
249 kirkwood_i2c_init();
250
251 platform_device_register(&dnskw_button_device);
252 platform_device_register(&dnskw_fan_device);
253
254 if (of_machine_is_compatible("dlink,dns-325")) {
255 i2c_register_board_info(0, dns325_i2c_board_info,
256 ARRAY_SIZE(dns325_i2c_board_info));
257 platform_device_register(&dns325_led_device);
258
259 } else if (of_machine_is_compatible("dlink,dns-320"))
260 platform_device_register(&dns320_led_device);
261
262 /* Register power-off GPIO. */
263 if (gpio_request(36, "dnskw:power:off") == 0
264 && gpio_direction_output(36, 0) == 0)
265 pm_power_off = dnskw_power_off;
266 else
267 pr_err("dnskw: failed to configure power-off GPIO\n");
268
269 /* Ensure power is supplied to both HDDs */
270 dnskw_gpio_register(39, "dnskw:power:sata0", 1);
271 dnskw_gpio_register(40, "dnskw:power:sata1", 1);
272
273 /* Set NAS to turn back on after a power failure */
274 dnskw_gpio_register(37, "dnskw:power:recover", 1);
275}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 1c672d9e6656..10d1969b9e3a 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/kexec.h>
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <mach/bridge-regs.h> 20#include <mach/bridge-regs.h>
@@ -55,11 +56,24 @@ static void __init kirkwood_dt_init(void)
55 if (of_machine_is_compatible("globalscale,dreamplug")) 56 if (of_machine_is_compatible("globalscale,dreamplug"))
56 dreamplug_init(); 57 dreamplug_init();
57 58
59 if (of_machine_is_compatible("dlink,dns-kirkwood"))
60 dnskw_init();
61
62 if (of_machine_is_compatible("iom,iconnect"))
63 iconnect_init();
64
65 if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
66 ib62x0_init();
67
58 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); 68 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
59} 69}
60 70
61static const char *kirkwood_dt_board_compat[] = { 71static const char *kirkwood_dt_board_compat[] = {
62 "globalscale,dreamplug", 72 "globalscale,dreamplug",
73 "dlink,dns-320",
74 "dlink,dns-325",
75 "iom,iconnect",
76 "raidsonic,ib-nas62x0",
63 NULL 77 NULL
64}; 78};
65 79
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
new file mode 100644
index 000000000000..eddf1df8891f
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -0,0 +1,143 @@
1/*
2 * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
3 *
4 * arch/arm/mach-kirkwood/board-ib62x0.c
5 *
6 * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not
7 * converted to flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/mtd/partitions.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/gpio.h>
21#include <linux/gpio_keys.h>
22#include <linux/input.h>
23#include <linux/leds.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <mach/kirkwood.h>
27#include "common.h"
28#include "mpp.h"
29
30#define IB62X0_GPIO_POWER_OFF 24
31
32static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
33 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
34};
35
36static struct mv_sata_platform_data ib62x0_sata_data = {
37 .n_ports = 2,
38};
39
40static unsigned int ib62x0_mpp_config[] __initdata = {
41 MPP0_NF_IO2,
42 MPP1_NF_IO3,
43 MPP2_NF_IO4,
44 MPP3_NF_IO5,
45 MPP4_NF_IO6,
46 MPP5_NF_IO7,
47 MPP18_NF_IO0,
48 MPP19_NF_IO1,
49 MPP22_GPIO, /* OS LED red */
50 MPP24_GPIO, /* Power off device */
51 MPP25_GPIO, /* OS LED green */
52 MPP27_GPIO, /* USB transfer LED */
53 MPP28_GPIO, /* Reset button */
54 MPP29_GPIO, /* USB Copy button */
55 0
56};
57
58static struct gpio_led ib62x0_led_pins[] = {
59 {
60 .name = "ib62x0:green:os",
61 .default_trigger = "default-on",
62 .gpio = 25,
63 .active_low = 0,
64 },
65 {
66 .name = "ib62x0:red:os",
67 .default_trigger = "none",
68 .gpio = 22,
69 .active_low = 0,
70 },
71 {
72 .name = "ib62x0:red:usb_copy",
73 .default_trigger = "none",
74 .gpio = 27,
75 .active_low = 0,
76 },
77};
78
79static struct gpio_led_platform_data ib62x0_led_data = {
80 .leds = ib62x0_led_pins,
81 .num_leds = ARRAY_SIZE(ib62x0_led_pins),
82};
83
84static struct platform_device ib62x0_led_device = {
85 .name = "leds-gpio",
86 .id = -1,
87 .dev = {
88 .platform_data = &ib62x0_led_data,
89 }
90};
91
92static struct gpio_keys_button ib62x0_button_pins[] = {
93 {
94 .code = KEY_COPY,
95 .gpio = 29,
96 .desc = "USB Copy",
97 .active_low = 1,
98 },
99 {
100 .code = KEY_RESTART,
101 .gpio = 28,
102 .desc = "Reset",
103 .active_low = 1,
104 },
105};
106
107static struct gpio_keys_platform_data ib62x0_button_data = {
108 .buttons = ib62x0_button_pins,
109 .nbuttons = ARRAY_SIZE(ib62x0_button_pins),
110};
111
112static struct platform_device ib62x0_button_device = {
113 .name = "gpio-keys",
114 .id = -1,
115 .num_resources = 0,
116 .dev = {
117 .platform_data = &ib62x0_button_data,
118 }
119};
120
121static void ib62x0_power_off(void)
122{
123 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
124}
125
126void __init ib62x0_init(void)
127{
128 /*
129 * Basic setup. Needs to be called early.
130 */
131 kirkwood_mpp_conf(ib62x0_mpp_config);
132
133 kirkwood_ehci_init();
134 kirkwood_ge00_init(&ib62x0_ge00_data);
135 kirkwood_sata_init(&ib62x0_sata_data);
136 platform_device_register(&ib62x0_led_device);
137 platform_device_register(&ib62x0_button_device);
138 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
139 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
140 pm_power_off = ib62x0_power_off;
141 else
142 pr_err("board-ib62x0: failed to configure power-off GPIO\n");
143}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
new file mode 100644
index 000000000000..2222c5739519
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -0,0 +1,165 @@
1/*
2 * arch/arm/mach-kirkwood/board-iconnect.c
3 *
4 * Iomega i-connect Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/of.h>
15#include <linux/of_address.h>
16#include <linux/of_fdt.h>
17#include <linux/of_irq.h>
18#include <linux/of_platform.h>
19#include <linux/mtd/partitions.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 <linux/i2c.h>
27#include <linux/input.h>
28#include <linux/gpio_keys.h>
29#include <asm/mach/arch.h>
30#include <mach/kirkwood.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data iconnect_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
36};
37
38static struct gpio_led iconnect_led_pins[] = {
39 {
40 .name = "led_level",
41 .gpio = 41,
42 .default_trigger = "default-on",
43 }, {
44 .name = "power:blue",
45 .gpio = 42,
46 .default_trigger = "timer",
47 }, {
48 .name = "power:red",
49 .gpio = 43,
50 }, {
51 .name = "usb1:blue",
52 .gpio = 44,
53 }, {
54 .name = "usb2:blue",
55 .gpio = 45,
56 }, {
57 .name = "usb3:blue",
58 .gpio = 46,
59 }, {
60 .name = "usb4:blue",
61 .gpio = 47,
62 }, {
63 .name = "otb:blue",
64 .gpio = 48,
65 },
66};
67
68static struct gpio_led_platform_data iconnect_led_data = {
69 .leds = iconnect_led_pins,
70 .num_leds = ARRAY_SIZE(iconnect_led_pins),
71 .gpio_blink_set = orion_gpio_led_blink_set,
72};
73
74static struct platform_device iconnect_leds = {
75 .name = "leds-gpio",
76 .id = -1,
77 .dev = {
78 .platform_data = &iconnect_led_data,
79 }
80};
81
82static unsigned int iconnect_mpp_config[] __initdata = {
83 MPP12_GPIO,
84 MPP35_GPIO,
85 MPP41_GPIO,
86 MPP42_GPIO,
87 MPP43_GPIO,
88 MPP44_GPIO,
89 MPP45_GPIO,
90 MPP46_GPIO,
91 MPP47_GPIO,
92 MPP48_GPIO,
93 0
94};
95
96static struct i2c_board_info __initdata iconnect_board_info[] = {
97 {
98 I2C_BOARD_INFO("lm63", 0x4c),
99 },
100};
101
102static struct mtd_partition iconnect_nand_parts[] = {
103 {
104 .name = "flash",
105 .offset = 0,
106 .size = MTDPART_SIZ_FULL,
107 },
108};
109
110/* yikes... theses are the original input buttons */
111/* but I'm not convinced by the sw event choices */
112static struct gpio_keys_button iconnect_buttons[] = {
113 {
114 .type = EV_SW,
115 .code = SW_LID,
116 .gpio = 12,
117 .desc = "Reset Button",
118 .active_low = 1,
119 .debounce_interval = 100,
120 }, {
121 .type = EV_SW,
122 .code = SW_TABLET_MODE,
123 .gpio = 35,
124 .desc = "OTB Button",
125 .active_low = 1,
126 .debounce_interval = 100,
127 },
128};
129
130static struct gpio_keys_platform_data iconnect_button_data = {
131 .buttons = iconnect_buttons,
132 .nbuttons = ARRAY_SIZE(iconnect_buttons),
133};
134
135static struct platform_device iconnect_button_device = {
136 .name = "gpio-keys",
137 .id = -1,
138 .num_resources = 0,
139 .dev = {
140 .platform_data = &iconnect_button_data,
141 },
142};
143
144void __init iconnect_init(void)
145{
146 kirkwood_mpp_conf(iconnect_mpp_config);
147 kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
148 kirkwood_i2c_init();
149 i2c_register_board_info(0, iconnect_board_info,
150 ARRAY_SIZE(iconnect_board_info));
151
152 kirkwood_ehci_init();
153 kirkwood_ge00_init(&iconnect_ge00_data);
154
155 platform_device_register(&iconnect_button_device);
156 platform_device_register(&iconnect_leds);
157}
158
159static int __init iconnect_pci_init(void)
160{
161 if (of_machine_is_compatible("iom,iconnect"))
162 kirkwood_pcie_init(KW_PCIE0);
163 return 0;
164}
165subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index a02cae881f2f..3ad037385a5e 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/mtd/nand.h> 16#include <linux/mtd/nand.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/of.h>
18#include <net/dsa.h> 19#include <net/dsa.h>
19#include <asm/page.h> 20#include <asm/page.h>
20#include <asm/timex.h> 21#include <asm/timex.h>
@@ -482,6 +483,9 @@ static int __init kirkwood_clock_gate(void)
482 unsigned int curr = readl(CLOCK_GATING_CTRL); 483 unsigned int curr = readl(CLOCK_GATING_CTRL);
483 u32 dev, rev; 484 u32 dev, rev;
484 485
486#ifdef CONFIG_OF
487 struct device_node *np;
488#endif
485 kirkwood_pcie_id(&dev, &rev); 489 kirkwood_pcie_id(&dev, &rev);
486 printk(KERN_DEBUG "Gating clock of unused units\n"); 490 printk(KERN_DEBUG "Gating clock of unused units\n");
487 printk(KERN_DEBUG "before: 0x%08x\n", curr); 491 printk(KERN_DEBUG "before: 0x%08x\n", curr);
@@ -489,6 +493,14 @@ static int __init kirkwood_clock_gate(void)
489 /* Make sure those units are accessible */ 493 /* Make sure those units are accessible */
490 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); 494 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
491 495
496#ifdef CONFIG_OF
497 np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand");
498 if (np && of_device_is_available(np)) {
499 kirkwood_clk_ctrl |= CGC_RUNIT;
500 of_node_put(np);
501 }
502#endif
503
492 /* For SATA: first shutdown the phy */ 504 /* For SATA: first shutdown the phy */
493 if (!(kirkwood_clk_ctrl & CGC_SATA0)) { 505 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
494 /* Disable PLL and IVREF */ 506 /* Disable PLL and IVREF */
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fa8e7689c436..a34c41a5172e 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,6 +58,24 @@ void dreamplug_init(void);
58static inline void dreamplug_init(void) {}; 58static inline void dreamplug_init(void) {};
59#endif 59#endif
60 60
61#ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
62void dnskw_init(void);
63#else
64static inline void dnskw_init(void) {};
65#endif
66
67#ifdef CONFIG_MACH_ICONNECT_DT
68void iconnect_init(void);
69#else
70static inline void iconnect_init(void) {};
71#endif
72
73#ifdef CONFIG_MACH_IB62X0_DT
74void ib62x0_init(void);
75#else
76static inline void ib62x0_init(void) {};
77#endif
78
61/* early init functions not converted to fdt yet */ 79/* early init functions not converted to fdt yet */
62char *kirkwood_id(void); 80char *kirkwood_id(void);
63void kirkwood_l2_init(void); 81void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index fcce7ff37630..cfd98b186fcc 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -48,7 +48,7 @@ static irqreturn_t deferred_fiq(int irq, void *dev_id)
48 struct irq_chip *irq_chip = NULL; 48 struct irq_chip *irq_chip = NULL;
49 int gpio, irq_num, fiq_count; 49 int gpio, irq_num, fiq_count;
50 50
51 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
52 if (irq_desc) 52 if (irq_desc)
53 irq_chip = irq_desc->irq_data.chip; 53 irq_chip = irq_desc->irq_data.chip;
54 54
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 16ec5c89e035..55dfcccf1a8a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -629,7 +629,7 @@ static struct regulator_consumer_supply dummy_supplies[] = {
629 629
630static void __init igep_init(void) 630static void __init igep_init(void)
631{ 631{
632 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 632 regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
633 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 633 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
634 634
635 /* Get IGEP2 hardware revision */ 635 /* Get IGEP2 hardware revision */
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
index 1e2d3322f33e..c88420de1151 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
+++ b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
@@ -941,10 +941,10 @@
941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29) 941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29)
942#define OMAP4_DSI1_LANEENABLE_SHIFT 24 942#define OMAP4_DSI1_LANEENABLE_SHIFT 24
943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24) 943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24)
944#define OMAP4_DSI2_PIPD_SHIFT 19 944#define OMAP4_DSI1_PIPD_SHIFT 19
945#define OMAP4_DSI2_PIPD_MASK (0x1f << 19) 945#define OMAP4_DSI1_PIPD_MASK (0x1f << 19)
946#define OMAP4_DSI1_PIPD_SHIFT 14 946#define OMAP4_DSI2_PIPD_SHIFT 14
947#define OMAP4_DSI1_PIPD_MASK (0x1f << 14) 947#define OMAP4_DSI2_PIPD_MASK (0x1f << 14)
948 948
949/* CONTROL_MCBSPLP */ 949/* CONTROL_MCBSPLP */
950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31 950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index c3ed15b8ea25..13d2bece1bae 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -253,27 +253,6 @@ error_fail:
253 * GPIO LEDs (simple - doesn't use hardware blinking support) 253 * GPIO LEDs (simple - doesn't use hardware blinking support)
254 */ 254 */
255 255
256#define ORION_BLINK_HALF_PERIOD 100 /* ms */
257
258static int dns323_gpio_blink_set(unsigned gpio, int state,
259 unsigned long *delay_on, unsigned long *delay_off)
260{
261
262 if (delay_on && delay_off && !*delay_on && !*delay_off)
263 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
264
265 switch(state) {
266 case GPIO_LED_NO_BLINK_LOW:
267 case GPIO_LED_NO_BLINK_HIGH:
268 orion_gpio_set_blink(gpio, 0);
269 gpio_set_value(gpio, state);
270 break;
271 case GPIO_LED_BLINK:
272 orion_gpio_set_blink(gpio, 1);
273 }
274 return 0;
275}
276
277static struct gpio_led dns323ab_leds[] = { 256static struct gpio_led dns323ab_leds[] = {
278 { 257 {
279 .name = "power:blue", 258 .name = "power:blue",
@@ -312,13 +291,13 @@ static struct gpio_led dns323c_leds[] = {
312static struct gpio_led_platform_data dns323ab_led_data = { 291static struct gpio_led_platform_data dns323ab_led_data = {
313 .num_leds = ARRAY_SIZE(dns323ab_leds), 292 .num_leds = ARRAY_SIZE(dns323ab_leds),
314 .leds = dns323ab_leds, 293 .leds = dns323ab_leds,
315 .gpio_blink_set = dns323_gpio_blink_set, 294 .gpio_blink_set = orion_gpio_led_blink_set,
316}; 295};
317 296
318static struct gpio_led_platform_data dns323c_led_data = { 297static struct gpio_led_platform_data dns323c_led_data = {
319 .num_leds = ARRAY_SIZE(dns323c_leds), 298 .num_leds = ARRAY_SIZE(dns323c_leds),
320 .leds = dns323c_leds, 299 .leds = dns323c_leds,
321 .gpio_blink_set = dns323_gpio_blink_set, 300 .gpio_blink_set = orion_gpio_led_blink_set,
322}; 301};
323 302
324static struct platform_device dns323_gpio_leds = { 303static struct platform_device dns323_gpio_leds = {
diff --git a/arch/arm/mach-orion5x/mpp.h b/arch/arm/mach-orion5x/mpp.h
index eac68978a2c2..db70e79a1198 100644
--- a/arch/arm/mach-orion5x/mpp.h
+++ b/arch/arm/mach-orion5x/mpp.h
@@ -65,8 +65,8 @@
65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1) 65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1)
66 66
67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1) 67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1)
68#define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1) 68#define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1)
69#define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1) 69#define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1)
70 70
71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1) 71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1)
72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1) 72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 10d160888133..af95af257301 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -16,6 +16,7 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/leds.h>
19 20
20/* 21/*
21 * GPIO unit register offsets. 22 * GPIO unit register offsets.
@@ -289,12 +290,34 @@ void orion_gpio_set_blink(unsigned pin, int blink)
289 return; 290 return;
290 291
291 spin_lock_irqsave(&ochip->lock, flags); 292 spin_lock_irqsave(&ochip->lock, flags);
292 __set_level(ochip, pin, 0); 293 __set_level(ochip, pin & 31, 0);
293 __set_blinking(ochip, pin, blink); 294 __set_blinking(ochip, pin & 31, blink);
294 spin_unlock_irqrestore(&ochip->lock, flags); 295 spin_unlock_irqrestore(&ochip->lock, flags);
295} 296}
296EXPORT_SYMBOL(orion_gpio_set_blink); 297EXPORT_SYMBOL(orion_gpio_set_blink);
297 298
299#define ORION_BLINK_HALF_PERIOD 100 /* ms */
300
301int orion_gpio_led_blink_set(unsigned gpio, int state,
302 unsigned long *delay_on, unsigned long *delay_off)
303{
304
305 if (delay_on && delay_off && !*delay_on && !*delay_off)
306 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
307
308 switch (state) {
309 case GPIO_LED_NO_BLINK_LOW:
310 case GPIO_LED_NO_BLINK_HIGH:
311 orion_gpio_set_blink(gpio, 0);
312 gpio_set_value(gpio, state);
313 break;
314 case GPIO_LED_BLINK:
315 orion_gpio_set_blink(gpio, 1);
316 }
317 return 0;
318}
319EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set);
320
298 321
299/***************************************************************************** 322/*****************************************************************************
300 * Orion GPIO IRQ 323 * Orion GPIO IRQ
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 3abf30428bee..bec0c98ce41f 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -19,6 +19,8 @@
19 */ 19 */
20void orion_gpio_set_unused(unsigned pin); 20void orion_gpio_set_unused(unsigned pin);
21void orion_gpio_set_blink(unsigned pin, int blink); 21void orion_gpio_set_blink(unsigned pin, int blink);
22int orion_gpio_led_blink_set(unsigned gpio, int state,
23 unsigned long *delay_on, unsigned long *delay_off);
22 24
23#define GPIO_INPUT_OK (1 << 0) 25#define GPIO_INPUT_OK (1 << 0)
24#define GPIO_OUTPUT_OK (1 << 1) 26#define GPIO_OUTPUT_OK (1 << 1)