linux/drivers/watchdog/iTCO_wdt.c
<<
ue="3ue="3ue//spa.6.ue/spa. class="lxr_search">ue="ue="3ue="3ue="3typ Searchue="3ue//spa.6.="3< ue/input typ u="3< . /div id < <1//a>/spa. class="comment">/*//spa.6.< <2//a>/spa. class="comment"> *="3< < <3//a>/spa. class="comment"> *//spa.6.< <4//a>/spa. class="comment"> *="3< <(c) Copyright 2006-2011 Wim Va. Sebroeck <wim@iguana.be>.//spa.6.< <5//a>/spa. class="comment"> *//spa.6.< <6//a>/spa. class="comment"> *="3< < <7//a>/spa. class="comment"> *="3< < <8//a>/spa. class="comment"> *="3< < <9//a>/spa. class="comment"> *="3< <2 of the License, or (at your v2.) any later versv2..//spa.6.< > a>/spa. class="comment"> *//spa.6.< 11//a>/spa. class="comment"> *="3< < 12//a>/spa. class="comment"> *="3< < 13//a>/spa. class="comment"> *="3< < 14//a>/spa. class="comment"> *//spa.6.< 15//a>/spa. class="comment"> *="3< < 16//a>/spa. class="comment"> *="3< <(See the intel documenta v2. on http://developer.intel.com.)//spa.6.< 17//a>/spa. class="comment"> *="3< < 18//a>/spa. class="comment"> *="3< < 19//a>/spa. class="comment"> *="3< < 2 a>/spa. class="comment"> *="3< < 21//a>/spa. class="comment"> *="3< < 22//a>/spa. class="comment"> *="3< < 23//a>/spa. class="comment"> *="3< < 24//a>/spa. class="comment"> *="3< < 25//a>/spa. class="comment"> *="3< < 26//a>/spa. class="comment"> *="3< < 27//a>/spa. class="comment"> *="3< < 28//a>/spa. class="comment"> *="3< < 29//a>/spa. class="comment"> *="3< spa.6.< 3 a>/spa. class="comment"> *="3< < 31//a>/spa. class="comment"> *="3< < 32//a>/spa. class="comment"> *="3< < 33//a>/spa. class="comment"> *="3< < 34//a>/spa. class="comment"> *="3< < 35//a>/spa. class="comment"> *="3< < 36//a>/spa. class="comment"> *="3< < 37//a>/spa. class="comment"> *="3< < 38//a>/spa. class="comment"> *="3< < 39//a>/spa. class="comment"> *="3< < 4 a>/spa. class="comment"> *="3< < 41//a>/spa. class="comment"> *///spa.6.< 42//a>.< 43//a>/spa. class="comment">/*//spa.6.< 44//a>/spa. class="comment"> *="3< < 45//a>/spa. class="comment"> *///spa.6.< 46//a>.< 47//a>#definepr_fmt//a>(/a href="+code=fmt" class="sref">fmt//a>)KBUILD_MODNAME//a> /spa. class="string">": "//spa.6fmt//a>.< 48//a>.< 49//a>/spa. class="comment">/* Module and versv2. informa v2. *///spa.6.< 50//a>#defineDRV_NAME//a> /spa. class="string">"iTCO_wdt"//spa.6.< 51//a>#defineDRV_VERSION//a> /spa. class="string">" > "//spa.6.< 52//a>.< 53//a>/spa. class="comment">/*< 54//a>#include <linux/module.h//a>> /spa. class="comment">/*< 55//a>#include <linux/moduleparam.h//a>> /spa. class="comment">/*< 56//a>#include <linux/typ s.h//a>> /spa. class="comment">/*< 57//a>#include <linux/errno.h//a>> /spa. class="comment">/*< 58//a>#include <linux/kernel.h//a>> /spa. class="comment">/*< 59//a>#include <linux/miscdevice.h//a>> /spa. class="comment">/*< 6 a>/spa. class="comment"> (WATCHDOG_MINOR) *///spa.6.< 61//a>#include <linux/watchdog.h//a>> /spa. class="comment">/*< 62//a>#include <linux/init.h//a>> /spa. class="comment">/*< 63//a>#include <linux/fs.h//a>> /spa. class="comment">/*< 64//a>#include <linux/platform_device.h//a>> /spa. class="comment">/*< 65//a>#include <linux/pci.h//a>> /spa. class="comment">/*< 66//a>#include <linux/ioport.h//a>> /spa. class="comment">/*< 67//a>#include <linux/spinlock.h//a>> /spa. class="comment">/*< 68//a>#include <linux/uaccess.h//a>> /spa. class="comment">/*< 69//a>#include <linux/io.h//a>> /spa. class="comment">/*< 70//a>#include <linux/mfd/core.h//a>>.< 71//a>#include <linux/mfd/lpc_ich.h//a>>.< 72//a>.< 73//a>#include "/a href="drivers/watchdog/iTCO_vendor.h" class="fref">iTCO_vendor.h//a>".< 74//a>.< 75//a>/spa. class="comment">/*
< 76//a>/spa. class="comment">/*< 77//a>#defineTCOBASE//a> (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>->/a href="+code=start" class="sref">start//a>).< 78//a>/spa. class="comment">/*< 79//a>#defineSMI_EN//a> (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>->/a href="+code=start" class="sref">start//a>).< 80//a>.< 81//a>#defineTCO_RLD//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x00) /spa. class="comment">/*< 82//a>#defineTCOv1_TMR//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x01) /spa. class="comment">/*< 83//a>#defineTCO_DAT_IN//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x02) /spa. class="comment">/*< 84//a>#defineTCO_DAT_OUT//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x03) /spa. class="comment">/*< 85//a>#defineTCO1_STS//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x04) /spa. class="comment">/*< 86//a>#defineTCO2_STS//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x06) /spa. class="comment">/*< 87//a>#defineTCO1_CNT//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x08) /spa. class="comment">/*< 88//a>#defineTCO2_CNT//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x0a) /spa. class="comment">/*< 89//a>#defineTCOv2_TMR//a> (/a href="+code=TCOBASE" class="sref">TCOBASE//a> + 0x12) /spa. class="comment">/*< 90//a>.< 91//a>/spa. class="comment">/* internal variables *///spa.6.< 92//a>static struct { /spa. class="comment">/*< 93//a> /spa. class="comment">/*< 94//a> unsigned intiTCO_versv2.//a>;.< 95//a> struct /a href="+code=resource" class="sref">resource//a> */a href="+code=tco_res" class="sref">tco_res//a>;.< 96//a> struct /a href="+code=resource" class="sref">resource//a> */a href="+code=smi_res" class="sref">smi_res//a>;.< 97//a> struct /a href="+code=resource" class="sref">resource//a> */a href="+code=gcs_res" class="sref">gcs_res//a>;.< 98//a> /spa. class="comment">/*< 99//a> unsigned long /a href="+code=__iomem" class="sref">__iomem//a> */a href="+code=gcs" class="sref">gcs//a>;.<100//a> /spa. class="comment">/*<101//a> /a href="+code=spinlock_t" class="sref">spinlock_t//a> /a href="+code=io_lock" class="sref">io_lock//a>;.<102//a> struct /a href="+code=platform_device" class="sref">platform_device//a> */a href="+code=dev" class="sref">dev//a>;.<103//a> /spa. class="comment">/*<104//a> struct /a href="+code=pci_dev" class="sref">pci_dev//a> */a href="+code=pdev" class="sref">pdev//a>;.<105//a>}iTCO_wdt_private//a>;.<106//a>.<107//a>/spa. class="comment">/*<108//a>#defineWATCHDOG_TIMEOUT//a> 30 /spa. class="comment">/*<30 sec default heartbeat *///spa.6.<109//a>static intheartbeat//a> =WATCHDOG_TIMEOUT//a>; /spa. class="comment">/*<1> a>/a href="+code=module_param" class="sref">module_param a>(/a href="+code=heartbeat" class="sref">heartbeat//a>, int, 0);.<111//a>/a href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESC a>(/a href="+code=heartbeat" class="sref">heartbeat//a>, /spa. class="string">"Watchdog timeout<112//a> /spa. class="string">"5..76 (TCO v1) or 3..614 (TCO v2), default="//spa.6.<113//a> /a href="+code=__MODULE_STRING" class="sref">__MODULE_STRING a>(/a href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUT//a>) /spa. class="string">")"//spa.6);.<114//a>.<115//a>static /a href="+code=bool" class="sref">bool//a> /a href="+code=nowayout" class="sref">nowayout//a> =WATCHDOG_NOWAYOUT//a>;.<116//a>/a href="+code=module_param" class="sref">module_param a>(/a href="+code=nowayout" class="sref">nowayout//a>, /a href="+code=bool" class="sref">bool//a>, 0);.<117//a>/a href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESC a>(/a href="+code=nowayout" class="sref">nowayout//a>,.<118//a> /spa. class="string">"Watchdog cannot be stopped once started (default="//spa.6.<119//a> /a href="+code=__MODULE_STRING" class="sref">__MODULE_STRING a>(/a href="+code=WATCHDOG_NOWAYOUT" class="sref">WATCHDOG_NOWAYOUT//a>) /spa. class="string">")"//spa.6);.<120//a>.<121//a>static intturn_SMI_watchdog_clear_off//a> =<1;.<122//a>/a href="+code=module_param" class="sref">module_param a>(/a href="+code=turn_SMI_watchdog_clear_off" class="sref">turn_SMI_watchdog_clear_off//a>, int, 0);.<123//a>/a href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESC a>(/a href="+code=turn_SMI_watchdog_clear_off" class="sref">turn_SMI_watchdog_clear_off//a>,.<124//a> /spa. class="string">"Turn off<125//a>.<126//a>/spa. class="comment">/*//spa.6.<127//a>/spa. class="comment"> *=Some TCO specific func v2.s//spa.6.<128//a>/spa. class="comment"> *///spa.6.<129//a>.<13 a>static /a href="+code=inline" class="sref">inline//a> unsigned intseconds_to_ticks a>(intseconds//a>).<131//a>{.<132//a> /spa. class="comment">/*<133//a>/spa. class="comment"> * every 0.6 seconds *///spa.6.<134//a> return (/a href="+code=seconds" class="sref">seconds//a> * 10) / 6;.<135//a>}.<136//a>.<137//a>static voidiTCO_wdt_set_NO_REBOOT_bit a>(void).<138//a>{.<139//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=val32" class="sref">val32//a>;.<140//a>.<141//a> /spa. class="comment">/*<142//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<143//a> /a href="+code=val32" class="sref">val32//a> =readl a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<144//a> /a href="+code=val32" class="sref">val32//a> |= 0x00000020;.<145//a> /a href="+code=writel" class="sref">writel a>(/a href="+code=val32" class="sref">val32//a>, /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<146//a> } else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) {.<147//a> /a href="+code=pci_read_config_dword" class="sref">pci_read_config_dword a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a>, 0xd4, &/a href="+code=val32" class="sref">val32//a>);.<148//a> /a href="+code=val32" class="sref">val32//a> |= 0x00000002;.<149//a> /a href="+code=pci_write_config_dword" class="sref">pci_write_config_dword a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a>, 0xd4, /a href="+code=val32" class="sref">val32//a>);.<150//a> }.<151//a>}.<152//a>.<153//a>static intiTCO_wdt_unset_NO_REBOOT_bit a>(void).<154//a>{.<155//a> intret//a> =<0;.<156//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=val32" class="sref">val32//a>;.<157//a>.<158//a> /spa. class="comment">/*<159//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<160//a> /a href="+code=val32" class="sref">val32//a> =readl a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<161//a> /a href="+code=val32" class="sref">val32//a> &= 0xffffffdf;.<162//a> /a href="+code=writel" class="sref">writel a>(/a href="+code=val32" class="sref">val32//a>, /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<163//a>.<164//a> /a href="+code=val32" class="sref">val32//a> =readl a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<165//a> if (/a href="+code=val32" class="sref">val32//a> & 0x00000020).<166//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EIO" class="sref">EIO//a>;.<167//a> } else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) {.<168//a> /a href="+code=pci_read_config_dword" class="sref">pci_read_config_dword a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a>, 0xd4, &/a href="+code=val32" class="sref">val32//a>);.<169//a> /a href="+code=val32" class="sref">val32//a> &= 0xfffffffd;.<170//a> /a href="+code=pci_write_config_dword" class="sref">pci_write_config_dword a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a>, 0xd4, /a href="+code=val32" class="sref">val32//a>);.<171//a>.<172//a> /a href="+code=pci_read_config_dword" class="sref">pci_read_config_dword a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a>, 0xd4, &/a href="+code=val32" class="sref">val32//a>);.<173//a> if (/a href="+code=val32" class="sref">val32//a> & 0x00000002).<174//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EIO" class="sref">EIO//a>;.<175//a> }.<176//a>.<177//a> return /a href="+code=ret" class="sref">ret//a>; /spa. class="comment">/*<178//a>}.<179//a>.<18 a>static intiTCO_wdt_start a>(struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> */a href="+code=wd_dev" class="sref">wd_dev//a>).<181//a>{.<182//a> unsigned intval//a>;.<183//a>.<184//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<185//a>.<186//a> /a href="+code=iTCO_vendor_pre_start" class="sref">iTCO_vendor_pre_start a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>, /a href="+code=wd_dev" class="sref">wd_dev//a>->/a href="+code=timeout" class="sref">timeout//a>);.<187//a>.<188//a> /spa. class="comment">/*<189//a> if (/a href="+code=iTCO_wdt_unset_NO_REBOOT_bit" class="sref">iTCO_wdt_unset_NO_REBOOT_bit a>()) {.<190//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<191//a> /a href="+code=pr_err" class="sref">pr_err a>(/spa. class="string">"failed to<192//a> return -/a href="+code=EIO" class="sref">EIO//a>;.<193//a> }.<194//a>.<195//a> /spa. class="comment">/*<196//a>/spa. class="comment"> register *///spa.6.<197//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2).<198//a> /a href="+code=outw" class="sref">outw a>(0x01, /a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<199//a> else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1).<200//a> /a href="+code=outb" class="sref">outb a>(0x01, /a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<201//a>.<202//a> /spa. class="comment">/*<203//a> /a href="+code=val" class="sref">val//a> =inw a>(/a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<204//a> /a href="+code=val" class="sref">val//a> &= 0xf7ff;.<205//a> /a href="+code=outw" class="sref">outw a>(/a href="+code=val" class="sref">val//a>, /a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<206//a> /a href="+code=val" class="sref">val//a> =inw a>(/a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<207//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<208//a>.<209//a> if (/a href="+code=val" class="sref">val//a> & 0x0800).<210//a> return -1;.<211//a> return 0;.<212//a>}.<213//a>.<214//a>static intiTCO_wdt_stop a>(struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> */a href="+code=wd_dev" class="sref">wd_dev//a>).<215//a>{.<216//a> unsigned intval//a>;.<217//a>.<218//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<219//a>.<220//a> /a href="+code=iTCO_vendor_pre_stop" class="sref">iTCO_vendor_pre_stop a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>);.<221//a>.<222//a> /spa. class="comment">/*<223//a> /a href="+code=val" class="sref">val//a> =inw a>(/a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<224//a> /a href="+code=val" class="sref">val//a> |= 0x0800;.<225//a> /a href="+code=outw" class="sref">outw a>(/a href="+code=val" class="sref">val//a>, /a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<226//a> /a href="+code=val" class="sref">val//a> =inw a>(/a href="+code=TCO1_CNT" class="sref">TCO1_CNT//a>);.<227//a>.<228//a> /spa. class="comment">/*<229//a> /a href="+code=iTCO_wdt_set_NO_REBOOT_bit" class="sref">iTCO_wdt_set_NO_REBOOT_bit a>();.<230//a>.<231//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<232//a>.<233//a> if ((/a href="+code=val" class="sref">val//a> & 0x0800) == 0).<234//a> return -1;.<235//a> return 0;.<236//a>}.<237//a>.<238//a>static intiTCO_wdt_ping a>(struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> */a href="+code=wd_dev" class="sref">wd_dev//a>).<239//a>{.<240//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<241//a>.<242//a> /a href="+code=iTCO_vendor_pre_keepalive" class="sref">iTCO_vendor_pre_keepalive a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>, /a href="+code=wd_dev" class="sref">wd_dev//a>->/a href="+code=timeout" class="sref">timeout//a>);.<243//a>.<244//a> /spa. class="comment">/*<245//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2).<246//a> /a href="+code=outw" class="sref">outw a>(0x01, /a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<247//a> else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) {.<248//a> /spa. class="comment">/*<249//a>/spa. class="comment"> * needs to<250//a> /a href="+code=outw" class="sref">outw a>(0x0008, /a href="+code=TCO1_STS" class="sref">TCO1_STS//a>); /spa. class="comment">/*<251//a>.<252//a> /a href="+code=outb" class="sref">outb a>(0x01, /a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<253//a> }.<254//a>.<255//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<256//a> return 0;.<257//a>}.<258//a>.<259//a>static intiTCO_wdt_set_timeout a>(struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> */a href="+code=wd_dev" class="sref">wd_dev//a>, unsigned intt//a>).<260//a>{.<261//a> unsigned intval16//a>;.<262//a> unsigned char /a href="+code=val8" class="sref">val8//a>;.<263//a> unsigned inttmrval//a>;.<264//a>.<265//a> /a href="+code=tmrval" class="sref">tmrval//a> =seconds_to_ticks a>(/a href="+code=t" class="sref">t//a>);.<266//a>.<267//a> /spa. class="comment">/*<268//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1).<269//a> /a href="+code=tmrval" class="sref">tmrval//a> /= 2;.<270//a>.<271//a> /spa. class="comment">/*<272//a> /spa. class="comment">/*<"V s of 0h-3h are ignored and should not be attempted" *///spa.6.<273//a> if (/a href="+code=tmrval" class="sref">tmrval//a> < 0x04).<274//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<275//a> if (((/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) && (/a href="+code=tmrval" class="sref">tmrval//a> > 0x3ff)) ||.<276//a> ((/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) && (/a href="+code=tmrval" class="sref">tmrval//a> > 0x03f))).<277//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<278//a>.<279//a> /a href="+code=iTCO_vendor_pre_set_heartbeat" class="sref">iTCO_vendor_pre_set_heartbeat a>(/a href="+code=tmrval" class="sref">tmrval//a>);.<280//a>.<281//a> /spa. class="comment">/*<282//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<283//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<284//a> /a href="+code=val16" class="sref">val16//a> =inw a>(/a href="+code=TCOv2_TMR" class="sref">TCOv2_TMR//a>);.<285//a> /a href="+code=val16" class="sref">val16//a> &= 0xfc00;.<286//a> /a href="+code=val16" class="sref">val16//a> |=tmrval//a>;.<287//a> /a href="+code=outw" class="sref">outw a>(/a href="+code=val16" class="sref">val16//a>, /a href="+code=TCOv2_TMR" class="sref">TCOv2_TMR//a>);.<288//a> /a href="+code=val16" class="sref">val16//a> =inw a>(/a href="+code=TCOv2_TMR" class="sref">TCOv2_TMR//a>);.<289//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<290//a>.<291//a> if ((/a href="+code=val16" class="sref">val16//a> & 0x3ff) !=tmrval//a>).<292//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<293//a> } else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) {.<294//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<295//a> /a href="+code=val8" class="sref">val8//a> =inb a>(/a href="+code=TCOv1_TMR" class="sref">TCOv1_TMR//a>);.<296//a> /a href="+code=val8" class="sref">val8//a> &= 0xc0;.<297//a> /a href="+code=val8" class="sref">val8//a> |=<(/a href="+code=tmrval" class="sref">tmrval//a> & 0xff);.<298//a> /a href="+code=outb" class="sref">outb a>(/a href="+code=val8" class="sref">val8//a>, /a href="+code=TCOv1_TMR" class="sref">TCOv1_TMR//a>);.<299//a> /a href="+code=val8" class="sref">val8//a> =inb a>(/a href="+code=TCOv1_TMR" class="sref">TCOv1_TMR//a>);.<300//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<301//a>.<302//a> if ((/a href="+code=val8" class="sref">val8//a> & 0x3f) !=tmrval//a>).<303//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<304//a> }.<305//a>.<306//a> /a href="+code=wd_dev" class="sref">wd_dev//a>->/a href="+code=timeout" class="sref">timeout//a> =t//a>;.<307//a> return 0;.<308//a>}.<309//a>.<31 a>static unsigned intiTCO_wdt_get_timeleft a>(struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> */a href="+code=wd_dev" class="sref">wd_dev//a>).<311//a>{.<312//a> unsigned intval16//a>;.<313//a> unsigned char /a href="+code=val8" class="sref">val8//a>;.<314//a> unsigned inttime_left//a> =<0;.<315//a>.<316//a> /spa. class="comment">/*<317//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<318//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<319//a> /a href="+code=val16" class="sref">val16//a> =inw a>(/a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<320//a> /a href="+code=val16" class="sref">val16//a> &= 0x3ff;.<321//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<322//a>.<323//a> /a href="+code=time_left" class="sref">time_left//a> =<(/a href="+code=val16" class="sref">val16//a> * 6) / 10;.<324//a> } else if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 1) {.<325//a> /a href="+code=spin_lock" class="sref">spin_lock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<326//a> /a href="+code=val8" class="sref">val8//a> =inb a>(/a href="+code=TCO_RLD" class="sref">TCO_RLD//a>);.<327//a> /a href="+code=val8" class="sref">val8//a> &= 0x3f;.<328//a> if (!(/a href="+code=inw" class="sref">inw a>(/a href="+code=TCO1_STS" class="sref">TCO1_STS//a>) & 0x0008)).<329//a> /a href="+code=val8" class="sref">val8//a> +=<(/a href="+code=inb" class="sref">inb a>(/a href="+code=TCOv1_TMR" class="sref">TCOv1_TMR//a>) & 0x3f);.<330//a> /a href="+code=spin_unlock" class="sref">spin_unlock a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<331//a>.<332//a> /a href="+code=time_left" class="sref">time_left//a> =<(/a href="+code=val8" class="sref">val8//a> * 6) / 10;.<333//a> }.<334//a> return /a href="+code=time_left" class="sref">time_left//a>;.<335//a>}.<336//a>.<337//a>/spa. class="comment">/*//spa.6.<338//a>/spa. class="comment"> * Kernel Interfaces//spa.6.<339//a>/spa. class="comment"> *///spa.6.<340//a>.<341//a>static constwatchdog_info//a> /a href="+code=ident" class="sref">ident//a> =<{.<342//a> ./a href="+code=optv2.s" class="sref">optv2.s//a> =< /a href="+code=WDIOF_SETTIMEOUT" class="sref">WDIOF_SETTIMEOUT//a> |.<343//a> /a href="+code=WDIOF_KEEPALIVEPING" class="sref">WDIOF_KEEPALIVEPING//a> |.<344//a> /a href="+code=WDIOF_MAGICCLOSE" class="sref">WDIOF_MAGICCLOSE//a>,.<345//a> ./a href="+code=firmware_versv2." class="sref">firmware_versv2.//a> =< 0,.<346//a> ./a href="+code=identity" class="sref">identity//a> =< /a href="+code=DRV_NAME" class="sref">DRV_NAME//a>,.<347//a>};.<348//a>.<349//a>static constwatchdog_ops//a> /a href="+code=iTCO_wdt_ops" class="sref">iTCO_wdt_ops//a> =<{.<350//a> ./a href="+code=owner" class="sref">owner//a> =< /a href="+code=THIS_MODULE" class="sref">THIS_MODULE//a>,.<351//a> ./a href="+code=start" class="sref">start a> =< /a href="+code=iTCO_wdt_start" class="sref">iTCO_wdt_start a>,.<352//a> ./a href="+code=stop" class="sref">stop a> =< iTCO_wdt_stop a>,.<353//a> ./a href="+code=ping" class="sref">ping a> =< iTCO_wdt_ping a>,.<354//a> ./a href="+code=set_timeout" class="sref">set_timeout a> =< /a href="+code=iTCO_wdt_set_timeout" class="sref">iTCO_wdt_set_timeout a>,.<355//a> ./a href="+code=get_timeleft" class="sref">get_timeleft a> =< /a href="+code=iTCO_wdt_get_timeleft" class="sref">iTCO_wdt_get_timeleft a>,.<356//a>};.<357//a>.<358//a>static struct /a href="+code=watchdog_device" class="sref">watchdog_device//a> /a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a> =<{.<359//a> ./a href="+code=info" class="sref">info//a> =< &/a href="+code=ident" class="sref">ident//a>,.<360//a> ./a href="+code=ops" class="sref">ops//a> =<< &/a href="+code=iTCO_wdt_ops" class="sref">iTCO_wdt_ops//a>,.<361//a>};.<362//a>.<363//a>/spa. class="comment">/*//spa.6.<364//a>/spa. class="comment"> * Init & exit routines//spa.6.<365//a>/spa. class="comment"> *///spa.6.<366//a>.<367//a>static void /a href="+code=__devexit" class="sref">__devexit//a> /a href="+code=iTCO_wdt_cleanup" class="sref">iTCO_wdt_cleanup a>(void).<368//a>{.<369//a> /spa. class="comment">/*<370//a> if (!/a href="+code=nowayout" class="sref">nowayout//a>).<371//a> /a href="+code=iTCO_wdt_stop" class="sref">iTCO_wdt_stop a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>);.<372//a>.<373//a> /spa. class="comment">/*<374//a> /a href="+code=watchdog_unregister_device" class="sref">watchdog_unregister_device a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>);.<375//a>.<376//a> /spa. class="comment">/*<377//a> /a href="+code=release_regi2." class="sref">release_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>->/a href="+code=start" class="sref">start a>,.<378//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>));.<379//a> /a href="+code=release_regi2." class="sref">release_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>->/a href="+code=start" class="sref">start a>,.<380//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>));.<381//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<382//a> /a href="+code=iounmap" class="sref">iounmap a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<383//a> /a href="+code=release_mem_regi2." class="sref">release_mem_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>->/a href="+code=start" class="sref">start a>,.<384//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>));.<385//a> }.<386//a>.<387//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a> =NULL//a>;.<388//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a> =NULL//a>;.<389//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a> =NULL//a>;.<390//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a> =NULL//a>;.<391//a>}.<392//a>.<393//a>static int__devinit//a> /a href="+code=iTCO_wdt_probe" class="sref">iTCO_wdt_probe a>(struct /a href="+code=platform_device" class="sref">platform_device//a> */a href="+code=dev" class="sref">dev//a>).<394//a>{.<395//a> intret//a> =<-/a href="+code=ENODEV" class="sref">ENODEV//a>;.<396//a> unsigned long /a href="+code=val32" class="sref">val32//a>;.<397//a> struct /a href="+code=lpc_ich_info" class="sref">lpc_ich_info//a> */a href="+code=ich_info" class="sref">ich_info//a> =dev//a>->/a href="+code=dev" class="sref">dev//a>./a href="+code=platform_data" class="sref">platform_data//a>;.<398//a>.<399//a> if (!/a href="+code=ich_info" class="sref">ich_info//a>).<400//a> goto /a href="+code=out" class="sref">out//a>;.<401//a>.<402//a> /a href="+code=spin_lock_init" class="sref">spin_lock_init a>(&/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=io_lock" class="sref">io_lock//a>);.<403//a>.<404//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a> =.<405//a> /a href="+code=platform_get_resource" class="sref">platform_get_resource a>(/a href="+code=dev" class="sref">dev//a>, /a href="+code=IORESOURCE_IO" class="sref">IORESOURCE_IO//a>, /a href="+code=ICH_RES_IO_TCO" class="sref">ICH_RES_IO_TCO//a>);.<406//a> if (!/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>).<407//a> goto /a href="+code=out" class="sref">out//a>;.<408//a>.<409//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a> =.<410//a> /a href="+code=platform_get_resource" class="sref">platform_get_resource a>(/a href="+code=dev" class="sref">dev//a>, /a href="+code=IORESOURCE_IO" class="sref">IORESOURCE_IO//a>, /a href="+code=ICH_RES_IO_SMI" class="sref">ICH_RES_IO_SMI//a>);.<411//a> if (!/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>).<412//a> goto /a href="+code=out" class="sref">out//a>;.<413//a>.<414//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> = /a href="+code=ich_info" class="sref">ich_info//a>->/a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a>;.<415//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=dev" class="sref">dev//a> =dev//a>;.<416//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=pdev" class="sref">pdev//a> =to_pci_dev a>(/a href="+code=dev" class="sref">dev//a>->/a href="+code=dev" class="sref">dev//a>./a href="+code=parent" class="sref">parent//a>);.<417//a>.<418//a> /spa. class="comment">/*//spa.6.<419//a>/spa. class="comment"> * Get<420//a>/spa. class="comment"> * NO_REBOOT flag (TCO v2).//spa.6.<421//a>/spa. class="comment"> *///spa.6.<422//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2) {.<423//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a> =platform_get_resource a>(/a href="+code=dev" class="sref">dev//a>,.<424//a> /a href="+code=IORESOURCE_MEM" class="sref">IORESOURCE_MEM//a>,.<425//a> /a href="+code=ICH_RES_MEM_GCS" class="sref">ICH_RES_MEM_GCS//a>);.<426//a>.<427//a> if (!/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>).<428//a> goto /a href="+code=out" class="sref">out//a>;.<429//a>.<430//a> if (!/a href="+code=request_mem_regi2." class="sref">request_mem_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>->/a href="+code=start" class="sref">start a>,.<431//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>), /a href="+code=dev" class="sref">dev//a>->/a href="+code=nam " class="sref">nam //a>)) {.<432//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EBUSY" class="sref">EBUSY//a>;.<433//a> goto /a href="+code=out" class="sref">out//a>;.<434//a> }.<435//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a> =ioremap a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>->/a href="+code=start" class="sref">start a>,.<436//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>));.<437//a> if (!/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>) {.<438//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EIO" class="sref">EIO//a>;.<439//a> goto /a href="+code=unreg_gcs" class="sref">unreg_gcs//a>;.<440//a> }.<441//a> }.<442//a>.<443//a> /spa. class="comment">/*<444//a> if (/a href="+code=iTCO_wdt_unset_NO_REBOOT_bit" class="sref">iTCO_wdt_unset_NO_REBOOT_bit a>() && /a href="+code=iTCO_vendor_check_noreboot_2." class="sref">iTCO_vendor_check_noreboot_2. a>()) {.<445//a> /a href="+code=pr_info" class="sref">pr_info a>(/spa. class="string">"unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n"//spa.6);.<446//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=ENODEV" class="sref">ENODEV//a>; /spa. class="comment">/*<447//a> goto /a href="+code=unmap_gcs" class="sref">unmap_gcs//a>;.<448//a> }.<449//a>.<450//a> /spa. class="comment">/*<451//a> /a href="+code=iTCO_wdt_set_NO_REBOOT_bit" class="sref">iTCO_wdt_set_NO_REBOOT_bit a>();.<452//a>.<453//a> /spa. class="comment">/*<454//a> if (!/a href="+code=request_regi2." class="sref">request_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>->/a href="+code=start" class="sref">start a>,.<455//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>), /a href="+code=dev" class="sref">dev//a>->/a href="+code=nam " class="sref">nam //a>)) {.<456//a> /a href="+code=pr_err" class="sref">pr_err a>(/spa. class="string">"I/O address 0x%04llx already in use, device disabled\n"//spa.6,.<457//a> (/a href="+code=u64" class="sref">u64//a>)/a href="+code=SMI_EN" class="sref">SMI_EN//a>);.<458//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EBUSY" class="sref">EBUSY//a>;.<459//a> goto /a href="+code=unmap_gcs" class="sref">unmap_gcs//a>;.<460//a> }.<461//a> if (/a href="+code=turn_SMI_watchdog_clear_off" class="sref">turn_SMI_watchdog_clear_off//a> >=iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a>) {.<462//a> /spa. class="comment">/*//spa.6.<463//a>/spa. class="comment"> * Bit 13: TCO_EN -> 0//spa.6.<464//a>/spa. class="comment"> * Disables TCO logic generating a. SMI#//spa.6.<465//a>/spa. class="comment"> *///spa.6.<466//a> /a href="+code=val32" class="sref">val32//a> =inl a>(/a href="+code=SMI_EN" class="sref">SMI_EN//a>);.<467//a> /a href="+code=val32" class="sref">val32//a> &= 0xffffdfff; /spa. class="comment">/* Turn off SMI clearing watchdog *///spa.6.<468//a> /a href="+code=outl" class="sref">outl a>(/a href="+code=val32" class="sref">val32//a>, /a href="+code=SMI_EN" class="sref">SMI_EN//a>);.<469//a> }.<470//a>.<471//a> if (!/a href="+code=request_regi2." class="sref">request_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>->/a href="+code=start" class="sref">start a>,.<472//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>), /a href="+code=dev" class="sref">dev//a>->/a href="+code=nam " class="sref">nam //a>)) {.<473//a> /a href="+code=pr_err" class="sref">pr_err a>(/spa. class="string">"I/O address 0x%04llx already in use, device disabled\n"//spa.6,.<474//a> (/a href="+code=u64" class="sref">u64//a>)/a href="+code=TCOBASE" class="sref">TCOBASE//a>);.<475//a> /a href="+code=ret" class="sref">ret//a> =<-/a href="+code=EBUSY" class="sref">EBUSY//a>;.<476//a> goto /a href="+code=unreg_smi" class="sref">unreg_smi//a>;.<477//a> }.<478//a>.<479//a> /a href="+code=pr_info" class="sref">pr_info a>(/spa. class="string">"Found a %s TCO device (Versv2.=%d, TCOBASE=0x%04llx)\n"//spa.6,.<480//a> /a href="+code=ich_info" class="sref">ich_info//a>->/a href="+code=nam " class="sref">nam //a>, /a href="+code=ich_info" class="sref">ich_info//a>->/a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a>, (/a href="+code=u64" class="sref">u64//a>)/a href="+code=TCOBASE" class="sref">TCOBASE//a>);.<481//a>.<482//a> /spa. class="comment">/*<483//a> /a href="+code=outw" class="sref">outw a>(0x0008, /a href="+code=TCO1_STS" class="sref">TCO1_STS//a>); /spa. class="comment">/*<484//a> /a href="+code=outw" class="sref">outw a>(0x0002, /a href="+code=TCO2_STS" class="sref">TCO2_STS//a>); /spa. class="comment">/*<485//a> /a href="+code=outw" class="sref">outw a>(0x0004, /a href="+code=TCO2_STS" class="sref">TCO2_STS//a>); /spa. class="comment">/*<486//a>.<487//a> /a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>./a href="+code=bootstatus" class="sref">bootstatus//a> =<0;.<488//a> /a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>./a href="+code=timeout" class="sref">timeout a> =WATCHDOG_TIMEOUT//a>;.<489//a> /a href="+code=watchdog_set_nowayout" class="sref">watchdog_set_nowayout a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>, /a href="+code=nowayout" class="sref">nowayout//a>);.<490//a> /a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>./a href="+code=parent" class="sref">parent//a> =dev//a>->/a href="+code=dev" class="sref">dev//a>./a href="+code=parent" class="sref">parent//a>;.<491//a>.<492//a> /spa. class="comment">/*<493//a> /a href="+code=iTCO_wdt_stop" class="sref">iTCO_wdt_stop a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>);.<494//a>.<495//a> /spa. class="comment">/*<496//a>/spa. class="comment"> if not reset to the default *///spa.6.<497//a> if (/a href="+code=iTCO_wdt_set_timeout" class="sref">iTCO_wdt_set_timeout a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>, /a href="+code=heartbeat" class="sref">heartbeat//a>)) {.<498//a> /a href="+code=iTCO_wdt_set_timeout" class="sref">iTCO_wdt_set_timeout a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>, /a href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUT//a>);.<499//a> /a href="+code=pr_info" class="sref">pr_info a>(/spa. class="string">"timeout value out of range, using %d\n"//spa.6,.<500//a> /a href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUT//a>);.<501//a> }.<502//a>.<503//a> /a href="+code=ret" class="sref">ret//a> =watchdog_register_device a>(&/a href="+code=iTCO_wdt_watchdog_dev" class="sref">iTCO_wdt_watchdog_dev//a>);.<504//a> if (/a href="+code=ret" class="sref">ret//a> !=<0) {.<505//a> /a href="+code=pr_err" class="sref">pr_err a>(/spa. class="string">"cannot register watchdog device (err=%d)\n"//spa.6, /a href="+code=ret" class="sref">ret//a>);.<506//a> goto /a href="+code=unreg_tco" class="sref">unreg_tco//a>;.<507//a> }.<508//a>.<509//a> /a href="+code=pr_info" class="sref">pr_info a>(/spa. class="string">"initialized. heartbeat=%d sec (nowayout=%d)\n"//spa.6,.<510//a> /a href="+code=heartbeat" class="sref">heartbeat//a>, /a href="+code=nowayout" class="sref">nowayout//a>);.<511//a>.<512//a> return 0;.<513//a>.<514//a>/a href="+code=unreg_tco" class="sref">unreg_tco//a>:.<515//a> /a href="+code=release_regi2." class="sref">release_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>->/a href="+code=start" class="sref">start a>,.<516//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a>));.<517//a>/a href="+code=unreg_smi" class="sref">unreg_smi//a>:.<518//a> /a href="+code=release_regi2." class="sref">release_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>->/a href="+code=start" class="sref">start a>,.<519//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>));.<520//a>/a href="+code=unmap_gcs" class="sref">unmap_gcs//a>:.<521//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2).<522//a> /a href="+code=iounmap" class="sref">iounmap a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a>);.<523//a>/a href="+code=unreg_gcs" class="sref">unreg_gcs//a>:.<524//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=iTCO_versv2." class="sref">iTCO_versv2.//a> == 2).<525//a> /a href="+code=release_mem_regi2." class="sref">release_mem_regi2. a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>->/a href="+code=start" class="sref">start a>,.<526//a> /a href="+code=resource_size" class="sref">resource_size a>(/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a>));.<527//a>/a href="+code=out" class="sref">out//a>:.<528//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a> =NULL//a>;.<529//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a> =NULL//a>;.<530//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs_res" class="sref">gcs_res//a> =NULL//a>;.<531//a> /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=gcs" class="sref">gcs//a> =NULL//a>;.<532//a>.<533//a> return /a href="+code=ret" class="sref">ret//a>;.<534//a>}.<535//a>.<536//a>static int__devexit//a> /a href="+code=iTCO_wdt_remove" class="sref">iTCO_wdt_remove a>(struct /a href="+code=platform_device" class="sref">platform_device//a> */a href="+code=dev" class="sref">dev//a>).<537//a>{.<538//a> if (/a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=tco_res" class="sref">tco_res//a> || /a href="+code=iTCO_wdt_private" class="sref">iTCO_wdt_private//a>./a href="+code=smi_res" class="sref">smi_res//a>).<539//a> /a href="+code=iTCO_wdt_cleanup" class="sref">iTCO_wdt_cleanup a>();.<540//a>.<541//a> return 0;.<542//a>}.<543//a>.<544//a>static void /a href="+code=iTCO_wdt_shutdow." class="sref">iTCO_wdt_shutdow. a>(struct /a href="+code=platform_device" class="sref">platform_device//a> */a href="+code=dev" class="sref">dev//a>).<545//a>{.<546//a> /a href="+code=iTCO_wdt_stop" class="sref">iTCO_wdt_stop a>(/a href="+code=NULL" class="sref">NULL//a>);.<547//a>}.<548//a>.<549//a>static struct /a href="+code=platform_driver" class="sref">platform_driver//a> /a href="+code=iTCO_wdt_driver" class="sref">iTCO_wdt_driver//a> =<{.<550//a> ./a href="+code=probe" class="sref">probe a> =iTCO_wdt_probe a>,.<551//a> ./a href="+code=remove" class="sref">remove a> =__devexit_p//a>);.pro442" clas4 }.pro442" clas4 "sref =<522//a./a href="9te//a>./a hr43o_driver//a> /a href=CO_wdt_drivcode=remov" class="sref">iTCO_wdt_driver//a> =<{. /a href=u64//a>)/HIS_MODUL=22"><522//a./a hrefhref="drivers/watchdog/iTCO_wdt.c5L455"5id ich_info//a>->/a href="drivers/watchdogDRV_NAM="sref">u64//a>)DRV_NAM=22"><522//a./a hrefhref="drivers/watchdog/iTCO_wdt.c5L456"5id ./a hrefhref="drivers/watchdog/iTCO_wdt.c5L457"5id NULL//a>);.<548//a>.static int_="+c_modult_p//a>);.dev//a>).iTCO_wdt_driver//a> =<{. href="f="+code=NULL" class="sref">NULL//a>);.<532//a>.<509//a> /a href="+code=pr_info" class="sref">prIntel. claWm (/sparegister watchdog device (err=&#DRV_VERSIOsref">val32//a>,DRV_VERSIOsa href="+code=NULL" class="sref">NULL//a>);.<494//a>.<5 href="dr5vers/watchdog/iTCO_wdt.c5L465"56d href="ode=gcs_res" class="sref">g"line"egister_dstruct /a href="+code=platformegister_d="+co="sref">watchdog_register_devm_driver//a> /a href="+code=iTCO_wdt_drief="+code=NULL" class="sref">NULL//a>);. href="href="+code=dev" class="sref">dev//a>). href="f="+code=NULL" class="sref">NULL//a>);.<548//a>.<541//a> return 0;.<547//a>}.<511//a>.static int_O_wdt_c_modult_p//a>);.dev//a>).iTCO_wdt_driver//a> =<{.g"line"e hrefter_dstruct /a href="+code=platforme hrefter_d="+co="sref">watchdog_register_devm_driver//a> /a href="+code=iTCO_wdt_drief="+code=NULL" class="sref">NULL//a>);.<509//a> /a href="+code=pr_info" class="sref">prWlass="stModult Unload7;04llx already ief="+code=NULL" class="sref">NULL//a>);.<547//a>}.<417//a>.<5 href="dr5vers/watchdog/iTCO_wdt.c5L478"5id static int__d="+c_modult_p//a>);.NULL//a>);.static int__dO_wdt_c_modult_p//a>);.NULL//a>);.<540//a>.prWim V ebroa> <wim@iguana.bede=gllx already ief="+code=NULL" class="sref">NULL//a>);.val32//a>,MODUL=_DESCRIPTIOs="+code=pr_info" class="sref">prIntel. claWm NULL//a>);.val32//a>,MODUL=_VERSIOs__devexit_p" class="DRV_VERSIOsref">val32//a>,DRV_VERSIOsa href="+code=NULL" class="sref">NULL//a>);.u64//a>)MODUL=_LICENs=="+code=pr_info" class="sref">prGPLllx already ief="+code=NULL" class="sref">NULL//a>);.ret//a> =NULL//a>);.ret//a> =pr"+code=p:llx already idrivers/watchdogDRV_NAM="sref">u64//a>)DRV_NAM=22">ef="+code=NULL" class="sref">NULL//a>);.
//a>original LXR soft_REBrese"com"+code=NUhttp://"+codede=ge.net/projects/lxds>LXR ne" u"+cy22">lxd@og/ux.norivat
lxd.og/ux.no kindly hoer_drese"+code=NUhttp://www.redpill-og/pro.no">Redpill Lg/pro AS="+c, providsr of Lg/ux nensul d op ens serforms since 1995.