ARM: shmobile: genmai-reference: Enable MTU2 in device tree
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 9 Jul 2014 13:12:44 +0000 (15:12 +0200)
committerSimon Horman <horms+renesas@verge.net.au>
Sun, 17 Aug 2014 00:02:54 +0000 (09:02 +0900)
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>
arch/arm/boot/dts/r7s72100-genmai.dts
arch/arm/mach-shmobile/board-genmai-reference.c
arch/arm/mach-shmobile/board-genmai.c
arch/arm/mach-shmobile/r7s72100.h
arch/arm/mach-shmobile/setup-r7s72100.c

index 20705467f4c9a0e63f85cdc465aeaf151e3592d0..a3ed23c0a8f58abd3e2d035042dceb658b528bee 100644 (file)
        clock-frequency = <48000000>;
 };
 
+&mtu2 {
+       status = "ok";
+};
+
 &i2c2 {
        status = "okay";
        clock-frequency = <400000>;
index e5448f7b868ad7bb5bed67fbd743a14a2d422548..bc52677986c3c0ebb21de4dbc401065d3ddcfdcf 100644 (file)
  */
 
 #include <linux/kernel.h>
-#include <linux/of_platform.h>
 
-#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include "clock.h"
 #include "common.h"
-#include "r7s72100.h"
-
-/*
- * This is a really crude hack to provide clkdev support to platform
- * devices until they get moved to DT.
- */
-static const struct clk_name clk_names[] = {
-       { "mtu2", "fck", "sh-mtu2" },
-};
-
-static void __init genmai_add_standard_devices(void)
-{
-       shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), true);
-       r7s72100_add_dt_devices();
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
 
 static const char * const genmai_boards_compat_dt[] __initconst = {
        "renesas,genmai",
@@ -50,6 +31,5 @@ static const char * const genmai_boards_compat_dt[] __initconst = {
 
 DT_MACHINE_START(GENMAI_DT, "genmai")
        .init_early     = shmobile_init_delay,
-       .init_machine   = genmai_add_standard_devices,
        .dt_compat      = genmai_boards_compat_dt,
 MACHINE_END
index 7bf2d805753562e9968362184575053c4b31af6e..ba545fc09649a548684a4a08cc91eb568bd6fa4a 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/serial_sci.h>
 #include <linux/sh_eth.h>
+#include <linux/sh_timer.h>
 #include <linux/spi/rspi.h>
 #include <linux/spi/spi.h>
 
@@ -125,10 +126,21 @@ R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
                                          &scif##index##_platform_data,        \
                                          sizeof(scif##index##_platform_data))
 
+static struct resource mtu2_resources[] __initdata = {
+       DEFINE_RES_MEM(0xfcff0000, 0x400),
+       DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
+};
+
+#define r7s72100_register_mtu2()                                       \
+       platform_device_register_resndata(&platform_bus, "sh-mtu2",     \
+                                         -1, mtu2_resources,           \
+                                         ARRAY_SIZE(mtu2_resources),   \
+                                         NULL, 0)
+
 static void __init genmai_add_standard_devices(void)
 {
        r7s72100_clock_init();
-       r7s72100_add_dt_devices();
+       r7s72100_register_mtu2();
 
        platform_device_register_full(&ether_info);
 
index efb723c88dd0a848f166a2e89bc5a930b9533a8e..321ae4e1012867cecb8e2118c99073e803d4e523 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __ASM_R7S72100_H__
 #define __ASM_R7S72100_H__
 
-void r7s72100_add_dt_devices(void);
 void r7s72100_clock_init(void);
 
 #endif /* __ASM_R7S72100_H__ */
index f3b3b14ba9726ffe7a0a45cc4c0c6208a318878a..d898cef2461108ff92577b25e0a18a26315aefd3 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/irq.h>
 #include <linux/kernel.h>
-#include <linux/of_platform.h>
-#include <linux/sh_timer.h>
 
 #include <asm/mach/arch.h>
 
 #include "common.h"
-#include "irqs.h"
-#include "r7s72100.h"
-
-static struct resource mtu2_resources[] __initdata = {
-       DEFINE_RES_MEM(0xfcff0000, 0x400),
-       DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
-};
-
-#define r7s72100_register_mtu2()                                       \
-       platform_device_register_resndata(NULL, "sh-mtu2",              \
-                                         -1, mtu2_resources,           \
-                                         ARRAY_SIZE(mtu2_resources),   \
-                                         NULL, 0)
-
-void __init r7s72100_add_dt_devices(void)
-{
-       r7s72100_register_mtu2();
-}
 
 #ifdef CONFIG_USE_OF
 static const char *r7s72100_boards_compat_dt[] __initdata = {