Skip to contentSkip to conversation

mpc5200: /dev/watchdog driver for GPT0

PATCH In review Domen Puncer 3 participants 5 messages Jun 12, 2007 – Oct 21, 2007 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc5200: /dev/watchdog driver for GPT0

Driver for internal mpc5200 watchdog on general purpose timer 0. For IPB clock of 132 MHz the maximum timeout is about 32 seconds.

---
Hi!

I also have some generic GPT code that one could extend with what he/she needs. Mail me if you'd find it useful.

 drivers/char/watchdog/Kconfig       |    4 
 drivers/char/watchdog/Makefile      |    1 
 drivers/char/watchdog/mpc5200_wdt.c |  257 ++++++++++++++++++++++++++++++++++++
 3 files changed, 262 insertions(+)
drivers/char/watchdog/Kconfig +4 -0
Index: work-powerpc.git/drivers/char/watchdog/Kconfig
===================================================================
@@ -521,6 +521,10 @@ config 8xx_WDT
 	tristate "MPC8xx Watchdog Timer"
 	depends on 8xx
 
+config MPC5200_WDT
+	tristate "MPC5200 Watchdog Timer"
+	depends on PPC_MPC52xx
+
 config 83xx_WDT
 	tristate "MPC83xx Watchdog Timer"
 	depends on PPC_83xx
drivers/char/watchdog/Makefile +1 -0
Index: work-powerpc.git/drivers/char/watchdog/Makefile
===================================================================
@@ -64,6 +64,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc
 
 # PowerPC Architecture
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
 obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
 obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
 obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
drivers/char/watchdog/mpc5200_wdt.c new file +257 -0

257 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Domen Puncer

Driver for internal mpc5200 watchdog on general purpose timer 0. For IPB clock of 132 MHz the maximum timeout is about 32 seconds.

Should really be submitted to the watchdog maintainer if you want this in the kernel

Quoted 57 lines

---
Hi!

I also have some generic GPT code that one could extend with what he/she needs. Mail me if you'd find it useful.

 drivers/char/watchdog/Kconfig       |    4
 drivers/char/watchdog/Makefile      |    1
 drivers/char/watchdog/mpc5200_wdt.c |  257 ++++++++++++++++++++++++ 
++++++++++++
 3 files changed, 262 insertions(+)

Index: work-powerpc.git/drivers/char/watchdog/Kconfig
===================================================================

drivers/char/watchdog/Kconfig +4 -0
@@ -521,6 +521,10 @@ config 8xx_WDT
 	tristate "MPC8xx Watchdog Timer"
 	depends on 8xx
 
+config MPC5200_WDT
+	tristate "MPC5200 Watchdog Timer"
+	depends on PPC_MPC52xx
+
 config 83xx_WDT
 	tristate "MPC83xx Watchdog Timer"
 	depends on PPC_83xx

Index: work-powerpc.git/drivers/char/watchdog/Makefile
===================================================================

drivers/char/watchdog/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc
 
 # PowerPC Architecture
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
 obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
 obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
 obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o

Index: work-powerpc.git/drivers/char/watchdog/mpc5200_wdt.c
===================================================================

drivers/char/watchdog/mpc5200_wdt.c new file +12 -0
@@ -0,0 +1,257 @@
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/io.h>
+#include <asm/of_platform.h>
+#include <asm/uaccess.h>
+#include <asm/mpc52xx.h>
+
+
+#define GPT_MODE_WDT		(1<<15)
+#define GPT_MODE_CE		(1<<12)

drivers/char/watchdog/mpc5200_wdt.c line 22

Quoted 10 lines
drivers/char/watchdog/mpc5200_wdt.c new file +10 -0
+#define GPT_MODE_MS_TIMER	(0x4)
+
+
+struct mpc5200_wdt {
+	unsigned count;	/* timer ticks before watchdog kicks in */
+	long ipb_freq;
+	struct miscdevice miscdev;
+	struct resource mem;
+	struct mpc52xx_gpt __iomem *regs;
+	struct mpc52xx_gpt saved_regs;

saved_regs isn't used anywhere

[snip]

- k

#2 lore raw
Quoted 11 lines · Kumar Gala
Quoted 5 lines · Domen Puncer

Driver for internal mpc5200 watchdog on general purpose timer 0. For IPB clock of 132 MHz the maximum timeout is about 32 seconds.

Should really be submitted to the watchdog maintainer if you want this in the kernel

Domen, are you going to respin this patch and submit it to the watchdog maintainer?

Cheers,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#3 lore raw
Quoted 8 lines · Grant Likely
Quoted 7 lines · Kumar Gala
Quoted 4 lines · Domen Puncer

Driver for internal mpc5200 watchdog on general purpose timer 0. For IPB clock of 132 MHz the maximum timeout is about 32 seconds.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Should really be submitted to the watchdog maintainer if you want this in the kernel

Domen, are you going to respin this patch and submit it to the watchdog maintainer?

Uhm... checked drivers/char/watchdog/ lately? ;-)

Domen

Quoted 9 lines

Cheers,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
Signature · 5 lines
Domen Puncer | Research & Development
.............................................................................................
Telargo d.o.o. | Zagrebška cesta 20 | 2000 Maribor | Slovenia
.............................................................................................
www.telargo.com
#4 lore raw
Quoted 11 lines · Domen Puncer
Quoted 10 lines · Grant Likely
Quoted 9 lines · Kumar Gala
Quoted 5 lines · Domen Puncer

Driver for internal mpc5200 watchdog on general purpose timer 0. For IPB clock of 132 MHz the maximum timeout is about 32 seconds.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Should really be submitted to the watchdog maintainer if you want this in the kernel

Domen, are you going to respin this patch and submit it to the watchdog maintainer?

Uhm... checked drivers/char/watchdog/ lately? ;-)

Hmmm, I checked it just before I wrote that email... I missed that drivers/char/watchdog has been moved to drivers/watchdog which is why I couldn't find the driver. :-)

Oops,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195