summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-09-05 11:40:32 -0400
committerArnd Bergmann <arnd@arndb.de>2014-09-05 11:40:32 -0400
commit09d12ad7936df431ecbf0faf2b81c56cc4bb6392 (patch)
tree730eefd698dd59556f823952531fb675f1e40455 /arch/arm/mach-shmobile
parente0ace5fc33e2046e83b0ebbe03b7489eabd6cc03 (diff)
parent9dddfcfacaadb5491b62233b893b510fa00da4e0 (diff)
Merge tag 'renesas-dt-timers-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Merge "Renesas ARM Based SoC DT Timers Updates for v3.18" from Simon Horman: * Enable timers using DT when booting boards without Legacy-C code Signed-off-by: Arnd Bergmann <arnd@arndb.de> * tag 'renesas-dt-timers-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: genmai-reference: Enable MTU2 in device tree ARM: shmobile: r7s72100: Add MTU2 device to DT ARM: shmobile: marzen-reference: Enable TMU0 in device tree ARM: shmobile: koelsch-reference: Enable CMT0 in device tree ARM: shmobile: lager-reference: Enable CMT0 in device tree ARM: shmobile: r8a7779: Add TMU devices to DT ARM: shmobile: r8a7791: Add CMT devices to DT ARM: shmobile: r8a7790: Add CMT devices to DT Conflicts: arch/arm/mach-shmobile/setup-r8a7779.c
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-genmai-reference.c20
-rw-r--r--arch/arm/mach-shmobile/board-genmai.c14
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-marzen-reference.c10
-rw-r--r--arch/arm/mach-shmobile/r7s72100.h1
-rw-r--r--arch/arm/mach-shmobile/r8a7779.h1
-rw-r--r--arch/arm/mach-shmobile/r8a7790.h1
-rw-r--r--arch/arm/mach-shmobile/r8a7791.h1
-rw-r--r--arch/arm/mach-shmobile/setup-r7s72100.c21
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c17
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c7
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c7
13 files changed, 20 insertions, 84 deletions
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c
index e5448f7b868a..bc52677986c3 100644
--- a/arch/arm/mach-shmobile/board-genmai-reference.c
+++ b/arch/arm/mach-shmobile/board-genmai-reference.c
@@ -19,29 +19,10 @@
19 */ 19 */
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/of_platform.h>
23 22
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
26 24
27#include "clock.h"
28#include "common.h" 25#include "common.h"
29#include "r7s72100.h"
30
31/*
32 * This is a really crude hack to provide clkdev support to platform
33 * devices until they get moved to DT.
34 */
35static const struct clk_name clk_names[] = {
36 { "mtu2", "fck", "sh-mtu2" },
37};
38
39static void __init genmai_add_standard_devices(void)
40{
41 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), true);
42 r7s72100_add_dt_devices();
43 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
44}
45 26
46static const char * const genmai_boards_compat_dt[] __initconst = { 27static const char * const genmai_boards_compat_dt[] __initconst = {
47 "renesas,genmai", 28 "renesas,genmai",
@@ -50,6 +31,5 @@ static const char * const genmai_boards_compat_dt[] __initconst = {
50 31
51DT_MACHINE_START(GENMAI_DT, "genmai") 32DT_MACHINE_START(GENMAI_DT, "genmai")
52 .init_early = shmobile_init_delay, 33 .init_early = shmobile_init_delay,
53 .init_machine = genmai_add_standard_devices,
54 .dt_compat = genmai_boards_compat_dt, 34 .dt_compat = genmai_boards_compat_dt,
55MACHINE_END 35MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
index 7bf2d8057535..ba545fc09649 100644
--- a/arch/arm/mach-shmobile/board-genmai.c
+++ b/arch/arm/mach-shmobile/board-genmai.c
@@ -23,6 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/serial_sci.h> 24#include <linux/serial_sci.h>
25#include <linux/sh_eth.h> 25#include <linux/sh_eth.h>
26#include <linux/sh_timer.h>
26#include <linux/spi/rspi.h> 27#include <linux/spi/rspi.h>
27#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
28 29
@@ -125,10 +126,21 @@ R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
125 &scif##index##_platform_data, \ 126 &scif##index##_platform_data, \
126 sizeof(scif##index##_platform_data)) 127 sizeof(scif##index##_platform_data))
127 128
129static struct resource mtu2_resources[] __initdata = {
130 DEFINE_RES_MEM(0xfcff0000, 0x400),
131 DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
132};
133
134#define r7s72100_register_mtu2() \
135 platform_device_register_resndata(&platform_bus, "sh-mtu2", \
136 -1, mtu2_resources, \
137 ARRAY_SIZE(mtu2_resources), \
138 NULL, 0)
139
128static void __init genmai_add_standard_devices(void) 140static void __init genmai_add_standard_devices(void)
129{ 141{
130 r7s72100_clock_init(); 142 r7s72100_clock_init();
131 r7s72100_add_dt_devices(); 143 r7s72100_register_mtu2();
132 144
133 platform_device_register_full(&ether_info); 145 platform_device_register_full(&ether_info);
134 146
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 3ff88c138896..9db5e6774fb7 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -88,7 +88,6 @@ static void __init koelsch_add_du_device(void)
88 * devices until they get moved to DT. 88 * devices until they get moved to DT.
89 */ 89 */
90static const struct clk_name clk_names[] __initconst = { 90static const struct clk_name clk_names[] __initconst = {
91 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
92 { "du0", "du.0", "rcar-du-r8a7791" }, 91 { "du0", "du.0", "rcar-du-r8a7791" },
93 { "du1", "du.1", "rcar-du-r8a7791" }, 92 { "du1", "du.1", "rcar-du-r8a7791" },
94 { "lvds0", "lvds.0", "rcar-du-r8a7791" }, 93 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
@@ -97,7 +96,6 @@ static const struct clk_name clk_names[] __initconst = {
97static void __init koelsch_add_standard_devices(void) 96static void __init koelsch_add_standard_devices(void)
98{ 97{
99 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); 98 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
100 r8a7791_add_dt_devices();
101 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 99 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
102 100
103 koelsch_add_du_device(); 101 koelsch_add_du_device();
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 41c808e56005..2a05c02bec39 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -92,7 +92,6 @@ static void __init lager_add_du_device(void)
92 * devices until they get moved to DT. 92 * devices until they get moved to DT.
93 */ 93 */
94static const struct clk_name clk_names[] __initconst = { 94static const struct clk_name clk_names[] __initconst = {
95 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
96 { "du0", "du.0", "rcar-du-r8a7790" }, 95 { "du0", "du.0", "rcar-du-r8a7790" },
97 { "du1", "du.1", "rcar-du-r8a7790" }, 96 { "du1", "du.1", "rcar-du-r8a7790" },
98 { "du2", "du.2", "rcar-du-r8a7790" }, 97 { "du2", "du.2", "rcar-du-r8a7790" },
@@ -103,7 +102,6 @@ static const struct clk_name clk_names[] __initconst = {
103static void __init lager_add_standard_devices(void) 102static void __init lager_add_standard_devices(void)
104{ 103{
105 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); 104 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
106 r8a7790_add_dt_devices();
107 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 105 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
108 106
109 lager_add_du_device(); 107 lager_add_du_device();
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index c3dfa6c89a9e..38d9cdd26587 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -37,18 +37,8 @@ static void __init marzen_init_timer(void)
37 clocksource_of_init(); 37 clocksource_of_init();
38} 38}
39 39
40/*
41 * This is a really crude hack to provide clkdev support to platform
42 * devices until they get moved to DT.
43 */
44static const struct clk_name clk_names[] __initconst = {
45 { "tmu0", "fck", "sh-tmu.0" },
46};
47
48static void __init marzen_init(void) 40static void __init marzen_init(void)
49{ 41{
50 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
51 r8a7779_add_standard_devices_dt();
52 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 42 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
53 r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ 43 r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
54} 44}
diff --git a/arch/arm/mach-shmobile/r7s72100.h b/arch/arm/mach-shmobile/r7s72100.h
index efb723c88dd0..321ae4e10128 100644
--- a/arch/arm/mach-shmobile/r7s72100.h
+++ b/arch/arm/mach-shmobile/r7s72100.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_R7S72100_H__ 1#ifndef __ASM_R7S72100_H__
2#define __ASM_R7S72100_H__ 2#define __ASM_R7S72100_H__
3 3
4void r7s72100_add_dt_devices(void);
5void r7s72100_clock_init(void); 4void r7s72100_clock_init(void);
6 5
7#endif /* __ASM_R7S72100_H__ */ 6#endif /* __ASM_R7S72100_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7779.h b/arch/arm/mach-shmobile/r8a7779.h
index 5415c719dc19..19f97046dd70 100644
--- a/arch/arm/mach-shmobile/r8a7779.h
+++ b/arch/arm/mach-shmobile/r8a7779.h
@@ -17,7 +17,6 @@ extern void r8a7779_map_io(void);
17extern void r8a7779_earlytimer_init(void); 17extern void r8a7779_earlytimer_init(void);
18extern void r8a7779_add_early_devices(void); 18extern void r8a7779_add_early_devices(void);
19extern void r8a7779_add_standard_devices(void); 19extern void r8a7779_add_standard_devices(void);
20extern void r8a7779_add_standard_devices_dt(void);
21extern void r8a7779_init_late(void); 20extern void r8a7779_init_late(void);
22extern u32 r8a7779_read_mode_pins(void); 21extern u32 r8a7779_read_mode_pins(void);
23extern void r8a7779_clock_init(void); 22extern void r8a7779_clock_init(void);
diff --git a/arch/arm/mach-shmobile/r8a7790.h b/arch/arm/mach-shmobile/r8a7790.h
index 459827f1369b..388f0514d931 100644
--- a/arch/arm/mach-shmobile/r8a7790.h
+++ b/arch/arm/mach-shmobile/r8a7790.h
@@ -27,7 +27,6 @@ enum {
27}; 27};
28 28
29void r8a7790_add_standard_devices(void); 29void r8a7790_add_standard_devices(void);
30void r8a7790_add_dt_devices(void);
31void r8a7790_clock_init(void); 30void r8a7790_clock_init(void);
32void r8a7790_pinmux_init(void); 31void r8a7790_pinmux_init(void);
33void r8a7790_pm_init(void); 32void r8a7790_pm_init(void);
diff --git a/arch/arm/mach-shmobile/r8a7791.h b/arch/arm/mach-shmobile/r8a7791.h
index 86eae7bceb6f..c1bf7abefa5a 100644
--- a/arch/arm/mach-shmobile/r8a7791.h
+++ b/arch/arm/mach-shmobile/r8a7791.h
@@ -2,7 +2,6 @@
2#define __ASM_R8A7791_H__ 2#define __ASM_R8A7791_H__
3 3
4void r8a7791_add_standard_devices(void); 4void r8a7791_add_standard_devices(void);
5void r8a7791_add_dt_devices(void);
6void r8a7791_clock_init(void); 5void r8a7791_clock_init(void);
7void r8a7791_pinmux_init(void); 6void r8a7791_pinmux_init(void);
8void r8a7791_pm_init(void); 7void r8a7791_pm_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index 8cdc25d146a9..46a93f73ee4a 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -18,32 +18,11 @@
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/irq.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/of_platform.h>
24#include <linux/sh_timer.h>
25 22
26#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
27 24
28#include "common.h" 25#include "common.h"
29#include "irqs.h"
30#include "r7s72100.h"
31
32static struct resource mtu2_resources[] __initdata = {
33 DEFINE_RES_MEM(0xfcff0000, 0x400),
34 DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
35};
36
37#define r7s72100_register_mtu2() \
38 platform_device_register_resndata(NULL, "sh-mtu2", \
39 -1, mtu2_resources, \
40 ARRAY_SIZE(mtu2_resources), \
41 NULL, 0)
42
43void __init r7s72100_add_dt_devices(void)
44{
45 r7s72100_register_mtu2();
46}
47 26
48#ifdef CONFIG_USE_OF 27#ifdef CONFIG_USE_OF
49static const char *r7s72100_boards_compat_dt[] __initdata = { 28static const char *r7s72100_boards_compat_dt[] __initdata = {
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 6829cd19ea72..136078ab9407 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -641,7 +641,7 @@ static void __init r8a7779_register_hpb_dmae(void)
641 sizeof(dma_platform_data)); 641 sizeof(dma_platform_data));
642} 642}
643 643
644static struct platform_device *r8a7779_devices_dt[] __initdata = { 644static struct platform_device *r8a7779_early_devices[] __initdata = {
645 &tmu0_device, 645 &tmu0_device,
646}; 646};
647 647
@@ -669,8 +669,8 @@ void __init r8a7779_add_standard_devices(void)
669 669
670 r8a7779_init_pm_domains(); 670 r8a7779_init_pm_domains();
671 671
672 platform_add_devices(r8a7779_devices_dt, 672 platform_add_devices(r8a7779_early_devices,
673 ARRAY_SIZE(r8a7779_devices_dt)); 673 ARRAY_SIZE(r8a7779_early_devices));
674 platform_add_devices(r8a7779_standard_devices, 674 platform_add_devices(r8a7779_standard_devices,
675 ARRAY_SIZE(r8a7779_standard_devices)); 675 ARRAY_SIZE(r8a7779_standard_devices));
676 r8a7779_register_hpb_dmae(); 676 r8a7779_register_hpb_dmae();
@@ -678,8 +678,8 @@ void __init r8a7779_add_standard_devices(void)
678 678
679void __init r8a7779_add_early_devices(void) 679void __init r8a7779_add_early_devices(void)
680{ 680{
681 early_platform_add_devices(r8a7779_devices_dt, 681 early_platform_add_devices(r8a7779_early_devices,
682 ARRAY_SIZE(r8a7779_devices_dt)); 682 ARRAY_SIZE(r8a7779_early_devices));
683 683
684 /* Early serial console setup is not included here due to 684 /* Early serial console setup is not included here due to
685 * memory map collisions. The SCIF serial ports in r8a7779 685 * memory map collisions. The SCIF serial ports in r8a7779
@@ -739,12 +739,6 @@ void __init r8a7779_init_irq_dt(void)
739 __raw_writel(0x003fee3f, INT2SMSKCR4); 739 __raw_writel(0x003fee3f, INT2SMSKCR4);
740} 740}
741 741
742void __init r8a7779_add_standard_devices_dt(void)
743{
744 platform_add_devices(r8a7779_devices_dt,
745 ARRAY_SIZE(r8a7779_devices_dt));
746}
747
748#define MODEMR 0xffcc0020 742#define MODEMR 0xffcc0020
749 743
750u32 __init r8a7779_read_mode_pins(void) 744u32 __init r8a7779_read_mode_pins(void)
@@ -772,7 +766,6 @@ DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
772 .map_io = r8a7779_map_io, 766 .map_io = r8a7779_map_io,
773 .init_early = shmobile_init_delay, 767 .init_early = shmobile_init_delay,
774 .init_irq = r8a7779_init_irq_dt, 768 .init_irq = r8a7779_init_irq_dt,
775 .init_machine = r8a7779_add_standard_devices_dt,
776 .init_late = shmobile_init_late, 769 .init_late = shmobile_init_late,
777 .dt_compat = r8a7779_compat_dt, 770 .dt_compat = r8a7779_compat_dt,
778MACHINE_END 771MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 0c12b01bb9e3..877fdeb985d0 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -282,11 +282,6 @@ static struct resource cmt0_resources[] = {
282 &cmt##idx##_platform_data, \ 282 &cmt##idx##_platform_data, \
283 sizeof(struct sh_timer_config)) 283 sizeof(struct sh_timer_config))
284 284
285void __init r8a7790_add_dt_devices(void)
286{
287 r8a7790_register_cmt(0);
288}
289
290void __init r8a7790_add_standard_devices(void) 285void __init r8a7790_add_standard_devices(void)
291{ 286{
292 r8a7790_register_scif(0); 287 r8a7790_register_scif(0);
@@ -299,7 +294,7 @@ void __init r8a7790_add_standard_devices(void)
299 r8a7790_register_scif(7); 294 r8a7790_register_scif(7);
300 r8a7790_register_scif(8); 295 r8a7790_register_scif(8);
301 r8a7790_register_scif(9); 296 r8a7790_register_scif(9);
302 r8a7790_add_dt_devices(); 297 r8a7790_register_cmt(0);
303 r8a7790_register_irqc(0); 298 r8a7790_register_irqc(0);
304 r8a7790_register_thermal(); 299 r8a7790_register_thermal();
305 r8a7790_register_i2c(0); 300 r8a7790_register_i2c(0);
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index d47d8b16a43f..35d78639244f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -182,11 +182,6 @@ static const struct resource thermal_resources[] __initconst = {
182 thermal_resources, \ 182 thermal_resources, \
183 ARRAY_SIZE(thermal_resources)) 183 ARRAY_SIZE(thermal_resources))
184 184
185void __init r8a7791_add_dt_devices(void)
186{
187 r8a7791_register_cmt(0);
188}
189
190void __init r8a7791_add_standard_devices(void) 185void __init r8a7791_add_standard_devices(void)
191{ 186{
192 r8a7791_register_scif(0); 187 r8a7791_register_scif(0);
@@ -204,7 +199,7 @@ void __init r8a7791_add_standard_devices(void)
204 r8a7791_register_scif(12); 199 r8a7791_register_scif(12);
205 r8a7791_register_scif(13); 200 r8a7791_register_scif(13);
206 r8a7791_register_scif(14); 201 r8a7791_register_scif(14);
207 r8a7791_add_dt_devices(); 202 r8a7791_register_cmt(0);
208 r8a7791_register_irqc(0); 203 r8a7791_register_irqc(0);
209 r8a7791_register_thermal(); 204 r8a7791_register_thermal();
210} 205}