// SPDX-License-Identifier: GPL-2.0+ /* * SBC8360 Watchdog driver * * (c) Copyright 2005 Webcon, Inc. * * Based on ib700wdt.c, which is based on advantechwdt.c which is based * on acquirewdt.c which is based on wdt.c. * * (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 *
*/
/* * * Watchdog Timer Configuration * * The function of the watchdog timer is to reset the system automatically * and is defined at I/O port 0120H and 0121H. To enable the watchdog timer * and allow the system to reset, write appropriate values from the table * below to I/O port 0120H and 0121H. To disable the timer, write a zero * value to I/O port 0121H for the system to stop the watchdog function. * * The following describes how the timer should be programmed (according to * the vendor documentation) * * Enabling Watchdog: * MOV AX,000AH (enable, phase I) * MOV DX,0120H * OUT DX,AX * MOV AX,000BH (enable, phase II) * MOV DX,0120H * OUT DX,AX * MOV AX,000nH (set multiplier n, from 1-4) * MOV DX,0120H * OUT DX,AX * MOV AX,000mH (set base timer m, from 0-F) * MOV DX,0121H * OUT DX,AX * * Reset timer: * MOV AX,000mH (same as set base timer, above) * MOV DX,0121H * OUT DX,AX * * Disabling Watchdog: * MOV AX,0000H (a zero value) * MOV DX,0120H * OUT DX,AX * * Watchdog timeout configuration values: * N * M | 1 2 3 4 * --|---------------------------------- * 0 | 0.5s 5s 50s 100s * 1 | 1s 10s 100s 200s * 2 | 1.5s 15s 150s 300s * 3 | 2s 20s 200s 400s * 4 | 2.5s 25s 250s 500s * 5 | 3s 30s 300s 600s * 6 | 3.5s 35s 350s 700s * 7 | 4s 40s 400s 800s * 8 | 4.5s 45s 450s 900s * 9 | 5s 50s 500s 1000s * A | 5.5s 55s 550s 1100s * B | 6s 60s 600s 1200s * C | 6.5s 65s 650s 1300s * D | 7s 70s 700s 1400s * E | 7.5s 75s 750s 1500s * F | 8s 80s 800s 1600s * * Another way to say the same things is: * For N=1, Timeout = (M+1) * 0.5s * For N=2, Timeout = (M+1) * 5s * For N=3, Timeout = (M+1) * 50s * For N=4, Timeout = (M+1) * 100s *
*/
staticint __init sbc8360_init(void)
{ int res; unsignedlongint mseconds = 60000;
if (timeout < 0 || timeout > 63) {
pr_err("Invalid timeout index (must be 0-63)\n");
res = -EINVAL; goto out;
}
if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) {
pr_err("ENABLE method I/O %X is not available\n",
SBC8360_ENABLE);
res = -EIO; goto out;
} if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) {
pr_err("BASETIME method I/O %X is not available\n",
SBC8360_BASETIME);
res = -EIO; goto out_nobasetimereg;
}
res = register_reboot_notifier(&sbc8360_notifier); if (res) {
pr_err("Failed to register reboot notifier\n"); goto out_noreboot;
}
res = misc_register(&sbc8360_miscdev); if (res) {
pr_err("failed to register misc device\n"); goto out_nomisc;
}
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.