[PATCH] mpc5200: /dev/watchdog driver for GPT0

Kumar Gala galak at kernel.crashing.org
Thu Jun 14 13:57:29 EST 2007


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 <domen.puncer at telargo.com>

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 <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)
> +#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





More information about the Linuxppc-embedded mailing list