aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d-reference.dts57
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d.dts2
-rw-r--r--arch/arm/boot/dts/emev2.dtsi59
-rw-r--r--arch/arm/boot/dts/r8a73a4-ape6evm.dts22
-rw-r--r--arch/arm/boot/dts/r8a73a4.dtsi126
-rw-r--r--arch/arm/boot/dts/r8a7790.dtsi54
-rw-r--r--arch/arm/mach-shmobile/Kconfig12
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot1
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm.c2
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c9
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d-reference.c46
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d.c4
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-lager.c2
-rw-r--r--arch/arm/mach-shmobile/clock-emev2.c2
-rw-r--r--arch/arm/mach-shmobile/include/mach/dma.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/emev2.h3
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h1
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c376
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c16
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c72
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c7
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c7
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c7
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c34
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c17
29 files changed, 490 insertions, 455 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 641b3c9a7028..af19e38f8e97 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -183,6 +183,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
183 ccu9540.dtb 183 ccu9540.dtb
184dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb 184dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb
185dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ 185dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
186 emev2-kzm9d-reference.dtb \
186 r8a7740-armadillo800eva.dtb \ 187 r8a7740-armadillo800eva.dtb \
187 r8a7778-bockw.dtb \ 188 r8a7778-bockw.dtb \
188 r8a7740-armadillo800eva-reference.dtb \ 189 r8a7740-armadillo800eva-reference.dtb \
diff --git a/arch/arm/boot/dts/emev2-kzm9d-reference.dts b/arch/arm/boot/dts/emev2-kzm9d-reference.dts
new file mode 100644
index 000000000000..bed676b95c27
--- /dev/null
+++ b/arch/arm/boot/dts/emev2-kzm9d-reference.dts
@@ -0,0 +1,57 @@
1/*
2 * Device Tree Source for the KZM9D 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/dts-v1/;
11
12/include/ "emev2.dtsi"
13
14/ {
15 model = "EMEV2 KZM9D Board";
16 compatible = "renesas,kzm9d-reference", "renesas,emev2";
17
18 memory {
19 device_type = "memory";
20 reg = <0x40000000 0x8000000>;
21 };
22
23 chosen {
24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
25 };
26
27 reg_1p8v: regulator@0 {
28 compatible = "regulator-fixed";
29 regulator-name = "fixed-1.8V";
30 regulator-min-microvolt = <1800000>;
31 regulator-max-microvolt = <1800000>;
32 regulator-always-on;
33 regulator-boot-on;
34 };
35
36 reg_3p3v: regulator@1 {
37 compatible = "regulator-fixed";
38 regulator-name = "fixed-3.3V";
39 regulator-min-microvolt = <3300000>;
40 regulator-max-microvolt = <3300000>;
41 regulator-always-on;
42 regulator-boot-on;
43 };
44
45 lan9220@20000000 {
46 compatible = "smsc,lan9220", "smsc,lan9115";
47 reg = <0x20000000 0x10000>;
48 phy-mode = "mii";
49 interrupt-parent = <&gpio0>;
50 interrupts = <1 1>; /* active high */
51 reg-io-width = <4>;
52 smsc,irq-active-high;
53 smsc,irq-push-pull;
54 vddvario-supply = <&reg_1p8v>;
55 vdd33a-supply = <&reg_3p3v>;
56 };
57};
diff --git a/arch/arm/boot/dts/emev2-kzm9d.dts b/arch/arm/boot/dts/emev2-kzm9d.dts
index b9b3241f173b..dda13bc02f9f 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=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M@0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"; 24 bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
25 }; 25 };
26}; 26};
diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi
index c8a8c08b48dd..99ad2b2e8e14 100644
--- a/arch/arm/boot/dts/emev2.dtsi
+++ b/arch/arm/boot/dts/emev2.dtsi
@@ -14,6 +14,14 @@
14 compatible = "renesas,emev2"; 14 compatible = "renesas,emev2";
15 interrupt-parent = <&gic>; 15 interrupt-parent = <&gic>;
16 16
17 aliases {
18 gpio0 = &gpio0;
19 gpio1 = &gpio1;
20 gpio2 = &gpio2;
21 gpio3 = &gpio3;
22 gpio4 = &gpio4;
23 };
24
17 cpus { 25 cpus {
18 #address-cells = <1>; 26 #address-cells = <1>;
19 #size-cells = <0>; 27 #size-cells = <0>;
@@ -67,4 +75,55 @@
67 reg = <0xe1050000 0x38>; 75 reg = <0xe1050000 0x38>;
68 interrupts = <0 11 0>; 76 interrupts = <0 11 0>;
69 }; 77 };
78
79 gpio0: gpio@e0050000 {
80 compatible = "renesas,em-gio";
81 reg = <0xe0050000 0x2c>, <0xe0050040 0x20>;
82 interrupts = <0 67 0>, <0 68 0>;
83 gpio-controller;
84 #gpio-cells = <2>;
85 ngpios = <32>;
86 interrupt-controller;
87 #interrupt-cells = <2>;
88 };
89 gpio1: gpio@e0050080 {
90 compatible = "renesas,em-gio";
91 reg = <0xe0050080 0x2c>, <0xe00500c0 0x20>;
92 interrupts = <0 69 0>, <0 70 0>;
93 gpio-controller;
94 #gpio-cells = <2>;
95 ngpios = <32>;
96 interrupt-controller;
97 #interrupt-cells = <2>;
98 };
99 gpio2: gpio@e0050100 {
100 compatible = "renesas,em-gio";
101 reg = <0xe0050100 0x2c>, <0xe0050140 0x20>;
102 interrupts = <0 71 0>, <0 72 0>;
103 gpio-controller;
104 #gpio-cells = <2>;
105 ngpios = <32>;
106 interrupt-controller;
107 #interrupt-cells = <2>;
108 };
109 gpio3: gpio@e0050180 {
110 compatible = "renesas,em-gio";
111 reg = <0xe0050180 0x2c>, <0xe00501c0 0x20>;
112 interrupts = <0 73 0>, <0 74 0>;
113 gpio-controller;
114 #gpio-cells = <2>;
115 ngpios = <32>;
116 interrupt-controller;
117 #interrupt-cells = <2>;
118 };
119 gpio4: gpio@e0050200 {
120 compatible = "renesas,em-gio";
121 reg = <0xe0050200 0x2c>, <0xe0050240 0x20>;
122 interrupts = <0 75 0>, <0 76 0>;
123 gpio-controller;
124 #gpio-cells = <2>;
125 ngpios = <31>;
126 interrupt-controller;
127 #interrupt-cells = <2>;
128 };
70}; 129};
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm.dts b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
index f603c6946c29..e657a9db1666 100644
--- a/arch/arm/boot/dts/r8a73a4-ape6evm.dts
+++ b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
@@ -50,3 +50,25 @@
50 }; 50 };
51 }; 51 };
52}; 52};
53
54&i2c5 {
55 vdd_dvfs: max8973@1b {
56 compatible = "maxim,max8973";
57 reg = <0x1b>;
58
59 regulator-min-microvolt = <935000>;
60 regulator-max-microvolt = <1200000>;
61 regulator-boot-on;
62 regulator-always-on;
63 };
64};
65
66&cpu0 {
67 cpu0-supply = <&vdd_dvfs>;
68 operating-points = <
69 /* kHz uV */
70 1950000 1115000
71 1462500 995000
72 >;
73 voltage-tolerance = <1>; /* 1% */
74};
diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi
index 4ff2019c0e30..6ce699be6095 100644
--- a/arch/arm/boot/dts/r8a73a4.dtsi
+++ b/arch/arm/boot/dts/r8a73a4.dtsi
@@ -85,4 +85,130 @@
85 interrupt-parent = <&gic>; 85 interrupt-parent = <&gic>;
86 interrupts = <0 69 4>; 86 interrupts = <0 69 4>;
87 }; 87 };
88
89 i2c0: i2c@e6500000 {
90 #address-cells = <1>;
91 #size-cells = <0>;
92 compatible = "renesas,rmobile-iic";
93 reg = <0 0xe6500000 0 0x428>;
94 interrupt-parent = <&gic>;
95 interrupts = <0 174 0x4>;
96 };
97
98 i2c1: i2c@e6510000 {
99 #address-cells = <1>;
100 #size-cells = <0>;
101 compatible = "renesas,rmobile-iic";
102 reg = <0 0xe6510000 0 0x428>;
103 interrupt-parent = <&gic>;
104 interrupts = <0 175 0x4>;
105 };
106
107 i2c2: i2c@e6520000 {
108 #address-cells = <1>;
109 #size-cells = <0>;
110 compatible = "renesas,rmobile-iic";
111 reg = <0 0xe6520000 0 0x428>;
112 interrupt-parent = <&gic>;
113 interrupts = <0 176 0x4>;
114 };
115
116 i2c3: i2c@e6530000 {
117 #address-cells = <1>;
118 #size-cells = <0>;
119 compatible = "renesas,rmobile-iic";
120 reg = <0 0xe6530000 0 0x428>;
121 interrupt-parent = <&gic>;
122 interrupts = <0 177 0x4>;
123 };
124
125 i2c4: i2c@e6540000 {
126 #address-cells = <1>;
127 #size-cells = <0>;
128 compatible = "renesas,rmobile-iic";
129 reg = <0 0xe6540000 0 0x428>;
130 interrupt-parent = <&gic>;
131 interrupts = <0 178 0x4>;
132 };
133
134 i2c5: i2c@e60b0000 {
135 #address-cells = <1>;
136 #size-cells = <0>;
137 compatible = "renesas,rmobile-iic";
138 reg = <0 0xe60b0000 0 0x428>;
139 interrupt-parent = <&gic>;
140 interrupts = <0 179 0x4>;
141 };
142
143 i2c6: i2c@e6550000 {
144 #address-cells = <1>;
145 #size-cells = <0>;
146 compatible = "renesas,rmobile-iic";
147 reg = <0 0xe6550000 0 0x428>;
148 interrupt-parent = <&gic>;
149 interrupts = <0 184 0x4>;
150 };
151
152 i2c7: i2c@e6560000 {
153 #address-cells = <1>;
154 #size-cells = <0>;
155 compatible = "renesas,rmobile-iic";
156 reg = <0 0xe6560000 0 0x428>;
157 interrupt-parent = <&gic>;
158 interrupts = <0 185 0x4>;
159 };
160
161 i2c8: i2c@e6570000 {
162 #address-cells = <1>;
163 #size-cells = <0>;
164 compatible = "renesas,rmobile-iic";
165 reg = <0 0xe6570000 0 0x428>;
166 interrupt-parent = <&gic>;
167 interrupts = <0 173 0x4>;
168 };
169
170 mmcif0: mmcif@ee200000 {
171 compatible = "renesas,sh-mmcif";
172 reg = <0 0xee200000 0 0x80>;
173 interrupt-parent = <&gic>;
174 interrupts = <0 169 0x4>;
175 reg-io-width = <4>;
176 status = "disabled";
177 };
178
179 mmcif1: mmcif@ee220000 {
180 compatible = "renesas,sh-mmcif";
181 reg = <0 0xee220000 0 0x80>;
182 interrupt-parent = <&gic>;
183 interrupts = <0 170 0x4>;
184 reg-io-width = <4>;
185 status = "disabled";
186 };
187
188 sdhi0: sdhi@ee100000 {
189 compatible = "renesas,r8a73a4-sdhi";
190 reg = <0 0xee100000 0 0x100>;
191 interrupt-parent = <&gic>;
192 interrupts = <0 165 4>;
193 cap-sd-highspeed;
194 status = "disabled";
195 };
196
197 sdhi1: sdhi@ee120000 {
198 compatible = "renesas,r8a73a4-sdhi";
199 reg = <0 0xee120000 0 0x100>;
200 interrupt-parent = <&gic>;
201 interrupts = <0 166 4>;
202 cap-sd-highspeed;
203 status = "disabled";
204 };
205
206 sdhi2: sdhi@ee140000 {
207 compatible = "renesas,r8a73a4-sdhi";
208 reg = <0 0xee140000 0 0x100>;
209 interrupt-parent = <&gic>;
210 interrupts = <0 167 4>;
211 cap-sd-highspeed;
212 status = "disabled";
213 };
88}; 214};
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 339d9b11721c..9cd882028095 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -54,4 +54,58 @@
54 interrupt-parent = <&gic>; 54 interrupt-parent = <&gic>;
55 interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>; 55 interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>;
56 }; 56 };
57
58 mmcif0: mmcif@ee200000 {
59 compatible = "renesas,sh-mmcif";
60 reg = <0 0xee200000 0 0x80>;
61 interrupt-parent = <&gic>;
62 interrupts = <0 169 0x4>;
63 reg-io-width = <4>;
64 status = "disabled";
65 };
66
67 mmcif1: mmcif@ee220000 {
68 compatible = "renesas,sh-mmcif";
69 reg = <0 0xee220000 0 0x80>;
70 interrupt-parent = <&gic>;
71 interrupts = <0 170 0x4>;
72 reg-io-width = <4>;
73 status = "disabled";
74 };
75
76 sdhi0: sdhi@ee100000 {
77 compatible = "renesas,r8a7790-sdhi";
78 reg = <0 0xee100000 0 0x100>;
79 interrupt-parent = <&gic>;
80 interrupts = <0 165 4>;
81 cap-sd-highspeed;
82 status = "disabled";
83 };
84
85 sdhi1: sdhi@ee120000 {
86 compatible = "renesas,r8a7790-sdhi";
87 reg = <0 0xee120000 0 0x100>;
88 interrupt-parent = <&gic>;
89 interrupts = <0 166 4>;
90 cap-sd-highspeed;
91 status = "disabled";
92 };
93
94 sdhi2: sdhi@ee140000 {
95 compatible = "renesas,r8a7790-sdhi";
96 reg = <0 0xee140000 0 0x100>;
97 interrupt-parent = <&gic>;
98 interrupts = <0 167 4>;
99 cap-sd-highspeed;
100 status = "disabled";
101 };
102
103 sdhi3: sdhi@ee160000 {
104 compatible = "renesas,r8a7790-sdhi";
105 reg = <0 0xee160000 0 0x100>;
106 interrupt-parent = <&gic>;
107 interrupts = <0 168 4>;
108 cap-sd-highspeed;
109 status = "disabled";
110 };
57}; 111};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 3912ce91fee4..7c5034aa1fe3 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -156,6 +156,18 @@ config MACH_KZM9D
156 select REGULATOR_FIXED_VOLTAGE if REGULATOR 156 select REGULATOR_FIXED_VOLTAGE if REGULATOR
157 select USE_OF 157 select USE_OF
158 158
159config MACH_KZM9D_REFERENCE
160 bool "KZM9D board - Reference Device Tree Implementation"
161 depends on ARCH_EMEV2
162 select REGULATOR_FIXED_VOLTAGE if REGULATOR
163 select USE_OF
164 ---help---
165 Use reference implementation of KZM9D board support
166 which makes a greater use of device tree at the expense
167 of not supporting a number of devices.
168
169 This is intended to aid developers
170
159config MACH_KZM9G 171config MACH_KZM9G
160 bool "KZM-A9-GT board" 172 bool "KZM-A9-GT board"
161 depends on ARCH_SH73A0 173 depends on ARCH_SH73A0
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 6165a517f580..e8d0a2c904a0 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_MACH_LAGER) += board-lager.o
46obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 46obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
47obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o 47obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
48obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 48obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
49obj-$(CONFIG_MACH_KZM9D_REFERENCE) += board-kzm9d-reference.o
49obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o 50obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
50obj-$(CONFIG_MACH_KZM9G_REFERENCE) += board-kzm9g-reference.o 51obj-$(CONFIG_MACH_KZM9G_REFERENCE) += board-kzm9g-reference.o
51 52
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 84c6868580f0..7785c52b5cfd 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -7,6 +7,7 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
8loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000 8loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000
9loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000 9loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
10loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000
10loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 11loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
11loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 12loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
12loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index 5eb0caa6a7d0..1fbc39a14e25 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -20,7 +20,6 @@
20 20
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/irqchip.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/pinctrl/machine.h> 24#include <linux/pinctrl/machine.h>
26#include <linux/platform_device.h> 25#include <linux/platform_device.h>
@@ -102,7 +101,6 @@ static const char *ape6evm_boards_compat_dt[] __initdata = {
102}; 101};
103 102
104DT_MACHINE_START(APE6EVM_DT, "ape6evm") 103DT_MACHINE_START(APE6EVM_DT, "ape6evm")
105 .init_irq = irqchip_init,
106 .init_time = shmobile_timer_init, 104 .init_time = shmobile_timer_init,
107 .init_machine = ape6evm_add_standard_devices, 105 .init_machine = ape6evm_add_standard_devices,
108 .dt_compat = ape6evm_boards_compat_dt, 106 .dt_compat = ape6evm_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index e115f6742107..66cfd5686578 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -679,15 +679,6 @@ static struct platform_device vcc_sdhi1 = {
679}; 679};
680 680
681/* SDHI0 */ 681/* SDHI0 */
682/*
683 * FIXME
684 *
685 * It use polling mode here, since
686 * CD (= Card Detect) pin is not connected to SDHI0_CD.
687 * We can use IRQ31 as card detect irq,
688 * but it needs chattering removal operation
689 */
690#define IRQ31 irq_pin(31)
691static struct sh_mobile_sdhi_info sdhi0_info = { 682static struct sh_mobile_sdhi_info sdhi0_info = {
692 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 683 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
693 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 684 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
diff --git a/arch/arm/mach-shmobile/board-kzm9d-reference.c b/arch/arm/mach-shmobile/board-kzm9d-reference.c
new file mode 100644
index 000000000000..a7b28b24ab38
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-kzm9d-reference.c
@@ -0,0 +1,46 @@
1/*
2 * kzm9d board support - Reference DT implementation
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/init.h>
22#include <linux/of_platform.h>
23#include <mach/emev2.h>
24#include <mach/common.h>
25#include <asm/mach/arch.h>
26
27static void __init kzm9d_add_standard_devices(void)
28{
29 emev2_clock_init();
30
31 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
32}
33
34static const char *kzm9d_boards_compat_dt[] __initdata = {
35 "renesas,kzm9d-reference",
36 NULL,
37};
38
39DT_MACHINE_START(KZM9D_DT, "kzm9d")
40 .smp = smp_ops(emev2_smp_ops),
41 .map_io = emev2_map_io,
42 .init_early = emev2_init_delay,
43 .init_machine = kzm9d_add_standard_devices,
44 .init_late = shmobile_init_late,
45 .dt_compat = kzm9d_boards_compat_dt,
46MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
index 4368000e1127..30c2cc695b12 100644
--- a/arch/arm/mach-shmobile/board-kzm9d.c
+++ b/arch/arm/mach-shmobile/board-kzm9d.c
@@ -85,9 +85,7 @@ static const char *kzm9d_boards_compat_dt[] __initdata = {
85DT_MACHINE_START(KZM9D_DT, "kzm9d") 85DT_MACHINE_START(KZM9D_DT, "kzm9d")
86 .smp = smp_ops(emev2_smp_ops), 86 .smp = smp_ops(emev2_smp_ops),
87 .map_io = emev2_map_io, 87 .map_io = emev2_map_io,
88 .init_early = emev2_add_early_devices, 88 .init_early = emev2_init_delay,
89 .nr_irqs = NR_IRQS_LEGACY,
90 .init_irq = emev2_init_irq,
91 .init_machine = kzm9d_add_standard_devices, 89 .init_machine = kzm9d_add_standard_devices,
92 .init_late = shmobile_init_late, 90 .init_late = shmobile_init_late,
93 .dt_compat = kzm9d_boards_compat_dt, 91 .dt_compat = kzm9d_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 44055fe8a45c..41092bb01ee5 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -24,7 +24,6 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/irqchip.h>
28#include <linux/input.h> 27#include <linux/input.h>
29#include <linux/of_platform.h> 28#include <linux/of_platform.h>
30#include <linux/pinctrl/machine.h> 29#include <linux/pinctrl/machine.h>
@@ -99,7 +98,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
99 .map_io = sh73a0_map_io, 98 .map_io = sh73a0_map_io,
100 .init_early = sh73a0_init_delay, 99 .init_early = sh73a0_init_delay,
101 .nr_irqs = NR_IRQS_LEGACY, 100 .nr_irqs = NR_IRQS_LEGACY,
102 .init_irq = irqchip_init,
103 .init_machine = kzm_init, 101 .init_machine = kzm_init,
104 .init_time = shmobile_timer_init, 102 .init_time = shmobile_timer_init,
105 .dt_compat = kzm9g_boards_compat_dt, 103 .dt_compat = kzm9g_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index d73e21d3ea8a..1e99b17767bb 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -22,7 +22,6 @@
22#include <linux/gpio_keys.h> 22#include <linux/gpio_keys.h>
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/irqchip.h>
26#include <linux/kernel.h> 25#include <linux/kernel.h>
27#include <linux/leds.h> 26#include <linux/leds.h>
28#include <linux/pinctrl/machine.h> 27#include <linux/pinctrl/machine.h>
@@ -103,7 +102,6 @@ static const char *lager_boards_compat_dt[] __initdata = {
103}; 102};
104 103
105DT_MACHINE_START(LAGER_DT, "lager") 104DT_MACHINE_START(LAGER_DT, "lager")
106 .init_irq = irqchip_init,
107 .init_time = r8a7790_timer_init, 105 .init_time = r8a7790_timer_init,
108 .init_machine = lager_add_standard_devices, 106 .init_machine = lager_add_standard_devices,
109 .dt_compat = lager_boards_compat_dt, 107 .dt_compat = lager_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
index 4710f1847bb7..56dd0cfcddc7 100644
--- a/arch/arm/mach-shmobile/clock-emev2.c
+++ b/arch/arm/mach-shmobile/clock-emev2.c
@@ -221,7 +221,7 @@ void __init emev2_clock_init(void)
221 smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); 221 smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
222 BUG_ON(!smu_base); 222 BUG_ON(!smu_base);
223 223
224 /* setup STI timer to run on 37.768 kHz and deassert reset */ 224 /* setup STI timer to run on 32.768 kHz and deassert reset */
225 emev2_smu_write(0, STI_CLKSEL); 225 emev2_smu_write(0, STI_CLKSEL);
226 emev2_smu_write(1, STI_RSTCTRL); 226 emev2_smu_write(1, STI_RSTCTRL);
227 227
diff --git a/arch/arm/mach-shmobile/include/mach/dma.h b/arch/arm/mach-shmobile/include/mach/dma.h
deleted file mode 100644
index 40a8c178f10d..000000000000
--- a/arch/arm/mach-shmobile/include/mach/dma.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
index ac3751705cab..b0ab4b72770a 100644
--- a/arch/arm/mach-shmobile/include/mach/emev2.h
+++ b/arch/arm/mach-shmobile/include/mach/emev2.h
@@ -2,8 +2,7 @@
2#define __ASM_EMEV2_H__ 2#define __ASM_EMEV2_H__
3 3
4extern void emev2_map_io(void); 4extern void emev2_map_io(void);
5extern void emev2_init_irq(void); 5extern void emev2_init_delay(void);
6extern void emev2_add_early_devices(void);
7extern void emev2_add_standard_devices(void); 6extern void emev2_add_standard_devices(void);
8extern void emev2_clock_init(void); 7extern void emev2_clock_init(void);
9extern void emev2_set_boot_vector(unsigned long value); 8extern void emev2_set_boot_vector(unsigned long value);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index 851d027a2f06..9b561bf4229f 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -33,7 +33,6 @@ extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
33 33
34extern void r8a7778_init_late(void); 34extern void r8a7778_init_late(void);
35extern void r8a7778_init_delay(void); 35extern void r8a7778_init_delay(void);
36extern void r8a7778_init_irq(void);
37extern void r8a7778_init_irq_dt(void); 36extern void r8a7778_init_irq_dt(void);
38extern void r8a7778_clock_init(void); 37extern void r8a7778_clock_init(void);
39extern void r8a7778_init_irq_extpin(int irlm); 38extern void r8a7778_init_irq_extpin(int irlm);
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index 1ccddd228112..19980be7d6a9 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -20,7 +20,6 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/irqchip.h>
24#include <linux/platform_device.h> 23#include <linux/platform_device.h>
25#include <linux/platform_data/gpio-em.h> 24#include <linux/platform_data/gpio-em.h>
26#include <linux/of_platform.h> 25#include <linux/of_platform.h>
@@ -39,13 +38,6 @@
39 38
40static struct map_desc emev2_io_desc[] __initdata = { 39static struct map_desc emev2_io_desc[] __initdata = {
41#ifdef CONFIG_SMP 40#ifdef CONFIG_SMP
42 /* 128K entity map for 0xe0100000 (SMU) */
43 {
44 .virtual = 0xe0100000,
45 .pfn = __phys_to_pfn(0xe0100000),
46 .length = SZ_128K,
47 .type = MT_DEVICE
48 },
49 /* 2M mapping for SCU + L2 controller */ 41 /* 2M mapping for SCU + L2 controller */
50 { 42 {
51 .virtual = 0xf0000000, 43 .virtual = 0xf0000000,
@@ -63,102 +55,40 @@ void __init emev2_map_io(void)
63 55
64/* UART */ 56/* UART */
65static struct resource uart0_resources[] = { 57static struct resource uart0_resources[] = {
66 [0] = { 58 DEFINE_RES_MEM(0xe1020000, 0x38),
67 .start = 0xe1020000, 59 DEFINE_RES_IRQ(40),
68 .end = 0xe1020037,
69 .flags = IORESOURCE_MEM,
70 },
71 [1] = {
72 .start = 40,
73 .flags = IORESOURCE_IRQ,
74 }
75};
76
77static struct platform_device uart0_device = {
78 .name = "serial8250-em",
79 .id = 0,
80 .num_resources = ARRAY_SIZE(uart0_resources),
81 .resource = uart0_resources,
82}; 60};
83 61
84static struct resource uart1_resources[] = { 62static struct resource uart1_resources[] = {
85 [0] = { 63 DEFINE_RES_MEM(0xe1030000, 0x38),
86 .start = 0xe1030000, 64 DEFINE_RES_IRQ(41),
87 .end = 0xe1030037,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
91 .start = 41,
92 .flags = IORESOURCE_IRQ,
93 }
94};
95
96static struct platform_device uart1_device = {
97 .name = "serial8250-em",
98 .id = 1,
99 .num_resources = ARRAY_SIZE(uart1_resources),
100 .resource = uart1_resources,
101}; 65};
102 66
103static struct resource uart2_resources[] = { 67static struct resource uart2_resources[] = {
104 [0] = { 68 DEFINE_RES_MEM(0xe1040000, 0x38),
105 .start = 0xe1040000, 69 DEFINE_RES_IRQ(42),
106 .end = 0xe1040037,
107 .flags = IORESOURCE_MEM,
108 },
109 [1] = {
110 .start = 42,
111 .flags = IORESOURCE_IRQ,
112 }
113};
114
115static struct platform_device uart2_device = {
116 .name = "serial8250-em",
117 .id = 2,
118 .num_resources = ARRAY_SIZE(uart2_resources),
119 .resource = uart2_resources,
120}; 70};
121 71
122static struct resource uart3_resources[] = { 72static struct resource uart3_resources[] = {
123 [0] = { 73 DEFINE_RES_MEM(0xe1050000, 0x38),
124 .start = 0xe1050000, 74 DEFINE_RES_IRQ(43),
125 .end = 0xe1050037,
126 .flags = IORESOURCE_MEM,
127 },
128 [1] = {
129 .start = 43,
130 .flags = IORESOURCE_IRQ,
131 }
132}; 75};
133 76
134static struct platform_device uart3_device = { 77#define emev2_register_uart(idx) \
135 .name = "serial8250-em", 78 platform_device_register_simple("serial8250-em", idx, \
136 .id = 3, 79 uart##idx##_resources, \
137 .num_resources = ARRAY_SIZE(uart3_resources), 80 ARRAY_SIZE(uart##idx##_resources))
138 .resource = uart3_resources,
139};
140 81
141/* STI */ 82/* STI */
142static struct resource sti_resources[] = { 83static struct resource sti_resources[] = {
143 [0] = { 84 DEFINE_RES_MEM(0xe0180000, 0x54),
144 .name = "STI", 85 DEFINE_RES_IRQ(157),
145 .start = 0xe0180000,
146 .end = 0xe0180053,
147 .flags = IORESOURCE_MEM,
148 },
149 [1] = {
150 .start = 157,
151 .flags = IORESOURCE_IRQ,
152 },
153};
154
155static struct platform_device sti_device = {
156 .name = "em_sti",
157 .id = 0,
158 .resource = sti_resources,
159 .num_resources = ARRAY_SIZE(sti_resources),
160}; 86};
161 87
88#define emev2_register_sti() \
89 platform_device_register_simple("em_sti", 0, \
90 sti_resources, \
91 ARRAY_SIZE(sti_resources))
162 92
163/* GIO */ 93/* GIO */
164static struct gpio_em_config gio0_config = { 94static struct gpio_em_config gio0_config = {
@@ -168,36 +98,10 @@ static struct gpio_em_config gio0_config = {
168}; 98};
169 99
170static struct resource gio0_resources[] = { 100static struct resource gio0_resources[] = {
171 [0] = { 101 DEFINE_RES_MEM(0xe0050000, 0x2c),
172 .name = "GIO_000", 102 DEFINE_RES_MEM(0xe0050040, 0x20),
173 .start = 0xe0050000, 103 DEFINE_RES_IRQ(99),
174 .end = 0xe005002b, 104 DEFINE_RES_IRQ(100),
175 .flags = IORESOURCE_MEM,
176 },
177 [1] = {
178 .name = "GIO_000",
179 .start = 0xe0050040,
180 .end = 0xe005005f,
181 .flags = IORESOURCE_MEM,
182 },
183 [2] = {
184 .start = 99,
185 .flags = IORESOURCE_IRQ,
186 },
187 [3] = {
188 .start = 100,
189 .flags = IORESOURCE_IRQ,
190 },
191};
192
193static struct platform_device gio0_device = {
194 .name = "em_gio",
195 .id = 0,
196 .resource = gio0_resources,
197 .num_resources = ARRAY_SIZE(gio0_resources),
198 .dev = {
199 .platform_data = &gio0_config,
200 },
201}; 105};
202 106
203static struct gpio_em_config gio1_config = { 107static struct gpio_em_config gio1_config = {
@@ -207,36 +111,10 @@ static struct gpio_em_config gio1_config = {
207}; 111};
208 112
209static struct resource gio1_resources[] = { 113static struct resource gio1_resources[] = {
210 [0] = { 114 DEFINE_RES_MEM(0xe0050080, 0x2c),
211 .name = "GIO_032", 115 DEFINE_RES_MEM(0xe00500c0, 0x20),
212 .start = 0xe0050080, 116 DEFINE_RES_IRQ(101),
213 .end = 0xe00500ab, 117 DEFINE_RES_IRQ(102),
214 .flags = IORESOURCE_MEM,
215 },
216 [1] = {
217 .name = "GIO_032",
218 .start = 0xe00500c0,
219 .end = 0xe00500df,
220 .flags = IORESOURCE_MEM,
221 },
222 [2] = {
223 .start = 101,
224 .flags = IORESOURCE_IRQ,
225 },
226 [3] = {
227 .start = 102,
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct platform_device gio1_device = {
233 .name = "em_gio",
234 .id = 1,
235 .resource = gio1_resources,
236 .num_resources = ARRAY_SIZE(gio1_resources),
237 .dev = {
238 .platform_data = &gio1_config,
239 },
240}; 118};
241 119
242static struct gpio_em_config gio2_config = { 120static struct gpio_em_config gio2_config = {
@@ -246,36 +124,10 @@ static struct gpio_em_config gio2_config = {
246}; 124};
247 125
248static struct resource gio2_resources[] = { 126static struct resource gio2_resources[] = {
249 [0] = { 127 DEFINE_RES_MEM(0xe0050100, 0x2c),
250 .name = "GIO_064", 128 DEFINE_RES_MEM(0xe0050140, 0x20),
251 .start = 0xe0050100, 129 DEFINE_RES_IRQ(103),
252 .end = 0xe005012b, 130 DEFINE_RES_IRQ(104),
253 .flags = IORESOURCE_MEM,
254 },
255 [1] = {
256 .name = "GIO_064",
257 .start = 0xe0050140,
258 .end = 0xe005015f,
259 .flags = IORESOURCE_MEM,
260 },
261 [2] = {
262 .start = 103,
263 .flags = IORESOURCE_IRQ,
264 },
265 [3] = {
266 .start = 104,
267 .flags = IORESOURCE_IRQ,
268 },
269};
270
271static struct platform_device gio2_device = {
272 .name = "em_gio",
273 .id = 2,
274 .resource = gio2_resources,
275 .num_resources = ARRAY_SIZE(gio2_resources),
276 .dev = {
277 .platform_data = &gio2_config,
278 },
279}; 131};
280 132
281static struct gpio_em_config gio3_config = { 133static struct gpio_em_config gio3_config = {
@@ -285,36 +137,10 @@ static struct gpio_em_config gio3_config = {
285}; 137};
286 138
287static struct resource gio3_resources[] = { 139static struct resource gio3_resources[] = {
288 [0] = { 140 DEFINE_RES_MEM(0xe0050180, 0x2c),
289 .name = "GIO_096", 141 DEFINE_RES_MEM(0xe00501c0, 0x20),
290 .start = 0xe0050180, 142 DEFINE_RES_IRQ(105),
291 .end = 0xe00501ab, 143 DEFINE_RES_IRQ(106),
292 .flags = IORESOURCE_MEM,
293 },
294 [1] = {
295 .name = "GIO_096",
296 .start = 0xe00501c0,
297 .end = 0xe00501df,
298 .flags = IORESOURCE_MEM,
299 },
300 [2] = {
301 .start = 105,
302 .flags = IORESOURCE_IRQ,
303 },
304 [3] = {
305 .start = 106,
306 .flags = IORESOURCE_IRQ,
307 },
308};
309
310static struct platform_device gio3_device = {
311 .name = "em_gio",
312 .id = 3,
313 .resource = gio3_resources,
314 .num_resources = ARRAY_SIZE(gio3_resources),
315 .dev = {
316 .platform_data = &gio3_config,
317 },
318}; 144};
319 145
320static struct gpio_em_config gio4_config = { 146static struct gpio_em_config gio4_config = {
@@ -324,126 +150,52 @@ static struct gpio_em_config gio4_config = {
324}; 150};
325 151
326static struct resource gio4_resources[] = { 152static struct resource gio4_resources[] = {
327 [0] = { 153 DEFINE_RES_MEM(0xe0050200, 0x2c),
328 .name = "GIO_128", 154 DEFINE_RES_MEM(0xe0050240, 0x20),
329 .start = 0xe0050200, 155 DEFINE_RES_IRQ(107),
330 .end = 0xe005022b, 156 DEFINE_RES_IRQ(108),
331 .flags = IORESOURCE_MEM,
332 },
333 [1] = {
334 .name = "GIO_128",
335 .start = 0xe0050240,
336 .end = 0xe005025f,
337 .flags = IORESOURCE_MEM,
338 },
339 [2] = {
340 .start = 107,
341 .flags = IORESOURCE_IRQ,
342 },
343 [3] = {
344 .start = 108,
345 .flags = IORESOURCE_IRQ,
346 },
347}; 157};
348 158
349static struct platform_device gio4_device = { 159#define emev2_register_gio(idx) \
350 .name = "em_gio", 160 platform_device_register_resndata(&platform_bus, "em_gio", \
351 .id = 4, 161 idx, gio##idx##_resources, \
352 .resource = gio4_resources, 162 ARRAY_SIZE(gio##idx##_resources), \
353 .num_resources = ARRAY_SIZE(gio4_resources), 163 &gio##idx##_config, \
354 .dev = { 164 sizeof(struct gpio_em_config))
355 .platform_data = &gio4_config,
356 },
357};
358 165
359static struct resource pmu_resources[] = { 166static struct resource pmu_resources[] = {
360 [0] = { 167 DEFINE_RES_IRQ(152),
361 .start = 152, 168 DEFINE_RES_IRQ(153),
362 .end = 152,
363 .flags = IORESOURCE_IRQ,
364 },
365 [1] = {
366 .start = 153,
367 .end = 153,
368 .flags = IORESOURCE_IRQ,
369 },
370}; 169};
371 170
372static struct platform_device pmu_device = { 171#define emev2_register_pmu() \
373 .name = "arm-pmu", 172 platform_device_register_simple("arm-pmu", -1, \
374 .id = -1, 173 pmu_resources, \
375 .num_resources = ARRAY_SIZE(pmu_resources), 174 ARRAY_SIZE(pmu_resources))
376 .resource = pmu_resources,
377};
378
379static struct platform_device *emev2_early_devices[] __initdata = {
380 &uart0_device,
381 &uart1_device,
382 &uart2_device,
383 &uart3_device,
384};
385
386static struct platform_device *emev2_late_devices[] __initdata = {
387 &sti_device,
388 &gio0_device,
389 &gio1_device,
390 &gio2_device,
391 &gio3_device,
392 &gio4_device,
393 &pmu_device,
394};
395 175
396void __init emev2_add_standard_devices(void) 176void __init emev2_add_standard_devices(void)
397{ 177{
398 emev2_clock_init(); 178 emev2_clock_init();
399 179
400 platform_add_devices(emev2_early_devices, 180 emev2_register_uart(0);
401 ARRAY_SIZE(emev2_early_devices)); 181 emev2_register_uart(1);
402 182 emev2_register_uart(2);
403 platform_add_devices(emev2_late_devices, 183 emev2_register_uart(3);
404 ARRAY_SIZE(emev2_late_devices)); 184 emev2_register_sti();
185 emev2_register_gio(0);
186 emev2_register_gio(1);
187 emev2_register_gio(2);
188 emev2_register_gio(3);
189 emev2_register_gio(4);
190 emev2_register_pmu();
405} 191}
406 192
407static void __init emev2_init_delay(void) 193void __init emev2_init_delay(void)
408{ 194{
409 shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ 195 shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
410} 196}
411 197
412void __init emev2_add_early_devices(void)
413{
414 emev2_init_delay();
415
416 early_platform_add_devices(emev2_early_devices,
417 ARRAY_SIZE(emev2_early_devices));
418
419 /* setup early console here as well */
420 shmobile_setup_console();
421}
422
423void __init emev2_init_irq(void)
424{
425 void __iomem *gic_dist_base;
426 void __iomem *gic_cpu_base;
427
428 /* Static mappings, never released */
429 gic_dist_base = ioremap(0xe0028000, PAGE_SIZE);
430 gic_cpu_base = ioremap(0xe0020000, PAGE_SIZE);
431 BUG_ON(!gic_dist_base || !gic_cpu_base);
432
433 /* Use GIC to handle interrupts */
434 gic_init(0, 29, gic_dist_base, gic_cpu_base);
435}
436
437#ifdef CONFIG_USE_OF 198#ifdef CONFIG_USE_OF
438static const struct of_dev_auxdata emev2_auxdata_lookup[] __initconst = {
439 { }
440};
441
442static void __init emev2_add_standard_devices_dt(void)
443{
444 of_platform_populate(NULL, of_default_bus_match_table,
445 emev2_auxdata_lookup, NULL);
446}
447 199
448static const char *emev2_boards_compat_dt[] __initdata = { 200static const char *emev2_boards_compat_dt[] __initdata = {
449 "renesas,emev2", 201 "renesas,emev2",
@@ -452,10 +204,8 @@ static const char *emev2_boards_compat_dt[] __initdata = {
452 204
453DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") 205DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
454 .smp = smp_ops(emev2_smp_ops), 206 .smp = smp_ops(emev2_smp_ops),
207 .map_io = emev2_map_io,
455 .init_early = emev2_init_delay, 208 .init_early = emev2_init_delay,
456 .nr_irqs = NR_IRQS_LEGACY,
457 .init_irq = irqchip_init,
458 .init_machine = emev2_add_standard_devices_dt,
459 .dt_compat = emev2_boards_compat_dt, 209 .dt_compat = emev2_boards_compat_dt,
460MACHINE_END 210MACHINE_END
461 211
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index 7f45c2edbca9..a8c4e41bf27a 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -18,7 +18,6 @@
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#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/irqchip.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/of_platform.h> 22#include <linux/of_platform.h>
24#include <linux/platform_data/irq-renesas-irqc.h> 23#include <linux/platform_data/irq-renesas-irqc.h>
@@ -194,7 +193,6 @@ static const char *r8a73a4_boards_compat_dt[] __initdata = {
194}; 193};
195 194
196DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)") 195DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)")
197 .init_irq = irqchip_init,
198 .init_machine = r8a73a4_add_standard_devices_dt, 196 .init_machine = r8a73a4_add_standard_devices_dt,
199 .init_time = shmobile_timer_init, 197 .init_time = shmobile_timer_init,
200 .dt_compat = r8a73a4_boards_compat_dt, 198 .dt_compat = r8a73a4_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 00c5a707238b..ac29c2ee011f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -986,16 +986,22 @@ void __init r8a7740_add_early_devices(void)
986 986
987#ifdef CONFIG_USE_OF 987#ifdef CONFIG_USE_OF
988 988
989static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = { 989void __init r8a7740_add_early_devices_dt(void)
990 { } 990{
991}; 991 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
992
993 early_platform_add_devices(r8a7740_early_devices,
994 ARRAY_SIZE(r8a7740_early_devices));
995
996 /* setup early console here as well */
997 shmobile_setup_console();
998}
992 999
993void __init r8a7740_add_standard_devices_dt(void) 1000void __init r8a7740_add_standard_devices_dt(void)
994{ 1001{
995 platform_add_devices(r8a7740_devices_dt, 1002 platform_add_devices(r8a7740_devices_dt,
996 ARRAY_SIZE(r8a7740_devices_dt)); 1003 ARRAY_SIZE(r8a7740_devices_dt));
997 of_platform_populate(NULL, of_default_bus_match_table, 1004 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
998 r8a7740_auxdata_lookup, NULL);
999} 1005}
1000 1006
1001void __init r8a7740_init_delay(void) 1007void __init r8a7740_init_delay(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 80c20392ad7c..a3a2e37b03f3 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -53,7 +53,7 @@
53 .irqs = SCIx_IRQ_MUXED(irq), \ 53 .irqs = SCIx_IRQ_MUXED(irq), \
54} 54}
55 55
56static struct plat_sci_port scif_platform_data[] = { 56static struct plat_sci_port scif_platform_data[] __initdata = {
57 SCIF_INFO(0xffe40000, gic_iid(0x66)), 57 SCIF_INFO(0xffe40000, gic_iid(0x66)),
58 SCIF_INFO(0xffe41000, gic_iid(0x67)), 58 SCIF_INFO(0xffe41000, gic_iid(0x67)),
59 SCIF_INFO(0xffe42000, gic_iid(0x68)), 59 SCIF_INFO(0xffe42000, gic_iid(0x68)),
@@ -63,24 +63,24 @@ static struct plat_sci_port scif_platform_data[] = {
63}; 63};
64 64
65/* TMU */ 65/* TMU */
66static struct resource sh_tmu0_resources[] = { 66static struct resource sh_tmu0_resources[] __initdata = {
67 DEFINE_RES_MEM(0xffd80008, 12), 67 DEFINE_RES_MEM(0xffd80008, 12),
68 DEFINE_RES_IRQ(gic_iid(0x40)), 68 DEFINE_RES_IRQ(gic_iid(0x40)),
69}; 69};
70 70
71static struct sh_timer_config sh_tmu0_platform_data = { 71static struct sh_timer_config sh_tmu0_platform_data __initdata = {
72 .name = "TMU00", 72 .name = "TMU00",
73 .channel_offset = 0x4, 73 .channel_offset = 0x4,
74 .timer_bit = 0, 74 .timer_bit = 0,
75 .clockevent_rating = 200, 75 .clockevent_rating = 200,
76}; 76};
77 77
78static struct resource sh_tmu1_resources[] = { 78static struct resource sh_tmu1_resources[] __initdata = {
79 DEFINE_RES_MEM(0xffd80014, 12), 79 DEFINE_RES_MEM(0xffd80014, 12),
80 DEFINE_RES_IRQ(gic_iid(0x41)), 80 DEFINE_RES_IRQ(gic_iid(0x41)),
81}; 81};
82 82
83static struct sh_timer_config sh_tmu1_platform_data = { 83static struct sh_timer_config sh_tmu1_platform_data __initdata = {
84 .name = "TMU01", 84 .name = "TMU01",
85 .channel_offset = 0x10, 85 .channel_offset = 0x10,
86 .timer_bit = 1, 86 .timer_bit = 1,
@@ -189,7 +189,7 @@ USB_PLATFORM_INFO(ehci);
189USB_PLATFORM_INFO(ohci); 189USB_PLATFORM_INFO(ohci);
190 190
191/* Ether */ 191/* Ether */
192static struct resource ether_resources[] = { 192static struct resource ether_resources[] __initdata = {
193 DEFINE_RES_MEM(0xfde00000, 0x400), 193 DEFINE_RES_MEM(0xfde00000, 0x400),
194 DEFINE_RES_IRQ(gic_iid(0x89)), 194 DEFINE_RES_IRQ(gic_iid(0x89)),
195}; 195};
@@ -203,17 +203,17 @@ void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata)
203} 203}
204 204
205/* PFC/GPIO */ 205/* PFC/GPIO */
206static struct resource pfc_resources[] = { 206static struct resource pfc_resources[] __initdata = {
207 DEFINE_RES_MEM(0xfffc0000, 0x118), 207 DEFINE_RES_MEM(0xfffc0000, 0x118),
208}; 208};
209 209
210#define R8A7778_GPIO(idx) \ 210#define R8A7778_GPIO(idx) \
211static struct resource r8a7778_gpio##idx##_resources[] = { \ 211static struct resource r8a7778_gpio##idx##_resources[] __initdata = { \
212 DEFINE_RES_MEM(0xffc40000 + 0x1000 * (idx), 0x30), \ 212 DEFINE_RES_MEM(0xffc40000 + 0x1000 * (idx), 0x30), \
213 DEFINE_RES_IRQ(gic_iid(0x87)), \ 213 DEFINE_RES_IRQ(gic_iid(0x87)), \
214}; \ 214}; \
215 \ 215 \
216static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data = { \ 216static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data __initdata = { \
217 .gpio_base = 32 * (idx), \ 217 .gpio_base = 32 * (idx), \
218 .irq_base = GPIO_IRQ_BASE(idx), \ 218 .irq_base = GPIO_IRQ_BASE(idx), \
219 .number_of_pins = 32, \ 219 .number_of_pins = 32, \
@@ -249,7 +249,7 @@ void __init r8a7778_pinmux_init(void)
249}; 249};
250 250
251/* SDHI */ 251/* SDHI */
252static struct resource sdhi_resources[] = { 252static struct resource sdhi_resources[] __initdata = {
253 /* SDHI0 */ 253 /* SDHI0 */
254 DEFINE_RES_MEM(0xFFE4C000, 0x100), 254 DEFINE_RES_MEM(0xFFE4C000, 0x100),
255 DEFINE_RES_IRQ(gic_iid(0x77)), 255 DEFINE_RES_IRQ(gic_iid(0x77)),
@@ -365,12 +365,12 @@ void __init r8a7778_init_late(void)
365 platform_device_register_full(&ohci_info); 365 platform_device_register_full(&ohci_info);
366} 366}
367 367
368static struct renesas_intc_irqpin_config irqpin_platform_data = { 368static struct renesas_intc_irqpin_config irqpin_platform_data __initdata = {
369 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ 369 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
370 .sense_bitfield_width = 2, 370 .sense_bitfield_width = 2,
371}; 371};
372 372
373static struct resource irqpin_resources[] = { 373static struct resource irqpin_resources[] __initdata = {
374 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ 374 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
375 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ 375 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
376 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ 376 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
@@ -408,17 +408,25 @@ void __init r8a7778_init_irq_extpin(int irlm)
408 &irqpin_platform_data, sizeof(irqpin_platform_data)); 408 &irqpin_platform_data, sizeof(irqpin_platform_data));
409} 409}
410 410
411void __init r8a7778_init_delay(void)
412{
413 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
414}
415
416#ifdef CONFIG_USE_OF
411#define INT2SMSKCR0 0x82288 /* 0xfe782288 */ 417#define INT2SMSKCR0 0x82288 /* 0xfe782288 */
412#define INT2SMSKCR1 0x8228c /* 0xfe78228c */ 418#define INT2SMSKCR1 0x8228c /* 0xfe78228c */
413 419
414#define INT2NTSR0 0x00018 /* 0xfe700018 */ 420#define INT2NTSR0 0x00018 /* 0xfe700018 */
415#define INT2NTSR1 0x0002c /* 0xfe70002c */ 421#define INT2NTSR1 0x0002c /* 0xfe70002c */
416static void __init r8a7778_init_irq_common(void) 422void __init r8a7778_init_irq_dt(void)
417{ 423{
418 void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000); 424 void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
419 425
420 BUG_ON(!base); 426 BUG_ON(!base);
421 427
428 irqchip_init();
429
422 /* route all interrupts to ARM */ 430 /* route all interrupts to ARM */
423 __raw_writel(0x73ffffff, base + INT2NTSR0); 431 __raw_writel(0x73ffffff, base + INT2NTSR0);
424 __raw_writel(0xffffffff, base + INT2NTSR1); 432 __raw_writel(0xffffffff, base + INT2NTSR1);
@@ -430,43 +438,6 @@ static void __init r8a7778_init_irq_common(void)
430 iounmap(base); 438 iounmap(base);
431} 439}
432 440
433void __init r8a7778_init_irq(void)
434{
435 void __iomem *gic_dist_base;
436 void __iomem *gic_cpu_base;
437
438 gic_dist_base = ioremap_nocache(0xfe438000, PAGE_SIZE);
439 gic_cpu_base = ioremap_nocache(0xfe430000, PAGE_SIZE);
440 BUG_ON(!gic_dist_base || !gic_cpu_base);
441
442 /* use GIC to handle interrupts */
443 gic_init(0, 29, gic_dist_base, gic_cpu_base);
444
445 r8a7778_init_irq_common();
446}
447
448void __init r8a7778_init_delay(void)
449{
450 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
451}
452
453#ifdef CONFIG_USE_OF
454void __init r8a7778_init_irq_dt(void)
455{
456 irqchip_init();
457 r8a7778_init_irq_common();
458}
459
460static const struct of_dev_auxdata r8a7778_auxdata_lookup[] __initconst = {
461 {},
462};
463
464void __init r8a7778_add_standard_devices_dt(void)
465{
466 of_platform_populate(NULL, of_default_bus_match_table,
467 r8a7778_auxdata_lookup, NULL);
468}
469
470static const char *r8a7778_compat_dt[] __initdata = { 441static const char *r8a7778_compat_dt[] __initdata = {
471 "renesas,r8a7778", 442 "renesas,r8a7778",
472 NULL, 443 NULL,
@@ -475,7 +446,6 @@ static const char *r8a7778_compat_dt[] __initdata = {
475DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)") 446DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
476 .init_early = r8a7778_init_delay, 447 .init_early = r8a7778_init_delay,
477 .init_irq = r8a7778_init_irq_dt, 448 .init_irq = r8a7778_init_irq_dt,
478 .init_machine = r8a7778_add_standard_devices_dt,
479 .init_time = shmobile_timer_init, 449 .init_time = shmobile_timer_init,
480 .dt_compat = r8a7778_compat_dt, 450 .dt_compat = r8a7778_compat_dt,
481 .init_late = r8a7778_init_late, 451 .init_late = r8a7778_init_late,
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 398687761f50..66d38261ecaa 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -665,10 +665,6 @@ void __init r8a7779_init_delay(void)
665 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ 665 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
666} 666}
667 667
668static const struct of_dev_auxdata r8a7779_auxdata_lookup[] __initconst = {
669 {},
670};
671
672void __init r8a7779_add_standard_devices_dt(void) 668void __init r8a7779_add_standard_devices_dt(void)
673{ 669{
674 /* clocks are setup late during boot in the case of DT */ 670 /* clocks are setup late during boot in the case of DT */
@@ -676,8 +672,7 @@ void __init r8a7779_add_standard_devices_dt(void)
676 672
677 platform_add_devices(r8a7779_devices_dt, 673 platform_add_devices(r8a7779_devices_dt,
678 ARRAY_SIZE(r8a7779_devices_dt)); 674 ARRAY_SIZE(r8a7779_devices_dt));
679 of_platform_populate(NULL, of_default_bus_match_table, 675 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
680 r8a7779_auxdata_lookup, NULL);
681} 676}
682 677
683static const char *r8a7779_compat_dt[] __initdata = { 678static const char *r8a7779_compat_dt[] __initdata = {
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 28f94752b8ff..b7e78b9a7fdf 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/irqchip.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/of_platform.h> 23#include <linux/of_platform.h>
25#include <linux/serial_sci.h> 24#include <linux/serial_sci.h>
@@ -177,10 +176,6 @@ void __init r8a7790_timer_init(void)
177} 176}
178 177
179#ifdef CONFIG_USE_OF 178#ifdef CONFIG_USE_OF
180void __init r8a7790_add_standard_devices_dt(void)
181{
182 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
183}
184 179
185static const char *r8a7790_boards_compat_dt[] __initdata = { 180static const char *r8a7790_boards_compat_dt[] __initdata = {
186 "renesas,r8a7790", 181 "renesas,r8a7790",
@@ -188,8 +183,6 @@ static const char *r8a7790_boards_compat_dt[] __initdata = {
188}; 183};
189 184
190DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") 185DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
191 .init_irq = irqchip_init,
192 .init_machine = r8a7790_add_standard_devices_dt,
193 .init_time = r8a7790_timer_init, 186 .init_time = r8a7790_timer_init,
194 .dt_compat = r8a7790_boards_compat_dt, 187 .dt_compat = r8a7790_boards_compat_dt,
195MACHINE_END 188MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 5502d624aca6..13e6fdbde0a5 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -1147,10 +1147,6 @@ void __init sh7372_add_early_devices_dt(void)
1147 shmobile_setup_console(); 1147 shmobile_setup_console();
1148} 1148}
1149 1149
1150static const struct of_dev_auxdata sh7372_auxdata_lookup[] __initconst = {
1151 { }
1152};
1153
1154void __init sh7372_add_standard_devices_dt(void) 1150void __init sh7372_add_standard_devices_dt(void)
1155{ 1151{
1156 /* clocks are setup late during boot in the case of DT */ 1152 /* clocks are setup late during boot in the case of DT */
@@ -1159,8 +1155,7 @@ void __init sh7372_add_standard_devices_dt(void)
1159 platform_add_devices(sh7372_early_devices, 1155 platform_add_devices(sh7372_early_devices,
1160 ARRAY_SIZE(sh7372_early_devices)); 1156 ARRAY_SIZE(sh7372_early_devices));
1161 1157
1162 of_platform_populate(NULL, of_default_bus_match_table, 1158 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
1163 sh7372_auxdata_lookup, NULL);
1164} 1159}
1165 1160
1166static const char *sh7372_boards_compat_dt[] __initdata = { 1161static const char *sh7372_boards_compat_dt[] __initdata = {
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 96e7ca1e4e11..516c2391b47a 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -22,7 +22,6 @@
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/platform_device.h> 25#include <linux/platform_device.h>
27#include <linux/of_platform.h> 26#include <linux/of_platform.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
@@ -61,29 +60,16 @@ void __init sh73a0_map_io(void)
61 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc)); 60 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
62} 61}
63 62
64static struct resource sh73a0_pfc_resources[] = { 63/* PFC */
65 [0] = { 64static struct resource pfc_resources[] __initdata = {
66 .start = 0xe6050000, 65 DEFINE_RES_MEM(0xe6050000, 0x8000),
67 .end = 0xe6057fff, 66 DEFINE_RES_MEM(0xe605801c, 0x000c),
68 .flags = IORESOURCE_MEM,
69 },
70 [1] = {
71 .start = 0xe605801c,
72 .end = 0xe6058027,
73 .flags = IORESOURCE_MEM,
74 }
75};
76
77static struct platform_device sh73a0_pfc_device = {
78 .name = "pfc-sh73a0",
79 .id = -1,
80 .resource = sh73a0_pfc_resources,
81 .num_resources = ARRAY_SIZE(sh73a0_pfc_resources),
82}; 67};
83 68
84void __init sh73a0_pinmux_init(void) 69void __init sh73a0_pinmux_init(void)
85{ 70{
86 platform_device_register(&sh73a0_pfc_device); 71 platform_device_register_simple("pfc-sh73a0", -1, pfc_resources,
72 ARRAY_SIZE(pfc_resources));
87} 73}
88 74
89static struct plat_sci_port scif0_platform_data = { 75static struct plat_sci_port scif0_platform_data = {
@@ -958,10 +944,6 @@ void __init sh73a0_add_early_devices(void)
958 944
959#ifdef CONFIG_USE_OF 945#ifdef CONFIG_USE_OF
960 946
961static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
962 {},
963};
964
965void __init sh73a0_add_standard_devices_dt(void) 947void __init sh73a0_add_standard_devices_dt(void)
966{ 948{
967 struct platform_device_info devinfo = { .name = "cpufreq-cpu0", .id = -1, }; 949 struct platform_device_info devinfo = { .name = "cpufreq-cpu0", .id = -1, };
@@ -971,8 +953,7 @@ void __init sh73a0_add_standard_devices_dt(void)
971 953
972 platform_add_devices(sh73a0_devices_dt, 954 platform_add_devices(sh73a0_devices_dt,
973 ARRAY_SIZE(sh73a0_devices_dt)); 955 ARRAY_SIZE(sh73a0_devices_dt));
974 of_platform_populate(NULL, of_default_bus_match_table, 956 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
975 sh73a0_auxdata_lookup, NULL);
976 957
977 /* Instantiate cpufreq-cpu0 */ 958 /* Instantiate cpufreq-cpu0 */
978 platform_device_register_full(&devinfo); 959 platform_device_register_full(&devinfo);
@@ -988,7 +969,6 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
988 .map_io = sh73a0_map_io, 969 .map_io = sh73a0_map_io,
989 .init_early = sh73a0_init_delay, 970 .init_early = sh73a0_init_delay,
990 .nr_irqs = NR_IRQS_LEGACY, 971 .nr_irqs = NR_IRQS_LEGACY,
991 .init_irq = irqchip_init,
992 .init_machine = sh73a0_add_standard_devices_dt, 972 .init_machine = sh73a0_add_standard_devices_dt,
993 .dt_compat = sh73a0_boards_compat_dt, 973 .dt_compat = sh73a0_boards_compat_dt,
994MACHINE_END 974MACHINE_END
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index 80991b35f4ac..97871655b716 100644
--- a/arch/arm/mach-shmobile/smp-emev2.c
+++ b/arch/arm/mach-shmobile/smp-emev2.c
@@ -38,9 +38,12 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
38 38
39static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) 39static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
40{ 40{
41 /* setup EMEV2 specific SCU base, enable */
42 shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
41 scu_enable(shmobile_scu_base); 43 scu_enable(shmobile_scu_base);
42 44
43 /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */ 45 /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */
46 emev2_clock_init(); /* need ioremapped SMU */
44 emev2_set_boot_vector(__pa(shmobile_boot_vector)); 47 emev2_set_boot_vector(__pa(shmobile_boot_vector));
45 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); 48 shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
46 shmobile_boot_arg = (unsigned long)shmobile_scu_base; 49 shmobile_boot_arg = (unsigned long)shmobile_scu_base;
@@ -49,21 +52,7 @@ static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
49 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); 52 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
50} 53}
51 54
52static void __init emev2_smp_init_cpus(void)
53{
54 unsigned int ncores;
55
56 /* setup EMEV2 specific SCU base */
57 shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
58 emev2_clock_init(); /* need ioremapped SMU */
59
60 ncores = shmobile_scu_base ? scu_get_core_count(shmobile_scu_base) : 1;
61
62 shmobile_smp_init_cpus(ncores);
63}
64
65struct smp_operations emev2_smp_ops __initdata = { 55struct smp_operations emev2_smp_ops __initdata = {
66 .smp_init_cpus = emev2_smp_init_cpus,
67 .smp_prepare_cpus = emev2_smp_prepare_cpus, 56 .smp_prepare_cpus = emev2_smp_prepare_cpus,
68 .smp_boot_secondary = emev2_boot_secondary, 57 .smp_boot_secondary = emev2_boot_secondary,
69}; 58};