aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-08-28 13:00:24 -0400
committerOlof Johansson <olof@lixom.net>2013-08-28 13:00:24 -0400
commite707bb338b5c6f5859578ae6eb426a21b78b0f42 (patch)
tree93f28a52a6d37e6855c51e644353bd23631a1c1c /arch/arm/mach-shmobile
parentf0a108b7227c4328c7a32514ee6a4ceffaaed886 (diff)
parent282b583f752f996ee5c33b0cdc18adf3b5094ee0 (diff)
Merge tag 'renesas-cleanup3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/renesas
From Simon Horman: Third round of Renesas ARM based SoC cleanups for v3.12 * Remove global GPIO_NR definition from sh73a0 SoC * Remove unnecessary nfsroot settings from bootargs of kzm9d and armadillo800eva * Rename irq initialisation functions of r8a7779 SoC to make them consistent with other SoCs * Simplify irq initialisation of r8a7740 SoC * Add missing __initdata annotations to bockw board, and r8a7790 and r8a7779 SoCs * Refactor time initialisation and remove shmobile_init_time. - This affects the following boards: kzm9g, marzen, ape6evm, armadillo800eva and bockw - This affects the following SoCs: r8a7790, r8a7779, r7a7740, r7a73a4 * Cleanup device registration code of r8a7778 SoC * tag 'renesas-cleanup3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (45 commits) ARM: shmobile: sh73a0: Remove global GPIO_NR definition ARM: shmobile: kzm9d: remove nfsroot settings from bootargs ARM: shmobile: armadillo800eva: remove nfsroot settings from bootargs ARM: shmobile: r8a7779: move r8a7779_init_irq_xxx() to setup ARM: shmobile: r8a7740: move r8a7740_init_irq_of() to setup ARM: shmobile: bockw: add missing __initdata ARM: shmobile: r8a7790: add missing __initdata ARM: shmobile: r8a7779: add missing __initdata ARM: shmobile: Remove unused shmobile_init_time() ARM: shmobile: Use clocksource_of_init() on r8a7790 ARM: shmobile: Use default ->init_time() on KZM9G DT ref ARM: shmobile: Use default ->init_time() on Marzen DT ref ARM: shmobile: Use default ->init_time() on APE6EVM DT ref ARM: shmobile: Use default ->init_time() on APE6EVM ARM: shmobile: Use default ->init_time() on Armadillo DT ref ARM: shmobile: Use default ->init_time() on Bockw DT ref ARM: shmobile: Use default ->init_time() on Bockw ARM: shmobile: Use default ->init_time() on r8a7779 ARM: shmobile: Use default ->init_time() on r8a7778 ARM: shmobile: Use default ->init_time() on r8a7740 ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Kconfig37
-rw-r--r--arch/arm/mach-shmobile/Makefile7
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot3
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm-reference.c63
-rw-r--r--arch/arm/mach-shmobile/board-ape6evm.c1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c2
-rw-r--r--arch/arm/mach-shmobile/board-bockw-reference.c61
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c49
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c16
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c45
-rw-r--r--arch/arm/mach-shmobile/board-marzen-reference.c1
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c11
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a73a4.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7740.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h9
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7790.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h2
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7740.c68
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c130
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c10
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c33
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c71
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c83
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c16
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c12
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c11
-rw-r--r--arch/arm/mach-shmobile/timer.c4
31 files changed, 424 insertions, 328 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index e4ad4089f6ff..fed06b06056d 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -76,6 +76,17 @@ config MACH_APE6EVM
76 depends on ARCH_R8A73A4 76 depends on ARCH_R8A73A4
77 select USE_OF 77 select USE_OF
78 78
79config MACH_APE6EVM_REFERENCE
80 bool "APE6EVM board - Reference Device Tree Implementation"
81 depends on ARCH_R8A73A4
82 select USE_OF
83 ---help---
84 Use reference implementation of APE6EVM board support
85 which makes a greater use of device tree at the expense
86 of not supporting a number of devices.
87
88 This is intended to aid developers
89
79config MACH_MACKEREL 90config MACH_MACKEREL
80 bool "mackerel board" 91 bool "mackerel board"
81 depends on ARCH_SH7372 92 depends on ARCH_SH7372
@@ -113,11 +124,26 @@ config MACH_BOCKW
113 select RENESAS_INTC_IRQPIN 124 select RENESAS_INTC_IRQPIN
114 select USE_OF 125 select USE_OF
115 126
127config MACH_BOCKW_REFERENCE
128 bool "BOCK-W - Reference Device Tree Implementation"
129 depends on ARCH_R8A7778
130 select ARCH_REQUIRE_GPIOLIB
131 select RENESAS_INTC_IRQPIN
132 select REGULATOR_FIXED_VOLTAGE if REGULATOR
133 select USE_OF
134 ---help---
135 Use reference implementation of BockW board support
136 which makes use of device tree at the expense
137 of not supporting a number of devices.
138
139 This is intended to aid developers
140
116config MACH_MARZEN 141config MACH_MARZEN
117 bool "MARZEN board" 142 bool "MARZEN board"
118 depends on ARCH_R8A7779 143 depends on ARCH_R8A7779
119 select ARCH_REQUIRE_GPIOLIB 144 select ARCH_REQUIRE_GPIOLIB
120 select REGULATOR_FIXED_VOLTAGE if REGULATOR 145 select REGULATOR_FIXED_VOLTAGE if REGULATOR
146 select USE_OF
121 147
122config MACH_MARZEN_REFERENCE 148config MACH_MARZEN_REFERENCE
123 bool "MARZEN board - Reference Device Tree Implementation" 149 bool "MARZEN board - Reference Device Tree Implementation"
@@ -137,6 +163,17 @@ config MACH_LAGER
137 depends on ARCH_R8A7790 163 depends on ARCH_R8A7790
138 select USE_OF 164 select USE_OF
139 165
166config MACH_LAGER_REFERENCE
167 bool "Lager board - Reference Device Tree Implementation"
168 depends on ARCH_R8A7790
169 select USE_OF
170 ---help---
171 Use reference implementation of Lager board support
172 which makes use of device tree at the expense
173 of not supporting a number of devices.
174
175 This is intended to aid developers
176
140config MACH_KZM9D 177config MACH_KZM9D
141 bool "KZM9D board" 178 bool "KZM9D board"
142 depends on ARCH_EMEV2 179 depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index e3f8592fab88..969c3a9dde5b 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -9,9 +9,9 @@ obj-y := timer.o console.o clock.o
9obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o 9obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
10obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o 10obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
11obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o 11obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o
12obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o 12obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o
13obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o clock-r8a7778.o 13obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o clock-r8a7778.o
14obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o 14obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o
15obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o clock-r8a7790.o 15obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o clock-r8a7790.o
16obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o 16obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o
17 17
@@ -34,11 +34,14 @@ obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
34 34
35# Board objects 35# Board objects
36obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o 36obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
37obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
37obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o 38obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
38obj-$(CONFIG_MACH_BOCKW) += board-bockw.o 39obj-$(CONFIG_MACH_BOCKW) += board-bockw.o
40obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o
39obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 41obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
40obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o 42obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
41obj-$(CONFIG_MACH_LAGER) += board-lager.o 43obj-$(CONFIG_MACH_LAGER) += board-lager.o
44obj-$(CONFIG_MACH_LAGER_REFERENCE) += board-lager-reference.o
42obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 45obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
43obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o 46obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
44obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 47obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index b8c1a21fcaf3..6a504fe7d86c 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -1,14 +1,17 @@
1# per-board load address for uImage 1# per-board load address for uImage
2loadaddr-y := 2loadaddr-y :=
3loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000 3loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000
4loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000
4loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 5loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000
5loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 6loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
6loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
8loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
7loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000 9loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
8loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000 10loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000
9loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 11loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
10loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 12loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
11loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 13loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
14loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
12loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 15loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
13loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 16loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
14loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000 17loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c
new file mode 100644
index 000000000000..a23fa714f7ac
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c
@@ -0,0 +1,63 @@
1/*
2 * APE6EVM board support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/gpio.h>
22#include <linux/kernel.h>
23#include <linux/of_platform.h>
24#include <linux/pinctrl/machine.h>
25#include <linux/platform_device.h>
26#include <linux/sh_clk.h>
27#include <mach/common.h>
28#include <mach/r8a73a4.h>
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31
32static void __init ape6evm_add_standard_devices(void)
33{
34
35 struct clk *parent;
36 struct clk *mp;
37
38 r8a73a4_clock_init();
39
40 /* MP clock parent = extal2 */
41 parent = clk_get(NULL, "extal2");
42 mp = clk_get(NULL, "mp");
43 BUG_ON(IS_ERR(parent) || IS_ERR(mp));
44
45 clk_set_parent(mp, parent);
46 clk_put(parent);
47 clk_put(mp);
48
49 r8a73a4_add_dt_devices();
50 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
51 platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
52}
53
54static const char *ape6evm_boards_compat_dt[] __initdata = {
55 "renesas,ape6evm-reference",
56 NULL,
57};
58
59DT_MACHINE_START(APE6EVM_DT, "ape6evm")
60 .init_early = r8a73a4_init_delay,
61 .init_machine = ape6evm_add_standard_devices,
62 .dt_compat = ape6evm_boards_compat_dt,
63MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index af6dd39d3758..57e66eb2fd5a 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -102,7 +102,6 @@ static const char *ape6evm_boards_compat_dt[] __initdata = {
102 102
103DT_MACHINE_START(APE6EVM_DT, "ape6evm") 103DT_MACHINE_START(APE6EVM_DT, "ape6evm")
104 .init_early = r8a73a4_init_delay, 104 .init_early = r8a73a4_init_delay,
105 .init_time = shmobile_timer_init,
106 .init_machine = ape6evm_add_standard_devices, 105 .init_machine = ape6evm_add_standard_devices,
107 .dt_compat = ape6evm_boards_compat_dt, 106 .dt_compat = ape6evm_boards_compat_dt,
108MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
index 03b85fec2ddb..5c8cc3c9e9d0 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
@@ -206,7 +206,6 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference")
206 .init_early = r8a7740_init_delay, 206 .init_early = r8a7740_init_delay,
207 .init_irq = r8a7740_init_irq_of, 207 .init_irq = r8a7740_init_irq_of,
208 .init_machine = eva_init, 208 .init_machine = eva_init,
209 .init_time = shmobile_timer_init,
210 .init_late = shmobile_init_late, 209 .init_late = shmobile_init_late,
211 .dt_compat = eva_boards_compat_dt, 210 .dt_compat = eva_boards_compat_dt,
212 .restart = eva_restart, 211 .restart = eva_restart,
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 5eb884d4324f..4d65263aafad 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1312,7 +1312,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
1312DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") 1312DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
1313 .map_io = r8a7740_map_io, 1313 .map_io = r8a7740_map_io,
1314 .init_early = eva_add_early_devices, 1314 .init_early = eva_add_early_devices,
1315 .init_irq = r8a7740_init_irq, 1315 .init_irq = r8a7740_init_irq_of,
1316 .init_machine = eva_init, 1316 .init_machine = eva_init,
1317 .init_late = shmobile_init_late, 1317 .init_late = shmobile_init_late,
1318 .init_time = eva_earlytimer_init, 1318 .init_time = eva_earlytimer_init,
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
new file mode 100644
index 000000000000..1a7c893e1a52
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-bockw-reference.c
@@ -0,0 +1,61 @@
1/*
2 * Bock-W board support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/of_platform.h>
22#include <linux/pinctrl/machine.h>
23#include <mach/common.h>
24#include <mach/r8a7778.h>
25#include <asm/mach/arch.h>
26
27/*
28 * see board-bock.c for checking detail of dip-switch
29 */
30
31static const struct pinctrl_map bockw_pinctrl_map[] = {
32 /* SCIF0 */
33 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
34 "scif0_data_a", "scif0"),
35 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
36 "scif0_ctrl", "scif0"),
37};
38
39static void __init bockw_init(void)
40{
41 r8a7778_clock_init();
42
43 pinctrl_register_mappings(bockw_pinctrl_map,
44 ARRAY_SIZE(bockw_pinctrl_map));
45 r8a7778_pinmux_init();
46 r8a7778_add_dt_devices();
47
48 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
49}
50
51static const char *bockw_boards_compat_dt[] __initdata = {
52 "renesas,bockw-reference",
53 NULL,
54};
55
56DT_MACHINE_START(BOCKW_DT, "bockw")
57 .init_early = r8a7778_init_delay,
58 .init_irq = r8a7778_init_irq_dt,
59 .init_machine = bockw_init,
60 .dt_compat = bockw_boards_compat_dt,
61MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 3354a85c90f7..255e97e5be83 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -20,8 +20,11 @@
20 20
21#include <linux/mfd/tmio.h> 21#include <linux/mfd/tmio.h>
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/mmc/sh_mobile_sdhi.h>
24#include <linux/mmc/sh_mmcif.h>
23#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
24#include <linux/pinctrl/machine.h> 26#include <linux/pinctrl/machine.h>
27#include <linux/platform_data/usb-rcar-phy.h>
25#include <linux/platform_device.h> 28#include <linux/platform_device.h>
26#include <linux/regulator/fixed.h> 29#include <linux/regulator/fixed.h>
27#include <linux/regulator/machine.h> 30#include <linux/regulator/machine.h>
@@ -64,28 +67,38 @@ static struct regulator_consumer_supply dummy_supplies[] = {
64 REGULATOR_SUPPLY("vdd33a", "smsc911x"), 67 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
65}; 68};
66 69
67static struct smsc911x_platform_config smsc911x_data = { 70static struct smsc911x_platform_config smsc911x_data __initdata = {
68 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 71 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
69 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 72 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
70 .flags = SMSC911X_USE_32BIT, 73 .flags = SMSC911X_USE_32BIT,
71 .phy_interface = PHY_INTERFACE_MODE_MII, 74 .phy_interface = PHY_INTERFACE_MODE_MII,
72}; 75};
73 76
74static struct resource smsc911x_resources[] = { 77static struct resource smsc911x_resources[] __initdata = {
75 DEFINE_RES_MEM(0x18300000, 0x1000), 78 DEFINE_RES_MEM(0x18300000, 0x1000),
76 DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ 79 DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */
77}; 80};
78 81
79/* USB */ 82/* USB */
83static struct resource usb_phy_resources[] __initdata = {
84 DEFINE_RES_MEM(0xffe70800, 0x100),
85 DEFINE_RES_MEM(0xffe76000, 0x100),
86};
87
80static struct rcar_phy_platform_data usb_phy_platform_data __initdata; 88static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
81 89
82/* SDHI */ 90/* SDHI */
83static struct sh_mobile_sdhi_info sdhi0_info = { 91static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
84 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 92 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
85 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 93 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
86 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 94 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
87}; 95};
88 96
97static struct resource sdhi0_resources[] __initdata = {
98 DEFINE_RES_MEM(0xFFE4C000, 0x100),
99 DEFINE_RES_IRQ(gic_iid(0x77)),
100};
101
89static struct sh_eth_plat_data ether_platform_data __initdata = { 102static struct sh_eth_plat_data ether_platform_data __initdata = {
90 .phy = 0x01, 103 .phy = 0x01,
91 .edmac_endian = EDMAC_LITTLE_ENDIAN, 104 .edmac_endian = EDMAC_LITTLE_ENDIAN,
@@ -135,7 +148,12 @@ static struct spi_board_info spi_board_info[] __initdata = {
135}; 148};
136 149
137/* MMC */ 150/* MMC */
138static struct sh_mmcif_plat_data sh_mmcif_plat = { 151static struct resource mmc_resources[] __initdata = {
152 DEFINE_RES_MEM(0xffe4e000, 0x100),
153 DEFINE_RES_IRQ(gic_iid(0x5d)),
154};
155
156static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
139 .sup_pclk = 0, 157 .sup_pclk = 0,
140 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 158 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
141 .caps = MMC_CAP_4_BIT_DATA | 159 .caps = MMC_CAP_4_BIT_DATA |
@@ -187,11 +205,7 @@ static void __init bockw_init(void)
187 r8a7778_clock_init(); 205 r8a7778_clock_init();
188 r8a7778_init_irq_extpin(1); 206 r8a7778_init_irq_extpin(1);
189 r8a7778_add_standard_devices(); 207 r8a7778_add_standard_devices();
190 r8a7778_add_usb_phy_device(&usb_phy_platform_data);
191 r8a7778_add_ether_device(&ether_platform_data); 208 r8a7778_add_ether_device(&ether_platform_data);
192 r8a7778_add_i2c_device(0);
193 r8a7778_add_hspi_device(0);
194 r8a7778_add_mmc_device(&sh_mmcif_plat);
195 209
196 i2c_register_board_info(0, i2c0_devices, 210 i2c_register_board_info(0, i2c0_devices,
197 ARRAY_SIZE(i2c0_devices)); 211 ARRAY_SIZE(i2c0_devices));
@@ -201,6 +215,19 @@ static void __init bockw_init(void)
201 ARRAY_SIZE(bockw_pinctrl_map)); 215 ARRAY_SIZE(bockw_pinctrl_map));
202 r8a7778_pinmux_init(); 216 r8a7778_pinmux_init();
203 217
218 platform_device_register_resndata(
219 &platform_bus, "sh_mmcif", -1,
220 mmc_resources, ARRAY_SIZE(mmc_resources),
221 &sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));
222
223 platform_device_register_resndata(
224 &platform_bus, "rcar_usb_phy", -1,
225 usb_phy_resources,
226 ARRAY_SIZE(usb_phy_resources),
227 &usb_phy_platform_data,
228 sizeof(struct rcar_phy_platform_data));
229
230
204 /* for SMSC */ 231 /* for SMSC */
205 base = ioremap_nocache(FPGA, SZ_1M); 232 base = ioremap_nocache(FPGA, SZ_1M);
206 if (base) { 233 if (base) {
@@ -236,7 +263,10 @@ static void __init bockw_init(void)
236 iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4); 263 iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4);
237 iounmap(base); 264 iounmap(base);
238 265
239 r8a7778_sdhi_init(0, &sdhi0_info); 266 platform_device_register_resndata(
267 &platform_bus, "sh_mobile_sdhi", 0,
268 sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
269 &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
240 } 270 }
241} 271}
242 272
@@ -249,7 +279,6 @@ DT_MACHINE_START(BOCKW_DT, "bockw")
249 .init_early = r8a7778_init_delay, 279 .init_early = r8a7778_init_delay,
250 .init_irq = r8a7778_init_irq_dt, 280 .init_irq = r8a7778_init_irq_dt,
251 .init_machine = bockw_init, 281 .init_machine = bockw_init,
252 .init_time = shmobile_timer_init,
253 .dt_compat = bockw_boards_compat_dt, 282 .dt_compat = bockw_boards_compat_dt,
254 .init_late = r8a7778_init_late, 283 .init_late = r8a7778_init_late,
255MACHINE_END 284MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 41092bb01ee5..4cf6babc4e02 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -99,6 +99,5 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
99 .init_early = sh73a0_init_delay, 99 .init_early = sh73a0_init_delay,
100 .nr_irqs = NR_IRQS_LEGACY, 100 .nr_irqs = NR_IRQS_LEGACY,
101 .init_machine = kzm_init, 101 .init_machine = kzm_init,
102 .init_time = shmobile_timer_init,
103 .dt_compat = kzm9g_boards_compat_dt, 102 .dt_compat = kzm9g_boards_compat_dt,
104MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 1068120d339f..f1994968d303 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -54,14 +54,14 @@
54/* 54/*
55 * external GPIO 55 * external GPIO
56 */ 56 */
57#define GPIO_PCF8575_BASE (GPIO_NR) 57#define GPIO_PCF8575_BASE (310)
58#define GPIO_PCF8575_PORT10 (GPIO_NR + 8) 58#define GPIO_PCF8575_PORT10 (GPIO_PCF8575_BASE + 8)
59#define GPIO_PCF8575_PORT11 (GPIO_NR + 9) 59#define GPIO_PCF8575_PORT11 (GPIO_PCF8575_BASE + 9)
60#define GPIO_PCF8575_PORT12 (GPIO_NR + 10) 60#define GPIO_PCF8575_PORT12 (GPIO_PCF8575_BASE + 10)
61#define GPIO_PCF8575_PORT13 (GPIO_NR + 11) 61#define GPIO_PCF8575_PORT13 (GPIO_PCF8575_BASE + 11)
62#define GPIO_PCF8575_PORT14 (GPIO_NR + 12) 62#define GPIO_PCF8575_PORT14 (GPIO_PCF8575_BASE + 12)
63#define GPIO_PCF8575_PORT15 (GPIO_NR + 13) 63#define GPIO_PCF8575_PORT15 (GPIO_PCF8575_BASE + 13)
64#define GPIO_PCF8575_PORT16 (GPIO_NR + 14) 64#define GPIO_PCF8575_PORT16 (GPIO_PCF8575_BASE + 14)
65 65
66/* Dummy supplies, where voltage doesn't matter */ 66/* Dummy supplies, where voltage doesn't matter */
67static struct regulator_consumer_supply dummy_supplies[] = { 67static struct regulator_consumer_supply dummy_supplies[] = {
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
new file mode 100644
index 000000000000..9c316a1b2e32
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -0,0 +1,45 @@
1/*
2 * Lager board support - Reference DT implementation
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/of_platform.h>
23#include <mach/r8a7790.h>
24#include <asm/mach/arch.h>
25
26static void __init lager_add_standard_devices(void)
27{
28 /* clocks are setup late during boot in the case of DT */
29 r8a7790_clock_init();
30
31 r8a7790_add_dt_devices();
32 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
33}
34
35static const char *lager_boards_compat_dt[] __initdata = {
36 "renesas,lager-reference",
37 NULL,
38};
39
40DT_MACHINE_START(LAGER_DT, "lager")
41 .init_early = r8a7790_init_delay,
42 .init_machine = lager_add_standard_devices,
43 .init_time = r8a7790_timer_init,
44 .dt_compat = lager_boards_compat_dt,
45MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 480d882e42c7..a20b7ee652ea 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -70,6 +70,5 @@ DT_MACHINE_START(MARZEN, "marzen")
70 .nr_irqs = NR_IRQS_LEGACY, 70 .nr_irqs = NR_IRQS_LEGACY,
71 .init_irq = r8a7779_init_irq_dt, 71 .init_irq = r8a7779_init_irq_dt,
72 .init_machine = marzen_init, 72 .init_machine = marzen_init,
73 .init_time = shmobile_timer_init,
74 .dt_compat = marzen_boards_compat_dt, 73 .dt_compat = marzen_boards_compat_dt,
75MACHINE_END 74MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 7474a60f98ae..3551b5480b47 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -257,13 +257,18 @@ static void __init marzen_init(void)
257 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 257 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
258} 258}
259 259
260MACHINE_START(MARZEN, "marzen") 260static const char *marzen_boards_compat_dt[] __initdata = {
261 "renesas,marzen",
262 NULL,
263};
264
265DT_MACHINE_START(MARZEN, "marzen")
261 .smp = smp_ops(r8a7779_smp_ops), 266 .smp = smp_ops(r8a7779_smp_ops),
262 .map_io = r8a7779_map_io, 267 .map_io = r8a7779_map_io,
263 .init_early = r8a7779_add_early_devices, 268 .init_early = r8a7779_add_early_devices,
264 .nr_irqs = NR_IRQS_LEGACY, 269 .init_irq = r8a7779_init_irq_dt,
265 .init_irq = r8a7779_init_irq,
266 .init_machine = marzen_init, 270 .init_machine = marzen_init,
267 .init_late = r8a7779_init_late, 271 .init_late = r8a7779_init_late,
272 .dt_compat = marzen_boards_compat_dt,
268 .init_time = r8a7779_earlytimer_init, 273 .init_time = r8a7779_earlytimer_init,
269MACHINE_END 274MACHINE_END
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index e818f029d8e3..18a76f91f4cb 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -2,7 +2,6 @@
2#define __ARCH_MACH_COMMON_H 2#define __ARCH_MACH_COMMON_H
3 3
4extern void shmobile_earlytimer_init(void); 4extern void shmobile_earlytimer_init(void);
5extern void shmobile_timer_init(void);
6extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, 5extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
7 unsigned int mult, unsigned int div); 6 unsigned int mult, unsigned int div);
8struct twd_local_timer; 7struct twd_local_timer;
diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
index 144a85e29245..f3a9b702da56 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a73a4.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
@@ -2,6 +2,7 @@
2#define __ASM_R8A73A4_H__ 2#define __ASM_R8A73A4_H__
3 3
4void r8a73a4_add_standard_devices(void); 4void r8a73a4_add_standard_devices(void);
5void r8a73a4_add_dt_devices(void);
5void r8a73a4_clock_init(void); 6void r8a73a4_clock_init(void);
6void r8a73a4_pinmux_init(void); 7void r8a73a4_pinmux_init(void);
7void r8a73a4_init_delay(void); 8void r8a73a4_init_delay(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
index 56f375005fcd..d07932f872b6 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7740.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
@@ -48,7 +48,6 @@ enum {
48 48
49extern void r8a7740_meram_workaround(void); 49extern void r8a7740_meram_workaround(void);
50extern void r8a7740_init_delay(void); 50extern void r8a7740_init_delay(void);
51extern void r8a7740_init_irq(void);
52extern void r8a7740_init_irq_of(void); 51extern void r8a7740_init_irq_of(void);
53extern void r8a7740_map_io(void); 52extern void r8a7740_map_io(void);
54extern void r8a7740_add_early_devices(void); 53extern void r8a7740_add_early_devices(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index 9b561bf4229f..41fd6da27574 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -18,18 +18,12 @@
18#ifndef __ASM_R8A7778_H__ 18#ifndef __ASM_R8A7778_H__
19#define __ASM_R8A7778_H__ 19#define __ASM_R8A7778_H__
20 20
21#include <linux/mmc/sh_mmcif.h>
22#include <linux/mmc/sh_mobile_sdhi.h>
23#include <linux/sh_eth.h> 21#include <linux/sh_eth.h>
24#include <linux/platform_data/usb-rcar-phy.h>
25 22
26extern void r8a7778_add_standard_devices(void); 23extern void r8a7778_add_standard_devices(void);
27extern void r8a7778_add_standard_devices_dt(void); 24extern void r8a7778_add_standard_devices_dt(void);
28extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata); 25extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
29extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata); 26extern void r8a7778_add_dt_devices(void);
30extern void r8a7778_add_i2c_device(int id);
31extern void r8a7778_add_hspi_device(int id);
32extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
33 27
34extern void r8a7778_init_late(void); 28extern void r8a7778_init_late(void);
35extern void r8a7778_init_delay(void); 29extern void r8a7778_init_delay(void);
@@ -37,6 +31,5 @@ extern void r8a7778_init_irq_dt(void);
37extern void r8a7778_clock_init(void); 31extern void r8a7778_clock_init(void);
38extern void r8a7778_init_irq_extpin(int irlm); 32extern void r8a7778_init_irq_extpin(int irlm);
39extern void r8a7778_pinmux_init(void); 33extern void r8a7778_pinmux_init(void);
40extern void r8a7778_sdhi_init(int id, struct sh_mobile_sdhi_info *info);
41 34
42#endif /* __ASM_R8A7778_H__ */ 35#endif /* __ASM_R8A7778_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index f10727f77b11..f08d6ecf5d1d 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -24,7 +24,6 @@ static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d)
24} 24}
25 25
26extern void r8a7779_init_delay(void); 26extern void r8a7779_init_delay(void);
27extern void r8a7779_init_irq(void);
28extern void r8a7779_init_irq_extpin(int irlm); 27extern void r8a7779_init_irq_extpin(int irlm);
29extern void r8a7779_init_irq_dt(void); 28extern void r8a7779_init_irq_dt(void);
30extern void r8a7779_map_io(void); 29extern void r8a7779_map_io(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 7aaef409a059..788d55952091 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -2,6 +2,7 @@
2#define __ASM_R8A7790_H__ 2#define __ASM_R8A7790_H__
3 3
4void r8a7790_add_standard_devices(void); 4void r8a7790_add_standard_devices(void);
5void r8a7790_add_dt_devices(void);
5void r8a7790_clock_init(void); 6void r8a7790_clock_init(void);
6void r8a7790_pinmux_init(void); 7void r8a7790_pinmux_init(void);
7void r8a7790_init_delay(void); 8void r8a7790_init_delay(void);
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index 680dc5f1655a..359b582dc270 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH73A0_H__ 1#ifndef __ASM_SH73A0_H__
2#define __ASM_SH73A0_H__ 2#define __ASM_SH73A0_H__
3 3
4#define GPIO_NR 310
5
6/* DMA slave IDs */ 4/* DMA slave IDs */
7enum { 5enum {
8 SHDMA_SLAVE_INVALID, 6 SHDMA_SLAVE_INVALID,
diff --git a/arch/arm/mach-shmobile/intc-r8a7740.c b/arch/arm/mach-shmobile/intc-r8a7740.c
deleted file mode 100644
index 8871f7717dc8..000000000000
--- a/arch/arm/mach-shmobile/intc-r8a7740.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * R8A7740 processor support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/io.h>
23#include <linux/irqchip.h>
24#include <linux/irqchip/arm-gic.h>
25
26static void __init r8a7740_init_irq_common(void)
27{
28 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
29 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
30 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
31
32 /* route signals to GIC */
33 iowrite32(0x0, pfc_inta_ctrl);
34
35 /*
36 * To mask the shared interrupt to SPI 149 we must ensure to set
37 * PRIO *and* MASK. Else we run into IRQ floods when registering
38 * the intc_irqpin devices
39 */
40 iowrite32(0x0, intc_prio_base + 0x0);
41 iowrite32(0x0, intc_prio_base + 0x4);
42 iowrite32(0x0, intc_prio_base + 0x8);
43 iowrite32(0x0, intc_prio_base + 0xc);
44 iowrite8(0xff, intc_msk_base + 0x0);
45 iowrite8(0xff, intc_msk_base + 0x4);
46 iowrite8(0xff, intc_msk_base + 0x8);
47 iowrite8(0xff, intc_msk_base + 0xc);
48
49 iounmap(intc_prio_base);
50 iounmap(intc_msk_base);
51 iounmap(pfc_inta_ctrl);
52}
53
54void __init r8a7740_init_irq_of(void)
55{
56 irqchip_init();
57 r8a7740_init_irq_common();
58}
59
60void __init r8a7740_init_irq(void)
61{
62 void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000);
63 void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000);
64
65 /* initialize the Generic Interrupt Controller PL390 r0p0 */
66 gic_init(0, 29, gic_dist_base, gic_cpu_base);
67 r8a7740_init_irq_common();
68}
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
deleted file mode 100644
index 5f9e5dc0238b..000000000000
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * r8a7779 processor support - INTC hardware block
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/io.h>
26#include <linux/irqchip/arm-gic.h>
27#include <linux/platform_data/irq-renesas-intc-irqpin.h>
28#include <linux/irqchip.h>
29#include <mach/common.h>
30#include <mach/irqs.h>
31#include <mach/r8a7779.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35#define INT2SMSKCR0 IOMEM(0xfe7822a0)
36#define INT2SMSKCR1 IOMEM(0xfe7822a4)
37#define INT2SMSKCR2 IOMEM(0xfe7822a8)
38#define INT2SMSKCR3 IOMEM(0xfe7822ac)
39#define INT2SMSKCR4 IOMEM(0xfe7822b0)
40
41#define INT2NTSR0 IOMEM(0xfe700060)
42#define INT2NTSR1 IOMEM(0xfe700064)
43
44static struct renesas_intc_irqpin_config irqpin0_platform_data = {
45 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
46 .sense_bitfield_width = 2,
47};
48
49static struct resource irqpin0_resources[] = {
50 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
51 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
52 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
53 DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
54 DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
55 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
56 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
57 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
58 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
59};
60
61static struct platform_device irqpin0_device = {
62 .name = "renesas_intc_irqpin",
63 .id = 0,
64 .resource = irqpin0_resources,
65 .num_resources = ARRAY_SIZE(irqpin0_resources),
66 .dev = {
67 .platform_data = &irqpin0_platform_data,
68 },
69};
70
71void __init r8a7779_init_irq_extpin(int irlm)
72{
73 void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
74 unsigned long tmp;
75
76 if (icr0) {
77 tmp = ioread32(icr0);
78 if (irlm)
79 tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
80 else
81 tmp &= ~(1 << 23); /* IRL mode - not supported */
82 tmp |= (1 << 21); /* LVLMODE = 1 */
83 iowrite32(tmp, icr0);
84 iounmap(icr0);
85
86 if (irlm)
87 platform_device_register(&irqpin0_device);
88 } else
89 pr_warn("r8a7779: unable to setup external irq pin mode\n");
90}
91
92static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
93{
94 return 0; /* always allow wakeup */
95}
96
97static void __init r8a7779_init_irq_common(void)
98{
99 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
100
101 /* route all interrupts to ARM */
102 __raw_writel(0xffffffff, INT2NTSR0);
103 __raw_writel(0x3fffffff, INT2NTSR1);
104
105 /* unmask all known interrupts in INTCS2 */
106 __raw_writel(0xfffffff0, INT2SMSKCR0);
107 __raw_writel(0xfff7ffff, INT2SMSKCR1);
108 __raw_writel(0xfffbffdf, INT2SMSKCR2);
109 __raw_writel(0xbffffffc, INT2SMSKCR3);
110 __raw_writel(0x003fee3f, INT2SMSKCR4);
111}
112
113void __init r8a7779_init_irq(void)
114{
115 void __iomem *gic_dist_base = IOMEM(0xf0001000);
116 void __iomem *gic_cpu_base = IOMEM(0xf0000100);
117
118 /* use GIC to handle interrupts */
119 gic_init(0, 29, gic_dist_base, gic_cpu_base);
120
121 r8a7779_init_irq_common();
122}
123
124#ifdef CONFIG_OF
125void __init r8a7779_init_irq_dt(void)
126{
127 irqchip_init();
128 r8a7779_init_irq_common();
129}
130#endif
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index 11c0f6305e6b..89491700afb7 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -188,7 +188,7 @@ static struct resource cmt10_resources[] = {
188 &cmt##idx##_platform_data, \ 188 &cmt##idx##_platform_data, \
189 sizeof(struct sh_timer_config)) 189 sizeof(struct sh_timer_config))
190 190
191void __init r8a73a4_add_standard_devices(void) 191void __init r8a73a4_add_dt_devices(void)
192{ 192{
193 r8a73a4_register_scif(SCIFA0); 193 r8a73a4_register_scif(SCIFA0);
194 r8a73a4_register_scif(SCIFA1); 194 r8a73a4_register_scif(SCIFA1);
@@ -196,10 +196,15 @@ void __init r8a73a4_add_standard_devices(void)
196 r8a73a4_register_scif(SCIFB1); 196 r8a73a4_register_scif(SCIFB1);
197 r8a73a4_register_scif(SCIFB2); 197 r8a73a4_register_scif(SCIFB2);
198 r8a73a4_register_scif(SCIFB3); 198 r8a73a4_register_scif(SCIFB3);
199 r8a7790_register_cmt(10);
200}
201
202void __init r8a73a4_add_standard_devices(void)
203{
204 r8a73a4_add_dt_devices();
199 r8a73a4_register_irqc(0); 205 r8a73a4_register_irqc(0);
200 r8a73a4_register_irqc(1); 206 r8a73a4_register_irqc(1);
201 r8a73a4_register_thermal(); 207 r8a73a4_register_thermal();
202 r8a7790_register_cmt(10);
203} 208}
204 209
205void __init r8a73a4_init_delay(void) 210void __init r8a73a4_init_delay(void)
@@ -218,7 +223,6 @@ static const char *r8a73a4_boards_compat_dt[] __initdata = {
218 223
219DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)") 224DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)")
220 .init_early = r8a73a4_init_delay, 225 .init_early = r8a73a4_init_delay,
221 .init_time = shmobile_timer_init,
222 .dt_compat = r8a73a4_boards_compat_dt, 226 .dt_compat = r8a73a4_boards_compat_dt,
223MACHINE_END 227MACHINE_END
224#endif /* CONFIG_USE_OF */ 228#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 84c5bb6d9725..b7d4b2c3bc29 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -22,6 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/irqchip.h>
26#include <linux/irqchip/arm-gic.h>
25#include <linux/platform_data/irq-renesas-intc-irqpin.h> 27#include <linux/platform_data/irq-renesas-intc-irqpin.h>
26#include <linux/platform_device.h> 28#include <linux/platform_device.h>
27#include <linux/of_platform.h> 29#include <linux/of_platform.h>
@@ -1019,6 +1021,36 @@ void __init r8a7740_init_delay(void)
1019 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ 1021 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
1020}; 1022};
1021 1023
1024void __init r8a7740_init_irq_of(void)
1025{
1026 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
1027 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
1028 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
1029
1030 irqchip_init();
1031
1032 /* route signals to GIC */
1033 iowrite32(0x0, pfc_inta_ctrl);
1034
1035 /*
1036 * To mask the shared interrupt to SPI 149 we must ensure to set
1037 * PRIO *and* MASK. Else we run into IRQ floods when registering
1038 * the intc_irqpin devices
1039 */
1040 iowrite32(0x0, intc_prio_base + 0x0);
1041 iowrite32(0x0, intc_prio_base + 0x4);
1042 iowrite32(0x0, intc_prio_base + 0x8);
1043 iowrite32(0x0, intc_prio_base + 0xc);
1044 iowrite8(0xff, intc_msk_base + 0x0);
1045 iowrite8(0xff, intc_msk_base + 0x4);
1046 iowrite8(0xff, intc_msk_base + 0x8);
1047 iowrite8(0xff, intc_msk_base + 0xc);
1048
1049 iounmap(intc_prio_base);
1050 iounmap(intc_msk_base);
1051 iounmap(pfc_inta_ctrl);
1052}
1053
1022static void __init r8a7740_generic_init(void) 1054static void __init r8a7740_generic_init(void)
1023{ 1055{
1024 r8a7740_clock_init(0); 1056 r8a7740_clock_init(0);
@@ -1035,7 +1067,6 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
1035 .init_early = r8a7740_init_delay, 1067 .init_early = r8a7740_init_delay,
1036 .init_irq = r8a7740_init_irq_of, 1068 .init_irq = r8a7740_init_irq_of,
1037 .init_machine = r8a7740_generic_init, 1069 .init_machine = r8a7740_generic_init,
1038 .init_time = shmobile_timer_init,
1039 .dt_compat = r8a7740_boards_compat_dt, 1070 .dt_compat = r8a7740_boards_compat_dt,
1040MACHINE_END 1071MACHINE_END
1041 1072
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index a3a2e37b03f3..604cf36b5616 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -95,20 +95,6 @@ static struct sh_timer_config sh_tmu1_platform_data __initdata = {
95 &sh_tmu##idx##_platform_data, \ 95 &sh_tmu##idx##_platform_data, \
96 sizeof(sh_tmu##idx##_platform_data)) 96 sizeof(sh_tmu##idx##_platform_data))
97 97
98/* USB PHY */
99static struct resource usb_phy_resources[] __initdata = {
100 DEFINE_RES_MEM(0xffe70800, 0x100),
101 DEFINE_RES_MEM(0xffe76000, 0x100),
102};
103
104void __init r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
105{
106 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
107 usb_phy_resources,
108 ARRAY_SIZE(usb_phy_resources),
109 pdata, sizeof(*pdata));
110}
111
112/* USB */ 98/* USB */
113static struct usb_phy *phy; 99static struct usb_phy *phy;
114 100
@@ -248,30 +234,6 @@ void __init r8a7778_pinmux_init(void)
248 r8a7778_register_gpio(4); 234 r8a7778_register_gpio(4);
249}; 235};
250 236
251/* SDHI */
252static struct resource sdhi_resources[] __initdata = {
253 /* SDHI0 */
254 DEFINE_RES_MEM(0xFFE4C000, 0x100),
255 DEFINE_RES_IRQ(gic_iid(0x77)),
256 /* SDHI1 */
257 DEFINE_RES_MEM(0xFFE4D000, 0x100),
258 DEFINE_RES_IRQ(gic_iid(0x78)),
259 /* SDHI2 */
260 DEFINE_RES_MEM(0xFFE4F000, 0x100),
261 DEFINE_RES_IRQ(gic_iid(0x76)),
262};
263
264void __init r8a7778_sdhi_init(int id,
265 struct sh_mobile_sdhi_info *info)
266{
267 BUG_ON(id < 0 || id > 2);
268
269 platform_device_register_resndata(
270 &platform_bus, "sh_mobile_sdhi", id,
271 sdhi_resources + (2 * id), 2,
272 info, sizeof(*info));
273}
274
275/* I2C */ 237/* I2C */
276static struct resource i2c_resources[] __initdata = { 238static struct resource i2c_resources[] __initdata = {
277 /* I2C0 */ 239 /* I2C0 */
@@ -288,7 +250,7 @@ static struct resource i2c_resources[] __initdata = {
288 DEFINE_RES_IRQ(gic_iid(0x6d)), 250 DEFINE_RES_IRQ(gic_iid(0x6d)),
289}; 251};
290 252
291void __init r8a7778_add_i2c_device(int id) 253static void __init r8a7778_register_i2c(int id)
292{ 254{
293 BUG_ON(id < 0 || id > 3); 255 BUG_ON(id < 0 || id > 3);
294 256
@@ -310,7 +272,7 @@ static struct resource hspi_resources[] __initdata = {
310 DEFINE_RES_IRQ(gic_iid(0x75)), 272 DEFINE_RES_IRQ(gic_iid(0x75)),
311}; 273};
312 274
313void __init r8a7778_add_hspi_device(int id) 275void __init r8a7778_register_hspi(int id)
314{ 276{
315 BUG_ON(id < 0 || id > 2); 277 BUG_ON(id < 0 || id > 2);
316 278
@@ -319,21 +281,7 @@ void __init r8a7778_add_hspi_device(int id)
319 hspi_resources + (2 * id), 2); 281 hspi_resources + (2 * id), 2);
320} 282}
321 283
322/* MMC */ 284void __init r8a7778_add_dt_devices(void)
323static struct resource mmc_resources[] __initdata = {
324 DEFINE_RES_MEM(0xffe4e000, 0x100),
325 DEFINE_RES_IRQ(gic_iid(0x5d)),
326};
327
328void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
329{
330 platform_device_register_resndata(
331 &platform_bus, "sh_mmcif", -1,
332 mmc_resources, ARRAY_SIZE(mmc_resources),
333 info, sizeof(*info));
334}
335
336void __init r8a7778_add_standard_devices(void)
337{ 285{
338 int i; 286 int i;
339 287
@@ -357,6 +305,18 @@ void __init r8a7778_add_standard_devices(void)
357 r8a7778_register_tmu(1); 305 r8a7778_register_tmu(1);
358} 306}
359 307
308void __init r8a7778_add_standard_devices(void)
309{
310 r8a7778_add_dt_devices();
311 r8a7778_register_i2c(0);
312 r8a7778_register_i2c(1);
313 r8a7778_register_i2c(2);
314 r8a7778_register_i2c(3);
315 r8a7778_register_hspi(0);
316 r8a7778_register_hspi(1);
317 r8a7778_register_hspi(2);
318}
319
360void __init r8a7778_init_late(void) 320void __init r8a7778_init_late(void)
361{ 321{
362 phy = usb_get_phy(USB_PHY_TYPE_USB2); 322 phy = usb_get_phy(USB_PHY_TYPE_USB2);
@@ -446,7 +406,6 @@ static const char *r8a7778_compat_dt[] __initdata = {
446DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)") 406DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
447 .init_early = r8a7778_init_delay, 407 .init_early = r8a7778_init_delay,
448 .init_irq = r8a7778_init_irq_dt, 408 .init_irq = r8a7778_init_irq_dt,
449 .init_time = shmobile_timer_init,
450 .dt_compat = r8a7778_compat_dt, 409 .dt_compat = r8a7778_compat_dt,
451 .init_late = r8a7778_init_late, 410 .init_late = r8a7778_init_late,
452MACHINE_END 411MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index ddee4aa8e669..6a9933395434 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -22,8 +22,11 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/irqchip.h>
26#include <linux/irqchip/arm-gic.h>
25#include <linux/of_platform.h> 27#include <linux/of_platform.h>
26#include <linux/platform_data/gpio-rcar.h> 28#include <linux/platform_data/gpio-rcar.h>
29#include <linux/platform_data/irq-renesas-intc-irqpin.h>
27#include <linux/platform_device.h> 30#include <linux/platform_device.h>
28#include <linux/delay.h> 31#include <linux/delay.h>
29#include <linux/input.h> 32#include <linux/input.h>
@@ -67,6 +70,60 @@ void __init r8a7779_map_io(void)
67 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc)); 70 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
68} 71}
69 72
73/* IRQ */
74#define INT2SMSKCR0 IOMEM(0xfe7822a0)
75#define INT2SMSKCR1 IOMEM(0xfe7822a4)
76#define INT2SMSKCR2 IOMEM(0xfe7822a8)
77#define INT2SMSKCR3 IOMEM(0xfe7822ac)
78#define INT2SMSKCR4 IOMEM(0xfe7822b0)
79
80#define INT2NTSR0 IOMEM(0xfe700060)
81#define INT2NTSR1 IOMEM(0xfe700064)
82
83static struct renesas_intc_irqpin_config irqpin0_platform_data __initdata = {
84 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
85 .sense_bitfield_width = 2,
86};
87
88static struct resource irqpin0_resources[] __initdata = {
89 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
90 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
91 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
92 DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
93 DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
94 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
95 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
96 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
97 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
98};
99
100void __init r8a7779_init_irq_extpin(int irlm)
101{
102 void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
103 u32 tmp;
104
105 if (!icr0) {
106 pr_warn("r8a7779: unable to setup external irq pin mode\n");
107 return;
108 }
109
110 tmp = ioread32(icr0);
111 if (irlm)
112 tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
113 else
114 tmp &= ~(1 << 23); /* IRL mode - not supported */
115 tmp |= (1 << 21); /* LVLMODE = 1 */
116 iowrite32(tmp, icr0);
117 iounmap(icr0);
118
119 if (irlm)
120 platform_device_register_resndata(
121 &platform_bus, "renesas_intc_irqpin", -1,
122 irqpin0_resources, ARRAY_SIZE(irqpin0_resources),
123 &irqpin0_platform_data, sizeof(irqpin0_platform_data));
124}
125
126/* PFC/GPIO */
70static struct resource r8a7779_pfc_resources[] = { 127static struct resource r8a7779_pfc_resources[] = {
71 DEFINE_RES_MEM(0xfffc0000, 0x023c), 128 DEFINE_RES_MEM(0xfffc0000, 0x023c),
72}; 129};
@@ -537,7 +594,7 @@ static struct platform_device ohci1_device = {
537}; 594};
538 595
539/* Ether */ 596/* Ether */
540static struct resource ether_resources[] = { 597static struct resource ether_resources[] __initdata = {
541 { 598 {
542 .start = 0xfde00000, 599 .start = 0xfde00000,
543 .end = 0xfde003ff, 600 .end = 0xfde003ff,
@@ -641,6 +698,29 @@ void __init r8a7779_init_late(void)
641} 698}
642 699
643#ifdef CONFIG_USE_OF 700#ifdef CONFIG_USE_OF
701static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
702{
703 return 0; /* always allow wakeup */
704}
705
706void __init r8a7779_init_irq_dt(void)
707{
708 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
709
710 irqchip_init();
711
712 /* route all interrupts to ARM */
713 __raw_writel(0xffffffff, INT2NTSR0);
714 __raw_writel(0x3fffffff, INT2NTSR1);
715
716 /* unmask all known interrupts in INTCS2 */
717 __raw_writel(0xfffffff0, INT2SMSKCR0);
718 __raw_writel(0xfff7ffff, INT2SMSKCR1);
719 __raw_writel(0xfffbffdf, INT2SMSKCR2);
720 __raw_writel(0xbffffffc, INT2SMSKCR3);
721 __raw_writel(0x003fee3f, INT2SMSKCR4);
722}
723
644void __init r8a7779_init_delay(void) 724void __init r8a7779_init_delay(void)
645{ 725{
646 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ 726 shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
@@ -667,7 +747,6 @@ DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
667 .nr_irqs = NR_IRQS_LEGACY, 747 .nr_irqs = NR_IRQS_LEGACY,
668 .init_irq = r8a7779_init_irq_dt, 748 .init_irq = r8a7779_init_irq_dt,
669 .init_machine = r8a7779_add_standard_devices_dt, 749 .init_machine = r8a7779_add_standard_devices_dt,
670 .init_time = shmobile_timer_init,
671 .init_late = r8a7779_init_late, 750 .init_late = r8a7779_init_late,
672 .dt_compat = r8a7779_compat_dt, 751 .dt_compat = r8a7779_compat_dt,
673MACHINE_END 752MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 4c96dad21195..d0f5c9f9349a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clocksource.h>
21#include <linux/irq.h> 22#include <linux/irq.h>
22#include <linux/kernel.h> 23#include <linux/kernel.h>
23#include <linux/of_platform.h> 24#include <linux/of_platform.h>
@@ -160,13 +161,13 @@ static struct resource thermal_resources[] __initdata = {
160 thermal_resources, \ 161 thermal_resources, \
161 ARRAY_SIZE(thermal_resources)) 162 ARRAY_SIZE(thermal_resources))
162 163
163static struct sh_timer_config cmt00_platform_data = { 164static struct sh_timer_config cmt00_platform_data __initdata = {
164 .name = "CMT00", 165 .name = "CMT00",
165 .timer_bit = 0, 166 .timer_bit = 0,
166 .clockevent_rating = 80, 167 .clockevent_rating = 80,
167}; 168};
168 169
169static struct resource cmt00_resources[] = { 170static struct resource cmt00_resources[] __initdata = {
170 DEFINE_RES_MEM(0xffca0510, 0x0c), 171 DEFINE_RES_MEM(0xffca0510, 0x0c),
171 DEFINE_RES_MEM(0xffca0500, 0x04), 172 DEFINE_RES_MEM(0xffca0500, 0x04),
172 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ 173 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
@@ -179,7 +180,7 @@ static struct resource cmt00_resources[] = {
179 &cmt##idx##_platform_data, \ 180 &cmt##idx##_platform_data, \
180 sizeof(struct sh_timer_config)) 181 sizeof(struct sh_timer_config))
181 182
182void __init r8a7790_add_standard_devices(void) 183void __init r8a7790_add_dt_devices(void)
183{ 184{
184 r8a7790_register_scif(SCIFA0); 185 r8a7790_register_scif(SCIFA0);
185 r8a7790_register_scif(SCIFA1); 186 r8a7790_register_scif(SCIFA1);
@@ -191,9 +192,14 @@ void __init r8a7790_add_standard_devices(void)
191 r8a7790_register_scif(SCIF1); 192 r8a7790_register_scif(SCIF1);
192 r8a7790_register_scif(HSCIF0); 193 r8a7790_register_scif(HSCIF0);
193 r8a7790_register_scif(HSCIF1); 194 r8a7790_register_scif(HSCIF1);
195 r8a7790_register_cmt(00);
196}
197
198void __init r8a7790_add_standard_devices(void)
199{
200 r8a7790_add_dt_devices();
194 r8a7790_register_irqc(0); 201 r8a7790_register_irqc(0);
195 r8a7790_register_thermal(); 202 r8a7790_register_thermal();
196 r8a7790_register_cmt(00);
197} 203}
198 204
199#define MODEMR 0xe6160060 205#define MODEMR 0xe6160060
@@ -258,7 +264,7 @@ void __init r8a7790_timer_init(void)
258 iounmap(base); 264 iounmap(base);
259#endif /* CONFIG_ARM_ARCH_TIMER */ 265#endif /* CONFIG_ARM_ARCH_TIMER */
260 266
261 shmobile_timer_init(); 267 clocksource_of_init();
262} 268}
263 269
264void __init r8a7790_init_delay(void) 270void __init r8a7790_init_delay(void)
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 9bdf810f2a87..42170af64cc0 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -99,6 +99,9 @@ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
99 99
100static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) 100static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
101{ 101{
102
103 /* setup r8a7779 specific SCU base */
104 shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
102 scu_enable(shmobile_scu_base); 105 scu_enable(shmobile_scu_base);
103 106
104 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ 107 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */
@@ -117,14 +120,6 @@ static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
117 r8a7779_platform_cpu_kill(3); 120 r8a7779_platform_cpu_kill(3);
118} 121}
119 122
120static void __init r8a7779_smp_init_cpus(void)
121{
122 /* setup r8a7779 specific SCU base */
123 shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
124
125 shmobile_smp_init_cpus(scu_get_core_count(shmobile_scu_base));
126}
127
128#ifdef CONFIG_HOTPLUG_CPU 123#ifdef CONFIG_HOTPLUG_CPU
129static int r8a7779_scu_psr_core_disabled(int cpu) 124static int r8a7779_scu_psr_core_disabled(int cpu)
130{ 125{
@@ -175,7 +170,6 @@ static int r8a7779_cpu_disable(unsigned int cpu)
175#endif /* CONFIG_HOTPLUG_CPU */ 170#endif /* CONFIG_HOTPLUG_CPU */
176 171
177struct smp_operations r8a7779_smp_ops __initdata = { 172struct smp_operations r8a7779_smp_ops __initdata = {
178 .smp_init_cpus = r8a7779_smp_init_cpus,
179 .smp_prepare_cpus = r8a7779_smp_prepare_cpus, 173 .smp_prepare_cpus = r8a7779_smp_prepare_cpus,
180 .smp_boot_secondary = r8a7779_boot_secondary, 174 .smp_boot_secondary = r8a7779_boot_secondary,
181#ifdef CONFIG_HOTPLUG_CPU 175#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index d5fc3ed4e315..d2b89f7e5daf 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -62,6 +62,8 @@ static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
62 62
63static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) 63static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
64{ 64{
65 /* setup sh73a0 specific SCU base */
66 shmobile_scu_base = IOMEM(SH73A0_SCU_BASE);
65 scu_enable(shmobile_scu_base); 67 scu_enable(shmobile_scu_base);
66 68
67 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ 69 /* Map the reset vector (in headsmp-scu.S, headsmp.S) */
@@ -74,14 +76,6 @@ static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
74 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); 76 scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
75} 77}
76 78
77static void __init sh73a0_smp_init_cpus(void)
78{
79 /* setup sh73a0 specific SCU base */
80 shmobile_scu_base = IOMEM(SH73A0_SCU_BASE);
81
82 shmobile_smp_init_cpus(scu_get_core_count(shmobile_scu_base));
83}
84
85#ifdef CONFIG_HOTPLUG_CPU 79#ifdef CONFIG_HOTPLUG_CPU
86static int sh73a0_cpu_kill(unsigned int cpu) 80static int sh73a0_cpu_kill(unsigned int cpu)
87{ 81{
@@ -120,7 +114,6 @@ static int sh73a0_cpu_disable(unsigned int cpu)
120#endif /* CONFIG_HOTPLUG_CPU */ 114#endif /* CONFIG_HOTPLUG_CPU */
121 115
122struct smp_operations sh73a0_smp_ops __initdata = { 116struct smp_operations sh73a0_smp_ops __initdata = {
123 .smp_init_cpus = sh73a0_smp_init_cpus,
124 .smp_prepare_cpus = sh73a0_smp_prepare_cpus, 117 .smp_prepare_cpus = sh73a0_smp_prepare_cpus,
125 .smp_boot_secondary = sh73a0_boot_secondary, 118 .smp_boot_secondary = sh73a0_boot_secondary,
126#ifdef CONFIG_HOTPLUG_CPU 119#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index f321dbeb2379..62d7052d6f21 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -59,7 +59,3 @@ void __init shmobile_earlytimer_init(void)
59 late_time_init = shmobile_late_time_init; 59 late_time_init = shmobile_late_time_init;
60} 60}
61 61
62void __init shmobile_timer_init(void)
63{
64 clocksource_of_init();
65}