/* User land timeout */ #define WDT_HEARTBEAT 15 staticint heartbeat = WDT_HEARTBEAT;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " "(default = " __MODULE_STRING(WDT_HEARTBEAT) ")");
staticbool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
staticstruct { void __iomem *fpga; unsignedlong next_heartbeat; /* the next_heartbeat for the timer */ unsignedlong open; char expect_close; int bootstatus; struct timer_list timer; /* The timer that pings the watchdog */
} pikawdt_private;
/* *Watchdogdeviceisopened,andwatchdogstartsrunning.
*/ staticint pikawdt_open(struct inode *inode, struct file *file)
{ /* /dev/watchdog can only be opened once */ if (test_and_set_bit(0, &pikawdt_private.open)) return -EBUSY;
/* POST information is in the sd area. */
np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); if (np == NULL) {
pr_err("Unable to find fpga-sd\n");
ret = -ENOENT; goto out;
}
fpga = of_iomap(np, 0);
of_node_put(np); if (fpga == NULL) {
pr_err("Unable to map fpga-sd\n");
ret = -ENOMEM; goto out;
}
/* -- FPGA: POST Test Results Register 1 (32bit R/W) (Offset: 0x4040) -- *Bit31,WDOG:Setto1whenthelastresetwascausedbyawatchdog *timeout.
*/
post1 = in_be32(fpga + 0x40); if (post1 & 0x80000000)
pikawdt_private.bootstatus = WDIOF_CARDRESET;
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.