Re: SBC: Winsystems EPX-C3 Watchdog Timer?

From: Willy Tarreau
Date: Fri Jan 13 2006 - 00:44:25 EST


Hi,

On Thu, Jan 12, 2006 at 08:48:43PM -0500, Calin A. Culianu wrote:
>
> Hi,
>
> I wanted to see if a driver for the watchdog timer built into the
> Winsystems EPX-C3 SBC board is something the linux kernel people are
> interested in. If so, how should I structure the driver if I were to
> submit it?
>
> The reason I ask is that this board's watchdog is pretty basic/primitive.
> It is not a PCI device, it doesn't have any status registers per se and
> is configured by jumpers on the board only.
>
> Behavior of the watchdog (if configured):
>
> Enable the watchdog: Write a 1 to io address: 0x1EE
> Pet the watchdog before the timeout period (1.5s or 200s depending on
> jumper config): Write any value to io address: 0x1EF
> Disable the watchdog: Write a 0 to io address: 0x1EE.
>
> Pretty basic huh? As such -- there is no way to tell in software if the
> watchdog exists, if it is enabled, or how long the timeout is. Since
> this is so basic.. does it belong in the mainline kernel? Or should it
> best be done as a userspace program instead?

Most of a watchdog's intelligence should be in userspace. However,
it's interesting to put the basic watchdog driver in kernel so that
you have the choice to use any watchdog daemon which will ping
/dev/watchdog. So I think that basically, your driver should turn
any write to /dev/watchdog into a write to 0x1EF.

Now about your concern that there's no way to detect the presence
of the hardware, well, it's already a problem with most such hardware.
I think you don't have to worry about that. Just put a big config
warning, put a message at startup reminding that it will write to
0x1EE and 0x1EF, and that's all.

> Any guidance is appreciated..
>
> -Calin

Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/