From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 8F887DDE46 for ; Thu, 14 Jun 2007 13:56:57 +1000 (EST) In-Reply-To: <20070612085931.GG23294@moe.telargo.com> References: <20070612085931.GG23294@moe.telargo.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: From: Kumar Gala Subject: Re: [PATCH] mpc5200: /dev/watchdog driver for GPT0 Date: Wed, 13 Jun 2007 22:57:29 -0500 To: Domen Puncer Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Jun 12, 2007, at 3:59 AM, Domen Puncer wrote: > Driver for internal mpc5200 watchdog on general purpose timer 0. > For IPB clock of 132 MHz the maximum timeout is about 32 seconds. > > > Signed-off-by: Domen Puncer Should really be submitted to the watchdog maintainer if you want this in the kernel > --- > 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 > =================================================================== > --- work-powerpc.git.orig/drivers/char/watchdog/Kconfig > +++ 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 > Index: work-powerpc.git/drivers/char/watchdog/Makefile > =================================================================== > --- work-powerpc.git.orig/drivers/char/watchdog/Makefile > +++ 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 > Index: work-powerpc.git/drivers/char/watchdog/mpc5200_wdt.c > =================================================================== > --- /dev/null > +++ work-powerpc.git/drivers/char/watchdog/mpc5200_wdt.c > @@ -0,0 +1,257 @@ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +#define GPT_MODE_WDT (1<<15) > +#define GPT_MODE_CE (1<<12) > +#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