Commit 51e618c357b39597b474165c5d17067afe8f16a6
Exists in
master
and in
4 other branches
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: watchdog: Driver for the watchdog timer on Freescale IMX2 (and later) processors. watchdog: s3c2410_wdt - Fix on handling of the request_mem_region fail watchdog: s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs iTCO_wdt: fix TCO V1 timeout values and limits watchdog: twl4030_wdt: Disable watchdog during probing watchdog: update/improve/consolidate watchdog driver watchdog: booke_wdt: fix ioctl status flags watchdog: fix several MODULE_PARM_DESC strings watchdog: bfin: use new common Blackfin watchdog header
Showing 20 changed files Side-by-side Diff
- Documentation/kernel-parameters.txt
- Documentation/watchdog/00-INDEX
- Documentation/watchdog/watchdog-parameters.txt
- Documentation/watchdog/wdt.txt
- drivers/watchdog/Kconfig
- drivers/watchdog/Makefile
- drivers/watchdog/bfin_wdt.c
- drivers/watchdog/booke_wdt.c
- drivers/watchdog/eurotechwdt.c
- drivers/watchdog/iTCO_vendor_support.c
- drivers/watchdog/iTCO_wdt.c
- drivers/watchdog/imx2_wdt.c
- drivers/watchdog/mpc8xxx_wdt.c
- drivers/watchdog/pc87413_wdt.c
- drivers/watchdog/pnx833x_wdt.c
- drivers/watchdog/s3c2410_wdt.c
- drivers/watchdog/shwdt.c
- drivers/watchdog/twl4030_wdt.c
- drivers/watchdog/wdt.c
- drivers/watchdog/wdt977.c
Documentation/kernel-parameters.txt
... | ... | @@ -290,9 +290,6 @@ |
290 | 290 | advansys= [HW,SCSI] |
291 | 291 | See header of drivers/scsi/advansys.c. |
292 | 292 | |
293 | - advwdt= [HW,WDT] Advantech WDT | |
294 | - Format: <iostart>,<iostop> | |
295 | - | |
296 | 293 | aedsp16= [HW,OSS] Audio Excel DSP 16 |
297 | 294 | Format: <io>,<irq>,<dma>,<mss_io>,<mpu_io>,<mpu_irq> |
298 | 295 | See also header of sound/oss/aedsp16.c. |
... | ... | @@ -765,9 +762,6 @@ |
765 | 762 | This option is obsoleted by the "netdev=" option, which |
766 | 763 | has equivalent usage. See its documentation for details. |
767 | 764 | |
768 | - eurwdt= [HW,WDT] Eurotech CPU-1220/1410 onboard watchdog. | |
769 | - Format: <io>[,<irq>] | |
770 | - | |
771 | 765 | failslab= |
772 | 766 | fail_page_alloc= |
773 | 767 | fail_make_request=[KNL] |
... | ... | @@ -2267,9 +2261,6 @@ |
2267 | 2261 | |
2268 | 2262 | sched_debug [KNL] Enables verbose scheduler debug messages. |
2269 | 2263 | |
2270 | - sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver | |
2271 | - Format: <io>[,<timeout>[,<isapnp>]] | |
2272 | - | |
2273 | 2264 | scsi_debug_*= [SCSI] |
2274 | 2265 | See drivers/scsi/scsi_debug.c. |
2275 | 2266 | |
... | ... | @@ -2858,8 +2849,10 @@ |
2858 | 2849 | wd7000= [HW,SCSI] |
2859 | 2850 | See header of drivers/scsi/wd7000.c. |
2860 | 2851 | |
2861 | - wdt= [WDT] Watchdog | |
2862 | - See Documentation/watchdog/wdt.txt. | |
2852 | + watchdog timers [HW,WDT] For information on watchdog timers, | |
2853 | + see Documentation/watchdog/watchdog-parameters.txt | |
2854 | + or other driver-specific files in the | |
2855 | + Documentation/watchdog/ directory. | |
2863 | 2856 | |
2864 | 2857 | x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of |
2865 | 2858 | default x2apic cluster mode on platforms |
Documentation/watchdog/00-INDEX
1 | 1 | 00-INDEX |
2 | 2 | - this file. |
3 | +hpwdt.txt | |
4 | + - information on the HP iLO2 NMI watchdog | |
3 | 5 | pcwd-watchdog.txt |
4 | 6 | - documentation for Berkshire Products PC Watchdog ISA cards. |
5 | 7 | src/ |
6 | 8 | - directory holding watchdog related example programs. |
7 | 9 | watchdog-api.txt |
8 | 10 | - description of the Linux Watchdog driver API. |
11 | +watchdog-parameters.txt | |
12 | + - information on driver parameters (for drivers other than | |
13 | + the ones that have driver-specific files here) | |
9 | 14 | wdt.txt |
10 | 15 | - description of the Watchdog Timer Interfaces for Linux. |
Documentation/watchdog/watchdog-parameters.txt
1 | +This file provides information on the module parameters of many of | |
2 | +the Linux watchdog drivers. Watchdog driver parameter specs should | |
3 | +be listed here unless the driver has its own driver-specific information | |
4 | +file. | |
5 | + | |
6 | + | |
7 | +See Documentation/kernel-parameters.txt for information on | |
8 | +providing kernel parameters for builtin drivers versus loadable | |
9 | +modules. | |
10 | + | |
11 | + | |
12 | +------------------------------------------------- | |
13 | +acquirewdt: | |
14 | +wdt_stop: Acquire WDT 'stop' io port (default 0x43) | |
15 | +wdt_start: Acquire WDT 'start' io port (default 0x443) | |
16 | +nowayout: Watchdog cannot be stopped once started | |
17 | + (default=kernel config parameter) | |
18 | +------------------------------------------------- | |
19 | +advantechwdt: | |
20 | +wdt_stop: Advantech WDT 'stop' io port (default 0x443) | |
21 | +wdt_start: Advantech WDT 'start' io port (default 0x443) | |
22 | +timeout: Watchdog timeout in seconds. 1<= timeout <=63, default=60. | |
23 | +nowayout: Watchdog cannot be stopped once started | |
24 | + (default=kernel config parameter) | |
25 | +------------------------------------------------- | |
26 | +alim1535_wdt: | |
27 | +timeout: Watchdog timeout in seconds. (0 < timeout < 18000, default=60 | |
28 | +nowayout: Watchdog cannot be stopped once started | |
29 | + (default=kernel config parameter) | |
30 | +------------------------------------------------- | |
31 | +alim7101_wdt: | |
32 | +timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30 | |
33 | +use_gpio: Use the gpio watchdog (required by old cobalt boards). | |
34 | + default=0/off/no | |
35 | +nowayout: Watchdog cannot be stopped once started | |
36 | + (default=kernel config parameter) | |
37 | +------------------------------------------------- | |
38 | +ar7_wdt: | |
39 | +margin: Watchdog margin in seconds (default=60) | |
40 | +nowayout: Disable watchdog shutdown on close | |
41 | + (default=kernel config parameter) | |
42 | +------------------------------------------------- | |
43 | +at32ap700x_wdt: | |
44 | +timeout: Timeout value. Limited to be 1 or 2 seconds. (default=2) | |
45 | +nowayout: Watchdog cannot be stopped once started | |
46 | + (default=kernel config parameter) | |
47 | +------------------------------------------------- | |
48 | +at91rm9200_wdt: | |
49 | +wdt_time: Watchdog time in seconds. (default=5) | |
50 | +nowayout: Watchdog cannot be stopped once started | |
51 | + (default=kernel config parameter) | |
52 | +------------------------------------------------- | |
53 | +at91sam9_wdt: | |
54 | +heartbeat: Watchdog heartbeats in seconds. (default = 15) | |
55 | +nowayout: Watchdog cannot be stopped once started | |
56 | + (default=kernel config parameter) | |
57 | +------------------------------------------------- | |
58 | +bcm47xx_wdt: | |
59 | +wdt_time: Watchdog time in seconds. (default=30) | |
60 | +nowayout: Watchdog cannot be stopped once started | |
61 | + (default=kernel config parameter) | |
62 | +------------------------------------------------- | |
63 | +bfin_wdt: | |
64 | +timeout: Watchdog timeout in seconds. (1<=timeout<=((2^32)/SCLK), default=20) | |
65 | +nowayout: Watchdog cannot be stopped once started | |
66 | + (default=kernel config parameter) | |
67 | +------------------------------------------------- | |
68 | +coh901327_wdt: | |
69 | +margin: Watchdog margin in seconds (default 60s) | |
70 | +------------------------------------------------- | |
71 | +cpu5wdt: | |
72 | +port: base address of watchdog card, default is 0x91 | |
73 | +verbose: be verbose, default is 0 (no) | |
74 | +ticks: count down ticks, default is 10000 | |
75 | +------------------------------------------------- | |
76 | +cpwd: | |
77 | +wd0_timeout: Default watchdog0 timeout in 1/10secs | |
78 | +wd1_timeout: Default watchdog1 timeout in 1/10secs | |
79 | +wd2_timeout: Default watchdog2 timeout in 1/10secs | |
80 | +------------------------------------------------- | |
81 | +davinci_wdt: | |
82 | +heartbeat: Watchdog heartbeat period in seconds from 1 to 600, default 60 | |
83 | +------------------------------------------------- | |
84 | +ep93xx_wdt: | |
85 | +nowayout: Watchdog cannot be stopped once started | |
86 | +timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=TBD) | |
87 | +------------------------------------------------- | |
88 | +eurotechwdt: | |
89 | +nowayout: Watchdog cannot be stopped once started | |
90 | + (default=kernel config parameter) | |
91 | +io: Eurotech WDT io port (default=0x3f0) | |
92 | +irq: Eurotech WDT irq (default=10) | |
93 | +ev: Eurotech WDT event type (default is `int') | |
94 | +------------------------------------------------- | |
95 | +gef_wdt: | |
96 | +nowayout: Watchdog cannot be stopped once started | |
97 | + (default=kernel config parameter) | |
98 | +------------------------------------------------- | |
99 | +geodewdt: | |
100 | +timeout: Watchdog timeout in seconds. 1<= timeout <=131, default=60. | |
101 | +nowayout: Watchdog cannot be stopped once started | |
102 | + (default=kernel config parameter) | |
103 | +------------------------------------------------- | |
104 | +i6300esb: | |
105 | +heartbeat: Watchdog heartbeat in seconds. (1<heartbeat<2046, default=30) | |
106 | +nowayout: Watchdog cannot be stopped once started | |
107 | + (default=kernel config parameter) | |
108 | +------------------------------------------------- | |
109 | +iTCO_wdt: | |
110 | +heartbeat: Watchdog heartbeat in seconds. | |
111 | + (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30) | |
112 | +nowayout: Watchdog cannot be stopped once started | |
113 | + (default=kernel config parameter) | |
114 | +------------------------------------------------- | |
115 | +iTCO_vendor_support: | |
116 | +vendorsupport: iTCO vendor specific support mode, default=0 (none), | |
117 | + 1=SuperMicro Pent3, 2=SuperMicro Pent4+, 911=Broken SMI BIOS | |
118 | +------------------------------------------------- | |
119 | +ib700wdt: | |
120 | +timeout: Watchdog timeout in seconds. 0<= timeout <=30, default=30. | |
121 | +nowayout: Watchdog cannot be stopped once started | |
122 | + (default=kernel config parameter) | |
123 | +------------------------------------------------- | |
124 | +ibmasr: | |
125 | +nowayout: Watchdog cannot be stopped once started | |
126 | + (default=kernel config parameter) | |
127 | +------------------------------------------------- | |
128 | +indydog: | |
129 | +nowayout: Watchdog cannot be stopped once started | |
130 | + (default=kernel config parameter) | |
131 | +------------------------------------------------- | |
132 | +iop_wdt: | |
133 | +nowayout: Watchdog cannot be stopped once started | |
134 | + (default=kernel config parameter) | |
135 | +------------------------------------------------- | |
136 | +it8712f_wdt: | |
137 | +margin: Watchdog margin in seconds (default 60) | |
138 | +nowayout: Disable watchdog shutdown on close | |
139 | + (default=kernel config parameter) | |
140 | +------------------------------------------------- | |
141 | +it87_wdt: | |
142 | +nogameport: Forbid the activation of game port, default=0 | |
143 | +exclusive: Watchdog exclusive device open, default=1 | |
144 | +timeout: Watchdog timeout in seconds, default=60 | |
145 | +testmode: Watchdog test mode (1 = no reboot), default=0 | |
146 | +nowayout: Watchdog cannot be stopped once started | |
147 | + (default=kernel config parameter) | |
148 | +------------------------------------------------- | |
149 | +ixp2000_wdt: | |
150 | +heartbeat: Watchdog heartbeat in seconds (default 60s) | |
151 | +nowayout: Watchdog cannot be stopped once started | |
152 | + (default=kernel config parameter) | |
153 | +------------------------------------------------- | |
154 | +ixp4xx_wdt: | |
155 | +heartbeat: Watchdog heartbeat in seconds (default 60s) | |
156 | +nowayout: Watchdog cannot be stopped once started | |
157 | + (default=kernel config parameter) | |
158 | +------------------------------------------------- | |
159 | +ks8695_wdt: | |
160 | +wdt_time: Watchdog time in seconds. (default=5) | |
161 | +nowayout: Watchdog cannot be stopped once started | |
162 | + (default=kernel config parameter) | |
163 | +------------------------------------------------- | |
164 | +machzwd: | |
165 | +nowayout: Watchdog cannot be stopped once started | |
166 | + (default=kernel config parameter) | |
167 | +action: after watchdog resets, generate: | |
168 | + 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI | |
169 | +------------------------------------------------- | |
170 | +max63xx_wdt: | |
171 | +heartbeat: Watchdog heartbeat period in seconds from 1 to 60, default 60 | |
172 | +nowayout: Watchdog cannot be stopped once started | |
173 | + (default=kernel config parameter) | |
174 | +nodelay: Force selection of a timeout setting without initial delay | |
175 | + (max6373/74 only, default=0) | |
176 | +------------------------------------------------- | |
177 | +mixcomwd: | |
178 | +nowayout: Watchdog cannot be stopped once started | |
179 | + (default=kernel config parameter) | |
180 | +------------------------------------------------- | |
181 | +mpc8xxx_wdt: | |
182 | +timeout: Watchdog timeout in ticks. (0<timeout<65536, default=65535) | |
183 | +reset: Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset | |
184 | +nowayout: Watchdog cannot be stopped once started | |
185 | + (default=kernel config parameter) | |
186 | +------------------------------------------------- | |
187 | +mpcore_wdt: | |
188 | +mpcore_margin: MPcore timer margin in seconds. | |
189 | + (0 < mpcore_margin < 65536, default=60) | |
190 | +nowayout: Watchdog cannot be stopped once started | |
191 | + (default=kernel config parameter) | |
192 | +mpcore_noboot: MPcore watchdog action, set to 1 to ignore reboots, | |
193 | + 0 to reboot (default=0 | |
194 | +------------------------------------------------- | |
195 | +mv64x60_wdt: | |
196 | +nowayout: Watchdog cannot be stopped once started | |
197 | + (default=kernel config parameter) | |
198 | +------------------------------------------------- | |
199 | +nuc900_wdt: | |
200 | +heartbeat: Watchdog heartbeats in seconds. | |
201 | + (default = 15) | |
202 | +nowayout: Watchdog cannot be stopped once started | |
203 | + (default=kernel config parameter) | |
204 | +------------------------------------------------- | |
205 | +omap_wdt: | |
206 | +timer_margin: initial watchdog timeout (in seconds) | |
207 | +------------------------------------------------- | |
208 | +orion_wdt: | |
209 | +heartbeat: Initial watchdog heartbeat in seconds | |
210 | +nowayout: Watchdog cannot be stopped once started | |
211 | + (default=kernel config parameter) | |
212 | +------------------------------------------------- | |
213 | +pc87413_wdt: | |
214 | +io: pc87413 WDT I/O port (default: io). | |
215 | +timeout: Watchdog timeout in minutes (default=timeout). | |
216 | +nowayout: Watchdog cannot be stopped once started | |
217 | + (default=kernel config parameter) | |
218 | +------------------------------------------------- | |
219 | +pika_wdt: | |
220 | +heartbeat: Watchdog heartbeats in seconds. (default = 15) | |
221 | +nowayout: Watchdog cannot be stopped once started | |
222 | + (default=kernel config parameter) | |
223 | +------------------------------------------------- | |
224 | +pnx4008_wdt: | |
225 | +heartbeat: Watchdog heartbeat period in seconds from 1 to 60, default 19 | |
226 | +nowayout: Set to 1 to keep watchdog running after device release | |
227 | +------------------------------------------------- | |
228 | +pnx833x_wdt: | |
229 | +timeout: Watchdog timeout in Mhz. (68Mhz clock), default=2040000000 (30 seconds) | |
230 | +nowayout: Watchdog cannot be stopped once started | |
231 | + (default=kernel config parameter) | |
232 | +start_enabled: Watchdog is started on module insertion (default=1) | |
233 | +------------------------------------------------- | |
234 | +rc32434_wdt: | |
235 | +timeout: Watchdog timeout value, in seconds (default=20) | |
236 | +nowayout: Watchdog cannot be stopped once started | |
237 | + (default=kernel config parameter) | |
238 | +------------------------------------------------- | |
239 | +riowd: | |
240 | +riowd_timeout: Watchdog timeout in minutes (default=1) | |
241 | +------------------------------------------------- | |
242 | +s3c2410_wdt: | |
243 | +tmr_margin: Watchdog tmr_margin in seconds. (default=15) | |
244 | +tmr_atboot: Watchdog is started at boot time if set to 1, default=0 | |
245 | +nowayout: Watchdog cannot be stopped once started | |
246 | + (default=kernel config parameter) | |
247 | +soft_noboot: Watchdog action, set to 1 to ignore reboots, 0 to reboot | |
248 | +debug: Watchdog debug, set to >1 for debug, (default 0) | |
249 | +------------------------------------------------- | |
250 | +sa1100_wdt: | |
251 | +margin: Watchdog margin in seconds (default 60s) | |
252 | +------------------------------------------------- | |
253 | +sb_wdog: | |
254 | +timeout: Watchdog timeout in microseconds (max/default 8388607 or 8.3ish secs) | |
255 | +------------------------------------------------- | |
256 | +sbc60xxwdt: | |
257 | +wdt_stop: SBC60xx WDT 'stop' io port (default 0x45) | |
258 | +wdt_start: SBC60xx WDT 'start' io port (default 0x443) | |
259 | +timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30) | |
260 | +nowayout: Watchdog cannot be stopped once started | |
261 | + (default=kernel config parameter) | |
262 | +------------------------------------------------- | |
263 | +sbc7240_wdt: | |
264 | +timeout: Watchdog timeout in seconds. (1<=timeout<=255, default=30) | |
265 | +nowayout: Disable watchdog when closing device file | |
266 | +------------------------------------------------- | |
267 | +sbc8360: | |
268 | +timeout: Index into timeout table (0-63) (default=27 (60s)) | |
269 | +nowayout: Watchdog cannot be stopped once started | |
270 | + (default=kernel config parameter) | |
271 | +------------------------------------------------- | |
272 | +sbc_epx_c3: | |
273 | +nowayout: Watchdog cannot be stopped once started | |
274 | + (default=kernel config parameter) | |
275 | +------------------------------------------------- | |
276 | +sbc_fitpc2_wdt: | |
277 | +margin: Watchdog margin in seconds (default 60s) | |
278 | +nowayout: Watchdog cannot be stopped once started | |
279 | +------------------------------------------------- | |
280 | +sc1200wdt: | |
281 | +isapnp: When set to 0 driver ISA PnP support will be disabled (default=1) | |
282 | +io: io port | |
283 | +timeout: range is 0-255 minutes, default is 1 | |
284 | +nowayout: Watchdog cannot be stopped once started | |
285 | + (default=kernel config parameter) | |
286 | +------------------------------------------------- | |
287 | +sc520_wdt: | |
288 | +timeout: Watchdog timeout in seconds. (1 <= timeout <= 3600, default=30) | |
289 | +nowayout: Watchdog cannot be stopped once started | |
290 | + (default=kernel config parameter) | |
291 | +------------------------------------------------- | |
292 | +sch311x_wdt: | |
293 | +force_id: Override the detected device ID | |
294 | +therm_trip: Should a ThermTrip trigger the reset generator | |
295 | +timeout: Watchdog timeout in seconds. 1<= timeout <=15300, default=60 | |
296 | +nowayout: Watchdog cannot be stopped once started | |
297 | + (default=kernel config parameter) | |
298 | +------------------------------------------------- | |
299 | +scx200_wdt: | |
300 | +margin: Watchdog margin in seconds | |
301 | +nowayout: Disable watchdog shutdown on close | |
302 | +------------------------------------------------- | |
303 | +shwdt: | |
304 | +clock_division_ratio: Clock division ratio. Valid ranges are from 0x5 (1.31ms) | |
305 | + to 0x7 (5.25ms). (default=7) | |
306 | +heartbeat: Watchdog heartbeat in seconds. (1 <= heartbeat <= 3600, default=30 | |
307 | +nowayout: Watchdog cannot be stopped once started | |
308 | + (default=kernel config parameter) | |
309 | +------------------------------------------------- | |
310 | +smsc37b787_wdt: | |
311 | +timeout: range is 1-255 units, default is 60 | |
312 | +nowayout: Watchdog cannot be stopped once started | |
313 | + (default=kernel config parameter) | |
314 | +------------------------------------------------- | |
315 | +softdog: | |
316 | +soft_margin: Watchdog soft_margin in seconds. | |
317 | + (0 < soft_margin < 65536, default=60) | |
318 | +nowayout: Watchdog cannot be stopped once started | |
319 | + (default=kernel config parameter) | |
320 | +soft_noboot: Softdog action, set to 1 to ignore reboots, 0 to reboot | |
321 | + (default=0) | |
322 | +------------------------------------------------- | |
323 | +stmp3xxx_wdt: | |
324 | +heartbeat: Watchdog heartbeat period in seconds from 1 to 4194304, default 19 | |
325 | +------------------------------------------------- | |
326 | +ts72xx_wdt: | |
327 | +timeout: Watchdog timeout in seconds. (1 <= timeout <= 8, default=8) | |
328 | +nowayout: Disable watchdog shutdown on close | |
329 | +------------------------------------------------- | |
330 | +twl4030_wdt: | |
331 | +nowayout: Watchdog cannot be stopped once started | |
332 | + (default=kernel config parameter) | |
333 | +------------------------------------------------- | |
334 | +txx9wdt: | |
335 | +timeout: Watchdog timeout in seconds. (0<timeout<N, default=60) | |
336 | +nowayout: Watchdog cannot be stopped once started | |
337 | + (default=kernel config parameter) | |
338 | +------------------------------------------------- | |
339 | +w83627hf_wdt: | |
340 | +wdt_io: w83627hf/thf WDT io port (default 0x2E) | |
341 | +timeout: Watchdog timeout in seconds. 1 <= timeout <= 255, default=60. | |
342 | +nowayout: Watchdog cannot be stopped once started | |
343 | + (default=kernel config parameter) | |
344 | +------------------------------------------------- | |
345 | +w83697hf_wdt: | |
346 | +wdt_io: w83697hf/hg WDT io port (default 0x2e, 0 = autodetect) | |
347 | +timeout: Watchdog timeout in seconds. 1<= timeout <=255 (default=60) | |
348 | +nowayout: Watchdog cannot be stopped once started | |
349 | + (default=kernel config parameter) | |
350 | +early_disable: Watchdog gets disabled at boot time (default=1) | |
351 | +------------------------------------------------- | |
352 | +w83697ug_wdt: | |
353 | +wdt_io: w83697ug/uf WDT io port (default 0x2e) | |
354 | +timeout: Watchdog timeout in seconds. 1<= timeout <=255 (default=60) | |
355 | +nowayout: Watchdog cannot be stopped once started | |
356 | + (default=kernel config parameter) | |
357 | +------------------------------------------------- | |
358 | +w83877f_wdt: | |
359 | +timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30) | |
360 | +nowayout: Watchdog cannot be stopped once started | |
361 | + (default=kernel config parameter) | |
362 | +------------------------------------------------- | |
363 | +w83977f_wdt: | |
364 | +timeout: Watchdog timeout in seconds (15..7635), default=45) | |
365 | +testmode: Watchdog testmode (1 = no reboot), default=0 | |
366 | +nowayout: Watchdog cannot be stopped once started | |
367 | + (default=kernel config parameter) | |
368 | +------------------------------------------------- | |
369 | +wafer5823wdt: | |
370 | +timeout: Watchdog timeout in seconds. 1 <= timeout <= 255, default=60. | |
371 | +nowayout: Watchdog cannot be stopped once started | |
372 | + (default=kernel config parameter) | |
373 | +------------------------------------------------- | |
374 | +wdt285: | |
375 | +soft_margin: Watchdog timeout in seconds (default=60) | |
376 | +------------------------------------------------- | |
377 | +wdt977: | |
378 | +timeout: Watchdog timeout in seconds (60..15300, default=60) | |
379 | +testmode: Watchdog testmode (1 = no reboot), default=0 | |
380 | +nowayout: Watchdog cannot be stopped once started | |
381 | + (default=kernel config parameter) | |
382 | +------------------------------------------------- | |
383 | +wm831x_wdt: | |
384 | +nowayout: Watchdog cannot be stopped once started | |
385 | + (default=kernel config parameter) | |
386 | +------------------------------------------------- | |
387 | +wm8350_wdt: | |
388 | +nowayout: Watchdog cannot be stopped once started | |
389 | + (default=kernel config parameter) | |
390 | +------------------------------------------------- |
Documentation/watchdog/wdt.txt
... | ... | @@ -14,14 +14,22 @@ |
14 | 14 | boards physically pull the machine down off their own onboard timers and |
15 | 15 | will reboot from almost anything. |
16 | 16 | |
17 | -A second temperature monitoring interface is available on the WDT501P cards | |
17 | +A second temperature monitoring interface is available on the WDT501P cards. | |
18 | 18 | This provides /dev/temperature. This is the machine internal temperature in |
19 | 19 | degrees Fahrenheit. Each read returns a single byte giving the temperature. |
20 | 20 | |
21 | 21 | The third interface logs kernel messages on additional alert events. |
22 | 22 | |
23 | -The wdt card cannot be safely probed for. Instead you need to pass | |
24 | -wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11". | |
23 | +The ICS ISA-bus wdt card cannot be safely probed for. Instead you need to | |
24 | +pass IO address and IRQ boot parameters. E.g.: | |
25 | + wdt.io=0x240 wdt.irq=11 | |
26 | + | |
27 | +Other "wdt" driver parameters are: | |
28 | + heartbeat Watchdog heartbeat in seconds (default 60) | |
29 | + nowayout Watchdog cannot be stopped once started (kernel | |
30 | + build parameter) | |
31 | + tachometer WDT501-P Fan Tachometer support (0=disable, default=0) | |
32 | + type WDT501-P Card type (500 or 501, default=500) | |
25 | 33 | |
26 | 34 | Features |
27 | 35 | -------- |
drivers/watchdog/Kconfig
... | ... | @@ -145,13 +145,19 @@ |
145 | 145 | Watchdog timer embedded into KS8695 processor. This will reboot your |
146 | 146 | system when the timeout is reached. |
147 | 147 | |
148 | +config HAVE_S3C2410_WATCHDOG | |
149 | + bool | |
150 | + help | |
151 | + This will include watchdog timer support for Samsung SoCs. If | |
152 | + you want to include watchdog support for any machine, kindly | |
153 | + select this in the respective mach-XXXX/Kconfig file. | |
154 | + | |
148 | 155 | config S3C2410_WATCHDOG |
149 | 156 | tristate "S3C2410 Watchdog" |
150 | - depends on ARCH_S3C2410 | |
157 | + depends on ARCH_S3C2410 || HAVE_S3C2410_WATCHDOG | |
151 | 158 | help |
152 | - Watchdog timer block in the Samsung S3C2410 chips. This will | |
153 | - reboot the system when the timer expires with the watchdog | |
154 | - enabled. | |
159 | + Watchdog timer block in the Samsung SoCs. This will reboot | |
160 | + the system when the timer expires with the watchdog enabled. | |
155 | 161 | |
156 | 162 | The driver is limited by the speed of the system's PCLK |
157 | 163 | signal, so with reasonably fast systems (PCLK around 50-66MHz) |
... | ... | @@ -305,6 +311,18 @@ |
305 | 311 | depends on ARM && HAS_IOMEM |
306 | 312 | help |
307 | 313 | Support for memory mapped max63{69,70,71,72,73,74} watchdog timer. |
314 | + | |
315 | +config IMX2_WDT | |
316 | + tristate "IMX2+ Watchdog" | |
317 | + depends on ARCH_MX2 || ARCH_MX25 || ARCH_MX3 || ARCH_MX5 | |
318 | + help | |
319 | + This is the driver for the hardware watchdog | |
320 | + on the Freescale IMX2 and later processors. | |
321 | + If you have one of these processors and wish to have | |
322 | + watchdog support enabled, say Y, otherwise say N. | |
323 | + | |
324 | + To compile this driver as a module, choose M here: the | |
325 | + module will be called imx2_wdt. | |
308 | 326 | |
309 | 327 | # AVR32 Architecture |
310 | 328 |
drivers/watchdog/Makefile
... | ... | @@ -47,6 +47,7 @@ |
47 | 47 | obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o |
48 | 48 | obj-$(CONFIG_ADX_WATCHDOG) += adx_wdt.o |
49 | 49 | obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o |
50 | +obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o | |
50 | 51 | |
51 | 52 | # AVR32 Architecture |
52 | 53 | obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o |
drivers/watchdog/bfin_wdt.c
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | #include <linux/interrupt.h> |
24 | 24 | #include <linux/uaccess.h> |
25 | 25 | #include <asm/blackfin.h> |
26 | +#include <asm/bfin_watchdog.h> | |
26 | 27 | |
27 | 28 | #define stamp(fmt, args...) \ |
28 | 29 | pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) |
... | ... | @@ -48,24 +49,6 @@ |
48 | 49 | # define bfin_write_WDOG_CNT(x) bfin_write_WDOGA_CNT(x) |
49 | 50 | # define bfin_write_WDOG_STAT(x) bfin_write_WDOGA_STAT(x) |
50 | 51 | #endif |
51 | - | |
52 | -/* Bit in SWRST that indicates boot caused by watchdog */ | |
53 | -#define SWRST_RESET_WDOG 0x4000 | |
54 | - | |
55 | -/* Bit in WDOG_CTL that indicates watchdog has expired (WDR0) */ | |
56 | -#define WDOG_EXPIRED 0x8000 | |
57 | - | |
58 | -/* Masks for WDEV field in WDOG_CTL register */ | |
59 | -#define ICTL_RESET 0x0 | |
60 | -#define ICTL_NMI 0x2 | |
61 | -#define ICTL_GPI 0x4 | |
62 | -#define ICTL_NONE 0x6 | |
63 | -#define ICTL_MASK 0x6 | |
64 | - | |
65 | -/* Masks for WDEN field in WDOG_CTL register */ | |
66 | -#define WDEN_MASK 0x0FF0 | |
67 | -#define WDEN_ENABLE 0x0000 | |
68 | -#define WDEN_DISABLE 0x0AD0 | |
69 | 52 | |
70 | 53 | /* some defaults */ |
71 | 54 | #define WATCHDOG_TIMEOUT 20 |
drivers/watchdog/booke_wdt.c
... | ... | @@ -137,12 +137,12 @@ |
137 | 137 | if (copy_to_user((void *)arg, &ident, sizeof(ident))) |
138 | 138 | return -EFAULT; |
139 | 139 | case WDIOC_GETSTATUS: |
140 | - return put_user(ident.options, p); | |
140 | + return put_user(0, p); | |
141 | 141 | case WDIOC_GETBOOTSTATUS: |
142 | 142 | /* XXX: something is clearing TSR */ |
143 | 143 | tmp = mfspr(SPRN_TSR) & TSR_WRS(3); |
144 | - /* returns 1 if last reset was caused by the WDT */ | |
145 | - return (tmp ? 1 : 0); | |
144 | + /* returns CARDRESET if last reset was caused by the WDT */ | |
145 | + return (tmp ? WDIOF_CARDRESET : 0); | |
146 | 146 | case WDIOC_SETOPTIONS: |
147 | 147 | if (get_user(tmp, p)) |
148 | 148 | return -EINVAL; |
drivers/watchdog/eurotechwdt.c
drivers/watchdog/iTCO_vendor_support.c
... | ... | @@ -101,13 +101,6 @@ |
101 | 101 | outl(val32, SMI_EN); /* Needed to deactivate watchdog */ |
102 | 102 | } |
103 | 103 | |
104 | -static void supermicro_old_pre_keepalive(unsigned long acpibase) | |
105 | -{ | |
106 | - /* Reload TCO Timer (done in iTCO_wdt_keepalive) + */ | |
107 | - /* Clear "Expire Flag" (Bit 3 of TC01_STS register) */ | |
108 | - outb(0x08, TCO1_STS); | |
109 | -} | |
110 | - | |
111 | 104 | /* |
112 | 105 | * Vendor Support: 2 |
113 | 106 | * Board: Super Micro Computer Inc. P4SBx, P4DPx |
... | ... | @@ -337,9 +330,7 @@ |
337 | 330 | |
338 | 331 | void iTCO_vendor_pre_keepalive(unsigned long acpibase, unsigned int heartbeat) |
339 | 332 | { |
340 | - if (vendorsupport == SUPERMICRO_OLD_BOARD) | |
341 | - supermicro_old_pre_keepalive(acpibase); | |
342 | - else if (vendorsupport == SUPERMICRO_NEW_BOARD) | |
333 | + if (vendorsupport == SUPERMICRO_NEW_BOARD) | |
343 | 334 | supermicro_new_pre_set_heartbeat(heartbeat); |
344 | 335 | } |
345 | 336 | EXPORT_SYMBOL(iTCO_vendor_pre_keepalive); |
drivers/watchdog/iTCO_wdt.c
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | |
41 | 41 | /* Module and version information */ |
42 | 42 | #define DRV_NAME "iTCO_wdt" |
43 | -#define DRV_VERSION "1.05" | |
43 | +#define DRV_VERSION "1.06" | |
44 | 44 | #define PFX DRV_NAME ": " |
45 | 45 | |
46 | 46 | /* Includes */ |
... | ... | @@ -391,8 +391,8 @@ |
391 | 391 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ |
392 | 392 | static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ |
393 | 393 | module_param(heartbeat, int, 0); |
394 | -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. " | |
395 | - "(2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=" | |
394 | +MODULE_PARM_DESC(heartbeat, "Watchdog timeout in seconds. " | |
395 | + "5..76 (TCO v1) or 3..614 (TCO v2), default=" | |
396 | 396 | __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
397 | 397 | |
398 | 398 | static int nowayout = WATCHDOG_NOWAYOUT; |
399 | 399 | |
... | ... | @@ -523,8 +523,13 @@ |
523 | 523 | /* Reload the timer by writing to the TCO Timer Counter register */ |
524 | 524 | if (iTCO_wdt_private.iTCO_version == 2) |
525 | 525 | outw(0x01, TCO_RLD); |
526 | - else if (iTCO_wdt_private.iTCO_version == 1) | |
526 | + else if (iTCO_wdt_private.iTCO_version == 1) { | |
527 | + /* Reset the timeout status bit so that the timer | |
528 | + * needs to count down twice again before rebooting */ | |
529 | + outw(0x0008, TCO1_STS); /* write 1 to clear bit */ | |
530 | + | |
527 | 531 | outb(0x01, TCO_RLD); |
532 | + } | |
528 | 533 | |
529 | 534 | spin_unlock(&iTCO_wdt_private.io_lock); |
530 | 535 | return 0; |
... | ... | @@ -537,6 +542,11 @@ |
537 | 542 | unsigned int tmrval; |
538 | 543 | |
539 | 544 | tmrval = seconds_to_ticks(t); |
545 | + | |
546 | + /* For TCO v1 the timer counts down twice before rebooting */ | |
547 | + if (iTCO_wdt_private.iTCO_version == 1) | |
548 | + tmrval /= 2; | |
549 | + | |
540 | 550 | /* from the specs: */ |
541 | 551 | /* "Values of 0h-3h are ignored and should not be attempted" */ |
542 | 552 | if (tmrval < 0x04) |
... | ... | @@ -593,6 +603,8 @@ |
593 | 603 | spin_lock(&iTCO_wdt_private.io_lock); |
594 | 604 | val8 = inb(TCO_RLD); |
595 | 605 | val8 &= 0x3f; |
606 | + if (!(inw(TCO1_STS) & 0x0008)) | |
607 | + val8 += (inb(TCOv1_TMR) & 0x3f); | |
596 | 608 | spin_unlock(&iTCO_wdt_private.io_lock); |
597 | 609 | |
598 | 610 | *time_left = (val8 * 6) / 10; |
... | ... | @@ -832,9 +844,9 @@ |
832 | 844 | TCOBASE); |
833 | 845 | |
834 | 846 | /* Clear out the (probably old) status */ |
835 | - outb(8, TCO1_STS); /* Clear the Time Out Status bit */ | |
836 | - outb(2, TCO2_STS); /* Clear SECOND_TO_STS bit */ | |
837 | - outb(4, TCO2_STS); /* Clear BOOT_STS bit */ | |
847 | + outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ | |
848 | + outw(0x0002, TCO2_STS); /* Clear SECOND_TO_STS bit */ | |
849 | + outw(0x0004, TCO2_STS); /* Clear BOOT_STS bit */ | |
838 | 850 | |
839 | 851 | /* Make sure the watchdog is not running */ |
840 | 852 | iTCO_wdt_stop(); |
... | ... | @@ -844,8 +856,7 @@ |
844 | 856 | if (iTCO_wdt_set_heartbeat(heartbeat)) { |
845 | 857 | iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); |
846 | 858 | printk(KERN_INFO PFX |
847 | - "heartbeat value must be 2 < heartbeat < 39 (TCO v1) " | |
848 | - "or 613 (TCO v2), using %d\n", heartbeat); | |
859 | + "timeout value out of range, using %d\n", heartbeat); | |
849 | 860 | } |
850 | 861 | |
851 | 862 | ret = misc_register(&iTCO_wdt_miscdev); |
drivers/watchdog/imx2_wdt.c
1 | +/* | |
2 | + * Watchdog driver for IMX2 and later processors | |
3 | + * | |
4 | + * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de> | |
5 | + * | |
6 | + * some parts adapted by similar drivers from Darius Augulis and Vladimir | |
7 | + * Zapolskiy, additional improvements by Wim Van Sebroeck. | |
8 | + * | |
9 | + * This program is free software; you can redistribute it and/or modify it | |
10 | + * under the terms of the GNU General Public License version 2 as published by | |
11 | + * the Free Software Foundation. | |
12 | + * | |
13 | + * NOTE: MX1 has a slightly different Watchdog than MX2 and later: | |
14 | + * | |
15 | + * MX1: MX2+: | |
16 | + * ---- ----- | |
17 | + * Registers: 32-bit 16-bit | |
18 | + * Stopable timer: Yes No | |
19 | + * Need to enable clk: No Yes | |
20 | + * Halt on suspend: Manual Can be automatic | |
21 | + */ | |
22 | + | |
23 | +#include <linux/init.h> | |
24 | +#include <linux/kernel.h> | |
25 | +#include <linux/miscdevice.h> | |
26 | +#include <linux/module.h> | |
27 | +#include <linux/moduleparam.h> | |
28 | +#include <linux/platform_device.h> | |
29 | +#include <linux/watchdog.h> | |
30 | +#include <linux/clk.h> | |
31 | +#include <linux/fs.h> | |
32 | +#include <linux/io.h> | |
33 | +#include <linux/uaccess.h> | |
34 | +#include <linux/timer.h> | |
35 | +#include <linux/jiffies.h> | |
36 | +#include <mach/hardware.h> | |
37 | + | |
38 | +#define DRIVER_NAME "imx2-wdt" | |
39 | + | |
40 | +#define IMX2_WDT_WCR 0x00 /* Control Register */ | |
41 | +#define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */ | |
42 | +#define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */ | |
43 | +#define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */ | |
44 | + | |
45 | +#define IMX2_WDT_WSR 0x02 /* Service Register */ | |
46 | +#define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */ | |
47 | +#define IMX2_WDT_SEQ2 0xAAAA /* -> service sequence 2 */ | |
48 | + | |
49 | +#define IMX2_WDT_MAX_TIME 128 | |
50 | +#define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */ | |
51 | + | |
52 | +#define WDOG_SEC_TO_COUNT(s) ((s * 2 - 1) << 8) | |
53 | + | |
54 | +#define IMX2_WDT_STATUS_OPEN 0 | |
55 | +#define IMX2_WDT_STATUS_STARTED 1 | |
56 | +#define IMX2_WDT_EXPECT_CLOSE 2 | |
57 | + | |
58 | +static struct { | |
59 | + struct clk *clk; | |
60 | + void __iomem *base; | |
61 | + unsigned timeout; | |
62 | + unsigned long status; | |
63 | + struct timer_list timer; /* Pings the watchdog when closed */ | |
64 | +} imx2_wdt; | |
65 | + | |
66 | +static struct miscdevice imx2_wdt_miscdev; | |
67 | + | |
68 | +static int nowayout = WATCHDOG_NOWAYOUT; | |
69 | +module_param(nowayout, int, 0); | |
70 | +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | |
71 | + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | |
72 | + | |
73 | + | |
74 | +static unsigned timeout = IMX2_WDT_DEFAULT_TIME; | |
75 | +module_param(timeout, uint, 0); | |
76 | +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=" | |
77 | + __MODULE_STRING(IMX2_WDT_DEFAULT_TIME) ")"); | |
78 | + | |
79 | +static const struct watchdog_info imx2_wdt_info = { | |
80 | + .identity = "imx2+ watchdog", | |
81 | + .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, | |
82 | +}; | |
83 | + | |
84 | +static inline void imx2_wdt_setup(void) | |
85 | +{ | |
86 | + u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR); | |
87 | + | |
88 | + /* Strip the old watchdog Time-Out value */ | |
89 | + val &= ~IMX2_WDT_WCR_WT; | |
90 | + /* Generate reset if WDOG times out */ | |
91 | + val &= ~IMX2_WDT_WCR_WRE; | |
92 | + /* Keep Watchdog Disabled */ | |
93 | + val &= ~IMX2_WDT_WCR_WDE; | |
94 | + /* Set the watchdog's Time-Out value */ | |
95 | + val |= WDOG_SEC_TO_COUNT(imx2_wdt.timeout); | |
96 | + | |
97 | + __raw_writew(val, imx2_wdt.base + IMX2_WDT_WCR); | |
98 | + | |
99 | + /* enable the watchdog */ | |
100 | + val |= IMX2_WDT_WCR_WDE; | |
101 | + __raw_writew(val, imx2_wdt.base + IMX2_WDT_WCR); | |
102 | +} | |
103 | + | |
104 | +static inline void imx2_wdt_ping(void) | |
105 | +{ | |
106 | + __raw_writew(IMX2_WDT_SEQ1, imx2_wdt.base + IMX2_WDT_WSR); | |
107 | + __raw_writew(IMX2_WDT_SEQ2, imx2_wdt.base + IMX2_WDT_WSR); | |
108 | +} | |
109 | + | |
110 | +static void imx2_wdt_timer_ping(unsigned long arg) | |
111 | +{ | |
112 | + /* ping it every imx2_wdt.timeout / 2 seconds to prevent reboot */ | |
113 | + imx2_wdt_ping(); | |
114 | + mod_timer(&imx2_wdt.timer, jiffies + imx2_wdt.timeout * HZ / 2); | |
115 | +} | |
116 | + | |
117 | +static void imx2_wdt_start(void) | |
118 | +{ | |
119 | + if (!test_and_set_bit(IMX2_WDT_STATUS_STARTED, &imx2_wdt.status)) { | |
120 | + /* at our first start we enable clock and do initialisations */ | |
121 | + clk_enable(imx2_wdt.clk); | |
122 | + | |
123 | + imx2_wdt_setup(); | |
124 | + } else /* delete the timer that pings the watchdog after close */ | |
125 | + del_timer_sync(&imx2_wdt.timer); | |
126 | + | |
127 | + /* Watchdog is enabled - time to reload the timeout value */ | |
128 | + imx2_wdt_ping(); | |
129 | +} | |
130 | + | |
131 | +static void imx2_wdt_stop(void) | |
132 | +{ | |
133 | + /* we don't need a clk_disable, it cannot be disabled once started. | |
134 | + * We use a timer to ping the watchdog while /dev/watchdog is closed */ | |
135 | + imx2_wdt_timer_ping(0); | |
136 | +} | |
137 | + | |
138 | +static void imx2_wdt_set_timeout(int new_timeout) | |
139 | +{ | |
140 | + u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR); | |
141 | + | |
142 | + /* set the new timeout value in the WSR */ | |
143 | + val &= ~IMX2_WDT_WCR_WT; | |
144 | + val |= WDOG_SEC_TO_COUNT(new_timeout); | |
145 | + __raw_writew(val, imx2_wdt.base + IMX2_WDT_WCR); | |
146 | +} | |
147 | + | |
148 | +static int imx2_wdt_open(struct inode *inode, struct file *file) | |
149 | +{ | |
150 | + if (test_and_set_bit(IMX2_WDT_STATUS_OPEN, &imx2_wdt.status)) | |
151 | + return -EBUSY; | |
152 | + | |
153 | + imx2_wdt_start(); | |
154 | + return nonseekable_open(inode, file); | |
155 | +} | |
156 | + | |
157 | +static int imx2_wdt_close(struct inode *inode, struct file *file) | |
158 | +{ | |
159 | + if (test_bit(IMX2_WDT_EXPECT_CLOSE, &imx2_wdt.status) && !nowayout) | |
160 | + imx2_wdt_stop(); | |
161 | + else { | |
162 | + dev_crit(imx2_wdt_miscdev.parent, | |
163 | + "Unexpected close: Expect reboot!\n"); | |
164 | + imx2_wdt_ping(); | |
165 | + } | |
166 | + | |
167 | + clear_bit(IMX2_WDT_EXPECT_CLOSE, &imx2_wdt.status); | |
168 | + clear_bit(IMX2_WDT_STATUS_OPEN, &imx2_wdt.status); | |
169 | + return 0; | |
170 | +} | |
171 | + | |
172 | +static long imx2_wdt_ioctl(struct file *file, unsigned int cmd, | |
173 | + unsigned long arg) | |
174 | +{ | |
175 | + void __user *argp = (void __user *)arg; | |
176 | + int __user *p = argp; | |
177 | + int new_value; | |
178 | + | |
179 | + switch (cmd) { | |
180 | + case WDIOC_GETSUPPORT: | |
181 | + return copy_to_user(argp, &imx2_wdt_info, | |
182 | + sizeof(struct watchdog_info)) ? -EFAULT : 0; | |
183 | + | |
184 | + case WDIOC_GETSTATUS: | |
185 | + case WDIOC_GETBOOTSTATUS: | |
186 | + return put_user(0, p); | |
187 | + | |
188 | + case WDIOC_KEEPALIVE: | |
189 | + imx2_wdt_ping(); | |
190 | + return 0; | |
191 | + | |
192 | + case WDIOC_SETTIMEOUT: | |
193 | + if (get_user(new_value, p)) | |
194 | + return -EFAULT; | |
195 | + if ((new_value < 1) || (new_value > IMX2_WDT_MAX_TIME)) | |
196 | + return -EINVAL; | |
197 | + imx2_wdt_set_timeout(new_value); | |
198 | + imx2_wdt.timeout = new_value; | |
199 | + imx2_wdt_ping(); | |
200 | + | |
201 | + /* Fallthrough to return current value */ | |
202 | + case WDIOC_GETTIMEOUT: | |
203 | + return put_user(imx2_wdt.timeout, p); | |
204 | + | |
205 | + default: | |
206 | + return -ENOTTY; | |
207 | + } | |
208 | +} | |
209 | + | |
210 | +static ssize_t imx2_wdt_write(struct file *file, const char __user *data, | |
211 | + size_t len, loff_t *ppos) | |
212 | +{ | |
213 | + size_t i; | |
214 | + char c; | |
215 | + | |
216 | + if (len == 0) /* Can we see this even ? */ | |
217 | + return 0; | |
218 | + | |
219 | + clear_bit(IMX2_WDT_EXPECT_CLOSE, &imx2_wdt.status); | |
220 | + /* scan to see whether or not we got the magic character */ | |
221 | + for (i = 0; i != len; i++) { | |
222 | + if (get_user(c, data + i)) | |
223 | + return -EFAULT; | |
224 | + if (c == 'V') | |
225 | + set_bit(IMX2_WDT_EXPECT_CLOSE, &imx2_wdt.status); | |
226 | + } | |
227 | + | |
228 | + imx2_wdt_ping(); | |
229 | + return len; | |
230 | +} | |
231 | + | |
232 | +static const struct file_operations imx2_wdt_fops = { | |
233 | + .owner = THIS_MODULE, | |
234 | + .llseek = no_llseek, | |
235 | + .unlocked_ioctl = imx2_wdt_ioctl, | |
236 | + .open = imx2_wdt_open, | |
237 | + .release = imx2_wdt_close, | |
238 | + .write = imx2_wdt_write, | |
239 | +}; | |
240 | + | |
241 | +static struct miscdevice imx2_wdt_miscdev = { | |
242 | + .minor = WATCHDOG_MINOR, | |
243 | + .name = "watchdog", | |
244 | + .fops = &imx2_wdt_fops, | |
245 | +}; | |
246 | + | |
247 | +static int __init imx2_wdt_probe(struct platform_device *pdev) | |
248 | +{ | |
249 | + int ret; | |
250 | + int res_size; | |
251 | + struct resource *res; | |
252 | + | |
253 | + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
254 | + if (!res) { | |
255 | + dev_err(&pdev->dev, "can't get device resources\n"); | |
256 | + return -ENODEV; | |
257 | + } | |
258 | + | |
259 | + res_size = resource_size(res); | |
260 | + if (!devm_request_mem_region(&pdev->dev, res->start, res_size, | |
261 | + res->name)) { | |
262 | + dev_err(&pdev->dev, "can't allocate %d bytes at %d address\n", | |
263 | + res_size, res->start); | |
264 | + return -ENOMEM; | |
265 | + } | |
266 | + | |
267 | + imx2_wdt.base = devm_ioremap_nocache(&pdev->dev, res->start, res_size); | |
268 | + if (!imx2_wdt.base) { | |
269 | + dev_err(&pdev->dev, "ioremap failed\n"); | |
270 | + return -ENOMEM; | |
271 | + } | |
272 | + | |
273 | + imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); | |
274 | + if (IS_ERR(imx2_wdt.clk)) { | |
275 | + dev_err(&pdev->dev, "can't get Watchdog clock\n"); | |
276 | + return PTR_ERR(imx2_wdt.clk); | |
277 | + } | |
278 | + | |
279 | + imx2_wdt.timeout = clamp_t(unsigned, timeout, 1, IMX2_WDT_MAX_TIME); | |
280 | + if (imx2_wdt.timeout != timeout) | |
281 | + dev_warn(&pdev->dev, "Initial timeout out of range! " | |
282 | + "Clamped from %u to %u\n", timeout, imx2_wdt.timeout); | |
283 | + | |
284 | + setup_timer(&imx2_wdt.timer, imx2_wdt_timer_ping, 0); | |
285 | + | |
286 | + imx2_wdt_miscdev.parent = &pdev->dev; | |
287 | + ret = misc_register(&imx2_wdt_miscdev); | |
288 | + if (ret) | |
289 | + goto fail; | |
290 | + | |
291 | + dev_info(&pdev->dev, | |
292 | + "IMX2+ Watchdog Timer enabled. timeout=%ds (nowayout=%d)\n", | |
293 | + imx2_wdt.timeout, nowayout); | |
294 | + return 0; | |
295 | + | |
296 | +fail: | |
297 | + imx2_wdt_miscdev.parent = NULL; | |
298 | + clk_put(imx2_wdt.clk); | |
299 | + return ret; | |
300 | +} | |
301 | + | |
302 | +static int __exit imx2_wdt_remove(struct platform_device *pdev) | |
303 | +{ | |
304 | + misc_deregister(&imx2_wdt_miscdev); | |
305 | + | |
306 | + if (test_bit(IMX2_WDT_STATUS_STARTED, &imx2_wdt.status)) { | |
307 | + del_timer_sync(&imx2_wdt.timer); | |
308 | + | |
309 | + dev_crit(imx2_wdt_miscdev.parent, | |
310 | + "Device removed: Expect reboot!\n"); | |
311 | + } else | |
312 | + clk_put(imx2_wdt.clk); | |
313 | + | |
314 | + imx2_wdt_miscdev.parent = NULL; | |
315 | + return 0; | |
316 | +} | |
317 | + | |
318 | +static void imx2_wdt_shutdown(struct platform_device *pdev) | |
319 | +{ | |
320 | + if (test_bit(IMX2_WDT_STATUS_STARTED, &imx2_wdt.status)) { | |
321 | + /* we are running, we need to delete the timer but will give | |
322 | + * max timeout before reboot will take place */ | |
323 | + del_timer_sync(&imx2_wdt.timer); | |
324 | + imx2_wdt_set_timeout(IMX2_WDT_MAX_TIME); | |
325 | + imx2_wdt_ping(); | |
326 | + | |
327 | + dev_crit(imx2_wdt_miscdev.parent, | |
328 | + "Device shutdown: Expect reboot!\n"); | |
329 | + } | |
330 | +} | |
331 | + | |
332 | +static struct platform_driver imx2_wdt_driver = { | |
333 | + .probe = imx2_wdt_probe, | |
334 | + .remove = __exit_p(imx2_wdt_remove), | |
335 | + .shutdown = imx2_wdt_shutdown, | |
336 | + .driver = { | |
337 | + .name = DRIVER_NAME, | |
338 | + .owner = THIS_MODULE, | |
339 | + }, | |
340 | +}; | |
341 | + | |
342 | +static int __init imx2_wdt_init(void) | |
343 | +{ | |
344 | + return platform_driver_probe(&imx2_wdt_driver, imx2_wdt_probe); | |
345 | +} | |
346 | +module_init(imx2_wdt_init); | |
347 | + | |
348 | +static void __exit imx2_wdt_exit(void) | |
349 | +{ | |
350 | + platform_driver_unregister(&imx2_wdt_driver); | |
351 | +} | |
352 | +module_exit(imx2_wdt_exit); | |
353 | + | |
354 | +MODULE_AUTHOR("Wolfram Sang"); | |
355 | +MODULE_DESCRIPTION("Watchdog driver for IMX2 and later"); | |
356 | +MODULE_LICENSE("GPL v2"); | |
357 | +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | |
358 | +MODULE_ALIAS("platform:" DRIVER_NAME); |
drivers/watchdog/mpc8xxx_wdt.c
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | static u16 timeout = 0xffff; |
54 | 54 | module_param(timeout, ushort, 0); |
55 | 55 | MODULE_PARM_DESC(timeout, |
56 | - "Watchdog timeout in ticks. (0<timeout<65536, default=65535"); | |
56 | + "Watchdog timeout in ticks. (0<timeout<65536, default=65535)"); | |
57 | 57 | |
58 | 58 | static int reset = 1; |
59 | 59 | module_param(reset, bool, 0); |
drivers/watchdog/pc87413_wdt.c
... | ... | @@ -53,8 +53,10 @@ |
53 | 53 | #define WDTO 0x11 /* Watchdog timeout register */ |
54 | 54 | #define WDCFG 0x12 /* Watchdog config register */ |
55 | 55 | |
56 | -static int io = 0x2E; /* Address used on Portwell Boards */ | |
56 | +#define IO_DEFAULT 0x2E /* Address used on Portwell Boards */ | |
57 | 57 | |
58 | +static int io = IO_DEFAULT; | |
59 | + | |
58 | 60 | static int timeout = DEFAULT_TIMEOUT; /* timeout value */ |
59 | 61 | static unsigned long timer_enabled; /* is the timer enabled? */ |
60 | 62 | |
61 | 63 | |
... | ... | @@ -583,12 +585,13 @@ |
583 | 585 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
584 | 586 | |
585 | 587 | module_param(io, int, 0); |
586 | -MODULE_PARM_DESC(io, MODNAME " I/O port (default: " __MODULE_STRING(io) ")."); | |
588 | +MODULE_PARM_DESC(io, MODNAME " I/O port (default: " | |
589 | + __MODULE_STRING(IO_DEFAULT) ")."); | |
587 | 590 | |
588 | 591 | module_param(timeout, int, 0); |
589 | 592 | MODULE_PARM_DESC(timeout, |
590 | 593 | "Watchdog timeout in minutes (default=" |
591 | - __MODULE_STRING(timeout) ")."); | |
594 | + __MODULE_STRING(DEFAULT_TIMEOUT) ")."); | |
592 | 595 | |
593 | 596 | module_param(nowayout, int, 0); |
594 | 597 | MODULE_PARM_DESC(nowayout, |
drivers/watchdog/pnx833x_wdt.c
... | ... | @@ -33,6 +33,8 @@ |
33 | 33 | #define PFX "pnx833x: " |
34 | 34 | #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ |
35 | 35 | #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ |
36 | +#define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) | |
37 | +#define PNX_TIMEOUT_VALUE 2040000000U | |
36 | 38 | |
37 | 39 | /** CONFIG block */ |
38 | 40 | #define PNX833X_CONFIG (0x07000U) |
39 | 41 | |
40 | 42 | |
41 | 43 | |
... | ... | @@ -47,20 +49,21 @@ |
47 | 49 | static int pnx833x_wdt_alive; |
48 | 50 | |
49 | 51 | /* Set default timeout in MHZ.*/ |
50 | -static int pnx833x_wdt_timeout = (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY); | |
52 | +static int pnx833x_wdt_timeout = PNX_WATCHDOG_TIMEOUT; | |
51 | 53 | module_param(pnx833x_wdt_timeout, int, 0); |
52 | 54 | MODULE_PARM_DESC(timeout, "Watchdog timeout in Mhz. (68Mhz clock), default=" |
53 | - __MODULE_STRING(pnx833x_wdt_timeout) "(30 seconds)."); | |
55 | + __MODULE_STRING(PNX_TIMEOUT_VALUE) "(30 seconds)."); | |
54 | 56 | |
55 | 57 | static int nowayout = WATCHDOG_NOWAYOUT; |
56 | 58 | module_param(nowayout, int, 0); |
57 | 59 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
58 | 60 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
59 | 61 | |
60 | -static int start_enabled = 1; | |
62 | +#define START_DEFAULT 1 | |
63 | +static int start_enabled = START_DEFAULT; | |
61 | 64 | module_param(start_enabled, int, 0); |
62 | 65 | MODULE_PARM_DESC(start_enabled, "Watchdog is started on module insertion " |
63 | - "(default=" __MODULE_STRING(start_enabled) ")"); | |
66 | + "(default=" __MODULE_STRING(START_DEFAULT) ")"); | |
64 | 67 | |
65 | 68 | static void pnx833x_wdt_start(void) |
66 | 69 | { |
drivers/watchdog/s3c2410_wdt.c
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | module_param(soft_noboot, int, 0); |
64 | 64 | module_param(debug, int, 0); |
65 | 65 | |
66 | -MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" | |
66 | +MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default=" | |
67 | 67 | __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")"); |
68 | 68 | MODULE_PARM_DESC(tmr_atboot, |
69 | 69 | "Watchdog is started at boot time if set to 1, default=" |
... | ... | @@ -71,8 +71,8 @@ |
71 | 71 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
72 | 72 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
73 | 73 | MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, " |
74 | - "0 to reboot (default depends on ONLY_TESTING)"); | |
75 | -MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)"); | |
74 | + "0 to reboot (default 0)"); | |
75 | +MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)"); | |
76 | 76 | |
77 | 77 | static unsigned long open_lock; |
78 | 78 | static struct device *wdt_dev; /* platform device attached to */ |
... | ... | @@ -426,8 +426,7 @@ |
426 | 426 | wdt_mem = request_mem_region(res->start, size, pdev->name); |
427 | 427 | if (wdt_mem == NULL) { |
428 | 428 | dev_err(dev, "failed to get memory region\n"); |
429 | - ret = -ENOENT; | |
430 | - goto err_req; | |
429 | + return -EBUSY; | |
431 | 430 | } |
432 | 431 | |
433 | 432 | wdt_base = ioremap(res->start, size); |
drivers/watchdog/shwdt.c
... | ... | @@ -496,7 +496,7 @@ |
496 | 496 | module_param(clock_division_ratio, int, 0); |
497 | 497 | MODULE_PARM_DESC(clock_division_ratio, |
498 | 498 | "Clock division ratio. Valid ranges are from 0x5 (1.31ms) " |
499 | - "to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")"); | |
499 | + "to 0x7 (5.25ms). (default=" __MODULE_STRING(WTCSR_CKS_4096) ")"); | |
500 | 500 | |
501 | 501 | module_param(heartbeat, int, 0); |
502 | 502 | MODULE_PARM_DESC(heartbeat, |
drivers/watchdog/twl4030_wdt.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt977.c
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | static DEFINE_SPINLOCK(spinlock); |
64 | 64 | |
65 | 65 | module_param(timeout, int, 0); |
66 | -MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300), default=" | |
66 | +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300, default=" | |
67 | 67 | __MODULE_STRING(DEFAULT_TIMEOUT) ")"); |
68 | 68 | module_param(testmode, int, 0); |
69 | 69 | MODULE_PARM_DESC(testmode, "Watchdog testmode (1 = no reboot), default=0"); |