aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/Makefile4
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen-reference.dts121
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen.dts116
-rw-r--r--arch/arm/boot/dts/r8a7779.dtsi220
-rw-r--r--arch/arm/mach-shmobile/Kconfig23
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot1
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm.c4
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c6
-rw-r--r--arch/arm/mach-shmobile/board-bockw-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c4
-rw-r--r--arch/arm/mach-shmobile/board-genmai-reference.c4
-rw-r--r--arch/arm/mach-shmobile/board-genmai.c4
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c8
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c6
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c4
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c8
-rw-r--r--arch/arm/mach-shmobile/board-lager.c5
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c10
-rw-r--r--arch/arm/mach-shmobile/board-marzen-reference.c28
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r7s72100.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a73a4.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c26
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c5
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7791.c6
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c4
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c4
-rw-r--r--arch/arm/mach-shmobile/clock.c6
-rw-r--r--arch/arm/mach-shmobile/clock.h (renamed from arch/arm/mach-shmobile/include/mach/clock.h)0
-rw-r--r--arch/arm/mach-shmobile/common.h (renamed from arch/arm/mach-shmobile/include/mach/common.h)0
-rw-r--r--arch/arm/mach-shmobile/console.c2
-rw-r--r--arch/arm/mach-shmobile/dma-register.h (renamed from arch/arm/mach-shmobile/include/mach/dma-register.h)0
-rw-r--r--arch/arm/mach-shmobile/include/mach/irqs.h16
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7740.h2
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h14
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7790.h2
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h4
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c5
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c5
-rw-r--r--arch/arm/mach-shmobile/intc.h (renamed from arch/arm/mach-shmobile/include/mach/intc.h)0
-rw-r--r--arch/arm/mach-shmobile/irqs.h21
-rw-r--r--arch/arm/mach-shmobile/platsmp-apmu.c2
-rw-r--r--arch/arm/mach-shmobile/platsmp-scu.c2
-rw-r--r--arch/arm/mach-shmobile/platsmp.c2
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7740.c4
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7779.c15
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7790.c2
-rw-r--r--arch/arm/mach-shmobile/pm-rcar.c2
-rw-r--r--arch/arm/mach-shmobile/pm-rcar.h (renamed from arch/arm/mach-shmobile/include/mach/pm-rcar.h)0
-rw-r--r--arch/arm/mach-shmobile/pm-rmobile.c2
-rw-r--r--arch/arm/mach-shmobile/pm-rmobile.h (renamed from arch/arm/mach-shmobile/include/mach/pm-rmobile.h)0
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c4
-rw-r--r--arch/arm/mach-shmobile/pm-sh73a0.c2
-rw-r--r--arch/arm/mach-shmobile/rcar-gen2.h (renamed from arch/arm/mach-shmobile/include/mach/rcar-gen2.h)0
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c2
-rw-r--r--arch/arm/mach-shmobile/setup-r7s72100.c4
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c6
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c8
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c4
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c49
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c7
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c6
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c4
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c8
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c7
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c2
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c4
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7790.c4
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7791.c4
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c2
76 files changed, 557 insertions, 327 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index adb5ed9e269e..eb280d3483eb 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -327,7 +327,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += r7s72100-genmai.dtb \
327 r8a7778-bockw-reference.dtb \ 327 r8a7778-bockw-reference.dtb \
328 r8a7740-armadillo800eva-reference.dtb \ 328 r8a7740-armadillo800eva-reference.dtb \
329 r8a7779-marzen.dtb \ 329 r8a7779-marzen.dtb \
330 r8a7779-marzen-reference.dtb \
331 r8a7791-koelsch.dtb \ 330 r8a7791-koelsch.dtb \
332 r8a7790-lager.dtb \ 331 r8a7790-lager.dtb \
333 sh73a0-kzm9g.dtb \ 332 sh73a0-kzm9g.dtb \
@@ -339,7 +338,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
339 r7s72100-genmai.dtb \ 338 r7s72100-genmai.dtb \
340 r8a7791-henninger.dtb \ 339 r8a7791-henninger.dtb \
341 r8a7791-koelsch.dtb \ 340 r8a7791-koelsch.dtb \
342 r8a7790-lager.dtb 341 r8a7790-lager.dtb \
342 r8a7779-marzen.dtb
343dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \ 343dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
344 socfpga_cyclone5_socdk.dtb \ 344 socfpga_cyclone5_socdk.dtb \
345 socfpga_cyclone5_sockit.dtb \ 345 socfpga_cyclone5_sockit.dtb \
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
deleted file mode 100644
index b27c6373ff4d..000000000000
--- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * Reference 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#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/interrupt-controller/irq.h>
16
17/ {
18 model = "marzen";
19 compatible = "renesas,marzen-reference", "renesas,r8a7779";
20
21 chosen {
22 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on rw";
23 };
24
25 memory {
26 device_type = "memory";
27 reg = <0x60000000 0x40000000>;
28 };
29
30 fixedregulator3v3: fixedregulator@0 {
31 compatible = "regulator-fixed";
32 regulator-name = "fixed-3.3V";
33 regulator-min-microvolt = <3300000>;
34 regulator-max-microvolt = <3300000>;
35 regulator-boot-on;
36 regulator-always-on;
37 };
38
39 lan0@18000000 {
40 compatible = "smsc,lan9220", "smsc,lan9115";
41 reg = <0x18000000 0x100>;
42 pinctrl-0 = <&lan0_pins>;
43 pinctrl-names = "default";
44
45 phy-mode = "mii";
46 interrupt-parent = <&irqpin0>;
47 interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
48 smsc,irq-push-pull;
49 reg-io-width = <4>;
50 vddvario-supply = <&fixedregulator3v3>;
51 vdd33a-supply = <&fixedregulator3v3>;
52 };
53
54 leds {
55 compatible = "gpio-leds";
56 led2 {
57 gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
58 };
59 led3 {
60 gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
61 };
62 led4 {
63 gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
64 };
65 };
66};
67
68&irqpin0 {
69 status = "okay";
70};
71
72&pfc {
73 pinctrl-0 = <&scif2_pins &scif4_pins>;
74 pinctrl-names = "default";
75
76 lan0_pins: lan0 {
77 intc {
78 renesas,groups = "intc_irq1_b";
79 renesas,function = "intc";
80 };
81 lbsc {
82 renesas,groups = "lbsc_ex_cs0";
83 renesas,function = "lbsc";
84 };
85 };
86
87 scif2_pins: serial2 {
88 renesas,groups = "scif2_data_c";
89 renesas,function = "scif2";
90 };
91
92 scif4_pins: serial4 {
93 renesas,groups = "scif4_data";
94 renesas,function = "scif4";
95 };
96
97 sdhi0_pins: sd0 {
98 renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd";
99 renesas,function = "sdhi0";
100 };
101
102 hspi0_pins: hspi0 {
103 renesas,groups = "hspi0";
104 renesas,function = "hspi0";
105 };
106};
107
108&sdhi0 {
109 pinctrl-0 = <&sdhi0_pins>;
110 pinctrl-names = "default";
111
112 vmmc-supply = <&fixedregulator3v3>;
113 bus-width = <4>;
114 status = "okay";
115};
116
117&hspi0 {
118 pinctrl-0 = <&hspi0_pins>;
119 pinctrl-names = "default";
120 status = "okay";
121};
diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index a7af2c2371f2..20b176807848 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -11,17 +11,131 @@
11 11
12/dts-v1/; 12/dts-v1/;
13#include "r8a7779.dtsi" 13#include "r8a7779.dtsi"
14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/interrupt-controller/irq.h>
14 16
15/ { 17/ {
16 model = "marzen"; 18 model = "marzen";
17 compatible = "renesas,marzen", "renesas,r8a7779"; 19 compatible = "renesas,marzen", "renesas,r8a7779";
18 20
21 aliases {
22 serial2 = &scif2;
23 serial4 = &scif4;
24 };
25
19 chosen { 26 chosen {
20 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"; 27 bootargs = "console=ttySC2,115200 ignore_loglevel root=/dev/nfs ip=on";
21 }; 28 };
22 29
23 memory { 30 memory {
24 device_type = "memory"; 31 device_type = "memory";
25 reg = <0x60000000 0x40000000>; 32 reg = <0x60000000 0x40000000>;
26 }; 33 };
34
35 fixedregulator3v3: fixedregulator@0 {
36 compatible = "regulator-fixed";
37 regulator-name = "fixed-3.3V";
38 regulator-min-microvolt = <3300000>;
39 regulator-max-microvolt = <3300000>;
40 regulator-boot-on;
41 regulator-always-on;
42 };
43
44 lan0@18000000 {
45 compatible = "smsc,lan9220", "smsc,lan9115";
46 reg = <0x18000000 0x100>;
47 pinctrl-0 = <&lan0_pins>;
48 pinctrl-names = "default";
49
50 phy-mode = "mii";
51 interrupt-parent = <&irqpin0>;
52 interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
53 smsc,irq-push-pull;
54 reg-io-width = <4>;
55 vddvario-supply = <&fixedregulator3v3>;
56 vdd33a-supply = <&fixedregulator3v3>;
57 };
58
59 leds {
60 compatible = "gpio-leds";
61 led2 {
62 gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
63 };
64 led3 {
65 gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
66 };
67 led4 {
68 gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
69 };
70 };
71};
72
73&irqpin0 {
74 status = "okay";
75};
76
77&extal_clk {
78 clock-frequency = <31250000>;
79};
80
81&pfc {
82 lan0_pins: lan0 {
83 intc {
84 renesas,groups = "intc_irq1_b";
85 renesas,function = "intc";
86 };
87 lbsc {
88 renesas,groups = "lbsc_ex_cs0";
89 renesas,function = "lbsc";
90 };
91 };
92
93 scif2_pins: serial2 {
94 renesas,groups = "scif2_data_c";
95 renesas,function = "scif2";
96 };
97
98 scif4_pins: serial4 {
99 renesas,groups = "scif4_data";
100 renesas,function = "scif4";
101 };
102
103 sdhi0_pins: sd0 {
104 renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd";
105 renesas,function = "sdhi0";
106 };
107
108 hspi0_pins: hspi0 {
109 renesas,groups = "hspi0";
110 renesas,function = "hspi0";
111 };
112};
113
114&scif2 {
115 pinctrl-0 = <&scif2_pins>;
116 pinctrl-names = "default";
117
118 status = "okay";
119};
120
121&scif4 {
122 pinctrl-0 = <&scif4_pins>;
123 pinctrl-names = "default";
124
125 status = "okay";
126};
127
128&sdhi0 {
129 pinctrl-0 = <&sdhi0_pins>;
130 pinctrl-names = "default";
131
132 vmmc-supply = <&fixedregulator3v3>;
133 bus-width = <4>;
134 status = "okay";
135};
136
137&hspi0 {
138 pinctrl-0 = <&hspi0_pins>;
139 pinctrl-names = "default";
140 status = "okay";
27}; 141};
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index b517c8e6b420..94e2fc836492 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -11,6 +11,7 @@
11 11
12/include/ "skeleton.dtsi" 12/include/ "skeleton.dtsi"
13 13
14#include <dt-bindings/clock/r8a7779-clock.h>
14#include <dt-bindings/interrupt-controller/irq.h> 15#include <dt-bindings/interrupt-controller/irq.h>
15 16
16/ { 17/ {
@@ -25,21 +26,25 @@
25 device_type = "cpu"; 26 device_type = "cpu";
26 compatible = "arm,cortex-a9"; 27 compatible = "arm,cortex-a9";
27 reg = <0>; 28 reg = <0>;
29 clock-frequency = <1000000000>;
28 }; 30 };
29 cpu@1 { 31 cpu@1 {
30 device_type = "cpu"; 32 device_type = "cpu";
31 compatible = "arm,cortex-a9"; 33 compatible = "arm,cortex-a9";
32 reg = <1>; 34 reg = <1>;
35 clock-frequency = <1000000000>;
33 }; 36 };
34 cpu@2 { 37 cpu@2 {
35 device_type = "cpu"; 38 device_type = "cpu";
36 compatible = "arm,cortex-a9"; 39 compatible = "arm,cortex-a9";
37 reg = <2>; 40 reg = <2>;
41 clock-frequency = <1000000000>;
38 }; 42 };
39 cpu@3 { 43 cpu@3 {
40 device_type = "cpu"; 44 device_type = "cpu";
41 compatible = "arm,cortex-a9"; 45 compatible = "arm,cortex-a9";
42 reg = <3>; 46 reg = <3>;
47 clock-frequency = <1000000000>;
43 }; 48 };
44 }; 49 };
45 50
@@ -157,6 +162,7 @@
157 compatible = "renesas,i2c-r8a7779"; 162 compatible = "renesas,i2c-r8a7779";
158 reg = <0xffc70000 0x1000>; 163 reg = <0xffc70000 0x1000>;
159 interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>; 164 interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
165 clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
160 status = "disabled"; 166 status = "disabled";
161 }; 167 };
162 168
@@ -166,6 +172,7 @@
166 compatible = "renesas,i2c-r8a7779"; 172 compatible = "renesas,i2c-r8a7779";
167 reg = <0xffc71000 0x1000>; 173 reg = <0xffc71000 0x1000>;
168 interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>; 174 interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
175 clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
169 status = "disabled"; 176 status = "disabled";
170 }; 177 };
171 178
@@ -175,6 +182,7 @@
175 compatible = "renesas,i2c-r8a7779"; 182 compatible = "renesas,i2c-r8a7779";
176 reg = <0xffc72000 0x1000>; 183 reg = <0xffc72000 0x1000>;
177 interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>; 184 interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
185 clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
178 status = "disabled"; 186 status = "disabled";
179 }; 187 };
180 188
@@ -184,6 +192,67 @@
184 compatible = "renesas,i2c-r8a7779"; 192 compatible = "renesas,i2c-r8a7779";
185 reg = <0xffc73000 0x1000>; 193 reg = <0xffc73000 0x1000>;
186 interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>; 194 interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
195 clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
196 status = "disabled";
197 };
198
199 scif0: serial@ffe40000 {
200 compatible = "renesas,scif-r8a7779", "renesas,scif";
201 reg = <0xffe40000 0x100>;
202 interrupt-parent = <&gic>;
203 interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
204 clocks = <&cpg_clocks R8A7779_CLK_P>;
205 clock-names = "sci_ick";
206 status = "disabled";
207 };
208
209 scif1: serial@ffe41000 {
210 compatible = "renesas,scif-r8a7779", "renesas,scif";
211 reg = <0xffe41000 0x100>;
212 interrupt-parent = <&gic>;
213 interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>;
214 clocks = <&cpg_clocks R8A7779_CLK_P>;
215 clock-names = "sci_ick";
216 status = "disabled";
217 };
218
219 scif2: serial@ffe42000 {
220 compatible = "renesas,scif-r8a7779", "renesas,scif";
221 reg = <0xffe42000 0x100>;
222 interrupt-parent = <&gic>;
223 interrupts = <0 90 IRQ_TYPE_LEVEL_HIGH>;
224 clocks = <&cpg_clocks R8A7779_CLK_P>;
225 clock-names = "sci_ick";
226 status = "disabled";
227 };
228
229 scif3: serial@ffe43000 {
230 compatible = "renesas,scif-r8a7779", "renesas,scif";
231 reg = <0xffe43000 0x100>;
232 interrupt-parent = <&gic>;
233 interrupts = <0 91 IRQ_TYPE_LEVEL_HIGH>;
234 clocks = <&cpg_clocks R8A7779_CLK_P>;
235 clock-names = "sci_ick";
236 status = "disabled";
237 };
238
239 scif4: serial@ffe44000 {
240 compatible = "renesas,scif-r8a7779", "renesas,scif";
241 reg = <0xffe44000 0x100>;
242 interrupt-parent = <&gic>;
243 interrupts = <0 92 IRQ_TYPE_LEVEL_HIGH>;
244 clocks = <&cpg_clocks R8A7779_CLK_P>;
245 clock-names = "sci_ick";
246 status = "disabled";
247 };
248
249 scif5: serial@ffe45000 {
250 compatible = "renesas,scif-r8a7779", "renesas,scif";
251 reg = <0xffe45000 0x100>;
252 interrupt-parent = <&gic>;
253 interrupts = <0 93 IRQ_TYPE_LEVEL_HIGH>;
254 clocks = <&cpg_clocks R8A7779_CLK_P>;
255 clock-names = "sci_ick";
187 status = "disabled"; 256 status = "disabled";
188 }; 257 };
189 258
@@ -201,12 +270,14 @@
201 compatible = "renesas,rcar-sata"; 270 compatible = "renesas,rcar-sata";
202 reg = <0xfc600000 0x2000>; 271 reg = <0xfc600000 0x2000>;
203 interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>; 272 interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>;
273 clocks = <&mstp1_clks R8A7779_CLK_SATA>;
204 }; 274 };
205 275
206 sdhi0: sd@ffe4c000 { 276 sdhi0: sd@ffe4c000 {
207 compatible = "renesas,sdhi-r8a7779"; 277 compatible = "renesas,sdhi-r8a7779";
208 reg = <0xffe4c000 0x100>; 278 reg = <0xffe4c000 0x100>;
209 interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>; 279 interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
280 clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
210 cap-sd-highspeed; 281 cap-sd-highspeed;
211 cap-sdio-irq; 282 cap-sdio-irq;
212 status = "disabled"; 283 status = "disabled";
@@ -216,6 +287,7 @@
216 compatible = "renesas,sdhi-r8a7779"; 287 compatible = "renesas,sdhi-r8a7779";
217 reg = <0xffe4d000 0x100>; 288 reg = <0xffe4d000 0x100>;
218 interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>; 289 interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
290 clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
219 cap-sd-highspeed; 291 cap-sd-highspeed;
220 cap-sdio-irq; 292 cap-sdio-irq;
221 status = "disabled"; 293 status = "disabled";
@@ -225,6 +297,7 @@
225 compatible = "renesas,sdhi-r8a7779"; 297 compatible = "renesas,sdhi-r8a7779";
226 reg = <0xffe4e000 0x100>; 298 reg = <0xffe4e000 0x100>;
227 interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; 299 interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
300 clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
228 cap-sd-highspeed; 301 cap-sd-highspeed;
229 cap-sdio-irq; 302 cap-sdio-irq;
230 status = "disabled"; 303 status = "disabled";
@@ -234,6 +307,7 @@
234 compatible = "renesas,sdhi-r8a7779"; 307 compatible = "renesas,sdhi-r8a7779";
235 reg = <0xffe4f000 0x100>; 308 reg = <0xffe4f000 0x100>;
236 interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>; 309 interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
310 clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
237 cap-sd-highspeed; 311 cap-sd-highspeed;
238 cap-sdio-irq; 312 cap-sdio-irq;
239 status = "disabled"; 313 status = "disabled";
@@ -245,6 +319,7 @@
245 interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>; 319 interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>;
246 #address-cells = <1>; 320 #address-cells = <1>;
247 #size-cells = <0>; 321 #size-cells = <0>;
322 clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
248 status = "disabled"; 323 status = "disabled";
249 }; 324 };
250 325
@@ -254,6 +329,7 @@
254 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>; 329 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>;
255 #address-cells = <1>; 330 #address-cells = <1>;
256 #size-cells = <0>; 331 #size-cells = <0>;
332 clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
257 status = "disabled"; 333 status = "disabled";
258 }; 334 };
259 335
@@ -263,6 +339,150 @@
263 interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>; 339 interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>;
264 #address-cells = <1>; 340 #address-cells = <1>;
265 #size-cells = <0>; 341 #size-cells = <0>;
342 clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
266 status = "disabled"; 343 status = "disabled";
267 }; 344 };
345
346 clocks {
347 #address-cells = <1>;
348 #size-cells = <1>;
349 ranges;
350
351 /* External root clock */
352 extal_clk: extal_clk {
353 compatible = "fixed-clock";
354 #clock-cells = <0>;
355 /* This value must be overriden by the board. */
356 clock-frequency = <0>;
357 clock-output-names = "extal";
358 };
359
360 /* Special CPG clocks */
361 cpg_clocks: clocks@ffc80000 {
362 compatible = "renesas,r8a7779-cpg-clocks";
363 reg = <0xffc80000 0x30>;
364 clocks = <&extal_clk>;
365 #clock-cells = <1>;
366 clock-output-names = "plla", "z", "zs", "s",
367 "s1", "p", "b", "out";
368 };
369
370 /* Fixed factor clocks */
371 i_clk: i_clk {
372 compatible = "fixed-factor-clock";
373 clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
374 #clock-cells = <0>;
375 clock-div = <2>;
376 clock-mult = <1>;
377 clock-output-names = "i";
378 };
379 s3_clk: s3_clk {
380 compatible = "fixed-factor-clock";
381 clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
382 #clock-cells = <0>;
383 clock-div = <8>;
384 clock-mult = <1>;
385 clock-output-names = "s3";
386 };
387 s4_clk: s4_clk {
388 compatible = "fixed-factor-clock";
389 clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
390 #clock-cells = <0>;
391 clock-div = <16>;
392 clock-mult = <1>;
393 clock-output-names = "s4";
394 };
395 g_clk: g_clk {
396 compatible = "fixed-factor-clock";
397 clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
398 #clock-cells = <0>;
399 clock-div = <24>;
400 clock-mult = <1>;
401 clock-output-names = "g";
402 };
403
404 /* Gate clocks */
405 mstp0_clks: clocks@ffc80030 {
406 compatible = "renesas,r8a7779-mstp-clocks",
407 "renesas,cpg-mstp-clocks";
408 reg = <0xffc80030 4>;
409 clocks = <&cpg_clocks R8A7779_CLK_S>,
410 <&cpg_clocks R8A7779_CLK_P>,
411 <&cpg_clocks R8A7779_CLK_P>,
412 <&cpg_clocks R8A7779_CLK_P>,
413 <&cpg_clocks R8A7779_CLK_S>,
414 <&cpg_clocks R8A7779_CLK_S>,
415 <&cpg_clocks R8A7779_CLK_S1>,
416 <&cpg_clocks R8A7779_CLK_S1>,
417 <&cpg_clocks R8A7779_CLK_S1>,
418 <&cpg_clocks R8A7779_CLK_S1>,
419 <&cpg_clocks R8A7779_CLK_S1>,
420 <&cpg_clocks R8A7779_CLK_S1>,
421 <&cpg_clocks R8A7779_CLK_P>,
422 <&cpg_clocks R8A7779_CLK_P>,
423 <&cpg_clocks R8A7779_CLK_P>,
424 <&cpg_clocks R8A7779_CLK_P>;
425 #clock-cells = <1>;
426 renesas,clock-indices = <
427 R8A7779_CLK_HSPI R8A7779_CLK_TMU2
428 R8A7779_CLK_TMU1 R8A7779_CLK_TMU0
429 R8A7779_CLK_HSCIF1 R8A7779_CLK_HSCIF0
430 R8A7779_CLK_SCIF5 R8A7779_CLK_SCIF4
431 R8A7779_CLK_SCIF3 R8A7779_CLK_SCIF2
432 R8A7779_CLK_SCIF1 R8A7779_CLK_SCIF0
433 R8A7779_CLK_I2C3 R8A7779_CLK_I2C2
434 R8A7779_CLK_I2C1 R8A7779_CLK_I2C0
435 >;
436 clock-output-names =
437 "hspi", "tmu2", "tmu1", "tmu0", "hscif1",
438 "hscif0", "scif5", "scif4", "scif3", "scif2",
439 "scif1", "scif0", "i2c3", "i2c2", "i2c1",
440 "i2c0";
441 };
442 mstp1_clks: clocks@ffc80034 {
443 compatible = "renesas,r8a7779-mstp-clocks",
444 "renesas,cpg-mstp-clocks";
445 reg = <0xffc80034 4>, <0xffc80044 4>;
446 clocks = <&cpg_clocks R8A7779_CLK_P>,
447 <&cpg_clocks R8A7779_CLK_P>,
448 <&cpg_clocks R8A7779_CLK_S>,
449 <&cpg_clocks R8A7779_CLK_S>,
450 <&cpg_clocks R8A7779_CLK_S>,
451 <&cpg_clocks R8A7779_CLK_S>,
452 <&cpg_clocks R8A7779_CLK_P>,
453 <&cpg_clocks R8A7779_CLK_P>,
454 <&cpg_clocks R8A7779_CLK_P>,
455 <&cpg_clocks R8A7779_CLK_S>;
456 #clock-cells = <1>;
457 renesas,clock-indices = <
458 R8A7779_CLK_USB01 R8A7779_CLK_USB2
459 R8A7779_CLK_DU R8A7779_CLK_VIN2
460 R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
461 R8A7779_CLK_ETHER R8A7779_CLK_SATA
462 R8A7779_CLK_PCIE R8A7779_CLK_VIN3
463 >;
464 clock-output-names =
465 "usb01", "usb2",
466 "du", "vin2",
467 "vin1", "vin0",
468 "ether", "sata",
469 "pcie", "vin3";
470 };
471 mstp3_clks: clocks@ffc8003c {
472 compatible = "renesas,r8a7779-mstp-clocks",
473 "renesas,cpg-mstp-clocks";
474 reg = <0xffc8003c 4>;
475 clocks = <&s4_clk>, <&s4_clk>, <&s4_clk>, <&s4_clk>,
476 <&s4_clk>, <&s4_clk>;
477 #clock-cells = <1>;
478 renesas,clock-indices = <
479 R8A7779_CLK_SDHI3 R8A7779_CLK_SDHI2
480 R8A7779_CLK_SDHI1 R8A7779_CLK_SDHI0
481 R8A7779_CLK_MMC1 R8A7779_CLK_MMC0
482 >;
483 clock-output-names =
484 "sdhi3", "sdhi2", "sdhi1", "sdhi0",
485 "mmc1", "mmc0";
486 };
487 };
268}; 488};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 798073057e51..5ec9c3855624 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -25,6 +25,11 @@ config ARCH_R7S72100
25 bool "RZ/A1H (R7S72100)" 25 bool "RZ/A1H (R7S72100)"
26 select SYS_SUPPORTS_SH_MTU2 26 select SYS_SUPPORTS_SH_MTU2
27 27
28config ARCH_R8A7779
29 bool "R-Car H1 (R8A77790)"
30 select RENESAS_INTC_IRQPIN
31 select SYS_SUPPORTS_SH_TMU
32
28config ARCH_R8A7790 33config ARCH_R8A7790
29 bool "R-Car H2 (R8A77900)" 34 bool "R-Car H2 (R8A77900)"
30 select RENESAS_IRQC 35 select RENESAS_IRQC
@@ -51,6 +56,11 @@ config MACH_LAGER
51 depends on ARCH_R8A7790 56 depends on ARCH_R8A7790
52 select MICREL_PHY if SH_ETH 57 select MICREL_PHY if SH_ETH
53 58
59config MACH_MARZEN
60 bool "MARZEN board"
61 depends on ARCH_R8A7779
62 select REGULATOR_FIXED_VOLTAGE if REGULATOR
63
54comment "Renesas ARM SoCs System Configuration" 64comment "Renesas ARM SoCs System Configuration"
55endif 65endif
56 66
@@ -234,19 +244,6 @@ config MACH_MARZEN
234 select REGULATOR_FIXED_VOLTAGE if REGULATOR 244 select REGULATOR_FIXED_VOLTAGE if REGULATOR
235 select USE_OF 245 select USE_OF
236 246
237config MACH_MARZEN_REFERENCE
238 bool "MARZEN board - Reference Device Tree Implementation"
239 depends on ARCH_R8A7779
240 select ARCH_REQUIRE_GPIOLIB
241 select REGULATOR_FIXED_VOLTAGE if REGULATOR
242 select USE_OF
243 ---help---
244 Use reference implementation of Marzen board support
245 which makes use of device tree at the expense
246 of not supporting a number of devices.
247
248 This is intended to aid developers
249
250config MACH_LAGER 247config MACH_LAGER
251 bool "Lager board" 248 bool "Lager board"
252 depends on ARCH_R8A7790 249 depends on ARCH_R8A7790
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 1b966da2c81c..d4fd9a98242e 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -60,6 +60,7 @@ ifdef CONFIG_ARCH_SHMOBILE_MULTI
60obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o 60obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o
61obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o 61obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o
62obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o 62obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o
63obj-$(CONFIG_MACH_MARZEN) += board-marzen-reference.o
63else 64else
64obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o 65obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
65obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o 66obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
@@ -68,7 +69,6 @@ obj-$(CONFIG_MACH_BOCKW) += board-bockw.o
68obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o 69obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o
69obj-$(CONFIG_MACH_GENMAI) += board-genmai.o 70obj-$(CONFIG_MACH_GENMAI) += board-genmai.o
70obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 71obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
71obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
72obj-$(CONFIG_MACH_LAGER) += board-lager.o 72obj-$(CONFIG_MACH_LAGER) += board-lager.o
73obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 73obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
74obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o 74obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 918fccffa1b6..ebf97d4bcfd8 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -13,7 +13,6 @@ loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
14loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 14loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
15loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 15loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
16loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
17 16
18__ZRELADDR := $(sort $(loadaddr-y)) 17__ZRELADDR := $(sort $(loadaddr-y))
19 zreladdr-y += $(__ZRELADDR) 18 zreladdr-y += $(__ZRELADDR)
diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c
index 3276afcf3cc9..76e4ff14be68 100644
--- a/arch/arm/mach-shmobile/board-ape6evm-reference.c
+++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c
@@ -24,10 +24,10 @@
24#include <linux/pinctrl/machine.h> 24#include <linux/pinctrl/machine.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/sh_clk.h> 26#include <linux/sh_clk.h>
27#include <mach/common.h>
28#include <mach/r8a73a4.h> 27#include <mach/r8a73a4.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include "common.h"
31 31
32static void __init ape6evm_add_standard_devices(void) 32static void __init ape6evm_add_standard_devices(void)
33{ 33{
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index fe071a9130b7..8f8da25310e7 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -33,11 +33,11 @@
33#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
34#include <linux/sh_clk.h> 34#include <linux/sh_clk.h>
35#include <linux/smsc911x.h> 35#include <linux/smsc911x.h>
36#include <mach/common.h>
37#include <mach/irqs.h>
38#include <mach/r8a73a4.h> 36#include <mach/r8a73a4.h>
39#include <asm/mach-types.h> 37#include <asm/mach-types.h>
40#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
39#include "common.h"
40#include "irqs.h"
41 41
42/* LEDS */ 42/* LEDS */
43static struct gpio_led ape6evm_leds[] = { 43static struct gpio_led ape6evm_leds[] = {
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
index f660fbb96e0b..368518b3b8ec 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
@@ -24,10 +24,10 @@
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <mach/common.h>
28#include <mach/r8a7740.h> 27#include <mach/r8a7740.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30#include <asm/hardware/cache-l2x0.h> 29#include <asm/hardware/cache-l2x0.h>
30#include "common.h"
31 31
32/* 32/*
33 * CON1 Camera Module 33 * CON1 Camera Module
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 30fcac73a540..53d03e85750a 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -45,8 +45,6 @@
45#include <linux/mmc/sh_mobile_sdhi.h> 45#include <linux/mmc/sh_mobile_sdhi.h>
46#include <linux/i2c-gpio.h> 46#include <linux/i2c-gpio.h>
47#include <linux/reboot.h> 47#include <linux/reboot.h>
48#include <mach/common.h>
49#include <mach/irqs.h>
50#include <mach/r8a7740.h> 48#include <mach/r8a7740.h>
51#include <media/mt9t112.h> 49#include <media/mt9t112.h>
52#include <media/sh_mobile_ceu.h> 50#include <media/sh_mobile_ceu.h>
@@ -61,7 +59,9 @@
61#include <video/sh_mobile_hdmi.h> 59#include <video/sh_mobile_hdmi.h>
62#include <sound/sh_fsi.h> 60#include <sound/sh_fsi.h>
63#include <sound/simple_card.h> 61#include <sound/simple_card.h>
64 62#include "common.h"
63#include "irqs.h"
64#include "pm-rmobile.h"
65#include "sh-gpio.h" 65#include "sh-gpio.h"
66 66
67/* 67/*
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
index 027373f8de82..91ff3a27ccc7 100644
--- a/arch/arm/mach-shmobile/board-bockw-reference.c
+++ b/arch/arm/mach-shmobile/board-bockw-reference.c
@@ -19,9 +19,9 @@
19 */ 19 */
20 20
21#include <linux/of_platform.h> 21#include <linux/of_platform.h>
22#include <mach/common.h>
23#include <mach/r8a7778.h> 22#include <mach/r8a7778.h>
24#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include "common.h"
25 25
26/* 26/*
27 * see board-bock.c for checking detail of dip-switch 27 * see board-bock.c for checking detail of dip-switch
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index f444be2f241e..8cb057f95c44 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -35,12 +35,12 @@
35#include <linux/spi/flash.h> 35#include <linux/spi/flash.h>
36#include <linux/usb/renesas_usbhs.h> 36#include <linux/usb/renesas_usbhs.h>
37#include <media/soc_camera.h> 37#include <media/soc_camera.h>
38#include <mach/common.h>
39#include <mach/irqs.h>
40#include <mach/r8a7778.h> 38#include <mach/r8a7778.h>
41#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
42#include <sound/rcar_snd.h> 40#include <sound/rcar_snd.h>
43#include <sound/simple_card.h> 41#include <sound/simple_card.h>
42#include "common.h"
43#include "irqs.h"
44 44
45#define FPGA 0x18200000 45#define FPGA 0x18200000
46#define IRQ0MR 0x30 46#define IRQ0MR 0x30
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c
index 2ff6ad6e608e..d341ef09ec37 100644
--- a/arch/arm/mach-shmobile/board-genmai-reference.c
+++ b/arch/arm/mach-shmobile/board-genmai-reference.c
@@ -20,11 +20,11 @@
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <mach/clock.h>
24#include <mach/common.h>
25#include <mach/r7s72100.h> 23#include <mach/r7s72100.h>
26#include <asm/mach-types.h> 24#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include "clock.h"
27#include "common.h"
28 28
29/* 29/*
30 * This is a really crude hack to provide clkdev support to platform 30 * This is a really crude hack to provide clkdev support to platform
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
index c94201ee8596..f0a8eca7d10d 100644
--- a/arch/arm/mach-shmobile/board-genmai.c
+++ b/arch/arm/mach-shmobile/board-genmai.c
@@ -25,11 +25,11 @@
25#include <linux/sh_eth.h> 25#include <linux/sh_eth.h>
26#include <linux/spi/rspi.h> 26#include <linux/spi/rspi.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <mach/common.h>
29#include <mach/irqs.h>
30#include <mach/r7s72100.h> 28#include <mach/r7s72100.h>
31#include <asm/mach-types.h> 29#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include "common.h"
32#include "irqs.h"
33 33
34/* Ether */ 34/* Ether */
35static const struct sh_eth_plat_data ether_pdata __initconst = { 35static const struct sh_eth_plat_data ether_pdata __initconst = {
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index d322a162b4b0..1d3f67d4ccd6 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -23,12 +23,12 @@
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/of_platform.h> 24#include <linux/of_platform.h>
25#include <linux/platform_data/rcar-du.h> 25#include <linux/platform_data/rcar-du.h>
26#include <mach/clock.h>
27#include <mach/common.h>
28#include <mach/irqs.h>
29#include <mach/rcar-gen2.h>
30#include <mach/r8a7791.h> 26#include <mach/r8a7791.h>
31#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include "clock.h"
29#include "common.h"
30#include "irqs.h"
31#include "rcar-gen2.h"
32 32
33/* DU */ 33/* DU */
34static struct rcar_du_encoder_data koelsch_du_encoders[] = { 34static struct rcar_du_encoder_data koelsch_du_encoders[] = {
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index c6c68892caa3..0d44e7eb6508 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -45,12 +45,12 @@
45#include <linux/spi/flash.h> 45#include <linux/spi/flash.h>
46#include <linux/spi/rspi.h> 46#include <linux/spi/rspi.h>
47#include <linux/spi/spi.h> 47#include <linux/spi/spi.h>
48#include <mach/common.h>
49#include <mach/irqs.h>
50#include <mach/r8a7791.h> 48#include <mach/r8a7791.h>
51#include <mach/rcar-gen2.h>
52#include <asm/mach-types.h> 49#include <asm/mach-types.h>
53#include <asm/mach/arch.h> 50#include <asm/mach/arch.h>
51#include "common.h"
52#include "irqs.h"
53#include "rcar-gen2.h"
54 54
55/* DU */ 55/* DU */
56static struct rcar_du_encoder_data koelsch_du_encoders[] = { 56static struct rcar_du_encoder_data koelsch_du_encoders[] = {
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index a735a1d80c28..e6285de6bc87 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -26,10 +26,10 @@
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/of_platform.h> 27#include <linux/of_platform.h>
28#include <mach/sh73a0.h> 28#include <mach/sh73a0.h>
29#include <mach/common.h>
30#include <asm/hardware/cache-l2x0.h> 29#include <asm/hardware/cache-l2x0.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include "common.h"
33 33
34static void __init kzm_init(void) 34static void __init kzm_init(void)
35{ 35{
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index f94ec8ca42c1..fff330f74925 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -43,13 +43,13 @@
43#include <linux/videodev2.h> 43#include <linux/videodev2.h>
44#include <sound/sh_fsi.h> 44#include <sound/sh_fsi.h>
45#include <sound/simple_card.h> 45#include <sound/simple_card.h>
46#include <mach/irqs.h>
47#include <mach/sh73a0.h> 46#include <mach/sh73a0.h>
48#include <mach/common.h>
49#include <asm/hardware/cache-l2x0.h> 47#include <asm/hardware/cache-l2x0.h>
50#include <asm/mach-types.h> 48#include <asm/mach-types.h>
51#include <asm/mach/arch.h> 49#include <asm/mach/arch.h>
52#include <video/sh_mobile_lcdc.h> 50#include <video/sh_mobile_lcdc.h>
51#include "common.h"
52#include "irqs.h"
53 53
54/* 54/*
55 * external GPIO 55 * external GPIO
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 749832e3f33c..4f0af91ebc81 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -22,12 +22,12 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/platform_data/rcar-du.h> 24#include <linux/platform_data/rcar-du.h>
25#include <mach/clock.h>
26#include <mach/common.h>
27#include <mach/irqs.h>
28#include <mach/rcar-gen2.h>
29#include <mach/r8a7790.h> 25#include <mach/r8a7790.h>
30#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include "clock.h"
28#include "common.h"
29#include "irqs.h"
30#include "rcar-gen2.h"
31 31
32/* DU */ 32/* DU */
33static struct rcar_du_encoder_data lager_du_encoders[] = { 33static struct rcar_du_encoder_data lager_du_encoders[] = {
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index f8b1e05463cc..83bbb5c48863 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -45,8 +45,6 @@
45#include <linux/sh_eth.h> 45#include <linux/sh_eth.h>
46#include <linux/usb/phy.h> 46#include <linux/usb/phy.h>
47#include <linux/usb/renesas_usbhs.h> 47#include <linux/usb/renesas_usbhs.h>
48#include <mach/common.h>
49#include <mach/irqs.h>
50#include <mach/r8a7790.h> 48#include <mach/r8a7790.h>
51#include <media/soc_camera.h> 49#include <media/soc_camera.h>
52#include <asm/mach-types.h> 50#include <asm/mach-types.h>
@@ -58,6 +56,9 @@
58#include <linux/spi/spi.h> 56#include <linux/spi/spi.h>
59#include <sound/rcar_snd.h> 57#include <sound/rcar_snd.h>
60#include <sound/simple_card.h> 58#include <sound/simple_card.h>
59#include "common.h"
60#include "irqs.h"
61#include "rcar-gen2.h"
61 62
62/* 63/*
63 * SSI-AK4643 64 * SSI-AK4643
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 0ff4d8e45cf7..0ece865cbc4d 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -47,7 +47,7 @@
47#include <linux/regulator/fixed.h> 47#include <linux/regulator/fixed.h>
48#include <linux/regulator/machine.h> 48#include <linux/regulator/machine.h>
49#include <linux/smsc911x.h> 49#include <linux/smsc911x.h>
50#include <linux/sh_intc.h> 50#include <linux/sh_clk.h>
51#include <linux/tca6416_keypad.h> 51#include <linux/tca6416_keypad.h>
52#include <linux/usb/renesas_usbhs.h> 52#include <linux/usb/renesas_usbhs.h>
53#include <linux/dma-mapping.h> 53#include <linux/dma-mapping.h>
@@ -58,14 +58,12 @@
58#include <media/soc_camera_platform.h> 58#include <media/soc_camera_platform.h>
59#include <sound/sh_fsi.h> 59#include <sound/sh_fsi.h>
60#include <sound/simple_card.h> 60#include <sound/simple_card.h>
61
62#include <mach/common.h>
63#include <mach/irqs.h>
64#include <mach/sh7372.h> 61#include <mach/sh7372.h>
65
66#include <asm/mach/arch.h> 62#include <asm/mach/arch.h>
67#include <asm/mach-types.h> 63#include <asm/mach-types.h>
68 64#include "common.h"
65#include "irqs.h"
66#include "pm-rmobile.h"
69#include "sh-gpio.h" 67#include "sh-gpio.h"
70 68
71/* 69/*
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 2773936bf7dc..0a000b74ac6d 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,19 +19,40 @@
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22#include <linux/clk/shmobile.h>
23#include <linux/clocksource.h>
24#include <linux/of_platform.h>
22#include <mach/r8a7779.h> 25#include <mach/r8a7779.h>
23#include <mach/common.h>
24#include <mach/irqs.h>
25#include <asm/irq.h> 26#include <asm/irq.h>
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include "clock.h"
29#include "common.h"
30#include "irqs.h"
31
32static void __init marzen_init_timer(void)
33{
34 r8a7779_clocks_init(r8a7779_read_mode_pins());
35 clocksource_of_init();
36}
37
38/*
39 * This is a really crude hack to provide clkdev support to platform
40 * devices until they get moved to DT.
41 */
42static const struct clk_name clk_names[] __initconst = {
43 { "tmu0", "fck", "sh-tmu.0" },
44};
27 45
28static void __init marzen_init(void) 46static void __init marzen_init(void)
29{ 47{
48 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
30 r8a7779_add_standard_devices_dt(); 49 r8a7779_add_standard_devices_dt();
50 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
31 r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ 51 r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
32} 52}
33 53
34static const char *marzen_boards_compat_dt[] __initdata = { 54static const char *marzen_boards_compat_dt[] __initdata = {
55 "renesas,marzen",
35 "renesas,marzen-reference", 56 "renesas,marzen-reference",
36 NULL, 57 NULL,
37}; 58};
@@ -39,7 +60,8 @@ static const char *marzen_boards_compat_dt[] __initdata = {
39DT_MACHINE_START(MARZEN, "marzen") 60DT_MACHINE_START(MARZEN, "marzen")
40 .smp = smp_ops(r8a7779_smp_ops), 61 .smp = smp_ops(r8a7779_smp_ops),
41 .map_io = r8a7779_map_io, 62 .map_io = r8a7779_map_io,
42 .init_early = r8a7779_init_delay, 63 .init_early = shmobile_init_delay,
64 .init_time = marzen_init_timer,
43 .nr_irqs = NR_IRQS_LEGACY, 65 .nr_irqs = NR_IRQS_LEGACY,
44 .init_irq = r8a7779_init_irq_dt, 66 .init_irq = r8a7779_init_irq_dt,
45 .init_machine = marzen_init, 67 .init_machine = marzen_init,
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index d832a4477b4b..fe445ef49fb9 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -43,11 +43,11 @@
43#include <linux/mfd/tmio.h> 43#include <linux/mfd/tmio.h>
44#include <media/soc_camera.h> 44#include <media/soc_camera.h>
45#include <mach/r8a7779.h> 45#include <mach/r8a7779.h>
46#include <mach/common.h>
47#include <mach/irqs.h>
48#include <asm/mach-types.h> 46#include <asm/mach-types.h>
49#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
50#include <asm/traps.h> 48#include <asm/traps.h>
49#include "common.h"
50#include "irqs.h"
51 51
52/* Fixed 3.3V regulator to be used by SDHI0 */ 52/* Fixed 3.3V regulator to be used by SDHI0 */
53static struct regulator_consumer_supply fixed3v3_power_consumers[] = { 53static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index df187484de5d..457dab0f8fc9 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -19,8 +19,8 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sh_clk.h> 20#include <linux/sh_clk.h>
21#include <linux/clkdev.h> 21#include <linux/clkdev.h>
22#include <mach/common.h>
23#include <mach/r7s72100.h> 22#include <mach/r7s72100.h>
23#include "common.h"
24 24
25/* Frequency Control Registers */ 25/* Frequency Control Registers */
26#define FRQCR 0xfcfe0010 26#define FRQCR 0xfcfe0010
diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c
index b5bc22c6a858..0f431498229b 100644
--- a/arch/arm/mach-shmobile/clock-r8a73a4.c
+++ b/arch/arm/mach-shmobile/clock-r8a73a4.c
@@ -22,8 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sh_clk.h> 23#include <linux/sh_clk.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <mach/clock.h> 25#include "common.h"
26#include <mach/common.h> 26#include "clock.h"
27 27
28#define CPG_BASE 0xe6150000 28#define CPG_BASE 0xe6150000
29#define CPG_LEN 0x270 29#define CPG_LEN 0x270
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index 50931e3c97c7..ffefec53b058 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -22,9 +22,9 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sh_clk.h> 23#include <linux/sh_clk.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <mach/clock.h>
26#include <mach/common.h>
27#include <mach/r8a7740.h> 25#include <mach/r8a7740.h>
26#include "clock.h"
27#include "common.h"
28 28
29/* 29/*
30 * | MDx | XTAL1/EXTAL1 | System | EXTALR | 30 * | MDx | XTAL1/EXTAL1 | System | EXTALR |
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 13f8f3ab8840..16bbc94a1520 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -39,8 +39,8 @@
39#include <linux/io.h> 39#include <linux/io.h>
40#include <linux/sh_clk.h> 40#include <linux/sh_clk.h>
41#include <linux/clkdev.h> 41#include <linux/clkdev.h>
42#include <mach/clock.h> 42#include "clock.h"
43#include <mach/common.h> 43#include "common.h"
44 44
45#define MSTPCR0 IOMEM(0xffc80030) 45#define MSTPCR0 IOMEM(0xffc80030)
46#define MSTPCR1 IOMEM(0xffc80034) 46#define MSTPCR1 IOMEM(0xffc80034)
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index a13298bd37a8..e690927f3505 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -23,8 +23,10 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/sh_clk.h> 24#include <linux/sh_clk.h>
25#include <linux/clkdev.h> 25#include <linux/clkdev.h>
26#include <mach/clock.h> 26#include <linux/sh_timer.h>
27#include <mach/common.h> 27#include <mach/r8a7779.h>
28#include "clock.h"
29#include "common.h"
28 30
29/* 31/*
30 * MD1 = 1 MD1 = 0 32 * MD1 = 1 MD1 = 0
@@ -52,9 +54,6 @@
52#define MSTPCR3 IOMEM(0xffc8003c) 54#define MSTPCR3 IOMEM(0xffc8003c)
53#define MSTPSR1 IOMEM(0xffc80044) 55#define MSTPSR1 IOMEM(0xffc80044)
54 56
55#define MODEMR 0xffcc0020
56
57
58/* ioremap() through clock mapping mandatory to avoid 57/* ioremap() through clock mapping mandatory to avoid
59 * collision with ARM coherent DMA virtual memory range. 58 * collision with ARM coherent DMA virtual memory range.
60 */ 59 */
@@ -207,14 +206,9 @@ static struct clk_lookup lookups[] = {
207 206
208void __init r8a7779_clock_init(void) 207void __init r8a7779_clock_init(void)
209{ 208{
210 void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); 209 u32 mode = r8a7779_read_mode_pins();
211 u32 mode;
212 int k, ret = 0; 210 int k, ret = 0;
213 211
214 BUG_ON(!modemr);
215 mode = ioread32(modemr);
216 iounmap(modemr);
217
218 if (mode & MD(1)) { 212 if (mode & MD(1)) {
219 plla_clk.rate = 1500000000; 213 plla_clk.rate = 1500000000;
220 214
@@ -268,3 +262,13 @@ void __init r8a7779_clock_init(void)
268 else 262 else
269 panic("failed to setup r8a7779 clocks\n"); 263 panic("failed to setup r8a7779 clocks\n");
270} 264}
265
266/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
267void __init __weak r8a7779_register_twd(void) { }
268
269void __init r8a7779_earlytimer_init(void)
270{
271 r8a7779_clock_init();
272 r8a7779_register_twd();
273 shmobile_earlytimer_init();
274}
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index 296a057109e4..ca980669806f 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -22,9 +22,10 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sh_clk.h> 23#include <linux/sh_clk.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <mach/clock.h>
26#include <mach/common.h>
27#include <mach/r8a7790.h> 25#include <mach/r8a7790.h>
26#include "clock.h"
27#include "common.h"
28#include "rcar-gen2.h"
28 29
29/* 30/*
30 * MD EXTAL PLL0 PLL1 PLL3 31 * MD EXTAL PLL0 PLL1 PLL3
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
index e2fdfcc14436..10e193d707f5 100644
--- a/arch/arm/mach-shmobile/clock-r8a7791.c
+++ b/arch/arm/mach-shmobile/clock-r8a7791.c
@@ -23,9 +23,9 @@
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/sh_clk.h> 24#include <linux/sh_clk.h>
25#include <linux/clkdev.h> 25#include <linux/clkdev.h>
26#include <mach/clock.h> 26#include "clock.h"
27#include <mach/common.h> 27#include "common.h"
28#include <mach/rcar-gen2.h> 28#include "rcar-gen2.h"
29 29
30/* 30/*
31 * MD EXTAL PLL0 PLL1 PLL3 31 * MD EXTAL PLL0 PLL1 PLL3
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index d16d9ca7f79e..7071676145c4 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -21,8 +21,8 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/sh_clk.h> 22#include <linux/sh_clk.h>
23#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <mach/clock.h> 24#include "clock.h"
25#include <mach/common.h> 25#include "common.h"
26 26
27/* SH7372 registers */ 27/* SH7372 registers */
28#define FRQCRA IOMEM(0xe6150000) 28#define FRQCRA IOMEM(0xe6150000)
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 0d9cd1fe0212..37f48383e05a 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -22,8 +22,8 @@
22#include <linux/sh_clk.h> 22#include <linux/sh_clk.h>
23#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <asm/processor.h> 24#include <asm/processor.h>
25#include <mach/clock.h> 25#include "clock.h"
26#include <mach/common.h> 26#include "common.h"
27 27
28#define FRQCRA IOMEM(0xe6150000) 28#define FRQCRA IOMEM(0xe6150000)
29#define FRQCRB IOMEM(0xe6150004) 29#define FRQCRB IOMEM(0xe6150004)
diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c
index e7232a0373b9..806f94038cc4 100644
--- a/arch/arm/mach-shmobile/clock.c
+++ b/arch/arm/mach-shmobile/clock.c
@@ -25,7 +25,7 @@
25#ifdef CONFIG_COMMON_CLK 25#ifdef CONFIG_COMMON_CLK
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/clkdev.h> 27#include <linux/clkdev.h>
28#include <mach/clock.h> 28#include "clock.h"
29 29
30void __init shmobile_clk_workaround(const struct clk_name *clks, 30void __init shmobile_clk_workaround(const struct clk_name *clks,
31 int nr_clks, bool enable) 31 int nr_clks, bool enable)
@@ -49,8 +49,8 @@ void __init shmobile_clk_workaround(const struct clk_name *clks,
49#else /* CONFIG_COMMON_CLK */ 49#else /* CONFIG_COMMON_CLK */
50#include <linux/sh_clk.h> 50#include <linux/sh_clk.h>
51#include <linux/export.h> 51#include <linux/export.h>
52#include <mach/clock.h> 52#include "clock.h"
53#include <mach/common.h> 53#include "common.h"
54 54
55unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk) 55unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk)
56{ 56{
diff --git a/arch/arm/mach-shmobile/include/mach/clock.h b/arch/arm/mach-shmobile/clock.h
index 31b6417463e6..31b6417463e6 100644
--- a/arch/arm/mach-shmobile/include/mach/clock.h
+++ b/arch/arm/mach-shmobile/clock.h
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/common.h
index 921a18ef4dfe..921a18ef4dfe 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/common.h
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c
index 9411a5bf4fd6..f2e79f2376e1 100644
--- a/arch/arm/mach-shmobile/console.c
+++ b/arch/arm/mach-shmobile/console.c
@@ -19,8 +19,8 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <mach/common.h>
23#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23#include "common.h"
24 24
25void __init shmobile_setup_console(void) 25void __init shmobile_setup_console(void)
26{ 26{
diff --git a/arch/arm/mach-shmobile/include/mach/dma-register.h b/arch/arm/mach-shmobile/dma-register.h
index 97c40bd9b94f..97c40bd9b94f 100644
--- a/arch/arm/mach-shmobile/include/mach/dma-register.h
+++ b/arch/arm/mach-shmobile/dma-register.h
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
index d241bfd6926d..5aee83f079e2 100644
--- a/arch/arm/mach-shmobile/include/mach/irqs.h
+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
@@ -1,24 +1,10 @@
1#ifndef __ASM_MACH_IRQS_H 1#ifndef __ASM_MACH_IRQS_H
2#define __ASM_MACH_IRQS_H 2#define __ASM_MACH_IRQS_H
3 3
4#include <linux/sh_intc.h> 4/* Stuck here until drivers/pinctl/sh-pfc gets rid of legacy code */
5
6/* GIC */
7#define gic_spi(nr) ((nr) + 32)
8#define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */
9
10/* INTCS */
11#define INTCS_VECT_BASE 0x3400
12#define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect))
13#define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt))
14 5
15/* External IRQ pins */ 6/* External IRQ pins */
16#define IRQPIN_BASE 2000 7#define IRQPIN_BASE 2000
17#define irq_pin(nr) ((nr) + IRQPIN_BASE) 8#define irq_pin(nr) ((nr) + IRQPIN_BASE)
18 9
19/* GPIO IRQ */
20#define _GPIO_IRQ_BASE 2500
21#define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x))
22#define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y)
23
24#endif /* __ASM_MACH_IRQS_H */ 10#endif /* __ASM_MACH_IRQS_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
index 5e3c9ec06303..1d1a5fd78b6b 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7740.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
@@ -19,8 +19,6 @@
19#ifndef __ASM_R8A7740_H__ 19#ifndef __ASM_R8A7740_H__
20#define __ASM_R8A7740_H__ 20#define __ASM_R8A7740_H__
21 21
22#include <mach/pm-rmobile.h>
23
24/* 22/*
25 * MD_CKx pin 23 * MD_CKx pin
26 */ 24 */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 88eeceaf1088..5415c719dc19 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -2,8 +2,6 @@
2#define __ASM_R8A7779_H__ 2#define __ASM_R8A7779_H__
3 3
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h>
6#include <mach/pm-rcar.h>
7 5
8/* HPB-DMA slave IDs */ 6/* HPB-DMA slave IDs */
9enum { 7enum {
@@ -12,17 +10,6 @@ enum {
12 HPBDMA_SLAVE_SDHI0_RX, 10 HPBDMA_SLAVE_SDHI0_RX,
13}; 11};
14 12
15struct r8a7779_pm_domain {
16 struct generic_pm_domain genpd;
17 struct rcar_sysc_ch ch;
18};
19
20static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d)
21{
22 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
23}
24
25extern void r8a7779_init_delay(void);
26extern void r8a7779_init_irq_extpin(int irlm); 13extern void r8a7779_init_irq_extpin(int irlm);
27extern void r8a7779_init_irq_extpin_dt(int irlm); 14extern void r8a7779_init_irq_extpin_dt(int irlm);
28extern void r8a7779_init_irq_dt(void); 15extern void r8a7779_init_irq_dt(void);
@@ -32,6 +19,7 @@ extern void r8a7779_add_early_devices(void);
32extern void r8a7779_add_standard_devices(void); 19extern void r8a7779_add_standard_devices(void);
33extern void r8a7779_add_standard_devices_dt(void); 20extern void r8a7779_add_standard_devices_dt(void);
34extern void r8a7779_init_late(void); 21extern void r8a7779_init_late(void);
22extern u32 r8a7779_read_mode_pins(void);
35extern void r8a7779_clock_init(void); 23extern void r8a7779_clock_init(void);
36extern void r8a7779_pinmux_init(void); 24extern void r8a7779_pinmux_init(void);
37extern void r8a7779_pm_init(void); 25extern void r8a7779_pm_init(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 0b95babe84ba..d7555440fc7b 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_R8A7790_H__ 1#ifndef __ASM_R8A7790_H__
2#define __ASM_R8A7790_H__ 2#define __ASM_R8A7790_H__
3 3
4#include <mach/rcar-gen2.h>
5
6/* DMA slave IDs */ 4/* DMA slave IDs */
7enum { 5enum {
8 RCAR_DMA_SLAVE_INVALID, 6 RCAR_DMA_SLAVE_INVALID,
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index 854a9f0ca040..4ad960d5075b 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -11,10 +11,6 @@
11#ifndef __ASM_SH7372_H__ 11#ifndef __ASM_SH7372_H__
12#define __ASM_SH7372_H__ 12#define __ASM_SH7372_H__
13 13
14#include <linux/sh_clk.h>
15#include <linux/pm_domain.h>
16#include <mach/pm-rmobile.h>
17
18/* DMA slave IDs */ 14/* DMA slave IDs */
19enum { 15enum {
20 SHDMA_SLAVE_INVALID, 16 SHDMA_SLAVE_INVALID,
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index a91caad7db7c..e2af00b1bd9d 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -22,11 +22,10 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/sh_intc.h>
26#include <mach/intc.h>
27#include <mach/irqs.h>
28#include <asm/mach-types.h> 25#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include "intc.h"
28#include "irqs.h"
30 29
31enum { 30enum {
32 UNUSED_INTCA = 0, 31 UNUSED_INTCA = 0,
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
index 19a26f4579b3..1a8f9a7af983 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -22,14 +22,13 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/sh_intc.h>
26#include <linux/irqchip.h> 25#include <linux/irqchip.h>
27#include <linux/irqchip/arm-gic.h> 26#include <linux/irqchip/arm-gic.h>
28#include <mach/intc.h>
29#include <mach/irqs.h>
30#include <mach/sh73a0.h> 27#include <mach/sh73a0.h>
31#include <asm/mach-types.h> 28#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include "intc.h"
31#include "irqs.h"
33 32
34enum { 33enum {
35 UNUSED = 0, 34 UNUSED = 0,
diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/intc.h
index a5603c76cfe0..a5603c76cfe0 100644
--- a/arch/arm/mach-shmobile/include/mach/intc.h
+++ b/arch/arm/mach-shmobile/intc.h
diff --git a/arch/arm/mach-shmobile/irqs.h b/arch/arm/mach-shmobile/irqs.h
new file mode 100644
index 000000000000..4ff2d2aa94f0
--- /dev/null
+++ b/arch/arm/mach-shmobile/irqs.h
@@ -0,0 +1,21 @@
1#ifndef __SHMOBILE_IRQS_H
2#define __SHMOBILE_IRQS_H
3
4#include <linux/sh_intc.h>
5#include <mach/irqs.h>
6
7/* GIC */
8#define gic_spi(nr) ((nr) + 32)
9#define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */
10
11/* INTCS */
12#define INTCS_VECT_BASE 0x3400
13#define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect))
14#define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt))
15
16/* GPIO IRQ */
17#define _GPIO_IRQ_BASE 2500
18#define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x))
19#define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y)
20
21#endif /* __SHMOBILE_IRQS_H */
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 8cb641c00fdb..fe648f5d8f06 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -16,7 +16,7 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/cp15.h> 17#include <asm/cp15.h>
18#include <asm/smp_plat.h> 18#include <asm/smp_plat.h>
19#include <mach/common.h> 19#include "common.h"
20 20
21static struct { 21static struct {
22 void __iomem *iomem; 22 void __iomem *iomem;
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index 673ad6e80869..64663110ab6c 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -15,7 +15,7 @@
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
17#include <asm/smp_scu.h> 17#include <asm/smp_scu.h>
18#include <mach/common.h> 18#include "common.h"
19 19
20static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, 20static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
21 unsigned long action, void *hcpu) 21 unsigned long action, void *hcpu)
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index 9ebc246b8d7d..3923e09e966d 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/smp_plat.h> 15#include <asm/smp_plat.h>
16#include <mach/common.h> 16#include "common.h"
17 17
18extern unsigned long shmobile_smp_fn[]; 18extern unsigned long shmobile_smp_fn[];
19extern unsigned long shmobile_smp_arg[]; 19extern unsigned long shmobile_smp_arg[];
diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
index 40b87aa1d448..a0d44d537fa0 100644
--- a/arch/arm/mach-shmobile/pm-r8a7740.c
+++ b/arch/arm/mach-shmobile/pm-r8a7740.c
@@ -10,8 +10,8 @@
10 */ 10 */
11#include <linux/console.h> 11#include <linux/console.h>
12#include <linux/suspend.h> 12#include <linux/suspend.h>
13#include <mach/pm-rmobile.h> 13#include "common.h"
14#include <mach/common.h> 14#include "pm-rmobile.h"
15 15
16#ifdef CONFIG_PM 16#ifdef CONFIG_PM
17static int r8a7740_pd_a4s_suspend(void) 17static int r8a7740_pd_a4s_suspend(void)
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index d6fe189b2df6..f0f36cb5ffe7 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -13,20 +13,31 @@
13#include <linux/suspend.h> 13#include <linux/suspend.h>
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/pm_clock.h> 15#include <linux/pm_clock.h>
16#include <linux/pm_domain.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17#include <linux/delay.h> 18#include <linux/delay.h>
18#include <linux/irq.h> 19#include <linux/irq.h>
19#include <linux/interrupt.h> 20#include <linux/interrupt.h>
20#include <linux/console.h> 21#include <linux/console.h>
21#include <asm/io.h> 22#include <asm/io.h>
22#include <mach/common.h>
23#include <mach/pm-rcar.h>
24#include <mach/r8a7779.h> 23#include <mach/r8a7779.h>
24#include "common.h"
25#include "pm-rcar.h"
25 26
26/* SYSC */ 27/* SYSC */
27#define SYSCIER 0x0c 28#define SYSCIER 0x0c
28#define SYSCIMR 0x10 29#define SYSCIMR 0x10
29 30
31struct r8a7779_pm_domain {
32 struct generic_pm_domain genpd;
33 struct rcar_sysc_ch ch;
34};
35
36static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d)
37{
38 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
39}
40
30#if defined(CONFIG_PM) || defined(CONFIG_SMP) 41#if defined(CONFIG_PM) || defined(CONFIG_SMP)
31 42
32static void __init r8a7779_sysc_init(void) 43static void __init r8a7779_sysc_init(void)
diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c
index fc82839e2c2a..0f1090d851e7 100644
--- a/arch/arm/mach-shmobile/pm-r8a7790.c
+++ b/arch/arm/mach-shmobile/pm-r8a7790.c
@@ -12,8 +12,8 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <asm/io.h> 14#include <asm/io.h>
15#include <mach/pm-rcar.h>
16#include <mach/r8a7790.h> 15#include <mach/r8a7790.h>
16#include "pm-rcar.h"
17 17
18/* SYSC */ 18/* SYSC */
19#define SYSCIER 0x0c 19#define SYSCIER 0x0c
diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c
index 1f465a12d1b1..34b8a5674f85 100644
--- a/arch/arm/mach-shmobile/pm-rcar.c
+++ b/arch/arm/mach-shmobile/pm-rcar.c
@@ -13,7 +13,7 @@
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <mach/pm-rcar.h> 16#include "pm-rcar.h"
17 17
18/* SYSC */ 18/* SYSC */
19#define SYSCSR 0x00 19#define SYSCSR 0x00
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/pm-rcar.h
index ef3a1ef628f1..ef3a1ef628f1 100644
--- a/arch/arm/mach-shmobile/include/mach/pm-rcar.h
+++ b/arch/arm/mach-shmobile/pm-rcar.h
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index f710235aff2f..ebdd16e94a84 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -17,7 +17,7 @@
17#include <linux/pm.h> 17#include <linux/pm.h>
18#include <linux/pm_clock.h> 18#include <linux/pm_clock.h>
19#include <asm/io.h> 19#include <asm/io.h>
20#include <mach/pm-rmobile.h> 20#include "pm-rmobile.h"
21 21
22/* SYSC */ 22/* SYSC */
23#define SPDCR IOMEM(0xe6180008) 23#define SPDCR IOMEM(0xe6180008)
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h
index 690553a06887..690553a06887 100644
--- a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h
+++ b/arch/arm/mach-shmobile/pm-rmobile.h
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 0de75fd394b9..7ef9a0126780 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -25,9 +25,9 @@
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27#include <asm/suspend.h> 27#include <asm/suspend.h>
28#include <mach/common.h>
29#include <mach/sh7372.h> 28#include <mach/sh7372.h>
30#include <mach/pm-rmobile.h> 29#include "common.h"
30#include "pm-rmobile.h"
31 31
32/* DBG */ 32/* DBG */
33#define DBGREG1 IOMEM(0xe6100020) 33#define DBGREG1 IOMEM(0xe6100020)
diff --git a/arch/arm/mach-shmobile/pm-sh73a0.c b/arch/arm/mach-shmobile/pm-sh73a0.c
index 99086e98fbbc..a7e466817965 100644
--- a/arch/arm/mach-shmobile/pm-sh73a0.c
+++ b/arch/arm/mach-shmobile/pm-sh73a0.c
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11#include <linux/suspend.h> 11#include <linux/suspend.h>
12#include <mach/common.h> 12#include "common.h"
13 13
14#ifdef CONFIG_SUSPEND 14#ifdef CONFIG_SUSPEND
15static int sh73a0_enter_suspend(suspend_state_t suspend_state) 15static int sh73a0_enter_suspend(suspend_state_t suspend_state)
diff --git a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h
index 43f606eb2d82..43f606eb2d82 100644
--- a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h
+++ b/arch/arm/mach-shmobile/rcar-gen2.h
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index d953ff6e78a2..6e4ffa74dad4 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -20,10 +20,10 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <mach/common.h>
24#include <asm/mach-types.h> 23#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include "common.h"
27 27
28static struct map_desc emev2_io_desc[] __initdata = { 28static struct map_desc emev2_io_desc[] __initdata = {
29#ifdef CONFIG_SMP 29#ifdef CONFIG_SMP
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index 412e179429cd..17a74d355c5d 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -22,10 +22,10 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/sh_timer.h> 24#include <linux/sh_timer.h>
25#include <mach/common.h>
26#include <mach/irqs.h>
27#include <mach/r7s72100.h> 25#include <mach/r7s72100.h>
28#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include "common.h"
28#include "irqs.h"
29 29
30static struct resource mtu2_resources[] __initdata = { 30static struct resource mtu2_resources[] __initdata = {
31 DEFINE_RES_MEM(0xfcff0000, 0x400), 31 DEFINE_RES_MEM(0xfcff0000, 0x400),
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index 9333770cfac2..da94d9b9292e 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -24,11 +24,11 @@
24#include <linux/serial_sci.h> 24#include <linux/serial_sci.h>
25#include <linux/sh_dma.h> 25#include <linux/sh_dma.h>
26#include <linux/sh_timer.h> 26#include <linux/sh_timer.h>
27#include <mach/common.h>
28#include <mach/dma-register.h>
29#include <mach/irqs.h>
30#include <mach/r8a73a4.h> 27#include <mach/r8a73a4.h>
31#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include "common.h"
30#include "dma-register.h"
31#include "irqs.h"
32 32
33static const struct resource pfc_resources[] = { 33static const struct resource pfc_resources[] = {
34 DEFINE_RES_MEM(0xe6050000, 0x9000), 34 DEFINE_RES_MEM(0xe6050000, 0x9000),
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 35dec233301e..10170b3560c2 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -31,15 +31,15 @@
31#include <linux/sh_dma.h> 31#include <linux/sh_dma.h>
32#include <linux/sh_timer.h> 32#include <linux/sh_timer.h>
33#include <linux/platform_data/sh_ipmmu.h> 33#include <linux/platform_data/sh_ipmmu.h>
34#include <mach/dma-register.h>
35#include <mach/r8a7740.h> 34#include <mach/r8a7740.h>
36#include <mach/pm-rmobile.h>
37#include <mach/common.h>
38#include <mach/irqs.h>
39#include <asm/mach-types.h> 35#include <asm/mach-types.h>
40#include <asm/mach/map.h> 36#include <asm/mach/map.h>
41#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
42#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39#include "common.h"
40#include "dma-register.h"
41#include "irqs.h"
42#include "pm-rmobile.h"
43 43
44static struct map_desc r8a7740_io_desc[] __initdata = { 44static struct map_desc r8a7740_io_desc[] __initdata = {
45 /* 45 /*
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index d311ef903b39..d9f4529d8e40 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -37,11 +37,11 @@
37#include <linux/usb/ehci_pdriver.h> 37#include <linux/usb/ehci_pdriver.h>
38#include <linux/usb/ohci_pdriver.h> 38#include <linux/usb/ohci_pdriver.h>
39#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
40#include <mach/irqs.h>
41#include <mach/r8a7778.h> 40#include <mach/r8a7778.h>
42#include <mach/common.h>
43#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
44#include <asm/hardware/cache-l2x0.h> 42#include <asm/hardware/cache-l2x0.h>
43#include "common.h"
44#include "irqs.h"
45 45
46/* SCIF */ 46/* SCIF */
47#define R8A7778_SCIF(index, baseaddr, irq) \ 47#define R8A7778_SCIF(index, baseaddr, irq) \
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index aba4ed652d54..2f59b99b9b86 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -40,14 +40,14 @@
40#include <linux/usb/ehci_pdriver.h> 40#include <linux/usb/ehci_pdriver.h>
41#include <linux/usb/ohci_pdriver.h> 41#include <linux/usb/ohci_pdriver.h>
42#include <linux/pm_runtime.h> 42#include <linux/pm_runtime.h>
43#include <mach/irqs.h>
44#include <mach/r8a7779.h> 43#include <mach/r8a7779.h>
45#include <mach/common.h>
46#include <asm/mach-types.h> 44#include <asm/mach-types.h>
47#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
48#include <asm/mach/time.h> 46#include <asm/mach/time.h>
49#include <asm/mach/map.h> 47#include <asm/mach/map.h>
50#include <asm/hardware/cache-l2x0.h> 48#include <asm/hardware/cache-l2x0.h>
49#include "common.h"
50#include "irqs.h"
51 51
52static struct map_desc r8a7779_io_desc[] __initdata = { 52static struct map_desc r8a7779_io_desc[] __initdata = {
53 /* 2M entity map for 0xf0000000 (MPCORE) */ 53 /* 2M entity map for 0xf0000000 (MPCORE) */
@@ -640,16 +640,16 @@ static void __init r8a7779_register_hpb_dmae(void)
640} 640}
641 641
642static struct platform_device *r8a7779_devices_dt[] __initdata = { 642static struct platform_device *r8a7779_devices_dt[] __initdata = {
643 &tmu0_device,
644};
645
646static struct platform_device *r8a7779_standard_devices[] __initdata = {
643 &scif0_device, 647 &scif0_device,
644 &scif1_device, 648 &scif1_device,
645 &scif2_device, 649 &scif2_device,
646 &scif3_device, 650 &scif3_device,
647 &scif4_device, 651 &scif4_device,
648 &scif5_device, 652 &scif5_device,
649 &tmu0_device,
650};
651
652static struct platform_device *r8a7779_standard_devices[] __initdata = {
653 &i2c0_device, 653 &i2c0_device,
654 &i2c1_device, 654 &i2c1_device,
655 &i2c2_device, 655 &i2c2_device,
@@ -674,16 +674,6 @@ void __init r8a7779_add_standard_devices(void)
674 r8a7779_register_hpb_dmae(); 674 r8a7779_register_hpb_dmae();
675} 675}
676 676
677/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
678void __init __weak r8a7779_register_twd(void) { }
679
680void __init r8a7779_earlytimer_init(void)
681{
682 r8a7779_clock_init();
683 r8a7779_register_twd();
684 shmobile_earlytimer_init();
685}
686
687void __init r8a7779_add_early_devices(void) 677void __init r8a7779_add_early_devices(void)
688{ 678{
689 early_platform_add_devices(r8a7779_devices_dt, 679 early_platform_add_devices(r8a7779_devices_dt,
@@ -747,19 +737,28 @@ void __init r8a7779_init_irq_dt(void)
747 __raw_writel(0x003fee3f, INT2SMSKCR4); 737 __raw_writel(0x003fee3f, INT2SMSKCR4);
748} 738}
749 739
750void __init r8a7779_init_delay(void) 740void __init r8a7779_add_standard_devices_dt(void)
751{ 741{
752 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ 742 platform_add_devices(r8a7779_devices_dt,
743 ARRAY_SIZE(r8a7779_devices_dt));
753} 744}
754 745
755void __init r8a7779_add_standard_devices_dt(void) 746#define MODEMR 0xffcc0020
747
748u32 __init r8a7779_read_mode_pins(void)
756{ 749{
757 /* clocks are setup late during boot in the case of DT */ 750 static u32 mode;
758 r8a7779_clock_init(); 751 static bool mode_valid;
752
753 if (!mode_valid) {
754 void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
755 BUG_ON(!modemr);
756 mode = ioread32(modemr);
757 iounmap(modemr);
758 mode_valid = true;
759 }
759 760
760 platform_add_devices(r8a7779_devices_dt, 761 return mode;
761 ARRAY_SIZE(r8a7779_devices_dt));
762 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
763} 762}
764 763
765static const char *r8a7779_compat_dt[] __initdata = { 764static const char *r8a7779_compat_dt[] __initdata = {
@@ -769,7 +768,7 @@ static const char *r8a7779_compat_dt[] __initdata = {
769 768
770DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") 769DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
771 .map_io = r8a7779_map_io, 770 .map_io = r8a7779_map_io,
772 .init_early = r8a7779_init_delay, 771 .init_early = shmobile_init_delay,
773 .nr_irqs = NR_IRQS_LEGACY, 772 .nr_irqs = NR_IRQS_LEGACY,
774 .init_irq = r8a7779_init_irq_dt, 773 .init_irq = r8a7779_init_irq_dt,
775 .init_machine = r8a7779_add_standard_devices_dt, 774 .init_machine = r8a7779_add_standard_devices_dt,
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 6bd08b127fa4..4212c8de987a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -26,11 +26,12 @@
26#include <linux/serial_sci.h> 26#include <linux/serial_sci.h>
27#include <linux/sh_dma.h> 27#include <linux/sh_dma.h>
28#include <linux/sh_timer.h> 28#include <linux/sh_timer.h>
29#include <mach/common.h>
30#include <mach/dma-register.h>
31#include <mach/irqs.h>
32#include <mach/r8a7790.h> 29#include <mach/r8a7790.h>
33#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include "common.h"
32#include "dma-register.h"
33#include "irqs.h"
34#include "rcar-gen2.h"
34 35
35/* Audio-DMAC */ 36/* Audio-DMAC */
36#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \ 37#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 04a96ddb3224..f554cda4a96a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -26,11 +26,11 @@
26#include <linux/platform_data/irq-renesas-irqc.h> 26#include <linux/platform_data/irq-renesas-irqc.h>
27#include <linux/serial_sci.h> 27#include <linux/serial_sci.h>
28#include <linux/sh_timer.h> 28#include <linux/sh_timer.h>
29#include <mach/common.h>
30#include <mach/irqs.h>
31#include <mach/r8a7791.h> 29#include <mach/r8a7791.h>
32#include <mach/rcar-gen2.h>
33#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include "common.h"
32#include "irqs.h"
33#include "rcar-gen2.h"
34 34
35static const struct resource pfc_resources[] __initconst = { 35static const struct resource pfc_resources[] __initconst = {
36 DEFINE_RES_MEM(0xe6060000, 0x250), 36 DEFINE_RES_MEM(0xe6060000, 0x250),
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 542c5a47173f..fdc714ebc4cd 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -22,9 +22,9 @@
22#include <linux/clocksource.h> 22#include <linux/clocksource.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <mach/common.h>
26#include <mach/rcar-gen2.h>
27#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include "common.h"
27#include "rcar-gen2.h"
28 28
29#define MODEMR 0xe6160060 29#define MODEMR 0xe6160060
30 30
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 2a8b9f2a2f54..5571f867c611 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -29,19 +29,19 @@
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/serial_sci.h> 30#include <linux/serial_sci.h>
31#include <linux/sh_dma.h> 31#include <linux/sh_dma.h>
32#include <linux/sh_intc.h>
33#include <linux/sh_timer.h> 32#include <linux/sh_timer.h>
34#include <linux/pm_domain.h> 33#include <linux/pm_domain.h>
35#include <linux/dma-mapping.h> 34#include <linux/dma-mapping.h>
36#include <linux/platform_data/sh_ipmmu.h> 35#include <linux/platform_data/sh_ipmmu.h>
37#include <mach/dma-register.h>
38#include <mach/irqs.h>
39#include <mach/sh7372.h> 36#include <mach/sh7372.h>
40#include <mach/common.h>
41#include <asm/mach/map.h> 37#include <asm/mach/map.h>
42#include <asm/mach-types.h> 38#include <asm/mach-types.h>
43#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
44#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include "common.h"
42#include "dma-register.h"
43#include "irqs.h"
44#include "pm-rmobile.h"
45 45
46static struct map_desc sh7372_io_desc[] __initdata = { 46static struct map_desc sh7372_io_desc[] __initdata = {
47 /* create a 1:1 entity map for 0xe6xxxxxx 47 /* create a 1:1 entity map for 0xe6xxxxxx
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index ad00724a2269..b30bbee6dc65 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -29,18 +29,17 @@
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/serial_sci.h> 30#include <linux/serial_sci.h>
31#include <linux/sh_dma.h> 31#include <linux/sh_dma.h>
32#include <linux/sh_intc.h>
33#include <linux/sh_timer.h> 32#include <linux/sh_timer.h>
34#include <linux/platform_data/sh_ipmmu.h> 33#include <linux/platform_data/sh_ipmmu.h>
35#include <linux/platform_data/irq-renesas-intc-irqpin.h> 34#include <linux/platform_data/irq-renesas-intc-irqpin.h>
36#include <mach/dma-register.h>
37#include <mach/irqs.h>
38#include <mach/sh73a0.h> 35#include <mach/sh73a0.h>
39#include <mach/common.h>
40#include <asm/mach-types.h> 36#include <asm/mach-types.h>
41#include <asm/mach/map.h> 37#include <asm/mach/map.h>
42#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
43#include <asm/mach/time.h> 39#include <asm/mach/time.h>
40#include "common.h"
41#include "dma-register.h"
42#include "irqs.h"
44 43
45static struct map_desc sh73a0_io_desc[] __initdata = { 44static struct map_desc sh73a0_io_desc[] __initdata = {
46 /* create a 1:1 entity map for 0xe6xxxxxx 45 /* create a 1:1 entity map for 0xe6xxxxxx
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index 2dfd748da7f3..6ff1df1df9a7 100644
--- a/arch/arm/mach-shmobile/smp-emev2.c
+++ b/arch/arm/mach-shmobile/smp-emev2.c
@@ -23,9 +23,9 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <mach/common.h>
27#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
28#include <asm/smp_scu.h> 27#include <asm/smp_scu.h>
28#include "common.h"
29 29
30#define EMEV2_SCU_BASE 0x1e000000 30#define EMEV2_SCU_BASE 0x1e000000
31#define EMEV2_SMU_BASE 0xe0110000 31#define EMEV2_SMU_BASE 0xe0110000
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index e7a3201473d0..c230fc0c3fef 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -23,13 +23,13 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <mach/common.h>
27#include <mach/pm-rcar.h>
28#include <mach/r8a7779.h> 26#include <mach/r8a7779.h>
29#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
30#include <asm/smp_plat.h> 28#include <asm/smp_plat.h>
31#include <asm/smp_scu.h> 29#include <asm/smp_scu.h>
32#include <asm/smp_twd.h> 30#include <asm/smp_twd.h>
31#include "common.h"
32#include "pm-rcar.h"
33 33
34#define AVECR IOMEM(0xfe700040) 34#define AVECR IOMEM(0xfe700040)
35#define R8A7779_SCU_BASE 0xf0000000 35#define R8A7779_SCU_BASE 0xf0000000
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
index 591052799e8f..a8ace58c3dd2 100644
--- a/arch/arm/mach-shmobile/smp-r8a7790.c
+++ b/arch/arm/mach-shmobile/smp-r8a7790.c
@@ -18,9 +18,9 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/smp_plat.h> 20#include <asm/smp_plat.h>
21#include <mach/common.h>
22#include <mach/pm-rcar.h>
23#include <mach/r8a7790.h> 21#include <mach/r8a7790.h>
22#include "common.h"
23#include "pm-rcar.h"
24 24
25#define RST 0xe6160000 25#define RST 0xe6160000
26#define CA15BAR 0x0020 26#define CA15BAR 0x0020
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index ec979529f30f..2648d68650e4 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -18,9 +18,9 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/smp_plat.h> 20#include <asm/smp_plat.h>
21#include <mach/common.h>
22#include <mach/r8a7791.h> 21#include <mach/r8a7791.h>
23#include <mach/rcar-gen2.h> 22#include "common.h"
23#include "rcar-gen2.h"
24 24
25#define RST 0xe6160000 25#define RST 0xe6160000
26#define CA15BAR 0x0020 26#define CA15BAR 0x0020
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index 13ba36a6831f..bf4aff99ed1c 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -22,10 +22,10 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <mach/common.h>
26#include <mach/sh73a0.h> 25#include <mach/sh73a0.h>
27#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
28#include <asm/smp_twd.h> 27#include <asm/smp_twd.h>
28#include "common.h"
29 29
30#define WUPCR IOMEM(0xe6151010) 30#define WUPCR IOMEM(0xe6151010)
31#define SRESCR IOMEM(0xe6151018) 31#define SRESCR IOMEM(0xe6151018)