Skip to contentSkip to conversation

powerpc: Add support for 8xx style watchdog

RFC/PATCH Jochen Friedrich 1 participant 1 message Nov 11, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

this is an attempt to port the 8xx watchdog driver to ARC=powerpc. As the watchdog seems to be similar on pq1 / pq2 and pq2pro platforms (except from the divider value), one driver should be enough to support the whole family. Am i correct with this assumption?

Thanks,
Jochen
---

arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 +
arch/powerpc/sysdev/Makefile                 |    3 +
arch/powerpc/sysdev/pq_wdt.c                 |  195 ++++++++++++++++++++++
arch/powerpc/sysdev/pq_wdt.h                 |   27 +++
drivers/watchdog/Kconfig                     |   13 ++-
drivers/watchdog/Makefile                    |    1 +
drivers/watchdog/pq_wdt.c                    |  222 ++++++++++++++++++++++++++
7 files changed, 465 insertions(+), 1 deletions(-)

create mode 100644 arch/powerpc/sysdev/pq_wdt.c
create mode 100644 arch/powerpc/sysdev/pq_wdt.h
create mode 100644 drivers/watchdog/pq_wdt.c

arch/powerpc/platforms/8xx/mpc885ads_setup.c +0 -0
index 2cf1b6a..a686747 100644
@@ -41,6 +41,7 @@

#include <asm/udbg.h>

#include <sysdev/commproc.h>
+#include <sysdev/pq_wdt.h>

static u32 __iomem *bcsr, *bcsr5;

@@ -246,6 +247,10 @@ static void __init mpc885ads_setup_arch(void)

	m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup;
	m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage;

#endif
+
+#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE)
+ pq_wdt_init();
+#endif
}

static int __init mpc885ads_probe(void)

arch/powerpc/sysdev/Makefile +0 -0
index 99a77d7..84f190e 100644
@@ -35,5 +35,8 @@ obj-$(CONFIG_CPM)		+= cpm_common.o

obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
obj-$(CONFIG_PPC_DCR) += dcr.o
obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o
+ifneq ($(CONFIG_PQ_WDT),)
+obj-y += pq_wdt.o
+endif
obj-$(CONFIG_UCODE_PATCH) += micropatch.o
endif

arch/powerpc/sysdev/pq_wdt.c new file +195 -0

195 lines not on this page · raw message

arch/powerpc/sysdev/pq_wdt.h new file +27 -0
new file mode 100644
index 0000000..6f9e085
@@ -0,0 +1,27 @@
+/*
+ * Author: Florian Schirmer <[email protected]>
+ *
+ * 2002 (c) Florian Schirmer <[email protected]> This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ * 2007 (c) Jochen Friedrich <[email protected]> ported to ARCH=powerpc and
+ * extended to be useful on any Power QUICC 1/2/2pro which have the same
+ * style of watchdog.
+ */
+#ifndef _POWERPC_SYSDEV_PQ_WDT_H
+#define _POWERPC_SYSDEV_PQ_WDT_H
+
+#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
+#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
+#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
+
+extern int pq_wdt_get_timeout(void);
+extern void pq_wdt_reset(void);
+extern void pq_wdt_install_timer(void);
+extern void pq_wdt_stop_timer(void);
+extern int pq_wdt_setup(int);
+extern int pq_wdt_init(void);
+
+#endif				/* _POWERPC_SYSDEV_PQ_WDT_H */
drivers/watchdog/Kconfig +0 -0
index 2792bc1..79ee351 100644
@@ -626,7 +626,18 @@ config MPC5200_WDT
 

config 8xx_WDT
tristate "MPC8xx Watchdog Timer"
- depends on 8xx
+ depends on 8xx && ! OF
+
+config PQ_WDT
+ tristate "Power QUICC Watchdog Timer"
+ depends on (8xx || PPC_82xx || PPC_83xx) && OF
+ default y
+ help

+	  Watchdog driver for Power QUICC 1/2/2pro style watchdog drivers.
+	  You should really select this unless your boot loader turns
+	  off the watchdog. As the watchdog is turned on by default and
+	  can be turned on/off only once after reboot, your board won't
+	  run otherwise. Say 'M' if unsure.

config 83xx_WDT
tristate "MPC83xx Watchdog Timer"

drivers/watchdog/Makefile +0 -0
index 7d9e573..bdcf3f3 100644
@@ -96,6 +96,7 @@ obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
 

# POWERPC Architecture
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_PQ_WDT) += pq_wdt.o
obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o

drivers/watchdog/pq_wdt.c new file +222 -0

222 lines not on this page · raw message

Signature · 1 line
1.5.3.5