Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

watchdog interface

0 views
Skip to first unread message

Mark

unread,
Dec 28, 2009, 9:00:03 PM12/28/09
to
Hello

I need to implement support for a watchdog on my embedded platform,
ucLinux-2.4.20. Is there any common interface (like what exists for system
timer) for watchdogs?

I think, WD initialization/start should be invoked on the early stage,
somewhere at architecture specific init code (may be in
arch/armnommu/mach-myarch/time.c), amI right ?

--
Mark

Mark Hobley

unread,
Dec 29, 2009, 4:08:07 AM12/29/09
to

The current 2.6.x kernel provides watchdog timer support. You might want to
look at how this is implemented before backporting.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/

Rainer Weikusat

unread,
Dec 29, 2009, 7:36:33 AM12/29/09
to
"Mark" <mark_cruz...@hotmail.com> writes:
> I need to implement support for a watchdog on my embedded platform,
> ucLinux-2.4.20. Is there any common interface (like what exists for
> system timer) for watchdogs?

Yes. Documentation is in Documentation/watchdog.txt and
Documentation/watchdog-api.txt. A 'watchdog' usually corresponds with
a character device. There should be a couple of drivers for watchdogs
in drivers/char, usually having wdt somewhere in their names which
could server as examples. After the system has booted, a system
service should be running (as application) which periodically
'placates' the watchdog. This implies that the machine will restart if
application scheduling stops to work (insofar applicable to
nommu-architectures).

> I think, WD initialization/start should be invoked on the early stage,
> somewhere at architecture specific init code (may be in
> arch/armnommu/mach-myarch/time.c), amI right ?

If you're paranoid, arm the watchdog in the boot loader before the
kernel is started.

Mark

unread,
Dec 29, 2009, 9:31:16 PM12/29/09
to
Thanks for replies.

I don't get one thing. The WD is supposed to be primed and start ticking as
early as possible, so doe sthe kernel guarantee this?

--
Mark

Rainer Weikusat

unread,
Dec 30, 2009, 4:29:12 PM12/30/09
to
"Mark" <mark_cruz...@hotmail.com> writes:
> I don't get one thing. The WD is supposed to be primed and start
> ticking as early as possible, so doe sthe kernel guarantee this?

That's up to you. In the two watchdog drivers I wrote, the watchdog
was armed in the init-routine of the corresponding chardev driver.
This means that it is happening at some unspecified point in time
after 'basic initialization' (eg, memory management) is complete and
before any 'userspace' code runs (for a driver compiled into the
kernel). If this isn't good enough for you, the other option (as I
already wrote) would be to arm it in the bootloader, just after
SDRAM-controller and 'clocks' are in a usable state.

0 new messages