ARM: orion: move watchdog setup to mach-orion5x
authorArnd Bergmann <arnd@arndb.de>
Wed, 2 Dec 2015 21:27:03 +0000 (22:27 +0100)
committerGregory CLEMENT <gregory.clement@free-electrons.com>
Mon, 7 Dec 2015 17:09:32 +0000 (18:09 +0100)
The watchdog device node is created in plat-orion/common.c
but depends on the bridge address that is platform specific,
so as a preparation for orion multiplatform support, we
move it out of the common code into orion5x and dove.

At the moment, dove does not use the watchdog, so I'm marking
the function as __maybe_unused for the moment. The compiler
will be able to compile out the device definition this way,
and we can easily add it later.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
arch/arm/mach-dove/common.c
arch/arm/mach-orion5x/common.c
arch/arm/plat-orion/common.c
arch/arm/plat-orion/include/plat/common.h

index 0d1a89298ece95518c43e07c2c32aa0b15147c69..25a682fd444f783692a9eeb9dc52f2905fa978b7 100644 (file)
@@ -375,6 +375,23 @@ void __init dove_setup_cpu_wins(void)
                                    DOVE_SCRATCHPAD_SIZE);
 }
 
+static struct resource orion_wdt_resource[] = {
+               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
+               DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
+};
+
+static struct platform_device orion_wdt_device = {
+       .name           = "orion_wdt",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(orion_wdt_resource),
+       .resource       = orion_wdt_resource,
+};
+
+static void __init __maybe_unused orion_wdt_init(void)
+{
+       platform_device_register(&orion_wdt_device);
+}
+
 void __init dove_init(void)
 {
        pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
index 6bbb7b55c6d12f8ebfce7825d821463c7a445ea6..2b7889e3b7bc4b283c8e993e0c5fc78b7db83cac 100644 (file)
@@ -184,9 +184,21 @@ static void __init orion5x_crypto_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
+static struct resource orion_wdt_resource[] = {
+               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
+               DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
+};
+
+static struct platform_device orion_wdt_device = {
+       .name           = "orion_wdt",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(orion_wdt_resource),
+       .resource       = orion_wdt_resource,
+};
+
 static void __init orion5x_wdt_init(void)
 {
-       orion_wdt_init();
+       platform_device_register(&orion_wdt_device);
 }
 
 
index 8861c367d06114651920b05420e53ebde3099712..78c8bf4043c06d1f3c8ad0d6e198224cfb777c57 100644 (file)
@@ -21,7 +21,6 @@
 #include <net/dsa.h>
 #include <linux/platform_data/dma-mv_xor.h>
 #include <linux/platform_data/usb-ehci-orion.h>
-#include <mach/bridge-regs.h>
 #include <plat/common.h>
 
 /* Create a clkdev entry for a given device/clk */
@@ -588,26 +587,6 @@ void __init orion_spi_1_init(unsigned long mapbase)
        platform_device_register(&orion_spi_1);
 }
 
-/*****************************************************************************
- * Watchdog
- ****************************************************************************/
-static struct resource orion_wdt_resource[] = {
-               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
-               DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
-};
-
-static struct platform_device orion_wdt_device = {
-       .name           = "orion_wdt",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(orion_wdt_resource),
-       .resource       = orion_wdt_resource,
-};
-
-void __init orion_wdt_init(void)
-{
-       platform_device_register(&orion_wdt_device);
-}
-
 /*****************************************************************************
  * XOR
  ****************************************************************************/
index d9a24f605a2b786dce8a85744c662f310f7d80a8..9e6d76ad48a9d16bc9a80bab7b06172d2ff14509 100644 (file)
@@ -75,8 +75,6 @@ void __init orion_spi_init(unsigned long mapbase);
 
 void __init orion_spi_1_init(unsigned long mapbase);
 
-void __init orion_wdt_init(void);
-
 void __init orion_xor0_init(unsigned long mapbase_low,
                            unsigned long mapbase_high,
                            unsigned long irq_0,