[ARM] Kirkwood: Add the watchdog timer as a platform device.
authorThomas Reitmayr <treitmayr@devbase.at>
Mon, 1 Jun 2009 11:38:34 +0000 (13:38 +0200)
committerNicolas Pitre <nico@cam.org>
Mon, 8 Jun 2009 17:04:59 +0000 (13:04 -0400)
The Kirkwood architecture uses the same watchdog device as the Orion
architecture. This patch adds orion5x_wdt as a platform device for
Kirkwood.

Signed-off-by: Thomas Reitmayr <treitmayr@devbase.at>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/include/mach/bridge-regs.h
drivers/watchdog/Kconfig

index d127731f47dc68aafc77edf64c763abebcb09e5f..a053184bdee5d9123ae00f3c093ba24f75169523 100644 (file)
@@ -30,6 +30,7 @@
 #include <plat/mvsdio.h>
 #include <plat/mv_xor.h>
 #include <plat/orion_nand.h>
+#include <plat/orion5x_wdt.h>
 #include <plat/time.h>
 #include "common.h"
 
@@ -767,6 +768,29 @@ static void __init kirkwood_xor1_init(void)
 }
 
 
+/*****************************************************************************
+ * Watchdog
+ ****************************************************************************/
+static struct orion5x_wdt_platform_data kirkwood_wdt_data = {
+       .tclk           = 0,
+};
+
+static struct platform_device kirkwood_wdt_device = {
+       .name           = "orion5x_wdt",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &kirkwood_wdt_data,
+       },
+       .num_resources  = 0,
+};
+
+static void __init kirkwood_wdt_init(void)
+{
+       kirkwood_wdt_data.tclk = kirkwood_tclk;
+       platform_device_register(&kirkwood_wdt_device);
+}
+
+
 /*****************************************************************************
  * Time handling
  ****************************************************************************/
@@ -859,6 +883,7 @@ void __init kirkwood_init(void)
 
        /* internal devices that every board has */
        kirkwood_rtc_init();
+       kirkwood_wdt_init();
        kirkwood_xor0_init();
        kirkwood_xor1_init();
 }
index 00d96abb718c7af9177c5b0ab0824efe625213e2..9e80d9232c831e315783509b71a837de115b92b9 100644 (file)
 #define CPU_RESET              0x00000002
 
 #define RSTOUTn_MASK           (BRIDGE_VIRT_BASE | 0x0108)
+#define WDT_RESET_OUT_EN       0x00000002
 #define SOFT_RESET_OUT_EN      0x00000004
 
 #define SYSTEM_SOFT_RESET      (BRIDGE_VIRT_BASE | 0x010c)
 #define SOFT_RESET             0x00000001
 
 #define BRIDGE_CAUSE           (BRIDGE_VIRT_BASE | 0x0110)
+#define WDT_INT_REQ            0x0008
+
 #define BRIDGE_MASK            (BRIDGE_VIRT_BASE | 0x0114)
 #define BRIDGE_INT_TIMER0      0x0002
 #define BRIDGE_INT_TIMER1      0x0004
index 5eb8f21da82e28e2efabf46673e185295a3328c1..1e983b1717d362a138a8888998df988584739fdb 100644 (file)
@@ -233,10 +233,10 @@ config DAVINCI_WATCHDOG
 
 config ORION5X_WATCHDOG
        tristate "Orion5x watchdog"
-       depends on ARCH_ORION5X
+       depends on ARCH_ORION5X || ARCH_KIRKWOOD
        help
          Say Y here if to include support for the watchdog timer
-         in the Orion5x ARM SoCs.
+         in the Orion5x and Kirkwood ARM SoCs.
          To compile this driver as a module, choose M here: the
          module will be called orion5x_wdt.