// SPDX-License-Identifier: GPL-2.0-only /* * VIA Chipset Watchdog Driver * * Copyright (C) 2011 Sigfox * Author: Marc Vertes <marc.vertes@sigfox.com> * Based on a preliminary version from Harald Welte <HaraldWelte@viatech.com> * Timer code by Wim Van Sebroeck <wim@iguana.be> * * Caveat: PnP must be enabled in BIOS to allow full access to watchdog * control registers. If not, the watchdog must be configured in BIOS manually.
*/
/* * Timer tick: the timer will make sure that the watchdog timer hardware * is being reset in time. The conditions to do this are: * 1) the watchdog timer has been started and /dev/watchdog is open * and there is still time left before userspace should send the * next heartbeat/ping. (note: the internal heartbeat is much smaller * then the external/userspace heartbeat). * 2) the watchdog timer has been stopped by userspace.
*/ staticvoid wdt_timer_tick(struct timer_list *unused)
{ if (time_before(jiffies, next_heartbeat) ||
(!watchdog_active(&wdt_dev))) {
wdt_reset();
mod_timer(&timer, jiffies + WDT_HEARTBEAT);
} else
pr_crit("I will reboot your machine !\n");
}
staticint wdt_ping(struct watchdog_device *wdd)
{ /* calculate when the next userspace timeout will be */
next_heartbeat = jiffies + wdd->timeout * HZ; return 0;
}
/* * Allocate a MMIO region which contains watchdog control register * and counter, then configure the watchdog to use this region. * This is possible only if PnP is properly enabled in BIOS. * If not, the watchdog must be configured in BIOS manually.
*/ if (allocate_resource(&iomem_resource, &wdt_res, VIA_WDT_MMIO_LEN,
0xf0000000, 0xffffff00, 0xff, NULL, NULL)) {
dev_err(&pdev->dev, "MMIO allocation failed\n"); goto err_out_disable_device;
}
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.