summaryrefslogtreecommitdiffstats
path: root/Documentation/watchdog.txt
blob: 893ead8a8bda922b8a4445a54d543a0ee963c26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	Watchdog Timer Interfaces For The Linux Operating System

		Alan Cox <alan@lxorguk.ukuu.org.uk>

	     Custom Linux Driver And Program Development


The following watchdog drivers are currently implemented:

	ICS	WDT501-P
	ICS	WDT501-P (no fan tachometer)
	ICS	WDT500-P
	Software Only
	Berkshire Products PC Watchdog Revision A & C (by Ken Hollis)


All five interfaces provide /dev/watchdog, which when open must be written
to within a timeout or the machine will reboot. Each write delays the reboot
time another timeout. In the case of the software watchdog the ability to 
reboot will depend on the state of the machines and interrupts. The hardware
boards physically pull the machine down off their own onboard timers and
will reboot from almost anything.

A second temperature monitoring interface is available on the WDT501P cards
and some Berkshire cards. This provides /dev/temperature. This is the machine 
internal temperature in degrees Fahrenheit. Each read returns a single byte 
giving the temperature.

The third interface logs kernel messages on additional alert events.

Both software and hardware watchdog drivers are available in the standard
kernel. If you are using the software watchdog, you probably also want
to use "panic=60" as a boot argument as well.

The wdt card cannot be safely probed for. Instead you need to pass
wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11".

Features
--------
		WDT501P		WDT500P		Software	Berkshire
Reboot Timer	   X               X                X		    X
External Reboot	   X	           X                o		    o
I/O Port Monitor   o		   o		    o		    X
Temperature	   X		   o		    o               X
Fan Speed          X		   o		    o               o
Power Under	   X               o                o               o
Power Over         X               o                o               o
Overheat           X               o                o               o

The external event interfaces on the WDT boards are not currently supported.
Minor numbers are however allocated for it.


Example Watchdog Driver
-----------------------

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, const char *argv[])
{
	int fd=open("/dev/watchdog",O_WRONLY);
	if(fd==-1)
	{
		perror("watchdog");
		exit(1);
	}
	while(1)
	{
		write(fd,"\0",1);
		sleep(10);
	}
}


Contact Information

People keep asking about the WDT watchdog timer hardware: The phone contacts
for Industrial Computer Source are:
 
Industrial Computer Source
http://www.indcompsrc.com
ICS Advent, San Diego
6260 Sequence Dr.
San Diego, CA 92121-4371
Phone (858) 677-0877
FAX: (858) 677-0895
>
ICS Advent Europe, UK
Oving Road
Chichester,
West Sussex,
PO19 4ET, UK
Phone: 00.44.1243.533900


and please mention Linux when enquiring.

For full information about the PCWD cards see the pcwd-watchdog.txt document.