aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 19:33:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 19:33:57 -0400
commitfa91515cbf2375a64c8bd0a033a05b0859dff591 (patch)
tree78d426e740152fa7abd6500b19ca0218190a2729
parenta35c6322e52c550b61a04a44df27d22394ee0a2c (diff)
parent25475030ec0e2c4c05f3ecb2c068f6e42944fd04 (diff)
Merge tag 'renesas-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM Renesas SoC cleanup, refactoring and more SMP support from Kevin Hilman: "Lots of cleanup and refactoring and some SMP additions for Renesas platforms. Due to some inter-dependencies with other arm-soc branches, this Renesas stuff was separated out for sending after the other branches were merged. Highlights: - remove unused board support and cleanup of unused headers - refactoring of init and device registration - simplify IRQ initialization" * tag 'renesas-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (68 commits) ARM: shmobile: Per-CPU SMP boot / sleep code for SCU SoCs ARM: shmobile: Introduce per-CPU SMP boot / sleep code ARM: shmobile: Use shared SCU CPU Hotplug code on r8a7779 ARM: shmobile: Use shared SCU CPU Hotplug code on sh73a0 ARM: shmobile: Add shared SCU CPU Hotplug code ARM: shmobile: Use shared SCU SMP boot code on emev2 ARM: shmobile: Use shared SCU SMP boot code on r8a7779 ARM: shmobile: Use shared SCU SMP boot code on sh73a0 ARM: shmobile: Introduce shared SCU SMP boot code ARM: shmobile: sh73a0: Remove global GPIO_NR definition ARM: shmobile: kzm9d: remove nfsroot settings from bootargs ARM: shmobile: armadillo800eva: remove nfsroot settings from bootargs ARM: shmobile: r8a7779: move r8a7779_init_irq_xxx() to setup ARM: shmobile: r8a7740: move r8a7740_init_irq_of() to setup ARM: shmobile: bockw: add missing __initdata ARM: shmobile: r8a7790: add missing __initdata ARM: shmobile: r8a7779: add missing __initdata ARM: shmobile: Remove unused shmobile_init_time() ARM: shmobile: Use clocksource_of_init() on r8a7790 ARM: shmobile: Use default ->init_time() on KZM9G DT ref ...
-rw-r--r--arch/arm/boot/dts/Makefile4
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d-reference.dts2
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d.dts2
-rw-r--r--arch/arm/boot/dts/emev2.dtsi6
-rw-r--r--arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts65
-rw-r--r--arch/arm/boot/dts/r8a73a4-ape6evm.dts2
-rw-r--r--arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts2
-rw-r--r--arch/arm/boot/dts/r8a7740-armadillo800eva.dts2
-rw-r--r--arch/arm/boot/dts/r8a7740.dtsi12
-rw-r--r--arch/arm/boot/dts/r8a7778-bockw-reference.dts32
-rw-r--r--arch/arm/boot/dts/r8a7778-bockw.dts2
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen-reference.dts2
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen.dts27
-rw-r--r--arch/arm/boot/dts/r8a7779.dtsi8
-rw-r--r--arch/arm/boot/dts/r8a7790-lager-reference.dts45
-rw-r--r--arch/arm/boot/dts/r8a7790-lager.dts2
-rw-r--r--arch/arm/boot/dts/sh73a0-kzm9g-reference.dts2
-rw-r--r--arch/arm/boot/dts/sh73a0-kzm9g.dts2
-rw-r--r--arch/arm/boot/dts/sh73a0.dtsi6
-rw-r--r--arch/arm/configs/ag5evm_defconfig83
-rw-r--r--arch/arm/configs/kota2_defconfig121
-rw-r--r--arch/arm/mach-shmobile/Kconfig50
-rw-r--r--arch/arm/mach-shmobile/Makefile23
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot5
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c639
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm-reference.c63
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm.c1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c2
-rw-r--r--arch/arm/mach-shmobile/board-bockw-reference.c61
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c49
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c550
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c16
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c45
-rw-r--r--arch/arm/mach-shmobile/board-marzen-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c36
-rw-r--r--arch/arm/mach-shmobile/headsmp.S49
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h10
-rw-r--r--arch/arm/mach-shmobile/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a73a4.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7740.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h9
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h3
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7790.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h2
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7740.c68
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c131
-rw-r--r--arch/arm/mach-shmobile/platsmp-scu.c81
-rw-r--r--arch/arm/mach-shmobile/platsmp.c18
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c1
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c16
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c33
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c71
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c102
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c16
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c1
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c1
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c19
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c70
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c72
-rw-r--r--arch/arm/mach-shmobile/timer.c4
62 files changed, 856 insertions, 1900 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 000cf7628e6e..4e02f1b6c8a2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -198,12 +198,16 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
198 emev2-kzm9d-reference.dtb \ 198 emev2-kzm9d-reference.dtb \
199 r8a7740-armadillo800eva.dtb \ 199 r8a7740-armadillo800eva.dtb \
200 r8a7778-bockw.dtb \ 200 r8a7778-bockw.dtb \
201 r8a7778-bockw-reference.dtb \
201 r8a7740-armadillo800eva-reference.dtb \ 202 r8a7740-armadillo800eva-reference.dtb \
203 r8a7779-marzen.dtb \
202 r8a7779-marzen-reference.dtb \ 204 r8a7779-marzen-reference.dtb \
203 r8a7790-lager.dtb \ 205 r8a7790-lager.dtb \
206 r8a7790-lager-reference.dtb \
204 sh73a0-kzm9g.dtb \ 207 sh73a0-kzm9g.dtb \
205 sh73a0-kzm9g-reference.dtb \ 208 sh73a0-kzm9g-reference.dtb \
206 r8a73a4-ape6evm.dtb \ 209 r8a73a4-ape6evm.dtb \
210 r8a73a4-ape6evm-reference.dtb \
207 sh7372-mackerel.dtb 211 sh7372-mackerel.dtb
208dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d-reference.dtb 212dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d-reference.dtb
209dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \ 213dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
diff --git a/arch/arm/boot/dts/emev2-kzm9d-reference.dts b/arch/arm/boot/dts/emev2-kzm9d-reference.dts
index bed676b95c27..cceefda268b6 100644
--- a/arch/arm/boot/dts/emev2-kzm9d-reference.dts
+++ b/arch/arm/boot/dts/emev2-kzm9d-reference.dts
@@ -21,7 +21,7 @@
21 }; 21 };
22 22
23 chosen { 23 chosen {
24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"; 24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp";
25 }; 25 };
26 26
27 reg_1p8v: regulator@0 { 27 reg_1p8v: regulator@0 {
diff --git a/arch/arm/boot/dts/emev2-kzm9d.dts b/arch/arm/boot/dts/emev2-kzm9d.dts
index dda13bc02f9f..f92e812fdd9f 100644
--- a/arch/arm/boot/dts/emev2-kzm9d.dts
+++ b/arch/arm/boot/dts/emev2-kzm9d.dts
@@ -21,6 +21,6 @@
21 }; 21 };
22 22
23 chosen { 23 chosen {
24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"; 24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp";
25 }; 25 };
26}; 26};
diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi
index 99ad2b2e8e14..9063a4434d6a 100644
--- a/arch/arm/boot/dts/emev2.dtsi
+++ b/arch/arm/boot/dts/emev2.dtsi
@@ -46,6 +46,12 @@
46 <0xe0020000 0x0100>; 46 <0xe0020000 0x0100>;
47 }; 47 };
48 48
49 pmu {
50 compatible = "arm,cortex-a9-pmu";
51 interrupts = <0 120 4>,
52 <0 121 4>;
53 };
54
49 sti@e0180000 { 55 sti@e0180000 {
50 compatible = "renesas,em-sti"; 56 compatible = "renesas,em-sti";
51 reg = <0xe0180000 0x54>; 57 reg = <0xe0180000 0x54>;
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts
new file mode 100644
index 000000000000..f444624eb097
--- /dev/null
+++ b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts
@@ -0,0 +1,65 @@
1/*
2 * Device Tree Source for the APE6EVM board
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12/include/ "r8a73a4.dtsi"
13
14/ {
15 model = "APE6EVM";
16 compatible = "renesas,ape6evm-reference", "renesas,r8a73a4";
17
18 chosen {
19 bootargs = "console=ttySC0,115200 ignore_loglevel rw";
20 };
21
22 memory@40000000 {
23 device_type = "memory";
24 reg = <0 0x40000000 0 0x40000000>;
25 };
26
27 lbsc {
28 compatible = "simple-bus";
29 #address-cells = <1>;
30 #size-cells = <1>;
31 ranges = <0 0 0 0x80000000>;
32 };
33};
34
35&i2c5 {
36 vdd_dvfs: max8973@1b {
37 compatible = "maxim,max8973";
38 reg = <0x1b>;
39
40 regulator-min-microvolt = <935000>;
41 regulator-max-microvolt = <1200000>;
42 regulator-boot-on;
43 regulator-always-on;
44 };
45};
46
47&cpu0 {
48 cpu0-supply = <&vdd_dvfs>;
49 operating-points = <
50 /* kHz uV */
51 1950000 1115000
52 1462500 995000
53 >;
54 voltage-tolerance = <1>; /* 1% */
55};
56
57&pfc {
58 pinctrl-0 = <&scifa0_pins>;
59 pinctrl-names = "default";
60
61 scifa0_pins: scifa0 {
62 renesas,groups = "scifa0_data";
63 renesas,function = "scifa0";
64 };
65};
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm.dts b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
index e657a9db1666..72f867e65791 100644
--- a/arch/arm/boot/dts/r8a73a4-ape6evm.dts
+++ b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
@@ -16,7 +16,7 @@
16 compatible = "renesas,ape6evm", "renesas,r8a73a4"; 16 compatible = "renesas,ape6evm", "renesas,r8a73a4";
17 17
18 chosen { 18 chosen {
19 bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp"; 19 bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw";
20 }; 20 };
21 21
22 memory@40000000 { 22 memory@40000000 {
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
index 366f72989dc3..c638e4ab91b8 100644
--- a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
@@ -17,7 +17,7 @@
17 compatible = "renesas,armadillo800eva-reference", "renesas,r8a7740"; 17 compatible = "renesas,armadillo800eva-reference", "renesas,r8a7740";
18 18
19 chosen { 19 chosen {
20 bootargs = "console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw"; 20 bootargs = "console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw";
21 }; 21 };
22 22
23 memory { 23 memory {
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
index 93da655b2598..426cd9c3e1c4 100644
--- a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
@@ -16,7 +16,7 @@
16 compatible = "renesas,armadillo800eva"; 16 compatible = "renesas,armadillo800eva";
17 17
18 chosen { 18 chosen {
19 bootargs = "console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw"; 19 bootargs = "console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw";
20 }; 20 };
21 21
22 memory { 22 memory {
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
index e18a195b55f3..44d3d520e01f 100644
--- a/arch/arm/boot/dts/r8a7740.dtsi
+++ b/arch/arm/boot/dts/r8a7740.dtsi
@@ -32,6 +32,11 @@
32 <0xc2000000 0x1000>; 32 <0xc2000000 0x1000>;
33 }; 33 };
34 34
35 pmu {
36 compatible = "arm,cortex-a9-pmu";
37 interrupts = <0 83 4>;
38 };
39
35 /* irqpin0: IRQ0 - IRQ7 */ 40 /* irqpin0: IRQ0 - IRQ7 */
36 irqpin0: irqpin@e6900000 { 41 irqpin0: irqpin@e6900000 {
37 compatible = "renesas,intc-irqpin"; 42 compatible = "renesas,intc-irqpin";
@@ -147,4 +152,11 @@
147 gpio-controller; 152 gpio-controller;
148 #gpio-cells = <2>; 153 #gpio-cells = <2>;
149 }; 154 };
155
156 tpu: pwm@e6600000 {
157 compatible = "renesas,tpu-r8a7740", "renesas,tpu";
158 reg = <0xe6600000 0x100>;
159 status = "disabled";
160 #pwm-cells = <3>;
161 };
150}; 162};
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
new file mode 100644
index 000000000000..9bb903a3230d
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
@@ -0,0 +1,32 @@
1/*
2 * Reference Device Tree Source for the Bock-W board
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * based on r8a7779
8 *
9 * Copyright (C) 2013 Renesas Solutions Corp.
10 * Copyright (C) 2013 Simon Horman
11 *
12 * This file is licensed under the terms of the GNU General Public License
13 * version 2. This program is licensed "as is" without any warranty of any
14 * kind, whether express or implied.
15 */
16
17/dts-v1/;
18/include/ "r8a7778.dtsi"
19
20/ {
21 model = "bockw";
22 compatible = "renesas,bockw-reference", "renesas,r8a7778";
23
24 chosen {
25 bootargs = "console=ttySC0,115200 ignore_loglevel rw";
26 };
27
28 memory {
29 device_type = "memory";
30 reg = <0x60000000 0x10000000>;
31 };
32};
diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts
index 0076b1e8a0fb..12bbebc9c955 100644
--- a/arch/arm/boot/dts/r8a7778-bockw.dts
+++ b/arch/arm/boot/dts/r8a7778-bockw.dts
@@ -22,7 +22,7 @@
22 compatible = "renesas,bockw", "renesas,r8a7778"; 22 compatible = "renesas,bockw", "renesas,r8a7778";
23 23
24 chosen { 24 chosen {
25 bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; 25 bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs rw";
26 }; 26 };
27 27
28 memory { 28 memory {
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
index b64705be258d..6d5508392252 100644
--- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
@@ -18,7 +18,7 @@
18 compatible = "renesas,marzen-reference", "renesas,r8a7779"; 18 compatible = "renesas,marzen-reference", "renesas,r8a7779";
19 19
20 chosen { 20 chosen {
21 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"; 21 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on rw";
22 }; 22 };
23 23
24 memory { 24 memory {
diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
new file mode 100644
index 000000000000..f3f7f7999736
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -0,0 +1,27 @@
1/*
2 * Device Tree Source for the Marzen board
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12/dts-v1/;
13/include/ "r8a7779.dtsi"
14
15/ {
16 model = "marzen";
17 compatible = "renesas,marzen", "renesas,r8a7779";
18
19 chosen {
20 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
21 };
22
23 memory {
24 device_type = "memory";
25 reg = <0x60000000 0x40000000>;
26 };
27};
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index e9fbe3d572d7..23a62447359c 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -149,7 +149,7 @@
149 sense-bitfield-width = <2>; 149 sense-bitfield-width = <2>;
150 }; 150 };
151 151
152 i2c0: i2c@0xffc70000 { 152 i2c0: i2c@ffc70000 {
153 #address-cells = <1>; 153 #address-cells = <1>;
154 #size-cells = <0>; 154 #size-cells = <0>;
155 compatible = "renesas,rmobile-iic"; 155 compatible = "renesas,rmobile-iic";
@@ -158,7 +158,7 @@
158 interrupts = <0 79 0x4>; 158 interrupts = <0 79 0x4>;
159 }; 159 };
160 160
161 i2c1: i2c@0xffc71000 { 161 i2c1: i2c@ffc71000 {
162 #address-cells = <1>; 162 #address-cells = <1>;
163 #size-cells = <0>; 163 #size-cells = <0>;
164 compatible = "renesas,rmobile-iic"; 164 compatible = "renesas,rmobile-iic";
@@ -167,7 +167,7 @@
167 interrupts = <0 82 0x4>; 167 interrupts = <0 82 0x4>;
168 }; 168 };
169 169
170 i2c2: i2c@0xffc72000 { 170 i2c2: i2c@ffc72000 {
171 #address-cells = <1>; 171 #address-cells = <1>;
172 #size-cells = <0>; 172 #size-cells = <0>;
173 compatible = "renesas,rmobile-iic"; 173 compatible = "renesas,rmobile-iic";
@@ -176,7 +176,7 @@
176 interrupts = <0 80 0x4>; 176 interrupts = <0 80 0x4>;
177 }; 177 };
178 178
179 i2c3: i2c@0xffc73000 { 179 i2c3: i2c@ffc73000 {
180 #address-cells = <1>; 180 #address-cells = <1>;
181 #size-cells = <0>; 181 #size-cells = <0>;
182 compatible = "renesas,rmobile-iic"; 182 compatible = "renesas,rmobile-iic";
diff --git a/arch/arm/boot/dts/r8a7790-lager-reference.dts b/arch/arm/boot/dts/r8a7790-lager-reference.dts
new file mode 100644
index 000000000000..c462ef138922
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7790-lager-reference.dts
@@ -0,0 +1,45 @@
1/*
2 * Device Tree Source for the Lager board
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12/include/ "r8a7790.dtsi"
13#include <dt-bindings/gpio/gpio.h>
14
15/ {
16 model = "Lager";
17 compatible = "renesas,lager-reference", "renesas,r8a7790";
18
19 chosen {
20 bootargs = "console=ttySC6,115200 ignore_loglevel rw";
21 };
22
23 memory@40000000 {
24 device_type = "memory";
25 reg = <0 0x40000000 0 0x80000000>;
26 };
27
28 lbsc {
29 #address-cells = <1>;
30 #size-cells = <1>;
31 };
32
33 leds {
34 compatible = "gpio-leds";
35 led6 {
36 gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>;
37 };
38 led7 {
39 gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
40 };
41 led8 {
42 gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
43 };
44 };
45};
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 09a84fce89d6..203bd089af29 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -16,7 +16,7 @@
16 compatible = "renesas,lager", "renesas,r8a7790"; 16 compatible = "renesas,lager", "renesas,r8a7790";
17 17
18 chosen { 18 chosen {
19 bootargs = "console=ttySC6,115200 ignore_loglevel"; 19 bootargs = "console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp";
20 }; 20 };
21 21
22 memory@40000000 { 22 memory@40000000 {
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index b99e890def54..212230629f27 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -33,7 +33,7 @@
33 }; 33 };
34 34
35 chosen { 35 chosen {
36 bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200"; 36 bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200 rw";
37 }; 37 };
38 38
39 memory { 39 memory {
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g.dts b/arch/arm/boot/dts/sh73a0-kzm9g.dts
index 7c4071e7790c..0f1ca7792c46 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g.dts
@@ -16,7 +16,7 @@
16 compatible = "renesas,kzm9g", "renesas,sh73a0"; 16 compatible = "renesas,kzm9g", "renesas,sh73a0";
17 17
18 chosen { 18 chosen {
19 bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200"; 19 bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200 rw";
20 }; 20 };
21 21
22 memory { 22 memory {
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
index 86e79feb7560..ba59a5875a10 100644
--- a/arch/arm/boot/dts/sh73a0.dtsi
+++ b/arch/arm/boot/dts/sh73a0.dtsi
@@ -38,6 +38,12 @@
38 <0xf0000100 0x100>; 38 <0xf0000100 0x100>;
39 }; 39 };
40 40
41 pmu {
42 compatible = "arm,cortex-a9-pmu";
43 interrupts = <0 55 4>,
44 <0 56 4>;
45 };
46
41 irqpin0: irqpin@e6900000 { 47 irqpin0: irqpin@e6900000 {
42 compatible = "renesas,intc-irqpin"; 48 compatible = "renesas,intc-irqpin";
43 #interrupt-cells = <2>; 49 #interrupt-cells = <2>;
diff --git a/arch/arm/configs/ag5evm_defconfig b/arch/arm/configs/ag5evm_defconfig
deleted file mode 100644
index 212ead354a6b..000000000000
--- a/arch/arm/configs/ag5evm_defconfig
+++ /dev/null
@@ -1,83 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_NAMESPACES=y
7# CONFIG_UTS_NS is not set
8# CONFIG_IPC_NS is not set
9# CONFIG_USER_NS is not set
10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y
12CONFIG_INITRAMFS_SOURCE=""
13CONFIG_EXPERT=y
14CONFIG_SLAB=y
15# CONFIG_BLK_DEV_BSG is not set
16# CONFIG_IOSCHED_DEADLINE is not set
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_SHMOBILE=y
19CONFIG_ARCH_SH73A0=y
20CONFIG_MACH_AG5EVM=y
21CONFIG_MEMORY_SIZE=0x10000000
22CONFIG_CPU_BPREDICT_DISABLE=y
23CONFIG_ARM_ERRATA_430973=y
24CONFIG_ARM_ERRATA_458693=y
25CONFIG_NO_HZ=y
26CONFIG_AEABI=y
27# CONFIG_OABI_COMPAT is not set
28CONFIG_HIGHMEM=y
29CONFIG_ZBOOT_ROM_TEXT=0x0
30CONFIG_ZBOOT_ROM_BSS=0x0
31CONFIG_CMDLINE="console=tty0 console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel"
32CONFIG_CMDLINE_FORCE=y
33CONFIG_KEXEC=y
34# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
35CONFIG_PM=y
36# CONFIG_SUSPEND is not set
37CONFIG_PM_RUNTIME=y
38CONFIG_NET=y
39CONFIG_PACKET=y
40CONFIG_UNIX=y
41CONFIG_INET=y
42# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
43# CONFIG_INET_XFRM_MODE_TUNNEL is not set
44# CONFIG_INET_XFRM_MODE_BEET is not set
45# CONFIG_INET_LRO is not set
46# CONFIG_INET_DIAG is not set
47# CONFIG_IPV6 is not set
48# CONFIG_WIRELESS is not set
49CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
50# CONFIG_BLK_DEV is not set
51CONFIG_NETDEVICES=y
52CONFIG_NET_ETHERNET=y
53CONFIG_SMSC911X=y
54# CONFIG_NETDEV_1000 is not set
55# CONFIG_NETDEV_10000 is not set
56# CONFIG_WLAN is not set
57CONFIG_INPUT_SPARSEKMAP=y
58# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
59CONFIG_INPUT_EVDEV=y
60# CONFIG_INPUT_KEYBOARD is not set
61# CONFIG_INPUT_MOUSE is not set
62CONFIG_SERIAL_SH_SCI=y
63CONFIG_SERIAL_SH_SCI_NR_UARTS=9
64CONFIG_SERIAL_SH_SCI_CONSOLE=y
65# CONFIG_LEGACY_PTYS is not set
66# CONFIG_HW_RANDOM is not set
67CONFIG_I2C=y
68CONFIG_I2C_SH_MOBILE=y
69# CONFIG_HWMON is not set
70# CONFIG_MFD_SUPPORT is not set
71CONFIG_FB=y
72CONFIG_FB_SH_MOBILE_LCDC=y
73CONFIG_FRAMEBUFFER_CONSOLE=y
74CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
75# CONFIG_HID_SUPPORT is not set
76# CONFIG_USB_SUPPORT is not set
77# CONFIG_DNOTIFY is not set
78# CONFIG_INOTIFY_USER is not set
79CONFIG_TMPFS=y
80# CONFIG_MISC_FILESYSTEMS is not set
81CONFIG_MAGIC_SYSRQ=y
82CONFIG_DEBUG_KERNEL=y
83# CONFIG_FTRACE is not set
diff --git a/arch/arm/configs/kota2_defconfig b/arch/arm/configs/kota2_defconfig
deleted file mode 100644
index 57ad3d47de70..000000000000
--- a/arch/arm/configs/kota2_defconfig
+++ /dev/null
@@ -1,121 +0,0 @@
1# CONFIG_ARM_PATCH_PHYS_VIRT is not set
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y
4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y
6CONFIG_LOG_BUF_SHIFT=16
7CONFIG_CGROUPS=y
8CONFIG_CPUSETS=y
9CONFIG_NAMESPACES=y
10# CONFIG_UTS_NS is not set
11# CONFIG_IPC_NS is not set
12# CONFIG_USER_NS is not set
13# CONFIG_PID_NS is not set
14CONFIG_SYSCTL_SYSCALL=y
15CONFIG_EMBEDDED=y
16CONFIG_SLAB=y
17# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_SHMOBILE=y
21CONFIG_KEYBOARD_GPIO_POLLED=y
22CONFIG_ARCH_SH73A0=y
23CONFIG_MACH_KOTA2=y
24CONFIG_MEMORY_SIZE=0x1e000000
25# CONFIG_SH_TIMER_TMU is not set
26# CONFIG_SWP_EMULATE is not set
27CONFIG_CPU_BPREDICT_DISABLE=y
28CONFIG_ARM_ERRATA_460075=y
29CONFIG_ARM_ERRATA_742230=y
30CONFIG_ARM_ERRATA_742231=y
31CONFIG_PL310_ERRATA_588369=y
32CONFIG_ARM_ERRATA_720789=y
33CONFIG_PL310_ERRATA_727915=y
34CONFIG_ARM_ERRATA_743622=y
35CONFIG_ARM_ERRATA_751472=y
36CONFIG_PL310_ERRATA_753970=y
37CONFIG_ARM_ERRATA_754322=y
38CONFIG_PL310_ERRATA_769419=y
39CONFIG_NO_HZ=y
40CONFIG_SMP=y
41CONFIG_AEABI=y
42# CONFIG_OABI_COMPAT is not set
43CONFIG_HIGHMEM=y
44CONFIG_ZBOOT_ROM_TEXT=0x0
45CONFIG_ZBOOT_ROM_BSS=0x0
46CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel"
47CONFIG_CMDLINE_FORCE=y
48CONFIG_KEXEC=y
49CONFIG_CPU_IDLE=y
50# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
51CONFIG_PM_RUNTIME=y
52CONFIG_NET=y
53CONFIG_PACKET=y
54CONFIG_UNIX=y
55CONFIG_INET=y
56CONFIG_IP_PNP=y
57CONFIG_IP_PNP_DHCP=y
58# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
59# CONFIG_INET_XFRM_MODE_TUNNEL is not set
60# CONFIG_INET_XFRM_MODE_BEET is not set
61# CONFIG_INET_LRO is not set
62# CONFIG_INET_DIAG is not set
63# CONFIG_IPV6 is not set
64CONFIG_CFG80211=y
65CONFIG_WIRELESS_EXT_SYSFS=y
66CONFIG_MAC80211=y
67CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
68# CONFIG_BLK_DEV is not set
69CONFIG_NETDEVICES=y
70# CONFIG_NET_VENDOR_BROADCOM is not set
71# CONFIG_NET_VENDOR_CHELSIO is not set
72# CONFIG_NET_VENDOR_FARADAY is not set
73# CONFIG_NET_VENDOR_INTEL is not set
74# CONFIG_NET_VENDOR_MARVELL is not set
75# CONFIG_NET_VENDOR_MICREL is not set
76# CONFIG_NET_VENDOR_NATSEMI is not set
77# CONFIG_NET_VENDOR_SEEQ is not set
78CONFIG_SMSC911X=y
79# CONFIG_NET_VENDOR_STMICRO is not set
80CONFIG_B43=y
81CONFIG_B43_PHY_N=y
82CONFIG_B43_DEBUG=y
83CONFIG_INPUT_SPARSEKMAP=y
84# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
85CONFIG_INPUT_EVDEV=y
86# CONFIG_KEYBOARD_ATKBD is not set
87CONFIG_KEYBOARD_GPIO=y
88CONFIG_KEYBOARD_SH_KEYSC=y
89# CONFIG_INPUT_MOUSE is not set
90# CONFIG_LEGACY_PTYS is not set
91CONFIG_SERIAL_SH_SCI=y
92CONFIG_SERIAL_SH_SCI_NR_UARTS=9
93CONFIG_SERIAL_SH_SCI_CONSOLE=y
94# CONFIG_HW_RANDOM is not set
95CONFIG_I2C_SH_MOBILE=y
96# CONFIG_HWMON is not set
97CONFIG_BCMA=y
98CONFIG_BCMA_DEBUG=y
99CONFIG_FB=y
100CONFIG_FB_SH_MOBILE_LCDC=y
101CONFIG_LCD_PLATFORM=y
102CONFIG_FRAMEBUFFER_CONSOLE=y
103CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
104# CONFIG_HID_SUPPORT is not set
105# CONFIG_USB_SUPPORT is not set
106CONFIG_MMC=y
107CONFIG_MMC_SDHI=y
108CONFIG_MMC_SH_MMCIF=y
109CONFIG_NEW_LEDS=y
110CONFIG_LEDS_CLASS=y
111CONFIG_LEDS_GPIO=y
112CONFIG_LEDS_RENESAS_TPU=y
113CONFIG_LEDS_TRIGGERS=y
114# CONFIG_DNOTIFY is not set
115CONFIG_TMPFS=y
116# CONFIG_MISC_FILESYSTEMS is not set
117CONFIG_MAGIC_SYSRQ=y
118CONFIG_DEBUG_INFO=y
119CONFIG_DEBUG_INFO_REDUCED=y
120# CONFIG_FTRACE is not set
121CONFIG_DEBUG_USER=y
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index e817fde6729a..1f94c310c477 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -109,18 +109,22 @@ config ARCH_EMEV2
109 109
110comment "SH-Mobile Board Type" 110comment "SH-Mobile Board Type"
111 111
112config MACH_AG5EVM
113 bool "AG5EVM board"
114 depends on ARCH_SH73A0
115 select ARCH_REQUIRE_GPIOLIB
116 select REGULATOR_FIXED_VOLTAGE if REGULATOR
117 select SH_LCD_MIPI_DSI
118
119config MACH_APE6EVM 112config MACH_APE6EVM
120 bool "APE6EVM board" 113 bool "APE6EVM board"
121 depends on ARCH_R8A73A4 114 depends on ARCH_R8A73A4
122 select USE_OF 115 select USE_OF
123 116
117config MACH_APE6EVM_REFERENCE
118 bool "APE6EVM board - Reference Device Tree Implementation"
119 depends on ARCH_R8A73A4
120 select USE_OF
121 ---help---
122 Use reference implementation of APE6EVM board support
123 which makes a greater use of device tree at the expense
124 of not supporting a number of devices.
125
126 This is intended to aid developers
127
124config MACH_MACKEREL 128config MACH_MACKEREL
125 bool "mackerel board" 129 bool "mackerel board"
126 depends on ARCH_SH7372 130 depends on ARCH_SH7372
@@ -129,12 +133,6 @@ config MACH_MACKEREL
129 select SND_SOC_AK4642 if SND_SIMPLE_CARD 133 select SND_SOC_AK4642 if SND_SIMPLE_CARD
130 select USE_OF 134 select USE_OF
131 135
132config MACH_KOTA2
133 bool "KOTA2 board"
134 depends on ARCH_SH73A0
135 select ARCH_REQUIRE_GPIOLIB
136 select REGULATOR_FIXED_VOLTAGE if REGULATOR
137
138config MACH_ARMADILLO800EVA 136config MACH_ARMADILLO800EVA
139 bool "Armadillo-800 EVA board" 137 bool "Armadillo-800 EVA board"
140 depends on ARCH_R8A7740 138 depends on ARCH_R8A7740
@@ -165,11 +163,26 @@ config MACH_BOCKW
165 select REGULATOR_FIXED_VOLTAGE if REGULATOR 163 select REGULATOR_FIXED_VOLTAGE if REGULATOR
166 select USE_OF 164 select USE_OF
167 165
166config MACH_BOCKW_REFERENCE
167 bool "BOCK-W - Reference Device Tree Implementation"
168 depends on ARCH_R8A7778
169 select ARCH_REQUIRE_GPIOLIB
170 select RENESAS_INTC_IRQPIN
171 select REGULATOR_FIXED_VOLTAGE if REGULATOR
172 select USE_OF
173 ---help---
174 Use reference implementation of BockW board support
175 which makes use of device tree at the expense
176 of not supporting a number of devices.
177
178 This is intended to aid developers
179
168config MACH_MARZEN 180config MACH_MARZEN
169 bool "MARZEN board" 181 bool "MARZEN board"
170 depends on ARCH_R8A7779 182 depends on ARCH_R8A7779
171 select ARCH_REQUIRE_GPIOLIB 183 select ARCH_REQUIRE_GPIOLIB
172 select REGULATOR_FIXED_VOLTAGE if REGULATOR 184 select REGULATOR_FIXED_VOLTAGE if REGULATOR
185 select USE_OF
173 186
174config MACH_MARZEN_REFERENCE 187config MACH_MARZEN_REFERENCE
175 bool "MARZEN board - Reference Device Tree Implementation" 188 bool "MARZEN board - Reference Device Tree Implementation"
@@ -189,6 +202,17 @@ config MACH_LAGER
189 depends on ARCH_R8A7790 202 depends on ARCH_R8A7790
190 select USE_OF 203 select USE_OF
191 204
205config MACH_LAGER_REFERENCE
206 bool "Lager board - Reference Device Tree Implementation"
207 depends on ARCH_R8A7790
208 select USE_OF
209 ---help---
210 Use reference implementation of Lager board support
211 which makes use of device tree at the expense
212 of not supporting a number of devices.
213
214 This is intended to aid developers
215
192config MACH_KZM9D 216config MACH_KZM9D
193 bool "KZM9D board" 217 bool "KZM9D board"
194 depends on ARCH_EMEV2 218 depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index b150c4508237..2705bfa8c113 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -11,9 +11,9 @@ obj-y := timer.o console.o
11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o 11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o
12obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o 12obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o
13obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o 13obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o
14obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o 14obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o
15obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o 15obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o
16obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o 16obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o
17obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o 17obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o
18obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o 18obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o
19 19
@@ -32,32 +32,31 @@ endif
32 32
33# SMP objects 33# SMP objects
34smp-y := platsmp.o headsmp.o 34smp-y := platsmp.o headsmp.o
35smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o 35smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o
36smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o 36smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o
37smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o 37smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o
38 38
39# IRQ objects 39# IRQ objects
40obj-$(CONFIG_ARCH_SH7372) += entry-intc.o 40obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
41obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o
42 41
43# PM objects 42# PM objects
44obj-$(CONFIG_SUSPEND) += suspend.o 43obj-$(CONFIG_SUSPEND) += suspend.o
45obj-$(CONFIG_CPU_IDLE) += cpuidle.o 44obj-$(CONFIG_CPU_IDLE) += cpuidle.o
46obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o 45obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
47obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o
48obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o
49obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
50obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o 46obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
47obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o
48obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
51 49
52# Board objects 50# Board objects
53obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
54obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o 51obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
52obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
55obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o 53obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
56obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
57obj-$(CONFIG_MACH_BOCKW) += board-bockw.o 54obj-$(CONFIG_MACH_BOCKW) += board-bockw.o
55obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o
58obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 56obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
59obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o 57obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
60obj-$(CONFIG_MACH_LAGER) += board-lager.o 58obj-$(CONFIG_MACH_LAGER) += board-lager.o
59obj-$(CONFIG_MACH_LAGER_REFERENCE) += board-lager-reference.o
61obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 60obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
62obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o 61obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
63obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 62obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 7785c52b5cfd..6a504fe7d86c 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -1,16 +1,17 @@
1# per-board load address for uImage 1# per-board load address for uImage
2loadaddr-y := 2loadaddr-y :=
3loadaddr-$(CONFIG_MACH_AG5EVM) += 0x40008000
4loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000 3loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000
4loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000
5loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 5loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000
6loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 6loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
8loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000 8loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
9loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000 9loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
10loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000 10loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000
11loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 11loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
12loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 12loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
14loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
14loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 15loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
15loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 16loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
16loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000 17loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
deleted file mode 100644
index f6d64495c405..000000000000
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ /dev/null
@@ -1,639 +0,0 @@
1/*
2 * arch/arm/mach-shmobile/board-ag5evm.c
3 *
4 * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
5 * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/pinctrl/machine.h>
27#include <linux/pinctrl/pinconf-generic.h>
28#include <linux/platform_device.h>
29#include <linux/delay.h>
30#include <linux/io.h>
31#include <linux/dma-mapping.h>
32#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h>
34#include <linux/serial_sci.h>
35#include <linux/smsc911x.h>
36#include <linux/gpio.h>
37#include <linux/videodev2.h>
38#include <linux/input.h>
39#include <linux/input/sh_keysc.h>
40#include <linux/mmc/host.h>
41#include <linux/mmc/sh_mmcif.h>
42#include <linux/mmc/sh_mobile_sdhi.h>
43#include <linux/mfd/tmio.h>
44#include <linux/platform_data/bd6107.h>
45#include <linux/sh_clk.h>
46#include <linux/irqchip/arm-gic.h>
47#include <video/sh_mobile_lcdc.h>
48#include <video/sh_mipi_dsi.h>
49#include <sound/sh_fsi.h>
50#include <mach/hardware.h>
51#include <mach/irqs.h>
52#include <mach/sh73a0.h>
53#include <mach/common.h>
54#include <asm/mach-types.h>
55#include <asm/mach/arch.h>
56#include <asm/hardware/cache-l2x0.h>
57#include <asm/traps.h>
58
59/* Dummy supplies, where voltage doesn't matter */
60static struct regulator_consumer_supply dummy_supplies[] = {
61 REGULATOR_SUPPLY("vddvario", "smsc911x"),
62 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
63};
64
65static struct resource smsc9220_resources[] = {
66 [0] = {
67 .start = 0x14000000,
68 .end = 0x14000000 + SZ_64K - 1,
69 .flags = IORESOURCE_MEM,
70 },
71 [1] = {
72 .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
73 .flags = IORESOURCE_IRQ,
74 },
75};
76
77static struct smsc911x_platform_config smsc9220_platdata = {
78 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
79 .phy_interface = PHY_INTERFACE_MODE_MII,
80 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
81 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
82};
83
84static struct platform_device eth_device = {
85 .name = "smsc911x",
86 .id = 0,
87 .dev = {
88 .platform_data = &smsc9220_platdata,
89 },
90 .resource = smsc9220_resources,
91 .num_resources = ARRAY_SIZE(smsc9220_resources),
92};
93
94static struct sh_keysc_info keysc_platdata = {
95 .mode = SH_KEYSC_MODE_6,
96 .scan_timing = 3,
97 .delay = 100,
98 .keycodes = {
99 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
100 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
101 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
102 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
103 KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
104 KEY_COFFEE,
105 KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
106 KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
107 KEY_COMPUTER,
108 },
109};
110
111static struct resource keysc_resources[] = {
112 [0] = {
113 .name = "KEYSC",
114 .start = 0xe61b0000,
115 .end = 0xe61b0098 - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = gic_spi(71),
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static struct platform_device keysc_device = {
125 .name = "sh_keysc",
126 .id = 0,
127 .num_resources = ARRAY_SIZE(keysc_resources),
128 .resource = keysc_resources,
129 .dev = {
130 .platform_data = &keysc_platdata,
131 },
132};
133
134/* FSI A */
135static struct resource fsi_resources[] = {
136 [0] = {
137 .name = "FSI",
138 .start = 0xEC230000,
139 .end = 0xEC230400 - 1,
140 .flags = IORESOURCE_MEM,
141 },
142 [1] = {
143 .start = gic_spi(146),
144 .flags = IORESOURCE_IRQ,
145 },
146};
147
148static struct platform_device fsi_device = {
149 .name = "sh_fsi2",
150 .id = -1,
151 .num_resources = ARRAY_SIZE(fsi_resources),
152 .resource = fsi_resources,
153};
154
155/* Fixed 1.8V regulator to be used by MMCIF */
156static struct regulator_consumer_supply fixed1v8_power_consumers[] =
157{
158 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
159 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
160};
161
162static struct resource sh_mmcif_resources[] = {
163 [0] = {
164 .name = "MMCIF",
165 .start = 0xe6bd0000,
166 .end = 0xe6bd00ff,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = gic_spi(141),
171 .flags = IORESOURCE_IRQ,
172 },
173 [2] = {
174 .start = gic_spi(140),
175 .flags = IORESOURCE_IRQ,
176 },
177};
178
179static struct sh_mmcif_plat_data sh_mmcif_platdata = {
180 .sup_pclk = 0,
181 .ocr = MMC_VDD_165_195,
182 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
183 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
184 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
185};
186
187static struct platform_device mmc_device = {
188 .name = "sh_mmcif",
189 .id = 0,
190 .dev = {
191 .dma_mask = NULL,
192 .coherent_dma_mask = 0xffffffff,
193 .platform_data = &sh_mmcif_platdata,
194 },
195 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
196 .resource = sh_mmcif_resources,
197};
198
199/* IrDA */
200static struct resource irda_resources[] = {
201 [0] = {
202 .start = 0xE6D00000,
203 .end = 0xE6D01FD4 - 1,
204 .flags = IORESOURCE_MEM,
205 },
206 [1] = {
207 .start = gic_spi(95),
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212static struct platform_device irda_device = {
213 .name = "sh_irda",
214 .id = 0,
215 .resource = irda_resources,
216 .num_resources = ARRAY_SIZE(irda_resources),
217};
218
219/* MIPI-DSI */
220static struct resource mipidsi0_resources[] = {
221 [0] = {
222 .name = "DSI0",
223 .start = 0xfeab0000,
224 .end = 0xfeab3fff,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .name = "DSI0",
229 .start = 0xfeab4000,
230 .end = 0xfeab7fff,
231 .flags = IORESOURCE_MEM,
232 },
233};
234
235static int sh_mipi_set_dot_clock(struct platform_device *pdev,
236 void __iomem *base,
237 int enable)
238{
239 struct clk *pck, *phy;
240 int ret;
241
242 pck = clk_get(&pdev->dev, "dsip_clk");
243 if (IS_ERR(pck)) {
244 ret = PTR_ERR(pck);
245 goto sh_mipi_set_dot_clock_pck_err;
246 }
247
248 phy = clk_get(&pdev->dev, "dsiphy_clk");
249 if (IS_ERR(phy)) {
250 ret = PTR_ERR(phy);
251 goto sh_mipi_set_dot_clock_phy_err;
252 }
253
254 if (enable) {
255 clk_set_rate(pck, clk_round_rate(pck, 24000000));
256 clk_set_rate(phy, clk_round_rate(pck, 510000000));
257 clk_enable(pck);
258 clk_enable(phy);
259 } else {
260 clk_disable(pck);
261 clk_disable(phy);
262 }
263
264 ret = 0;
265
266 clk_put(phy);
267sh_mipi_set_dot_clock_phy_err:
268 clk_put(pck);
269sh_mipi_set_dot_clock_pck_err:
270 return ret;
271}
272
273static struct sh_mipi_dsi_info mipidsi0_info = {
274 .data_format = MIPI_RGB888,
275 .channel = LCDC_CHAN_MAINLCD,
276 .lane = 2,
277 .vsynw_offset = 20,
278 .clksrc = 1,
279 .flags = SH_MIPI_DSI_HSABM |
280 SH_MIPI_DSI_SYNC_PULSES_MODE |
281 SH_MIPI_DSI_HSbyteCLK,
282 .set_dot_clock = sh_mipi_set_dot_clock,
283};
284
285static struct platform_device mipidsi0_device = {
286 .name = "sh-mipi-dsi",
287 .num_resources = ARRAY_SIZE(mipidsi0_resources),
288 .resource = mipidsi0_resources,
289 .id = 0,
290 .dev = {
291 .platform_data = &mipidsi0_info,
292 },
293};
294
295/* LCDC0 and backlight */
296static const struct fb_videomode lcdc0_modes[] = {
297 {
298 .name = "R63302(QHD)",
299 .xres = 544,
300 .yres = 961,
301 .left_margin = 72,
302 .right_margin = 600,
303 .hsync_len = 16,
304 .upper_margin = 8,
305 .lower_margin = 8,
306 .vsync_len = 2,
307 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
308 },
309};
310
311static struct sh_mobile_lcdc_info lcdc0_info = {
312 .clock_source = LCDC_CLK_PERIPHERAL,
313 .ch[0] = {
314 .chan = LCDC_CHAN_MAINLCD,
315 .interface_type = RGB24,
316 .clock_divider = 1,
317 .flags = LCDC_FLAGS_DWPOL,
318 .fourcc = V4L2_PIX_FMT_RGB565,
319 .lcd_modes = lcdc0_modes,
320 .num_modes = ARRAY_SIZE(lcdc0_modes),
321 .panel_cfg = {
322 .width = 44,
323 .height = 79,
324 },
325 .tx_dev = &mipidsi0_device,
326 }
327};
328
329static struct resource lcdc0_resources[] = {
330 [0] = {
331 .name = "LCDC0",
332 .start = 0xfe940000, /* P4-only space */
333 .end = 0xfe943fff,
334 .flags = IORESOURCE_MEM,
335 },
336 [1] = {
337 .start = intcs_evt2irq(0x580),
338 .flags = IORESOURCE_IRQ,
339 },
340};
341
342static struct platform_device lcdc0_device = {
343 .name = "sh_mobile_lcdc_fb",
344 .num_resources = ARRAY_SIZE(lcdc0_resources),
345 .resource = lcdc0_resources,
346 .id = 0,
347 .dev = {
348 .platform_data = &lcdc0_info,
349 .coherent_dma_mask = ~0,
350 },
351};
352
353static struct bd6107_platform_data backlight_data = {
354 .fbdev = &lcdc0_device.dev,
355 .reset = 235,
356 .def_value = 0,
357};
358
359static struct i2c_board_info backlight_board_info = {
360 I2C_BOARD_INFO("bd6107", 0x6d),
361 .platform_data = &backlight_data,
362};
363
364/* Fixed 2.8V regulators to be used by SDHI0 */
365static struct regulator_consumer_supply fixed2v8_power_consumers[] =
366{
367 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
368 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
369};
370
371/* SDHI0 */
372static struct sh_mobile_sdhi_info sdhi0_info = {
373 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
374 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
375 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
376 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
377 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
378 .cd_gpio = 251,
379};
380
381static struct resource sdhi0_resources[] = {
382 [0] = {
383 .name = "SDHI0",
384 .start = 0xee100000,
385 .end = 0xee1000ff,
386 .flags = IORESOURCE_MEM,
387 },
388 [1] = {
389 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
390 .start = gic_spi(83),
391 .flags = IORESOURCE_IRQ,
392 },
393 [2] = {
394 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
395 .start = gic_spi(84),
396 .flags = IORESOURCE_IRQ,
397 },
398 [3] = {
399 .name = SH_MOBILE_SDHI_IRQ_SDIO,
400 .start = gic_spi(85),
401 .flags = IORESOURCE_IRQ,
402 },
403};
404
405static struct platform_device sdhi0_device = {
406 .name = "sh_mobile_sdhi",
407 .id = 0,
408 .num_resources = ARRAY_SIZE(sdhi0_resources),
409 .resource = sdhi0_resources,
410 .dev = {
411 .platform_data = &sdhi0_info,
412 },
413};
414
415/* Fixed 3.3V regulator to be used by SDHI1 */
416static struct regulator_consumer_supply cn4_power_consumers[] =
417{
418 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
419 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
420};
421
422static struct regulator_init_data cn4_power_init_data = {
423 .constraints = {
424 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
425 },
426 .num_consumer_supplies = ARRAY_SIZE(cn4_power_consumers),
427 .consumer_supplies = cn4_power_consumers,
428};
429
430static struct fixed_voltage_config cn4_power_info = {
431 .supply_name = "CN4 SD/MMC Vdd",
432 .microvolts = 3300000,
433 .gpio = 114,
434 .enable_high = 1,
435 .init_data = &cn4_power_init_data,
436};
437
438static struct platform_device cn4_power = {
439 .name = "reg-fixed-voltage",
440 .id = 2,
441 .dev = {
442 .platform_data = &cn4_power_info,
443 },
444};
445
446static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
447{
448 static int power_gpio = -EINVAL;
449
450 if (power_gpio < 0) {
451 int ret = gpio_request_one(114, GPIOF_OUT_INIT_LOW,
452 "sdhi1_power");
453 if (!ret)
454 power_gpio = 114;
455 }
456
457 /*
458 * If requesting the GPIO above failed, it means, that the regulator got
459 * probed and grabbed the GPIO, but we don't know, whether the sdhi
460 * driver already uses the regulator. If it doesn't, we have to toggle
461 * the GPIO ourselves, even though it is now owned by the fixed
462 * regulator driver. We have to live with the race in case the driver
463 * gets unloaded and the GPIO freed between these two steps.
464 */
465 gpio_set_value(114, state);
466}
467
468static struct sh_mobile_sdhi_info sh_sdhi1_info = {
469 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
470 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
471 .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
472 .set_pwr = ag5evm_sdhi1_set_pwr,
473};
474
475static struct resource sdhi1_resources[] = {
476 [0] = {
477 .name = "SDHI1",
478 .start = 0xee120000,
479 .end = 0xee1200ff,
480 .flags = IORESOURCE_MEM,
481 },
482 [1] = {
483 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
484 .start = gic_spi(87),
485 .flags = IORESOURCE_IRQ,
486 },
487 [2] = {
488 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
489 .start = gic_spi(88),
490 .flags = IORESOURCE_IRQ,
491 },
492 [3] = {
493 .name = SH_MOBILE_SDHI_IRQ_SDIO,
494 .start = gic_spi(89),
495 .flags = IORESOURCE_IRQ,
496 },
497};
498
499static struct platform_device sdhi1_device = {
500 .name = "sh_mobile_sdhi",
501 .id = 1,
502 .dev = {
503 .platform_data = &sh_sdhi1_info,
504 },
505 .num_resources = ARRAY_SIZE(sdhi1_resources),
506 .resource = sdhi1_resources,
507};
508
509static struct platform_device *ag5evm_devices[] __initdata = {
510 &cn4_power,
511 &eth_device,
512 &keysc_device,
513 &fsi_device,
514 &mmc_device,
515 &irda_device,
516 &mipidsi0_device,
517 &lcdc0_device,
518 &sdhi0_device,
519 &sdhi1_device,
520};
521
522static unsigned long pin_pullup_conf[] = {
523 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
524};
525
526static const struct pinctrl_map ag5evm_pinctrl_map[] = {
527 /* FSIA */
528 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
529 "fsia_mclk_in", "fsia"),
530 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
531 "fsia_sclk_in", "fsia"),
532 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
533 "fsia_data_in", "fsia"),
534 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
535 "fsia_data_out", "fsia"),
536 /* I2C2 & I2C3 */
537 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.2", "pfc-sh73a0",
538 "i2c2_0", "i2c2"),
539 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
540 "i2c3_0", "i2c3"),
541 /* IrDA */
542 PIN_MAP_MUX_GROUP_DEFAULT("sh_irda.0", "pfc-sh73a0",
543 "irda_0", "irda"),
544 /* KEYSC */
545 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
546 "keysc_in8", "keysc"),
547 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
548 "keysc_out04", "keysc"),
549 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
550 "keysc_out5", "keysc"),
551 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
552 "keysc_out6_0", "keysc"),
553 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
554 "keysc_out7_0", "keysc"),
555 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
556 "keysc_out8_0", "keysc"),
557 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
558 "keysc_out9_2", "keysc"),
559 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
560 "keysc_in8", pin_pullup_conf),
561 /* MMCIF */
562 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
563 "mmc0_data8_0", "mmc0"),
564 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
565 "mmc0_ctrl_0", "mmc0"),
566 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
567 "PORT279", pin_pullup_conf),
568 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
569 "mmc0_data8_0", pin_pullup_conf),
570 /* SCIFA2 */
571 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
572 "scifa2_data_0", "scifa2"),
573 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
574 "scifa2_ctrl_0", "scifa2"),
575 /* SDHI0 (CN15 [SD I/F]) */
576 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
577 "sdhi0_data4", "sdhi0"),
578 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
579 "sdhi0_ctrl", "sdhi0"),
580 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
581 "sdhi0_wp", "sdhi0"),
582 /* SDHI1 (CN4 [WLAN I/F]) */
583 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
584 "sdhi1_data4", "sdhi1"),
585 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
586 "sdhi1_ctrl", "sdhi1"),
587 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
588 "sdhi1_data4", pin_pullup_conf),
589 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
590 "PORT263", pin_pullup_conf),
591};
592
593static void __init ag5evm_init(void)
594{
595 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
596 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
597 regulator_register_always_on(1, "fixed-2.8V", fixed2v8_power_consumers,
598 ARRAY_SIZE(fixed2v8_power_consumers), 3300000);
599 regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
600
601 pinctrl_register_mappings(ag5evm_pinctrl_map,
602 ARRAY_SIZE(ag5evm_pinctrl_map));
603 sh73a0_pinmux_init();
604
605 /* enable MMCIF */
606 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
607
608 /* enable SMSC911X */
609 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
610 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
611
612 /* LCD panel */
613 gpio_request_one(217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
614 mdelay(1);
615 gpio_set_value(217, 1);
616 mdelay(100);
617
618
619#ifdef CONFIG_CACHE_L2X0
620 /* Shared attribute override enable, 64K*8way */
621 l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);
622#endif
623 sh73a0_add_standard_devices();
624
625 i2c_register_board_info(1, &backlight_board_info, 1);
626
627 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
628}
629
630MACHINE_START(AG5EVM, "ag5evm")
631 .smp = smp_ops(sh73a0_smp_ops),
632 .map_io = sh73a0_map_io,
633 .init_early = sh73a0_add_early_devices,
634 .nr_irqs = NR_IRQS_LEGACY,
635 .init_irq = sh73a0_init_irq,
636 .init_machine = ag5evm_init,
637 .init_late = shmobile_init_late,
638 .init_time = sh73a0_earlytimer_init,
639MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c
new file mode 100644
index 000000000000..a23fa714f7ac
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c
@@ -0,0 +1,63 @@
1/*
2 * APE6EVM board support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/gpio.h>
22#include <linux/kernel.h>
23#include <linux/of_platform.h>
24#include <linux/pinctrl/machine.h>
25#include <linux/platform_device.h>
26#include <linux/sh_clk.h>
27#include <mach/common.h>
28#include <mach/r8a73a4.h>
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31
32static void __init ape6evm_add_standard_devices(void)
33{
34
35 struct clk *parent;
36 struct clk *mp;
37
38 r8a73a4_clock_init();
39
40 /* MP clock parent = extal2 */
41 parent = clk_get(NULL, "extal2");
42 mp = clk_get(NULL, "mp");
43 BUG_ON(IS_ERR(parent) || IS_ERR(mp));
44
45 clk_set_parent(mp, parent);
46 clk_put(parent);
47 clk_put(mp);
48
49 r8a73a4_add_dt_devices();
50 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
51 platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
52}
53
54static const char *ape6evm_boards_compat_dt[] __initdata = {
55 "renesas,ape6evm-reference",
56 NULL,
57};
58
59DT_MACHINE_START(APE6EVM_DT, "ape6evm")
60 .init_early = r8a73a4_init_delay,
61 .init_machine = ape6evm_add_standard_devices,
62 .dt_compat = ape6evm_boards_compat_dt,
63MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index 38c6c733fabf..24b87eea9da3 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -241,7 +241,6 @@ static const char *ape6evm_boards_compat_dt[] __initdata = {
241 241
242DT_MACHINE_START(APE6EVM_DT, "ape6evm") 242DT_MACHINE_START(APE6EVM_DT, "ape6evm")
243 .init_early = r8a73a4_init_delay, 243 .init_early = r8a73a4_init_delay,
244 .init_time = shmobile_timer_init,
245 .init_machine = ape6evm_add_standard_devices, 244 .init_machine = ape6evm_add_standard_devices,
246 .dt_compat = ape6evm_boards_compat_dt, 245 .dt_compat = ape6evm_boards_compat_dt,
247MACHINE_END 246MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
index fd2446d995ad..57d1a78367b6 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
@@ -190,7 +190,6 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference")
190 .init_early = r8a7740_init_delay, 190 .init_early = r8a7740_init_delay,
191 .init_irq = r8a7740_init_irq_of, 191 .init_irq = r8a7740_init_irq_of,
192 .init_machine = eva_init, 192 .init_machine = eva_init,
193 .init_time = shmobile_timer_init,
194 .init_late = shmobile_init_late, 193 .init_late = shmobile_init_late,
195 .dt_compat = eva_boards_compat_dt, 194 .dt_compat = eva_boards_compat_dt,
196 .restart = eva_restart, 195 .restart = eva_restart,
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 6b4b77dd2c29..5bd1479d3deb 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1313,7 +1313,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
1313DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") 1313DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
1314 .map_io = r8a7740_map_io, 1314 .map_io = r8a7740_map_io,
1315 .init_early = eva_add_early_devices, 1315 .init_early = eva_add_early_devices,
1316 .init_irq = r8a7740_init_irq, 1316 .init_irq = r8a7740_init_irq_of,
1317 .init_machine = eva_init, 1317 .init_machine = eva_init,
1318 .init_late = shmobile_init_late, 1318 .init_late = shmobile_init_late,
1319 .init_time = eva_earlytimer_init, 1319 .init_time = eva_earlytimer_init,
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
new file mode 100644
index 000000000000..1a7c893e1a52
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-bockw-reference.c
@@ -0,0 +1,61 @@
1/*
2 * Bock-W board support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/of_platform.h>
22#include <linux/pinctrl/machine.h>
23#include <mach/common.h>
24#include <mach/r8a7778.h>
25#include <asm/mach/arch.h>
26
27/*
28 * see board-bock.c for checking detail of dip-switch
29 */
30
31static const struct pinctrl_map bockw_pinctrl_map[] = {
32 /* SCIF0 */
33 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
34 "scif0_data_a", "scif0"),
35 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
36 "scif0_ctrl", "scif0"),
37};
38
39static void __init bockw_init(void)
40{
41 r8a7778_clock_init();
42
43 pinctrl_register_mappings(bockw_pinctrl_map,
44 ARRAY_SIZE(bockw_pinctrl_map));
45 r8a7778_pinmux_init();
46 r8a7778_add_dt_devices();
47
48 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
49}
50
51static const char *bockw_boards_compat_dt[] __initdata = {
52 "renesas,bockw-reference",
53 NULL,
54};
55
56DT_MACHINE_START(BOCKW_DT, "bockw")
57 .init_early = r8a7778_init_delay,
58 .init_irq = r8a7778_init_irq_dt,
59 .init_machine = bockw_init,
60 .dt_compat = bockw_boards_compat_dt,
61MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 35dd7f201a16..6b9faf3908f7 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -21,8 +21,11 @@
21 21
22#include <linux/mfd/tmio.h> 22#include <linux/mfd/tmio.h>
23#include <linux/mmc/host.h> 23#include <linux/mmc/host.h>
24#include <linux/mmc/sh_mobile_sdhi.h>
25#include <linux/mmc/sh_mmcif.h>
24#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
25#include <linux/pinctrl/machine.h> 27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/usb-rcar-phy.h>
26#include <linux/platform_device.h> 29#include <linux/platform_device.h>
27#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
28#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
@@ -66,28 +69,38 @@ static struct regulator_consumer_supply dummy_supplies[] = {
66 REGULATOR_SUPPLY("vdd33a", "smsc911x"), 69 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
67}; 70};
68 71
69static struct smsc911x_platform_config smsc911x_data = { 72static struct smsc911x_platform_config smsc911x_data __initdata = {
70 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 73 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
71 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 74 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
72 .flags = SMSC911X_USE_32BIT, 75 .flags = SMSC911X_USE_32BIT,
73 .phy_interface = PHY_INTERFACE_MODE_MII, 76 .phy_interface = PHY_INTERFACE_MODE_MII,
74}; 77};
75 78
76static struct resource smsc911x_resources[] = { 79static struct resource smsc911x_resources[] __initdata = {
77 DEFINE_RES_MEM(0x18300000, 0x1000), 80 DEFINE_RES_MEM(0x18300000, 0x1000),
78 DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ 81 DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */
79}; 82};
80 83
81/* USB */ 84/* USB */
85static struct resource usb_phy_resources[] __initdata = {
86 DEFINE_RES_MEM(0xffe70800, 0x100),
87 DEFINE_RES_MEM(0xffe76000, 0x100),
88};
89
82static struct rcar_phy_platform_data usb_phy_platform_data __initdata; 90static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
83 91
84/* SDHI */ 92/* SDHI */
85static struct sh_mobile_sdhi_info sdhi0_info = { 93static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
86 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 94 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
87 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 95 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
88 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 96 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
89}; 97};
90 98
99static struct resource sdhi0_resources[] __initdata = {
100 DEFINE_RES_MEM(0xFFE4C000, 0x100),
101 DEFINE_RES_IRQ(gic_iid(0x77)),
102};
103
91static struct sh_eth_plat_data ether_platform_data __initdata = { 104static struct sh_eth_plat_data ether_platform_data __initdata = {
92 .phy = 0x01, 105 .phy = 0x01,
93 .edmac_endian = EDMAC_LITTLE_ENDIAN, 106 .edmac_endian = EDMAC_LITTLE_ENDIAN,
@@ -136,7 +149,12 @@ static struct spi_board_info spi_board_info[] __initdata = {
136}; 149};
137 150
138/* MMC */ 151/* MMC */
139static struct sh_mmcif_plat_data sh_mmcif_plat = { 152static struct resource mmc_resources[] __initdata = {
153 DEFINE_RES_MEM(0xffe4e000, 0x100),
154 DEFINE_RES_IRQ(gic_iid(0x5d)),
155};
156
157static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
140 .sup_pclk = 0, 158 .sup_pclk = 0,
141 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 159 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
142 .caps = MMC_CAP_4_BIT_DATA | 160 .caps = MMC_CAP_4_BIT_DATA |
@@ -217,11 +235,7 @@ static void __init bockw_init(void)
217 r8a7778_clock_init(); 235 r8a7778_clock_init();
218 r8a7778_init_irq_extpin(1); 236 r8a7778_init_irq_extpin(1);
219 r8a7778_add_standard_devices(); 237 r8a7778_add_standard_devices();
220 r8a7778_add_usb_phy_device(&usb_phy_platform_data);
221 r8a7778_add_ether_device(&ether_platform_data); 238 r8a7778_add_ether_device(&ether_platform_data);
222 r8a7778_add_i2c_device(0);
223 r8a7778_add_hspi_device(0);
224 r8a7778_add_mmc_device(&sh_mmcif_plat);
225 r8a7778_add_vin_device(0, &vin_platform_data); 239 r8a7778_add_vin_device(0, &vin_platform_data);
226 /* VIN1 has a pin conflict with Ether */ 240 /* VIN1 has a pin conflict with Ether */
227 if (!IS_ENABLED(CONFIG_SH_ETH)) 241 if (!IS_ENABLED(CONFIG_SH_ETH))
@@ -241,6 +255,19 @@ static void __init bockw_init(void)
241 ARRAY_SIZE(bockw_pinctrl_map)); 255 ARRAY_SIZE(bockw_pinctrl_map));
242 r8a7778_pinmux_init(); 256 r8a7778_pinmux_init();
243 257
258 platform_device_register_resndata(
259 &platform_bus, "sh_mmcif", -1,
260 mmc_resources, ARRAY_SIZE(mmc_resources),
261 &sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));
262
263 platform_device_register_resndata(
264 &platform_bus, "rcar_usb_phy", -1,
265 usb_phy_resources,
266 ARRAY_SIZE(usb_phy_resources),
267 &usb_phy_platform_data,
268 sizeof(struct rcar_phy_platform_data));
269
270
244 /* for SMSC */ 271 /* for SMSC */
245 base = ioremap_nocache(FPGA, SZ_1M); 272 base = ioremap_nocache(FPGA, SZ_1M);
246 if (base) { 273 if (base) {
@@ -276,7 +303,10 @@ static void __init bockw_init(void)
276 iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4); 303 iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4);
277 iounmap(base); 304 iounmap(base);
278 305
279 r8a7778_sdhi_init(0, &sdhi0_info); 306 platform_device_register_resndata(
307 &platform_bus, "sh_mobile_sdhi", 0,
308 sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
309 &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
280 } 310 }
281} 311}
282 312
@@ -289,7 +319,6 @@ DT_MACHINE_START(BOCKW_DT, "bockw")
289 .init_early = r8a7778_init_delay, 319 .init_early = r8a7778_init_delay,
290 .init_irq = r8a7778_init_irq_dt, 320 .init_irq = r8a7778_init_irq_dt,
291 .init_machine = bockw_init, 321 .init_machine = bockw_init,
292 .init_time = shmobile_timer_init,
293 .dt_compat = bockw_boards_compat_dt, 322 .dt_compat = bockw_boards_compat_dt,
294 .init_late = r8a7778_init_late, 323 .init_late = r8a7778_init_late,
295MACHINE_END 324MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
deleted file mode 100644
index 6af20d909bdb..000000000000
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ /dev/null
@@ -1,550 +0,0 @@
1/*
2 * kota2 board support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
7 * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <linux/kernel.h>
24#include <linux/init.h>
25#include <linux/interrupt.h>
26#include <linux/irq.h>
27#include <linux/pinctrl/machine.h>
28#include <linux/pinctrl/pinconf-generic.h>
29#include <linux/platform_data/pwm-renesas-tpu.h>
30#include <linux/platform_device.h>
31#include <linux/delay.h>
32#include <linux/io.h>
33#include <linux/regulator/fixed.h>
34#include <linux/regulator/machine.h>
35#include <linux/smsc911x.h>
36#include <linux/gpio.h>
37#include <linux/input.h>
38#include <linux/input/sh_keysc.h>
39#include <linux/gpio_keys.h>
40#include <linux/leds.h>
41#include <linux/leds_pwm.h>
42#include <linux/irqchip/arm-gic.h>
43#include <linux/mmc/host.h>
44#include <linux/mmc/sh_mmcif.h>
45#include <linux/mfd/tmio.h>
46#include <linux/mmc/sh_mobile_sdhi.h>
47#include <mach/hardware.h>
48#include <mach/irqs.h>
49#include <mach/sh73a0.h>
50#include <mach/common.h>
51#include <asm/mach-types.h>
52#include <asm/mach/arch.h>
53#include <asm/mach/time.h>
54#include <asm/hardware/cache-l2x0.h>
55#include <asm/traps.h>
56
57/* Dummy supplies, where voltage doesn't matter */
58static struct regulator_consumer_supply dummy_supplies[] = {
59 REGULATOR_SUPPLY("vddvario", "smsc911x"),
60 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
61};
62
63/* SMSC 9220 */
64static struct resource smsc9220_resources[] = {
65 [0] = {
66 .start = 0x14000000, /* CS5A */
67 .end = 0x140000ff, /* A1->A7 */
68 .flags = IORESOURCE_MEM,
69 },
70 [1] = {
71 .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct smsc911x_platform_config smsc9220_platdata = {
77 .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
78 .phy_interface = PHY_INTERFACE_MODE_MII,
79 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
80 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
81};
82
83static struct platform_device eth_device = {
84 .name = "smsc911x",
85 .id = 0,
86 .dev = {
87 .platform_data = &smsc9220_platdata,
88 },
89 .resource = smsc9220_resources,
90 .num_resources = ARRAY_SIZE(smsc9220_resources),
91};
92
93/* KEYSC */
94static struct sh_keysc_info keysc_platdata = {
95 .mode = SH_KEYSC_MODE_6,
96 .scan_timing = 3,
97 .delay = 100,
98 .keycodes = {
99 KEY_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND,
100 0, 0, 0, 0, 0,
101 KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9,
102 0, KEY_DOWN, 0, 0, 0,
103 KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6,
104 KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0,
105 KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3,
106 0, KEY_UP, 0, 0, 0,
107 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0,
110 0, 0, 0, 0, 0, 0, 0, 0,
111 },
112};
113
114static struct resource keysc_resources[] = {
115 [0] = {
116 .name = "KEYSC",
117 .start = 0xe61b0000,
118 .end = 0xe61b0098 - 1,
119 .flags = IORESOURCE_MEM,
120 },
121 [1] = {
122 .start = gic_spi(71),
123 .flags = IORESOURCE_IRQ,
124 },
125};
126
127static struct platform_device keysc_device = {
128 .name = "sh_keysc",
129 .id = 0,
130 .num_resources = ARRAY_SIZE(keysc_resources),
131 .resource = keysc_resources,
132 .dev = {
133 .platform_data = &keysc_platdata,
134 },
135};
136
137/* GPIO KEY */
138#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
139
140static struct gpio_keys_button gpio_buttons[] = {
141 GPIO_KEY(KEY_VOLUMEUP, 56, "+"), /* S2: VOL+ [IRQ9] */
142 GPIO_KEY(KEY_VOLUMEDOWN, 54, "-"), /* S3: VOL- [IRQ10] */
143 GPIO_KEY(KEY_MENU, 27, "Menu"), /* S4: MENU [IRQ30] */
144 GPIO_KEY(KEY_HOMEPAGE, 26, "Home"), /* S5: HOME [IRQ31] */
145 GPIO_KEY(KEY_BACK, 11, "Back"), /* S6: BACK [IRQ0] */
146 GPIO_KEY(KEY_PHONE, 238, "Tel"), /* S7: TEL [IRQ11] */
147 GPIO_KEY(KEY_POWER, 239, "C1"), /* S8: CAM [IRQ13] */
148 GPIO_KEY(KEY_MAIL, 224, "Mail"), /* S9: MAIL [IRQ3] */
149 /* Omitted button "C3?": 223 - S10: CUST [IRQ8] */
150 GPIO_KEY(KEY_CAMERA, 164, "C2"), /* S11: CAM_HALF [IRQ25] */
151 /* Omitted button "?": 152 - S12: CAM_FULL [No IRQ] */
152};
153
154static struct gpio_keys_platform_data gpio_key_info = {
155 .buttons = gpio_buttons,
156 .nbuttons = ARRAY_SIZE(gpio_buttons),
157};
158
159static struct platform_device gpio_keys_device = {
160 .name = "gpio-keys",
161 .id = -1,
162 .dev = {
163 .platform_data = &gpio_key_info,
164 },
165};
166
167/* GPIO LED */
168#define GPIO_LED(n, g) { .name = n, .gpio = g }
169
170static struct gpio_led gpio_leds[] = {
171 GPIO_LED("G", 20), /* PORT20 [GPO0] -> LED7 -> "G" */
172 GPIO_LED("H", 21), /* PORT21 [GPO1] -> LED8 -> "H" */
173 GPIO_LED("J", 22), /* PORT22 [GPO2] -> LED9 -> "J" */
174};
175
176static struct gpio_led_platform_data gpio_leds_info = {
177 .leds = gpio_leds,
178 .num_leds = ARRAY_SIZE(gpio_leds),
179};
180
181static struct platform_device gpio_leds_device = {
182 .name = "leds-gpio",
183 .id = -1,
184 .dev = {
185 .platform_data = &gpio_leds_info,
186 },
187};
188
189/* TPU LED */
190static struct resource tpu1_pwm_resources[] = {
191 [0] = {
192 .start = 0xe6610000,
193 .end = 0xe66100ff,
194 .flags = IORESOURCE_MEM,
195 },
196};
197
198static struct platform_device tpu1_pwm_device = {
199 .name = "renesas-tpu-pwm",
200 .id = 1,
201 .num_resources = ARRAY_SIZE(tpu1_pwm_resources),
202 .resource = tpu1_pwm_resources,
203};
204
205static struct resource tpu2_pwm_resources[] = {
206 [0] = {
207 .start = 0xe6620000,
208 .end = 0xe66200ff,
209 .flags = IORESOURCE_MEM,
210 },
211};
212
213static struct platform_device tpu2_pwm_device = {
214 .name = "renesas-tpu-pwm",
215 .id = 2,
216 .num_resources = ARRAY_SIZE(tpu2_pwm_resources),
217 .resource = tpu2_pwm_resources,
218};
219
220static struct resource tpu3_pwm_resources[] = {
221 [0] = {
222 .start = 0xe6630000,
223 .end = 0xe66300ff,
224 .flags = IORESOURCE_MEM,
225 },
226};
227
228static struct platform_device tpu3_pwm_device = {
229 .name = "renesas-tpu-pwm",
230 .id = 3,
231 .num_resources = ARRAY_SIZE(tpu3_pwm_resources),
232 .resource = tpu3_pwm_resources,
233};
234
235static struct resource tpu4_pwm_resources[] = {
236 [0] = {
237 .start = 0xe6640000,
238 .end = 0xe66400ff,
239 .flags = IORESOURCE_MEM,
240 },
241};
242
243static struct platform_device tpu4_pwm_device = {
244 .name = "renesas-tpu-pwm",
245 .id = 4,
246 .num_resources = ARRAY_SIZE(tpu4_pwm_resources),
247 .resource = tpu4_pwm_resources,
248};
249
250static struct pwm_lookup pwm_lookup[] = {
251 PWM_LOOKUP("renesas-tpu-pwm.1", 2, "leds-pwm.0", "V2513"),
252 PWM_LOOKUP("renesas-tpu-pwm.2", 1, "leds-pwm.0", "V2515"),
253 PWM_LOOKUP("renesas-tpu-pwm.3", 0, "leds-pwm.0", "KEYLED"),
254 PWM_LOOKUP("renesas-tpu-pwm.4", 1, "leds-pwm.0", "V2514"),
255};
256
257static struct led_pwm tpu_pwm_leds[] = {
258 {
259 .name = "V2513",
260 .max_brightness = 1000,
261 }, {
262 .name = "V2515",
263 .max_brightness = 1000,
264 }, {
265 .name = "KEYLED",
266 .max_brightness = 1000,
267 }, {
268 .name = "V2514",
269 .max_brightness = 1000,
270 },
271};
272
273static struct led_pwm_platform_data leds_pwm_pdata = {
274 .num_leds = ARRAY_SIZE(tpu_pwm_leds),
275 .leds = tpu_pwm_leds,
276};
277
278static struct platform_device leds_pwm_device = {
279 .name = "leds-pwm",
280 .id = 0,
281 .dev = {
282 .platform_data = &leds_pwm_pdata,
283 },
284};
285
286/* Fixed 1.8V regulator to be used by MMCIF */
287static struct regulator_consumer_supply fixed1v8_power_consumers[] =
288{
289 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
290 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
291};
292
293/* MMCIF */
294static struct resource mmcif_resources[] = {
295 [0] = {
296 .name = "MMCIF",
297 .start = 0xe6bd0000,
298 .end = 0xe6bd00ff,
299 .flags = IORESOURCE_MEM,
300 },
301 [1] = {
302 .start = gic_spi(140),
303 .flags = IORESOURCE_IRQ,
304 },
305 [2] = {
306 .start = gic_spi(141),
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311static struct sh_mmcif_plat_data mmcif_info = {
312 .ocr = MMC_VDD_165_195,
313 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
314};
315
316static struct platform_device mmcif_device = {
317 .name = "sh_mmcif",
318 .id = 0,
319 .dev = {
320 .platform_data = &mmcif_info,
321 },
322 .num_resources = ARRAY_SIZE(mmcif_resources),
323 .resource = mmcif_resources,
324};
325
326/* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
327static struct regulator_consumer_supply fixed3v3_power_consumers[] =
328{
329 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
330 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
331 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
332 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
333};
334
335/* SDHI0 */
336static struct sh_mobile_sdhi_info sdhi0_info = {
337 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
338 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
339};
340
341static struct resource sdhi0_resources[] = {
342 [0] = {
343 .name = "SDHI0",
344 .start = 0xee100000,
345 .end = 0xee1000ff,
346 .flags = IORESOURCE_MEM,
347 },
348 [1] = {
349 .start = gic_spi(83),
350 .flags = IORESOURCE_IRQ,
351 },
352 [2] = {
353 .start = gic_spi(84),
354 .flags = IORESOURCE_IRQ,
355 },
356 [3] = {
357 .start = gic_spi(85),
358 .flags = IORESOURCE_IRQ,
359 },
360};
361
362static struct platform_device sdhi0_device = {
363 .name = "sh_mobile_sdhi",
364 .id = 0,
365 .num_resources = ARRAY_SIZE(sdhi0_resources),
366 .resource = sdhi0_resources,
367 .dev = {
368 .platform_data = &sdhi0_info,
369 },
370};
371
372/* SDHI1 */
373static struct sh_mobile_sdhi_info sdhi1_info = {
374 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
375 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
376};
377
378static struct resource sdhi1_resources[] = {
379 [0] = {
380 .name = "SDHI1",
381 .start = 0xee120000,
382 .end = 0xee1200ff,
383 .flags = IORESOURCE_MEM,
384 },
385 [1] = {
386 .start = gic_spi(87),
387 .flags = IORESOURCE_IRQ,
388 },
389 [2] = {
390 .start = gic_spi(88),
391 .flags = IORESOURCE_IRQ,
392 },
393 [3] = {
394 .start = gic_spi(89),
395 .flags = IORESOURCE_IRQ,
396 },
397};
398
399static struct platform_device sdhi1_device = {
400 .name = "sh_mobile_sdhi",
401 .id = 1,
402 .num_resources = ARRAY_SIZE(sdhi1_resources),
403 .resource = sdhi1_resources,
404 .dev = {
405 .platform_data = &sdhi1_info,
406 },
407};
408
409static struct platform_device *kota2_devices[] __initdata = {
410 &eth_device,
411 &keysc_device,
412 &gpio_keys_device,
413 &gpio_leds_device,
414 &tpu1_pwm_device,
415 &tpu2_pwm_device,
416 &tpu3_pwm_device,
417 &tpu4_pwm_device,
418 &leds_pwm_device,
419 &mmcif_device,
420 &sdhi0_device,
421 &sdhi1_device,
422};
423
424static unsigned long pin_pullup_conf[] = {
425 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
426};
427
428static const struct pinctrl_map kota2_pinctrl_map[] = {
429 /* KEYSC */
430 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
431 "keysc_in8", "keysc"),
432 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
433 "keysc_out04", "keysc"),
434 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
435 "keysc_out5", "keysc"),
436 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
437 "keysc_out6_0", "keysc"),
438 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
439 "keysc_out7_0", "keysc"),
440 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
441 "keysc_out8_0", "keysc"),
442 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
443 "keysc_in8", pin_pullup_conf),
444 /* MMCIF */
445 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
446 "mmc0_data8_0", "mmc0"),
447 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
448 "mmc0_ctrl_0", "mmc0"),
449 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
450 "PORT279", pin_pullup_conf),
451 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
452 "mmc0_data8_0", pin_pullup_conf),
453 /* SCIFA2 (UART2) */
454 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
455 "scifa2_data_0", "scifa2"),
456 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
457 "scifa2_ctrl_0", "scifa2"),
458 /* SCIFA4 (UART1) */
459 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
460 "scifa4_data", "scifa4"),
461 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
462 "scifa4_ctrl", "scifa4"),
463 /* SCIFB (BT) */
464 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
465 "scifb_data_0", "scifb"),
466 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
467 "scifb_clk_0", "scifb"),
468 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
469 "scifb_ctrl_0", "scifb"),
470 /* SDHI0 (microSD) */
471 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
472 "sdhi0_data4", "sdhi0"),
473 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
474 "sdhi0_ctrl", "sdhi0"),
475 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
476 "sdhi0_cd", "sdhi0"),
477 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
478 "sdhi0_data4", pin_pullup_conf),
479 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
480 "PORT256", pin_pullup_conf),
481 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
482 "PORT251", pin_pullup_conf),
483 /* SDHI1 (BCM4330) */
484 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
485 "sdhi1_data4", "sdhi1"),
486 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
487 "sdhi1_ctrl", "sdhi1"),
488 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
489 "sdhi1_data4", pin_pullup_conf),
490 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
491 "PORT263", pin_pullup_conf),
492 /* SMSC911X */
493 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
494 "bsc_data_0_7", "bsc"),
495 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
496 "bsc_data_8_15", "bsc"),
497 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
498 "bsc_cs5_a", "bsc"),
499 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
500 "bsc_we0", "bsc"),
501 /* TPU */
502 PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.1", "pfc-sh73a0",
503 "tpu1_to2", "tpu1"),
504 PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.2", "pfc-sh73a0",
505 "tpu2_to1", "tpu2"),
506 PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.3", "pfc-sh73a0",
507 "tpu3_to0", "tpu3"),
508 PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.4", "pfc-sh73a0",
509 "tpu4_to1", "tpu4"),
510};
511
512static void __init kota2_init(void)
513{
514 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
515 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
516 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
517 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
518 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
519
520 pinctrl_register_mappings(kota2_pinctrl_map,
521 ARRAY_SIZE(kota2_pinctrl_map));
522 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
523
524 sh73a0_pinmux_init();
525
526 /* SMSC911X */
527 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
528 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
529
530 /* MMCIF */
531 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
532
533#ifdef CONFIG_CACHE_L2X0
534 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
535 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
536#endif
537 sh73a0_add_standard_devices();
538 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
539}
540
541MACHINE_START(KOTA2, "kota2")
542 .smp = smp_ops(sh73a0_smp_ops),
543 .map_io = sh73a0_map_io,
544 .init_early = sh73a0_add_early_devices,
545 .nr_irqs = NR_IRQS_LEGACY,
546 .init_irq = sh73a0_init_irq,
547 .init_machine = kota2_init,
548 .init_late = shmobile_init_late,
549 .init_time = sh73a0_earlytimer_init,
550MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index a66a808db012..598e32488410 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -52,6 +52,5 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
52 .init_early = sh73a0_init_delay, 52 .init_early = sh73a0_init_delay,
53 .nr_irqs = NR_IRQS_LEGACY, 53 .nr_irqs = NR_IRQS_LEGACY,
54 .init_machine = kzm_init, 54 .init_machine = kzm_init,
55 .init_time = shmobile_timer_init,
56 .dt_compat = kzm9g_boards_compat_dt, 55 .dt_compat = kzm9g_boards_compat_dt,
57MACHINE_END 56MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 1068120d339f..f1994968d303 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -54,14 +54,14 @@
54/* 54/*
55 * external GPIO 55 * external GPIO
56 */ 56 */
57#define GPIO_PCF8575_BASE (GPIO_NR) 57#define GPIO_PCF8575_BASE (310)
58#define GPIO_PCF8575_PORT10 (GPIO_NR + 8) 58#define GPIO_PCF8575_PORT10 (GPIO_PCF8575_BASE + 8)
59#define GPIO_PCF8575_PORT11 (GPIO_NR + 9) 59#define GPIO_PCF8575_PORT11 (GPIO_PCF8575_BASE + 9)
60#define GPIO_PCF8575_PORT12 (GPIO_NR + 10) 60#define GPIO_PCF8575_PORT12 (GPIO_PCF8575_BASE + 10)
61#define GPIO_PCF8575_PORT13 (GPIO_NR + 11) 61#define GPIO_PCF8575_PORT13 (GPIO_PCF8575_BASE + 11)
62#define GPIO_PCF8575_PORT14 (GPIO_NR + 12) 62#define GPIO_PCF8575_PORT14 (GPIO_PCF8575_BASE + 12)
63#define GPIO_PCF8575_PORT15 (GPIO_NR + 13) 63#define GPIO_PCF8575_PORT15 (GPIO_PCF8575_BASE + 13)
64#define GPIO_PCF8575_PORT16 (GPIO_NR + 14) 64#define GPIO_PCF8575_PORT16 (GPIO_PCF8575_BASE + 14)
65 65
66/* Dummy supplies, where voltage doesn't matter */ 66/* Dummy supplies, where voltage doesn't matter */
67static struct regulator_consumer_supply dummy_supplies[] = { 67static struct regulator_consumer_supply dummy_supplies[] = {
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
new file mode 100644
index 000000000000..9c316a1b2e32
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -0,0 +1,45 @@
1/*
2 * Lager board support - Reference DT implementation
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/of_platform.h>
23#include <mach/r8a7790.h>
24#include <asm/mach/arch.h>
25
26static void __init lager_add_standard_devices(void)
27{
28 /* clocks are setup late during boot in the case of DT */
29 r8a7790_clock_init();
30
31 r8a7790_add_dt_devices();
32 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
33}
34
35static const char *lager_boards_compat_dt[] __initdata = {
36 "renesas,lager-reference",
37 NULL,
38};
39
40DT_MACHINE_START(LAGER_DT, "lager")
41 .init_early = r8a7790_init_delay,
42 .init_machine = lager_add_standard_devices,
43 .init_time = r8a7790_timer_init,
44 .dt_compat = lager_boards_compat_dt,
45MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 3d1c439b4998..3f4250a2d4eb 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -42,6 +42,5 @@ DT_MACHINE_START(MARZEN, "marzen")
42 .nr_irqs = NR_IRQS_LEGACY, 42 .nr_irqs = NR_IRQS_LEGACY,
43 .init_irq = r8a7779_init_irq_dt, 43 .init_irq = r8a7779_init_irq_dt,
44 .init_machine = marzen_init, 44 .init_machine = marzen_init,
45 .init_time = shmobile_timer_init,
46 .dt_compat = marzen_boards_compat_dt, 45 .dt_compat = marzen_boards_compat_dt,
47MACHINE_END 46MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index ca7fb2e63c60..3f5044fda4e3 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -30,6 +30,7 @@
30#include <linux/dma-mapping.h> 30#include <linux/dma-mapping.h>
31#include <linux/pinctrl/machine.h> 31#include <linux/pinctrl/machine.h>
32#include <linux/platform_data/gpio-rcar.h> 32#include <linux/platform_data/gpio-rcar.h>
33#include <linux/platform_data/usb-rcar-phy.h>
33#include <linux/regulator/fixed.h> 34#include <linux/regulator/fixed.h>
34#include <linux/regulator/machine.h> 35#include <linux/regulator/machine.h>
35#include <linux/smsc911x.h> 36#include <linux/smsc911x.h>
@@ -39,7 +40,6 @@
39#include <linux/mmc/sh_mobile_sdhi.h> 40#include <linux/mmc/sh_mobile_sdhi.h>
40#include <linux/mfd/tmio.h> 41#include <linux/mfd/tmio.h>
41#include <media/soc_camera.h> 42#include <media/soc_camera.h>
42#include <mach/hardware.h>
43#include <mach/r8a7779.h> 43#include <mach/r8a7779.h>
44#include <mach/common.h> 44#include <mach/common.h>
45#include <mach/irqs.h> 45#include <mach/irqs.h>
@@ -59,7 +59,26 @@ static struct regulator_consumer_supply dummy_supplies[] = {
59 REGULATOR_SUPPLY("vdd33a", "smsc911x"), 59 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
60}; 60};
61 61
62static struct rcar_phy_platform_data usb_phy_platform_data __initdata; 62/* USB PHY */
63static struct resource usb_phy_resources[] = {
64 [0] = {
65 .start = 0xffe70800,
66 .end = 0xffe70900 - 1,
67 .flags = IORESOURCE_MEM,
68 },
69};
70
71static struct rcar_phy_platform_data usb_phy_platform_data;
72
73static struct platform_device usb_phy = {
74 .name = "rcar_usb_phy",
75 .id = -1,
76 .dev = {
77 .platform_data = &usb_phy_platform_data,
78 },
79 .resource = usb_phy_resources,
80 .num_resources = ARRAY_SIZE(usb_phy_resources),
81};
63 82
64/* SMSC LAN89218 */ 83/* SMSC LAN89218 */
65static struct resource smsc911x_resources[] = { 84static struct resource smsc911x_resources[] = {
@@ -212,6 +231,7 @@ static struct platform_device *marzen_devices[] __initdata = {
212 &thermal_device, 231 &thermal_device,
213 &hspi_device, 232 &hspi_device,
214 &leds_device, 233 &leds_device,
234 &usb_phy,
215 &camera0_device, 235 &camera0_device,
216 &camera1_device, 236 &camera1_device,
217}; 237};
@@ -274,19 +294,23 @@ static void __init marzen_init(void)
274 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ 294 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
275 295
276 r8a7779_add_standard_devices(); 296 r8a7779_add_standard_devices();
277 r8a7779_add_usb_phy_device(&usb_phy_platform_data);
278 r8a7779_add_vin_device(1, &vin_platform_data); 297 r8a7779_add_vin_device(1, &vin_platform_data);
279 r8a7779_add_vin_device(3, &vin_platform_data); 298 r8a7779_add_vin_device(3, &vin_platform_data);
280 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 299 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
281} 300}
282 301
283MACHINE_START(MARZEN, "marzen") 302static const char *marzen_boards_compat_dt[] __initdata = {
303 "renesas,marzen",
304 NULL,
305};
306
307DT_MACHINE_START(MARZEN, "marzen")
284 .smp = smp_ops(r8a7779_smp_ops), 308 .smp = smp_ops(r8a7779_smp_ops),
285 .map_io = r8a7779_map_io, 309 .map_io = r8a7779_map_io,
286 .init_early = r8a7779_add_early_devices, 310 .init_early = r8a7779_add_early_devices,
287 .nr_irqs = NR_IRQS_LEGACY, 311 .init_irq = r8a7779_init_irq_dt,
288 .init_irq = r8a7779_init_irq,
289 .init_machine = marzen_init, 312 .init_machine = marzen_init,
290 .init_late = r8a7779_init_late, 313 .init_late = r8a7779_init_late,
314 .dt_compat = marzen_boards_compat_dt,
291 .init_time = r8a7779_earlytimer_init, 315 .init_time = r8a7779_earlytimer_init,
292MACHINE_END 316MACHINE_END
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 2667db806c39..f93751caf5cb 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -40,3 +40,52 @@ shmobile_boot_fn:
40 .globl shmobile_boot_arg 40 .globl shmobile_boot_arg
41shmobile_boot_arg: 41shmobile_boot_arg:
422: .space 4 422: .space 4
43
44/*
45 * Per-CPU SMP boot function/argument selection code based on MPIDR
46 */
47
48ENTRY(shmobile_smp_boot)
49 @ r0 = MPIDR_HWID_BITMASK
50 mrc p15, 0, r1, c0, c0, 5 @ r1 = MPIDR
51 and r0, r1, r0 @ r0 = cpu_logical_map() value
52 mov r1, #0 @ r1 = CPU index
53 adr r5, 1f @ array of per-cpu mpidr values
54 adr r6, 2f @ array of per-cpu functions
55 adr r7, 3f @ array of per-cpu arguments
56
57shmobile_smp_boot_find_mpidr:
58 ldr r8, [r5, r1, lsl #2]
59 cmp r8, r0
60 bne shmobile_smp_boot_next
61
62 ldr r9, [r6, r1, lsl #2]
63 cmp r9, #0
64 bne shmobile_smp_boot_found
65
66shmobile_smp_boot_next:
67 add r1, r1, #1
68 cmp r1, #CONFIG_NR_CPUS
69 blo shmobile_smp_boot_find_mpidr
70
71 b shmobile_smp_sleep
72
73shmobile_smp_boot_found:
74 ldr r0, [r7, r1, lsl #2]
75 mov pc, r9
76ENDPROC(shmobile_smp_boot)
77
78ENTRY(shmobile_smp_sleep)
79 wfi
80 b shmobile_smp_boot
81ENDPROC(shmobile_smp_sleep)
82
83 .globl shmobile_smp_mpidr
84shmobile_smp_mpidr:
851: .space CONFIG_NR_CPUS * 4
86 .globl shmobile_smp_fn
87shmobile_smp_fn:
882: .space CONFIG_NR_CPUS * 4
89 .globl shmobile_smp_arg
90shmobile_smp_arg:
913: .space CONFIG_NR_CPUS * 4
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index e818f029d8e3..7b938681e756 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -2,7 +2,6 @@
2#define __ARCH_MACH_COMMON_H 2#define __ARCH_MACH_COMMON_H
3 3
4extern void shmobile_earlytimer_init(void); 4extern void shmobile_earlytimer_init(void);
5extern void shmobile_timer_init(void);
6extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, 5extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
7 unsigned int mult, unsigned int div); 6 unsigned int mult, unsigned int div);
8struct twd_local_timer; 7struct twd_local_timer;
@@ -10,7 +9,16 @@ extern void shmobile_setup_console(void);
10extern void shmobile_boot_vector(void); 9extern void shmobile_boot_vector(void);
11extern unsigned long shmobile_boot_fn; 10extern unsigned long shmobile_boot_fn;
12extern unsigned long shmobile_boot_arg; 11extern unsigned long shmobile_boot_arg;
12extern void shmobile_smp_boot(void);
13extern void shmobile_smp_sleep(void);
14extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
15 unsigned long arg);
13extern void shmobile_boot_scu(void); 16extern void shmobile_boot_scu(void);
17extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
18extern int shmobile_smp_scu_boot_secondary(unsigned int cpu,
19 struct task_struct *idle);
20extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
21extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
14struct clk; 22struct clk;
15extern int shmobile_clk_init(void); 23extern int shmobile_clk_init(void);
16extern void shmobile_handle_irq_intc(struct pt_regs *); 24extern void shmobile_handle_irq_intc(struct pt_regs *);
diff --git a/arch/arm/mach-shmobile/include/mach/hardware.h b/arch/arm/mach-shmobile/include/mach/hardware.h
deleted file mode 100644
index 99264a5ce5e4..000000000000
--- a/arch/arm/mach-shmobile/include/mach/hardware.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASM_MACH_HARDWARE_H
2#define __ASM_MACH_HARDWARE_H
3
4#endif /* __ASM_MACH_HARDWARE_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
index 144a85e29245..f3a9b702da56 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a73a4.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
@@ -2,6 +2,7 @@
2#define __ASM_R8A73A4_H__ 2#define __ASM_R8A73A4_H__
3 3
4void r8a73a4_add_standard_devices(void); 4void r8a73a4_add_standard_devices(void);
5void r8a73a4_add_dt_devices(void);
5void r8a73a4_clock_init(void); 6void r8a73a4_clock_init(void);
6void r8a73a4_pinmux_init(void); 7void r8a73a4_pinmux_init(void);
7void r8a73a4_init_delay(void); 8void r8a73a4_init_delay(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
index 56f375005fcd..d07932f872b6 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7740.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
@@ -48,7 +48,6 @@ enum {
48 48
49extern void r8a7740_meram_workaround(void); 49extern void r8a7740_meram_workaround(void);
50extern void r8a7740_init_delay(void); 50extern void r8a7740_init_delay(void);
51extern void r8a7740_init_irq(void);
52extern void r8a7740_init_irq_of(void); 51extern void r8a7740_init_irq_of(void);
53extern void r8a7740_map_io(void); 52extern void r8a7740_map_io(void);
54extern void r8a7740_add_early_devices(void); 53extern void r8a7740_add_early_devices(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index 2866704e7afd..adfcf51b163d 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -18,21 +18,15 @@
18#ifndef __ASM_R8A7778_H__ 18#ifndef __ASM_R8A7778_H__
19#define __ASM_R8A7778_H__ 19#define __ASM_R8A7778_H__
20 20
21#include <linux/mmc/sh_mmcif.h>
22#include <linux/mmc/sh_mobile_sdhi.h>
23#include <linux/sh_eth.h> 21#include <linux/sh_eth.h>
24#include <linux/platform_data/usb-rcar-phy.h>
25#include <linux/platform_data/camera-rcar.h> 22#include <linux/platform_data/camera-rcar.h>
26 23
27extern void r8a7778_add_standard_devices(void); 24extern void r8a7778_add_standard_devices(void);
28extern void r8a7778_add_standard_devices_dt(void); 25extern void r8a7778_add_standard_devices_dt(void);
29extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata); 26extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
30extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
31extern void r8a7778_add_i2c_device(int id);
32extern void r8a7778_add_hspi_device(int id);
33extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
34extern void r8a7778_add_vin_device(int id, 27extern void r8a7778_add_vin_device(int id,
35 struct rcar_vin_platform_data *pdata); 28 struct rcar_vin_platform_data *pdata);
29extern void r8a7778_add_dt_devices(void);
36 30
37extern void r8a7778_init_late(void); 31extern void r8a7778_init_late(void);
38extern void r8a7778_init_delay(void); 32extern void r8a7778_init_delay(void);
@@ -40,6 +34,5 @@ extern void r8a7778_init_irq_dt(void);
40extern void r8a7778_clock_init(void); 34extern void r8a7778_clock_init(void);
41extern void r8a7778_init_irq_extpin(int irlm); 35extern void r8a7778_init_irq_extpin(int irlm);
42extern void r8a7778_pinmux_init(void); 36extern void r8a7778_pinmux_init(void);
43extern void r8a7778_sdhi_init(int id, struct sh_mobile_sdhi_info *info);
44 37
45#endif /* __ASM_R8A7778_H__ */ 38#endif /* __ASM_R8A7778_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 6d2b6417fe2a..11c740047e14 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -4,7 +4,6 @@
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h> 5#include <linux/pm_domain.h>
6#include <linux/sh_eth.h> 6#include <linux/sh_eth.h>
7#include <linux/platform_data/usb-rcar-phy.h>
8#include <linux/platform_data/camera-rcar.h> 7#include <linux/platform_data/camera-rcar.h>
9 8
10struct platform_device; 9struct platform_device;
@@ -26,7 +25,6 @@ static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d)
26} 25}
27 26
28extern void r8a7779_init_delay(void); 27extern void r8a7779_init_delay(void);
29extern void r8a7779_init_irq(void);
30extern void r8a7779_init_irq_extpin(int irlm); 28extern void r8a7779_init_irq_extpin(int irlm);
31extern void r8a7779_init_irq_dt(void); 29extern void r8a7779_init_irq_dt(void);
32extern void r8a7779_map_io(void); 30extern void r8a7779_map_io(void);
@@ -35,7 +33,6 @@ extern void r8a7779_add_early_devices(void);
35extern void r8a7779_add_standard_devices(void); 33extern void r8a7779_add_standard_devices(void);
36extern void r8a7779_add_standard_devices_dt(void); 34extern void r8a7779_add_standard_devices_dt(void);
37extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); 35extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
38extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
39extern void r8a7779_add_vin_device(int idx, 36extern void r8a7779_add_vin_device(int idx,
40 struct rcar_vin_platform_data *pdata); 37 struct rcar_vin_platform_data *pdata);
41extern void r8a7779_init_late(void); 38extern void r8a7779_init_late(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 7aaef409a059..788d55952091 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -2,6 +2,7 @@
2#define __ASM_R8A7790_H__ 2#define __ASM_R8A7790_H__
3 3
4void r8a7790_add_standard_devices(void); 4void r8a7790_add_standard_devices(void);
5void r8a7790_add_dt_devices(void);
5void r8a7790_clock_init(void); 6void r8a7790_clock_init(void);
6void r8a7790_pinmux_init(void); 7void r8a7790_pinmux_init(void);
7void r8a7790_init_delay(void); 8void r8a7790_init_delay(void);
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index 680dc5f1655a..359b582dc270 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH73A0_H__ 1#ifndef __ASM_SH73A0_H__
2#define __ASM_SH73A0_H__ 2#define __ASM_SH73A0_H__
3 3
4#define GPIO_NR 310
5
6/* DMA slave IDs */ 4/* DMA slave IDs */
7enum { 5enum {
8 SHDMA_SLAVE_INVALID, 6 SHDMA_SLAVE_INVALID,
diff --git a/arch/arm/mach-shmobile/intc-r8a7740.c b/arch/arm/mach-shmobile/intc-r8a7740.c
deleted file mode 100644
index 8871f7717dc8..000000000000
--- a/arch/arm/mach-shmobile/intc-r8a7740.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * R8A7740 processor support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/io.h>
23#include <linux/irqchip.h>
24#include <linux/irqchip/arm-gic.h>
25
26static void __init r8a7740_init_irq_common(void)
27{
28 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
29 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
30 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
31
32 /* route signals to GIC */
33 iowrite32(0x0, pfc_inta_ctrl);
34
35 /*
36 * To mask the shared interrupt to SPI 149 we must ensure to set
37 * PRIO *and* MASK. Else we run into IRQ floods when registering
38 * the intc_irqpin devices
39 */
40 iowrite32(0x0, intc_prio_base + 0x0);
41 iowrite32(0x0, intc_prio_base + 0x4);
42 iowrite32(0x0, intc_prio_base + 0x8);
43 iowrite32(0x0, intc_prio_base + 0xc);
44 iowrite8(0xff, intc_msk_base + 0x0);
45 iowrite8(0xff, intc_msk_base + 0x4);
46 iowrite8(0xff, intc_msk_base + 0x8);
47 iowrite8(0xff, intc_msk_base + 0xc);
48
49 iounmap(intc_prio_base);
50 iounmap(intc_msk_base);
51 iounmap(pfc_inta_ctrl);
52}
53
54void __init r8a7740_init_irq_of(void)
55{
56 irqchip_init();
57 r8a7740_init_irq_common();
58}
59
60void __init r8a7740_init_irq(void)
61{
62 void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000);
63 void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000);
64
65 /* initialize the Generic Interrupt Controller PL390 r0p0 */
66 gic_init(0, 29, gic_dist_base, gic_cpu_base);
67 r8a7740_init_irq_common();
68}
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
deleted file mode 100644
index b86dc8908724..000000000000
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ /dev/null
@@ -1,131 +0,0 @@
1/*
2 * r8a7779 processor support - INTC hardware block
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/io.h>
26#include <linux/irqchip/arm-gic.h>
27#include <linux/platform_data/irq-renesas-intc-irqpin.h>
28#include <linux/irqchip.h>
29#include <mach/common.h>
30#include <mach/intc.h>
31#include <mach/irqs.h>
32#include <mach/r8a7779.h>
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35
36#define INT2SMSKCR0 IOMEM(0xfe7822a0)
37#define INT2SMSKCR1 IOMEM(0xfe7822a4)
38#define INT2SMSKCR2 IOMEM(0xfe7822a8)
39#define INT2SMSKCR3 IOMEM(0xfe7822ac)
40#define INT2SMSKCR4 IOMEM(0xfe7822b0)
41
42#define INT2NTSR0 IOMEM(0xfe700060)
43#define INT2NTSR1 IOMEM(0xfe700064)
44
45static struct renesas_intc_irqpin_config irqpin0_platform_data = {
46 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
47 .sense_bitfield_width = 2,
48};
49
50static struct resource irqpin0_resources[] = {
51 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
52 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
53 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
54 DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
55 DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
56 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
57 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
58 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
59 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
60};
61
62static struct platform_device irqpin0_device = {
63 .name = "renesas_intc_irqpin",
64 .id = 0,
65 .resource = irqpin0_resources,
66 .num_resources = ARRAY_SIZE(irqpin0_resources),
67 .dev = {
68 .platform_data = &irqpin0_platform_data,
69 },
70};
71
72void __init r8a7779_init_irq_extpin(int irlm)
73{
74 void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
75 unsigned long tmp;
76
77 if (icr0) {
78 tmp = ioread32(icr0);
79 if (irlm)
80 tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
81 else
82 tmp &= ~(1 << 23); /* IRL mode - not supported */
83 tmp |= (1 << 21); /* LVLMODE = 1 */
84 iowrite32(tmp, icr0);
85 iounmap(icr0);
86
87 if (irlm)
88 platform_device_register(&irqpin0_device);
89 } else
90 pr_warn("r8a7779: unable to setup external irq pin mode\n");
91}
92
93static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
94{
95 return 0; /* always allow wakeup */
96}
97
98static void __init r8a7779_init_irq_common(void)
99{
100 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
101
102 /* route all interrupts to ARM */
103 __raw_writel(0xffffffff, INT2NTSR0);
104 __raw_writel(0x3fffffff, INT2NTSR1);
105
106 /* unmask all known interrupts in INTCS2 */
107 __raw_writel(0xfffffff0, INT2SMSKCR0);
108 __raw_writel(0xfff7ffff, INT2SMSKCR1);
109 __raw_writel(0xfffbffdf, INT2SMSKCR2);
110 __raw_writel(0xbffffffc, INT2SMSKCR3);
111 __raw_writel(0x003fee3f, INT2SMSKCR4);
112}
113
114void __init r8a7779_init_irq(void)
115{
116 void __iomem *gic_dist_base = IOMEM(0xf0001000);
117 void __iomem *gic_cpu_base = IOMEM(0xf0000100);
118
119 /* use GIC to handle interrupts */
120 gic_init(0, 29, gic_dist_base, gic_cpu_base);
121
122 r8a7779_init_irq_common();
123}
124
125#ifdef CONFIG_OF
126void __init r8a7779_init_irq_dt(void)
127{
128 irqchip_init();
129 r8a7779_init_irq_common();
130}
131#endif
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
new file mode 100644
index 000000000000..c96f50160be6
--- /dev/null
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -0,0 +1,81 @@
1/*
2 * SMP support for SoCs with SCU covered by mach-shmobile
3 *
4 * Copyright (C) 2013 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/delay.h>
11#include <linux/init.h>
12#include <linux/io.h>
13#include <linux/smp.h>
14#include <asm/cacheflush.h>
15#include <asm/smp_plat.h>
16#include <asm/smp_scu.h>
17#include <mach/common.h>
18
19void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
20{
21 /* install boot code shared by all CPUs */
22 shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
23 shmobile_boot_arg = MPIDR_HWID_BITMASK;
24
25 /* enable SCU and cache coherency on booting CPU */
26 scu_enable(shmobile_scu_base);
27 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
28}
29
30int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)
31{
32 /* For this particular CPU register SCU boot vector */
33 shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
34 (unsigned long)shmobile_scu_base);
35 return 0;
36}
37
38#ifdef CONFIG_HOTPLUG_CPU
39void shmobile_smp_scu_cpu_die(unsigned int cpu)
40{
41 /* For this particular CPU deregister boot vector */
42 shmobile_smp_hook(cpu, 0, 0);
43
44 dsb();
45 flush_cache_all();
46
47 /* disable cache coherency */
48 scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF);
49
50 /* jump to shared mach-shmobile sleep / reset code */
51 shmobile_smp_sleep();
52}
53
54static int shmobile_smp_scu_psr_core_disabled(int cpu)
55{
56 unsigned long mask = SCU_PM_POWEROFF << (cpu * 8);
57
58 if ((__raw_readl(shmobile_scu_base + 8) & mask) == mask)
59 return 1;
60
61 return 0;
62}
63
64int shmobile_smp_scu_cpu_kill(unsigned int cpu)
65{
66 int k;
67
68 /* this function is running on another CPU than the offline target,
69 * here we need wait for shutdown code in platform_cpu_die() to
70 * finish before asking SoC-specific code to power off the CPU core.
71 */
72 for (k = 0; k < 1000; k++) {
73 if (shmobile_smp_scu_psr_core_disabled(cpu))
74 return 1;
75
76 mdelay(1);
77 }
78
79 return 0;
80}
81#endif
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index 1f958d7b0bac..d4ae616bcedb 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -12,6 +12,9 @@
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <asm/cacheflush.h>
16#include <asm/smp_plat.h>
17#include <mach/common.h>
15 18
16void __init shmobile_smp_init_cpus(unsigned int ncores) 19void __init shmobile_smp_init_cpus(unsigned int ncores)
17{ 20{
@@ -26,3 +29,18 @@ void __init shmobile_smp_init_cpus(unsigned int ncores)
26 for (i = 0; i < ncores; i++) 29 for (i = 0; i < ncores; i++)
27 set_cpu_possible(i, true); 30 set_cpu_possible(i, true);
28} 31}
32
33extern unsigned long shmobile_smp_fn[];
34extern unsigned long shmobile_smp_arg[];
35extern unsigned long shmobile_smp_mpidr[];
36
37void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg)
38{
39 shmobile_smp_fn[cpu] = 0;
40 flush_cache_all();
41
42 shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu);
43 shmobile_smp_fn[cpu] = fn;
44 shmobile_smp_arg[cpu] = arg;
45 flush_cache_all();
46}
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index 1553af8e04ff..3ad531caf4f0 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -27,7 +27,6 @@
27#include <linux/input.h> 27#include <linux/input.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/irqchip/arm-gic.h> 29#include <linux/irqchip/arm-gic.h>
30#include <mach/hardware.h>
31#include <mach/common.h> 30#include <mach/common.h>
32#include <mach/emev2.h> 31#include <mach/emev2.h>
33#include <mach/irqs.h> 32#include <mach/irqs.h>
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index d533bd23865c..89491700afb7 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -188,7 +188,7 @@ static struct resource cmt10_resources[] = {
188 &cmt##idx##_platform_data, \ 188 &cmt##idx##_platform_data, \
189 sizeof(struct sh_timer_config)) 189 sizeof(struct sh_timer_config))
190 190
191void __init r8a73a4_add_standard_devices(void) 191void __init r8a73a4_add_dt_devices(void)
192{ 192{
193 r8a73a4_register_scif(SCIFA0); 193 r8a73a4_register_scif(SCIFA0);
194 r8a73a4_register_scif(SCIFA1); 194 r8a73a4_register_scif(SCIFA1);
@@ -196,10 +196,15 @@ void __init r8a73a4_add_standard_devices(void)
196 r8a73a4_register_scif(SCIFB1); 196 r8a73a4_register_scif(SCIFB1);
197 r8a73a4_register_scif(SCIFB2); 197 r8a73a4_register_scif(SCIFB2);
198 r8a73a4_register_scif(SCIFB3); 198 r8a73a4_register_scif(SCIFB3);
199 r8a7790_register_cmt(10);
200}
201
202void __init r8a73a4_add_standard_devices(void)
203{
204 r8a73a4_add_dt_devices();
199 r8a73a4_register_irqc(0); 205 r8a73a4_register_irqc(0);
200 r8a73a4_register_irqc(1); 206 r8a73a4_register_irqc(1);
201 r8a73a4_register_thermal(); 207 r8a73a4_register_thermal();
202 r8a7790_register_cmt(10);
203} 208}
204 209
205void __init r8a73a4_init_delay(void) 210void __init r8a73a4_init_delay(void)
@@ -210,11 +215,6 @@ void __init r8a73a4_init_delay(void)
210} 215}
211 216
212#ifdef CONFIG_USE_OF 217#ifdef CONFIG_USE_OF
213void __init r8a73a4_add_standard_devices_dt(void)
214{
215 platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
216 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
217}
218 218
219static const char *r8a73a4_boards_compat_dt[] __initdata = { 219static const char *r8a73a4_boards_compat_dt[] __initdata = {
220 "renesas,r8a73a4", 220 "renesas,r8a73a4",
@@ -223,8 +223,6 @@ static const char *r8a73a4_boards_compat_dt[] __initdata = {
223 223
224DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)") 224DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)")
225 .init_early = r8a73a4_init_delay, 225 .init_early = r8a73a4_init_delay,
226 .init_machine = r8a73a4_add_standard_devices_dt,
227 .init_time = shmobile_timer_init,
228 .dt_compat = r8a73a4_boards_compat_dt, 226 .dt_compat = r8a73a4_boards_compat_dt,
229MACHINE_END 227MACHINE_END
230#endif /* CONFIG_USE_OF */ 228#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 84c5bb6d9725..b7d4b2c3bc29 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -22,6 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/irqchip.h>
26#include <linux/irqchip/arm-gic.h>
25#include <linux/platform_data/irq-renesas-intc-irqpin.h> 27#include <linux/platform_data/irq-renesas-intc-irqpin.h>
26#include <linux/platform_device.h> 28#include <linux/platform_device.h>
27#include <linux/of_platform.h> 29#include <linux/of_platform.h>
@@ -1019,6 +1021,36 @@ void __init r8a7740_init_delay(void)
1019 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ 1021 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
1020}; 1022};
1021 1023
1024void __init r8a7740_init_irq_of(void)
1025{
1026 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
1027 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
1028 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
1029
1030 irqchip_init();
1031
1032 /* route signals to GIC */
1033 iowrite32(0x0, pfc_inta_ctrl);
1034
1035 /*
1036 * To mask the shared interrupt to SPI 149 we must ensure to set
1037 * PRIO *and* MASK. Else we run into IRQ floods when registering
1038 * the intc_irqpin devices
1039 */
1040 iowrite32(0x0, intc_prio_base + 0x0);
1041 iowrite32(0x0, intc_prio_base + 0x4);
1042 iowrite32(0x0, intc_prio_base + 0x8);
1043 iowrite32(0x0, intc_prio_base + 0xc);
1044 iowrite8(0xff, intc_msk_base + 0x0);
1045 iowrite8(0xff, intc_msk_base + 0x4);
1046 iowrite8(0xff, intc_msk_base + 0x8);
1047 iowrite8(0xff, intc_msk_base + 0xc);
1048
1049 iounmap(intc_prio_base);
1050 iounmap(intc_msk_base);
1051 iounmap(pfc_inta_ctrl);
1052}
1053
1022static void __init r8a7740_generic_init(void) 1054static void __init r8a7740_generic_init(void)
1023{ 1055{
1024 r8a7740_clock_init(0); 1056 r8a7740_clock_init(0);
@@ -1035,7 +1067,6 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
1035 .init_early = r8a7740_init_delay, 1067 .init_early = r8a7740_init_delay,
1036 .init_irq = r8a7740_init_irq_of, 1068 .init_irq = r8a7740_init_irq_of,
1037 .init_machine = r8a7740_generic_init, 1069 .init_machine = r8a7740_generic_init,
1038 .init_time = shmobile_timer_init,
1039 .dt_compat = r8a7740_boards_compat_dt, 1070 .dt_compat = r8a7740_boards_compat_dt,
1040MACHINE_END 1071MACHINE_END
1041 1072
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 203becfc6e31..6a2657ebd197 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -95,20 +95,6 @@ static struct sh_timer_config sh_tmu1_platform_data __initdata = {
95 &sh_tmu##idx##_platform_data, \ 95 &sh_tmu##idx##_platform_data, \
96 sizeof(sh_tmu##idx##_platform_data)) 96 sizeof(sh_tmu##idx##_platform_data))
97 97
98/* USB PHY */
99static struct resource usb_phy_resources[] __initdata = {
100 DEFINE_RES_MEM(0xffe70800, 0x100),
101 DEFINE_RES_MEM(0xffe76000, 0x100),
102};
103
104void __init r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
105{
106 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
107 usb_phy_resources,
108 ARRAY_SIZE(usb_phy_resources),
109 pdata, sizeof(*pdata));
110}
111
112/* USB */ 98/* USB */
113static struct usb_phy *phy; 99static struct usb_phy *phy;
114 100
@@ -248,30 +234,6 @@ void __init r8a7778_pinmux_init(void)
248 r8a7778_register_gpio(4); 234 r8a7778_register_gpio(4);
249}; 235};
250 236
251/* SDHI */
252static struct resource sdhi_resources[] __initdata = {
253 /* SDHI0 */
254 DEFINE_RES_MEM(0xFFE4C000, 0x100),
255 DEFINE_RES_IRQ(gic_iid(0x77)),
256 /* SDHI1 */
257 DEFINE_RES_MEM(0xFFE4D000, 0x100),
258 DEFINE_RES_IRQ(gic_iid(0x78)),
259 /* SDHI2 */
260 DEFINE_RES_MEM(0xFFE4F000, 0x100),
261 DEFINE_RES_IRQ(gic_iid(0x76)),
262};
263
264void __init r8a7778_sdhi_init(int id,
265 struct sh_mobile_sdhi_info *info)
266{
267 BUG_ON(id < 0 || id > 2);
268
269 platform_device_register_resndata(
270 &platform_bus, "sh_mobile_sdhi", id,
271 sdhi_resources + (2 * id), 2,
272 info, sizeof(*info));
273}
274
275/* I2C */ 237/* I2C */
276static struct resource i2c_resources[] __initdata = { 238static struct resource i2c_resources[] __initdata = {
277 /* I2C0 */ 239 /* I2C0 */
@@ -288,7 +250,7 @@ static struct resource i2c_resources[] __initdata = {
288 DEFINE_RES_IRQ(gic_iid(0x6d)), 250 DEFINE_RES_IRQ(gic_iid(0x6d)),
289}; 251};
290 252
291void __init r8a7778_add_i2c_device(int id) 253static void __init r8a7778_register_i2c(int id)
292{ 254{
293 BUG_ON(id < 0 || id > 3); 255 BUG_ON(id < 0 || id > 3);
294 256
@@ -310,7 +272,7 @@ static struct resource hspi_resources[] __initdata = {
310 DEFINE_RES_IRQ(gic_iid(0x75)), 272 DEFINE_RES_IRQ(gic_iid(0x75)),
311}; 273};
312 274
313void __init r8a7778_add_hspi_device(int id) 275void __init r8a7778_register_hspi(int id)
314{ 276{
315 BUG_ON(id < 0 || id > 2); 277 BUG_ON(id < 0 || id > 2);
316 278
@@ -319,20 +281,6 @@ void __init r8a7778_add_hspi_device(int id)
319 hspi_resources + (2 * id), 2); 281 hspi_resources + (2 * id), 2);
320} 282}
321 283
322/* MMC */
323static struct resource mmc_resources[] __initdata = {
324 DEFINE_RES_MEM(0xffe4e000, 0x100),
325 DEFINE_RES_IRQ(gic_iid(0x5d)),
326};
327
328void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
329{
330 platform_device_register_resndata(
331 &platform_bus, "sh_mmcif", -1,
332 mmc_resources, ARRAY_SIZE(mmc_resources),
333 info, sizeof(*info));
334}
335
336/* VIN */ 284/* VIN */
337#define R8A7778_VIN(idx) \ 285#define R8A7778_VIN(idx) \
338static struct resource vin##idx##_resources[] __initdata = { \ 286static struct resource vin##idx##_resources[] __initdata = { \
@@ -367,7 +315,7 @@ void __init r8a7778_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
367 platform_device_register_full(vin_info_table[id]); 315 platform_device_register_full(vin_info_table[id]);
368} 316}
369 317
370void __init r8a7778_add_standard_devices(void) 318void __init r8a7778_add_dt_devices(void)
371{ 319{
372 int i; 320 int i;
373 321
@@ -391,6 +339,18 @@ void __init r8a7778_add_standard_devices(void)
391 r8a7778_register_tmu(1); 339 r8a7778_register_tmu(1);
392} 340}
393 341
342void __init r8a7778_add_standard_devices(void)
343{
344 r8a7778_add_dt_devices();
345 r8a7778_register_i2c(0);
346 r8a7778_register_i2c(1);
347 r8a7778_register_i2c(2);
348 r8a7778_register_i2c(3);
349 r8a7778_register_hspi(0);
350 r8a7778_register_hspi(1);
351 r8a7778_register_hspi(2);
352}
353
394void __init r8a7778_init_late(void) 354void __init r8a7778_init_late(void)
395{ 355{
396 phy = usb_get_phy(USB_PHY_TYPE_USB2); 356 phy = usb_get_phy(USB_PHY_TYPE_USB2);
@@ -480,7 +440,6 @@ static const char *r8a7778_compat_dt[] __initdata = {
480DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)") 440DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
481 .init_early = r8a7778_init_delay, 441 .init_early = r8a7778_init_delay,
482 .init_irq = r8a7778_init_irq_dt, 442 .init_irq = r8a7778_init_irq_dt,
483 .init_time = shmobile_timer_init,
484 .dt_compat = r8a7778_compat_dt, 443 .dt_compat = r8a7778_compat_dt,
485 .init_late = r8a7778_init_late, 444 .init_late = r8a7778_init_late,
486MACHINE_END 445MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 41bab625341e..b5b2f787da2e 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -22,14 +22,16 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/irqchip.h>
26#include <linux/irqchip/arm-gic.h>
25#include <linux/of_platform.h> 27#include <linux/of_platform.h>
26#include <linux/platform_data/gpio-rcar.h> 28#include <linux/platform_data/gpio-rcar.h>
29#include <linux/platform_data/irq-renesas-intc-irqpin.h>
27#include <linux/platform_device.h> 30#include <linux/platform_device.h>
28#include <linux/delay.h> 31#include <linux/delay.h>
29#include <linux/input.h> 32#include <linux/input.h>
30#include <linux/io.h> 33#include <linux/io.h>
31#include <linux/serial_sci.h> 34#include <linux/serial_sci.h>
32#include <linux/sh_intc.h>
33#include <linux/sh_timer.h> 35#include <linux/sh_timer.h>
34#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
35#include <linux/usb/otg.h> 37#include <linux/usb/otg.h>
@@ -37,7 +39,6 @@
37#include <linux/usb/ehci_pdriver.h> 39#include <linux/usb/ehci_pdriver.h>
38#include <linux/usb/ohci_pdriver.h> 40#include <linux/usb/ohci_pdriver.h>
39#include <linux/pm_runtime.h> 41#include <linux/pm_runtime.h>
40#include <mach/hardware.h>
41#include <mach/irqs.h> 42#include <mach/irqs.h>
42#include <mach/r8a7779.h> 43#include <mach/r8a7779.h>
43#include <mach/common.h> 44#include <mach/common.h>
@@ -69,6 +70,60 @@ void __init r8a7779_map_io(void)
69 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc)); 70 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
70} 71}
71 72
73/* IRQ */
74#define INT2SMSKCR0 IOMEM(0xfe7822a0)
75#define INT2SMSKCR1 IOMEM(0xfe7822a4)
76#define INT2SMSKCR2 IOMEM(0xfe7822a8)
77#define INT2SMSKCR3 IOMEM(0xfe7822ac)
78#define INT2SMSKCR4 IOMEM(0xfe7822b0)
79
80#define INT2NTSR0 IOMEM(0xfe700060)
81#define INT2NTSR1 IOMEM(0xfe700064)
82
83static struct renesas_intc_irqpin_config irqpin0_platform_data __initdata = {
84 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
85 .sense_bitfield_width = 2,
86};
87
88static struct resource irqpin0_resources[] __initdata = {
89 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
90 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
91 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
92 DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
93 DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
94 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
95 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
96 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
97 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
98};
99
100void __init r8a7779_init_irq_extpin(int irlm)
101{
102 void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
103 u32 tmp;
104
105 if (!icr0) {
106 pr_warn("r8a7779: unable to setup external irq pin mode\n");
107 return;
108 }
109
110 tmp = ioread32(icr0);
111 if (irlm)
112 tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
113 else
114 tmp &= ~(1 << 23); /* IRL mode - not supported */
115 tmp |= (1 << 21); /* LVLMODE = 1 */
116 iowrite32(tmp, icr0);
117 iounmap(icr0);
118
119 if (irlm)
120 platform_device_register_resndata(
121 &platform_bus, "renesas_intc_irqpin", -1,
122 irqpin0_resources, ARRAY_SIZE(irqpin0_resources),
123 &irqpin0_platform_data, sizeof(irqpin0_platform_data));
124}
125
126/* PFC/GPIO */
72static struct resource r8a7779_pfc_resources[] = { 127static struct resource r8a7779_pfc_resources[] = {
73 DEFINE_RES_MEM(0xfffc0000, 0x023c), 128 DEFINE_RES_MEM(0xfffc0000, 0x023c),
74}; 129};
@@ -388,15 +443,6 @@ static struct platform_device sata_device = {
388 }, 443 },
389}; 444};
390 445
391/* USB PHY */
392static struct resource usb_phy_resources[] __initdata = {
393 [0] = {
394 .start = 0xffe70800,
395 .end = 0xffe70900 - 1,
396 .flags = IORESOURCE_MEM,
397 },
398};
399
400/* USB */ 446/* USB */
401static struct usb_phy *phy; 447static struct usb_phy *phy;
402 448
@@ -548,7 +594,7 @@ static struct platform_device ohci1_device = {
548}; 594};
549 595
550/* Ether */ 596/* Ether */
551static struct resource ether_resources[] = { 597static struct resource ether_resources[] __initdata = {
552 { 598 {
553 .start = 0xfde00000, 599 .start = 0xfde00000,
554 .end = 0xfde003ff, 600 .end = 0xfde003ff,
@@ -629,14 +675,6 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
629 pdata, sizeof(*pdata)); 675 pdata, sizeof(*pdata));
630} 676}
631 677
632void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
633{
634 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
635 usb_phy_resources,
636 ARRAY_SIZE(usb_phy_resources),
637 pdata, sizeof(*pdata));
638}
639
640void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata) 678void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
641{ 679{
642 BUG_ON(id < 0 || id > 3); 680 BUG_ON(id < 0 || id > 3);
@@ -697,6 +735,29 @@ void __init r8a7779_init_late(void)
697} 735}
698 736
699#ifdef CONFIG_USE_OF 737#ifdef CONFIG_USE_OF
738static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
739{
740 return 0; /* always allow wakeup */
741}
742
743void __init r8a7779_init_irq_dt(void)
744{
745 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
746
747 irqchip_init();
748
749 /* route all interrupts to ARM */
750 __raw_writel(0xffffffff, INT2NTSR0);
751 __raw_writel(0x3fffffff, INT2NTSR1);
752
753 /* unmask all known interrupts in INTCS2 */
754 __raw_writel(0xfffffff0, INT2SMSKCR0);
755 __raw_writel(0xfff7ffff, INT2SMSKCR1);
756 __raw_writel(0xfffbffdf, INT2SMSKCR2);
757 __raw_writel(0xbffffffc, INT2SMSKCR3);
758 __raw_writel(0x003fee3f, INT2SMSKCR4);
759}
760
700void __init r8a7779_init_delay(void) 761void __init r8a7779_init_delay(void)
701{ 762{
702 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ 763 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
@@ -723,7 +784,6 @@ DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
723 .nr_irqs = NR_IRQS_LEGACY, 784 .nr_irqs = NR_IRQS_LEGACY,
724 .init_irq = r8a7779_init_irq_dt, 785 .init_irq = r8a7779_init_irq_dt,
725 .init_machine = r8a7779_add_standard_devices_dt, 786 .init_machine = r8a7779_add_standard_devices_dt,
726 .init_time = shmobile_timer_init,
727 .init_late = r8a7779_init_late, 787 .init_late = r8a7779_init_late,
728 .dt_compat = r8a7779_compat_dt, 788 .dt_compat = r8a7779_compat_dt,
729MACHINE_END 789MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 4c96dad21195..d0f5c9f9349a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clocksource.h>
21#include <linux/irq.h> 22#include <linux/irq.h>
22#include <linux/kernel.h> 23#include <linux/kernel.h>
23#include <linux/of_platform.h> 24#include <linux/of_platform.h>
@@ -160,13 +161,13 @@ static struct resource thermal_resources[] __initdata = {
160 thermal_resources, \ 161 thermal_resources, \
161 ARRAY_SIZE(thermal_resources)) 162 ARRAY_SIZE(thermal_resources))
162 163
163static struct sh_timer_config cmt00_platform_data = { 164static struct sh_timer_config cmt00_platform_data __initdata = {
164 .name = "CMT00", 165 .name = "CMT00",
165 .timer_bit = 0, 166 .timer_bit = 0,
166 .clockevent_rating = 80, 167 .clockevent_rating = 80,
167}; 168};
168 169
169static struct resource cmt00_resources[] = { 170static struct resource cmt00_resources[] __initdata = {
170 DEFINE_RES_MEM(0xffca0510, 0x0c), 171 DEFINE_RES_MEM(0xffca0510, 0x0c),
171 DEFINE_RES_MEM(0xffca0500, 0x04), 172 DEFINE_RES_MEM(0xffca0500, 0x04),
172 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ 173 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
@@ -179,7 +180,7 @@ static struct resource cmt00_resources[] = {
179 &cmt##idx##_platform_data, \ 180 &cmt##idx##_platform_data, \
180 sizeof(struct sh_timer_config)) 181 sizeof(struct sh_timer_config))
181 182
182void __init r8a7790_add_standard_devices(void) 183void __init r8a7790_add_dt_devices(void)
183{ 184{
184 r8a7790_register_scif(SCIFA0); 185 r8a7790_register_scif(SCIFA0);
185 r8a7790_register_scif(SCIFA1); 186 r8a7790_register_scif(SCIFA1);
@@ -191,9 +192,14 @@ void __init r8a7790_add_standard_devices(void)
191 r8a7790_register_scif(SCIF1); 192 r8a7790_register_scif(SCIF1);
192 r8a7790_register_scif(HSCIF0); 193 r8a7790_register_scif(HSCIF0);
193 r8a7790_register_scif(HSCIF1); 194 r8a7790_register_scif(HSCIF1);
195 r8a7790_register_cmt(00);
196}
197
198void __init r8a7790_add_standard_devices(void)
199{
200 r8a7790_add_dt_devices();
194 r8a7790_register_irqc(0); 201 r8a7790_register_irqc(0);
195 r8a7790_register_thermal(); 202 r8a7790_register_thermal();
196 r8a7790_register_cmt(00);
197} 203}
198 204
199#define MODEMR 0xe6160060 205#define MODEMR 0xe6160060
@@ -258,7 +264,7 @@ void __init r8a7790_timer_init(void)
258 iounmap(base); 264 iounmap(base);
259#endif /* CONFIG_ARM_ARCH_TIMER */ 265#endif /* CONFIG_ARM_ARCH_TIMER */
260 266
261 shmobile_timer_init(); 267 clocksource_of_init();
262} 268}
263 269
264void __init r8a7790_init_delay(void) 270void __init r8a7790_init_delay(void)
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 13e6fdbde0a5..311878391e18 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -35,7 +35,6 @@
35#include <linux/dma-mapping.h> 35#include <linux/dma-mapping.h>
36#include <linux/platform_data/sh_ipmmu.h> 36#include <linux/platform_data/sh_ipmmu.h>
37#include <mach/dma-register.h> 37#include <mach/dma-register.h>
38#include <mach/hardware.h>
39#include <mach/irqs.h> 38#include <mach/irqs.h>
40#include <mach/sh7372.h> 39#include <mach/sh7372.h>
41#include <mach/common.h> 40#include <mach/common.h>
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 516c2391b47a..22de17417fd7 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -34,7 +34,6 @@
34#include <linux/platform_data/sh_ipmmu.h> 34#include <linux/platform_data/sh_ipmmu.h>
35#include <linux/platform_data/irq-renesas-intc-irqpin.h> 35#include <linux/platform_data/irq-renesas-intc-irqpin.h>
36#include <mach/dma-register.h> 36#include <mach/dma-register.h>
37#include <mach/hardware.h>
38#include <mach/irqs.h> 37#include <mach/irqs.h>
39#include <mach/sh73a0.h> 38#include <mach/sh73a0.h>
40#include <mach/common.h> 39#include <mach/common.h>
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index 78e84c582453..522de5ebb55f 100644
--- a/arch/arm/mach-shmobile/smp-emev2.c
+++ b/arch/arm/mach-shmobile/smp-emev2.c
@@ -34,6 +34,12 @@
34 34
35static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle) 35static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
36{ 36{
37 int ret;
38
39 ret = shmobile_smp_scu_boot_secondary(cpu, idle);
40 if (ret)
41 return ret;
42
37 arch_send_wakeup_ipi_mask(cpumask_of(cpu_logical_map(cpu))); 43 arch_send_wakeup_ipi_mask(cpumask_of(cpu_logical_map(cpu)));
38 return 0; 44 return 0;
39} 45}
@@ -42,21 +48,16 @@ static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
42{ 48{
43 void __iomem *smu; 49 void __iomem *smu;
44 50
45 /* setup EMEV2 specific SCU base, enable */ 51 /* Tell ROM loader about our vector (in headsmp.S) */
46 shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
47 scu_enable(shmobile_scu_base);
48
49 /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */
50 smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); 52 smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
51 if (smu) { 53 if (smu) {
52 iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0); 54 iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0);
53 iounmap(smu); 55 iounmap(smu);
54 } 56 }
55 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
56 shmobile_boot_arg = (unsigned long)shmobile_scu_base;
57 57
58 /* enable cache coherency on booting CPU */ 58 /* setup EMEV2 specific SCU bits */
59 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); 59 shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
60 shmobile_smp_scu_prepare_cpus(max_cpus);
60} 61}
61 62
62struct smp_operations emev2_smp_ops __initdata = { 63struct smp_operations emev2_smp_ops __initdata = {
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 9bdf810f2a87..0f05e9fb722f 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -84,30 +84,34 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu)
84static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) 84static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
85{ 85{
86 struct r8a7779_pm_ch *ch = NULL; 86 struct r8a7779_pm_ch *ch = NULL;
87 int ret = -EIO; 87 unsigned int lcpu = cpu_logical_map(cpu);
88 int ret;
88 89
89 cpu = cpu_logical_map(cpu); 90 ret = shmobile_smp_scu_boot_secondary(cpu, idle);
91 if (ret)
92 return ret;
90 93
91 if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) 94 if (lcpu < ARRAY_SIZE(r8a7779_ch_cpu))
92 ch = r8a7779_ch_cpu[cpu]; 95 ch = r8a7779_ch_cpu[lcpu];
93 96
94 if (ch) 97 if (ch)
95 ret = r8a7779_sysc_power_up(ch); 98 ret = r8a7779_sysc_power_up(ch);
99 else
100 ret = -EIO;
96 101
97 return ret; 102 return ret;
98} 103}
99 104
100static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) 105static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
101{ 106{
102 scu_enable(shmobile_scu_base);
103
104 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ 107 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */
105 __raw_writel(__pa(shmobile_boot_vector), AVECR); 108 __raw_writel(__pa(shmobile_boot_vector), AVECR);
106 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); 109 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
107 shmobile_boot_arg = (unsigned long)shmobile_scu_base; 110 shmobile_boot_arg = (unsigned long)shmobile_scu_base;
108 111
109 /* enable cache coherency on booting CPU */ 112 /* setup r8a7779 specific SCU bits */
110 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); 113 shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
114 shmobile_smp_scu_prepare_cpus(max_cpus);
111 115
112 r8a7779_pm_init(); 116 r8a7779_pm_init();
113 117
@@ -117,56 +121,15 @@ static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
117 r8a7779_platform_cpu_kill(3); 121 r8a7779_platform_cpu_kill(3);
118} 122}
119 123
120static void __init r8a7779_smp_init_cpus(void)
121{
122 /* setup r8a7779 specific SCU base */
123 shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
124
125 shmobile_smp_init_cpus(scu_get_core_count(shmobile_scu_base));
126}
127
128#ifdef CONFIG_HOTPLUG_CPU 124#ifdef CONFIG_HOTPLUG_CPU
129static int r8a7779_scu_psr_core_disabled(int cpu)
130{
131 unsigned long mask = 3 << (cpu * 8);
132
133 if ((__raw_readl(shmobile_scu_base + 8) & mask) == mask)
134 return 1;
135
136 return 0;
137}
138
139static int r8a7779_cpu_kill(unsigned int cpu) 125static int r8a7779_cpu_kill(unsigned int cpu)
140{ 126{
141 int k; 127 if (shmobile_smp_scu_cpu_kill(cpu))
142 128 return r8a7779_platform_cpu_kill(cpu);
143 /* this function is running on another CPU than the offline target,
144 * here we need wait for shutdown code in platform_cpu_die() to
145 * finish before asking SoC-specific code to power off the CPU core.
146 */
147 for (k = 0; k < 1000; k++) {
148 if (r8a7779_scu_psr_core_disabled(cpu))
149 return r8a7779_platform_cpu_kill(cpu);
150
151 mdelay(1);
152 }
153 129
154 return 0; 130 return 0;
155} 131}
156 132
157static void r8a7779_cpu_die(unsigned int cpu)
158{
159 dsb();
160 flush_cache_all();
161
162 /* disable cache coherency */
163 scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF);
164
165 /* Endless loop until power off from r8a7779_cpu_kill() */
166 while (1)
167 cpu_do_idle();
168}
169
170static int r8a7779_cpu_disable(unsigned int cpu) 133static int r8a7779_cpu_disable(unsigned int cpu)
171{ 134{
172 /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ 135 /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */
@@ -175,12 +138,11 @@ static int r8a7779_cpu_disable(unsigned int cpu)
175#endif /* CONFIG_HOTPLUG_CPU */ 138#endif /* CONFIG_HOTPLUG_CPU */
176 139
177struct smp_operations r8a7779_smp_ops __initdata = { 140struct smp_operations r8a7779_smp_ops __initdata = {
178 .smp_init_cpus = r8a7779_smp_init_cpus,
179 .smp_prepare_cpus = r8a7779_smp_prepare_cpus, 141 .smp_prepare_cpus = r8a7779_smp_prepare_cpus,
180 .smp_boot_secondary = r8a7779_boot_secondary, 142 .smp_boot_secondary = r8a7779_boot_secondary,
181#ifdef CONFIG_HOTPLUG_CPU 143#ifdef CONFIG_HOTPLUG_CPU
182 .cpu_kill = r8a7779_cpu_kill,
183 .cpu_die = r8a7779_cpu_die,
184 .cpu_disable = r8a7779_cpu_disable, 144 .cpu_disable = r8a7779_cpu_disable,
145 .cpu_die = shmobile_smp_scu_cpu_die,
146 .cpu_kill = r8a7779_cpu_kill,
185#endif 147#endif
186}; 148};
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index d5fc3ed4e315..0baa24443793 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -20,14 +20,11 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/spinlock.h>
24#include <linux/io.h> 23#include <linux/io.h>
25#include <linux/delay.h> 24#include <linux/delay.h>
26#include <mach/common.h> 25#include <mach/common.h>
27#include <asm/cacheflush.h>
28#include <asm/smp_plat.h>
29#include <mach/sh73a0.h> 26#include <mach/sh73a0.h>
30#include <asm/smp_scu.h> 27#include <asm/smp_plat.h>
31#include <asm/smp_twd.h> 28#include <asm/smp_twd.h>
32 29
33#define WUPCR IOMEM(0xe6151010) 30#define WUPCR IOMEM(0xe6151010)
@@ -36,8 +33,6 @@
36#define SBAR IOMEM(0xe6180020) 33#define SBAR IOMEM(0xe6180020)
37#define APARMBAREA IOMEM(0xe6f10020) 34#define APARMBAREA IOMEM(0xe6f10020)
38 35
39#define PSTR_SHUTDOWN_MODE 3
40
41#define SH73A0_SCU_BASE 0xf0000000 36#define SH73A0_SCU_BASE 0xf0000000
42 37
43#ifdef CONFIG_HAVE_ARM_TWD 38#ifdef CONFIG_HAVE_ARM_TWD
@@ -50,69 +45,33 @@ void __init sh73a0_register_twd(void)
50 45
51static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle) 46static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
52{ 47{
53 cpu = cpu_logical_map(cpu); 48 unsigned int lcpu = cpu_logical_map(cpu);
49 int ret;
54 50
55 if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) 51 ret = shmobile_smp_scu_boot_secondary(cpu, idle);
56 __raw_writel(1 << cpu, WUPCR); /* wake up */ 52 if (ret)
53 return ret;
54
55 if (((__raw_readl(PSTR) >> (4 * lcpu)) & 3) == 3)
56 __raw_writel(1 << lcpu, WUPCR); /* wake up */
57 else 57 else
58 __raw_writel(1 << cpu, SRESCR); /* reset */ 58 __raw_writel(1 << lcpu, SRESCR); /* reset */
59 59
60 return 0; 60 return 0;
61} 61}
62 62
63static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) 63static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
64{ 64{
65 scu_enable(shmobile_scu_base); 65 /* Map the reset vector (in headsmp.S) */
66
67 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */
68 __raw_writel(0, APARMBAREA); /* 4k */ 66 __raw_writel(0, APARMBAREA); /* 4k */
69 __raw_writel(__pa(shmobile_boot_vector), SBAR); 67 __raw_writel(__pa(shmobile_boot_vector), SBAR);
70 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
71 shmobile_boot_arg = (unsigned long)shmobile_scu_base;
72 68
73 /* enable cache coherency on booting CPU */ 69 /* setup sh73a0 specific SCU bits */
74 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
75}
76
77static void __init sh73a0_smp_init_cpus(void)
78{
79 /* setup sh73a0 specific SCU base */
80 shmobile_scu_base = IOMEM(SH73A0_SCU_BASE); 70 shmobile_scu_base = IOMEM(SH73A0_SCU_BASE);
81 71 shmobile_smp_scu_prepare_cpus(max_cpus);
82 shmobile_smp_init_cpus(scu_get_core_count(shmobile_scu_base));
83} 72}
84 73
85#ifdef CONFIG_HOTPLUG_CPU 74#ifdef CONFIG_HOTPLUG_CPU
86static int sh73a0_cpu_kill(unsigned int cpu)
87{
88
89 int k;
90 u32 pstr;
91
92 /*
93 * wait until the power status register confirms the shutdown of the
94 * offline target
95 */
96 for (k = 0; k < 1000; k++) {
97 pstr = (__raw_readl(PSTR) >> (4 * cpu)) & 3;
98 if (pstr == PSTR_SHUTDOWN_MODE)
99 return 1;
100
101 mdelay(1);
102 }
103
104 return 0;
105}
106
107static void sh73a0_cpu_die(unsigned int cpu)
108{
109 /* Set power off mode. This takes the CPU out of the MP cluster */
110 scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF);
111
112 /* Enter shutdown mode */
113 cpu_do_idle();
114}
115
116static int sh73a0_cpu_disable(unsigned int cpu) 75static int sh73a0_cpu_disable(unsigned int cpu)
117{ 76{
118 return 0; /* CPU0 and CPU1 supported */ 77 return 0; /* CPU0 and CPU1 supported */
@@ -120,12 +79,11 @@ static int sh73a0_cpu_disable(unsigned int cpu)
120#endif /* CONFIG_HOTPLUG_CPU */ 79#endif /* CONFIG_HOTPLUG_CPU */
121 80
122struct smp_operations sh73a0_smp_ops __initdata = { 81struct smp_operations sh73a0_smp_ops __initdata = {
123 .smp_init_cpus = sh73a0_smp_init_cpus,
124 .smp_prepare_cpus = sh73a0_smp_prepare_cpus, 82 .smp_prepare_cpus = sh73a0_smp_prepare_cpus,
125 .smp_boot_secondary = sh73a0_boot_secondary, 83 .smp_boot_secondary = sh73a0_boot_secondary,
126#ifdef CONFIG_HOTPLUG_CPU 84#ifdef CONFIG_HOTPLUG_CPU
127 .cpu_kill = sh73a0_cpu_kill,
128 .cpu_die = sh73a0_cpu_die,
129 .cpu_disable = sh73a0_cpu_disable, 85 .cpu_disable = sh73a0_cpu_disable,
86 .cpu_die = shmobile_smp_scu_cpu_die,
87 .cpu_kill = shmobile_smp_scu_cpu_kill,
130#endif 88#endif
131}; 89};
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index f321dbeb2379..62d7052d6f21 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -59,7 +59,3 @@ void __init shmobile_earlytimer_init(void)
59 late_time_init = shmobile_late_time_init; 59 late_time_init = shmobile_late_time_init;
60} 60}
61 61
62void __init shmobile_timer_init(void)
63{
64 clocksource_of_init();
65}