// SPDX-License-Identifier: GPL-2.0+ /* * IB700 Single Board Computer WDT driver * * (c) Copyright 2001 Charles Howes <chowes@vsol.net> * * Based on advantechwdt.c which is based on acquirewdt.c which * is based on wdt.c. * * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl> * * Based on acquirewdt.c which is based on wdt.c. * Original copyright messages: * * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>, * All Rights Reserved. * * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide * warranty for any of this software. This material is provided * "AS-IS" and at no charge. * * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> * * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com> * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT * Added timeout module option to override default *
*/
/* Module information */ #define DRV_NAME "ib700wdt"
/* * * Watchdog Timer Configuration * * The function of the watchdog timer is to reset the system * automatically and is defined at I/O port 0443H. To enable the * watchdog timer and allow the system to reset, write I/O port 0443H. * To disable the timer, write I/O port 0441H for the system to stop the * watchdog function. The timer has a tolerance of 20% for its * intervals. * * The following describes how the timer should be programmed. * * Enabling Watchdog: * MOV AX,000FH (Choose the values from 0 to F) * MOV DX,0443H * OUT DX,AX * * Disabling Watchdog: * MOV AX,000FH (Any value is fine.) * MOV DX,0441H * OUT DX,AX * * Watchdog timer control table: * Level Value Time/sec | Level Value Time/sec * 1 F 0 | 9 7 16 * 2 E 2 | 10 6 18 * 3 D 4 | 11 5 20 * 4 C 6 | 12 4 22 * 5 B 8 | 13 3 24 * 6 A 10 | 14 2 26 * 7 9 12 | 15 1 28 * 8 8 14 | 16 0 30 *
*/
staticint __init ibwdt_probe(struct platform_device *dev)
{ int res;
#if WDT_START != WDT_STOP if (!request_region(WDT_STOP, 1, "IB700 WDT")) {
pr_err("STOP method I/O %X is not available\n", WDT_STOP);
res = -EIO; goto out_nostopreg;
} #endif
if (!request_region(WDT_START, 1, "IB700 WDT")) {
pr_err("START method I/O %X is not available\n", WDT_START);
res = -EIO; goto out_nostartreg;
}
/* Check that the heartbeat value is within it's range ;
* if not reset to the default */ if (ibwdt_set_heartbeat(timeout)) {
ibwdt_set_heartbeat(WATCHDOG_TIMEOUT);
pr_info("timeout value must be 0<=x<=30, using %d\n", timeout);
}
res = misc_register(&ibwdt_miscdev); if (res) {
pr_err("failed to register misc device\n"); goto out_nomisc;
} return 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.