diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-07-09 09:12:44 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-08-16 20:02:54 -0400 |
commit | 9dddfcfacaadb5491b62233b893b510fa00da4e0 (patch) | |
tree | dbb63fbe9f066baa3b7caa4d9b7c09999aa7f58a | |
parent | 9162d39ccb9400bfaed85630cf517c85861faa6f (diff) |
ARM: shmobile: genmai-reference: Enable MTU2 in device tree
No more device needs to be added from platform code when booting the
reference platform, move MTU2 registration from setup-r7s72100.c to
board-genmai.c and remove the now empty r7s72100_add_dt_devices()
function.
As the genmai_add_standard_devices() function is now identical to the
default init_machine implementation, remove it as well.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/boot/dts/r7s72100-genmai.dts | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-genmai-reference.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-genmai.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/r7s72100.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r7s72100.c | 21 |
5 files changed, 17 insertions, 43 deletions
diff --git a/arch/arm/boot/dts/r7s72100-genmai.dts b/arch/arm/boot/dts/r7s72100-genmai.dts index 20705467f4c9..a3ed23c0a8f5 100644 --- a/arch/arm/boot/dts/r7s72100-genmai.dts +++ b/arch/arm/boot/dts/r7s72100-genmai.dts | |||
@@ -43,6 +43,10 @@ | |||
43 | clock-frequency = <48000000>; | 43 | clock-frequency = <48000000>; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | &mtu2 { | ||
47 | status = "ok"; | ||
48 | }; | ||
49 | |||
46 | &i2c2 { | 50 | &i2c2 { |
47 | status = "okay"; | 51 | status = "okay"; |
48 | clock-frequency = <400000>; | 52 | clock-frequency = <400000>; |
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 | */ | ||
35 | static const struct clk_name clk_names[] = { | ||
36 | { "mtu2", "fck", "sh-mtu2" }, | ||
37 | }; | ||
38 | |||
39 | static 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 | ||
46 | static const char * const genmai_boards_compat_dt[] __initconst = { | 27 | static 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 | ||
51 | DT_MACHINE_START(GENMAI_DT, "genmai") | 32 | DT_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, |
55 | MACHINE_END | 35 | MACHINE_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 | ||
129 | static 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 | |||
128 | static void __init genmai_add_standard_devices(void) | 140 | static 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(ðer_info); | 145 | platform_device_register_full(ðer_info); |
134 | 146 | ||
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 | ||
4 | void r7s72100_add_dt_devices(void); | ||
5 | void r7s72100_clock_init(void); | 4 | void r7s72100_clock_init(void); |
6 | 5 | ||
7 | #endif /* __ASM_R7S72100_H__ */ | 6 | #endif /* __ASM_R7S72100_H__ */ |
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index f3b3b14ba972..d898cef24611 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 | |||
32 | static 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 | |||
43 | void __init r7s72100_add_dt_devices(void) | ||
44 | { | ||
45 | r7s72100_register_mtu2(); | ||
46 | } | ||
47 | 26 | ||
48 | #ifdef CONFIG_USE_OF | 27 | #ifdef CONFIG_USE_OF |
49 | static const char *r7s72100_boards_compat_dt[] __initdata = { | 28 | static const char *r7s72100_boards_compat_dt[] __initdata = { |