示例#1
0
/* tyan motherboards seem to set F5 to 0x4C ?
 * So explicitly init to appropriate value. */
static void
w83627hf_init(void)
{
	unsigned char t;

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER); /* Select CRF6 */
	t=inb_p(WDT_EFDR);      /* read CRF6 */
	if (t != 0) {
		printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
		outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
	}

	outb_p(0xF5, WDT_EFER); /* Select CRF5 */
	t=inb_p(WDT_EFDR);      /* read CRF5 */
	t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
	outb_p(t, WDT_EFDR);    /* Write back to CRF5 */

	outb_p(0xF7, WDT_EFER); /* Select CRF7 */
	t=inb_p(WDT_EFDR);      /* read CRF7 */
	t&=~0xC0;               /* disable keyboard & mouse turning off watchdog */
	outb_p(t, WDT_EFDR);    /* Write back to CRF7 */

	w83627hf_unselect_wd_register();
}
示例#2
0
static void w83627hf_init(void)
{
	unsigned char t;

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER); 
	t = inb_p(WDT_EFDR);      
	if (t != 0) {
		printk(KERN_INFO PFX
		     "Watchdog already running. Resetting timeout to %d sec\n",
								timeout);
		outb_p(timeout, WDT_EFDR);    
	}

	outb_p(0xF5, WDT_EFER); 
	t = inb_p(WDT_EFDR);      
	t &= ~0x0C;               
	outb_p(t, WDT_EFDR);    

	outb_p(0xF7, WDT_EFER); 
	t = inb_p(WDT_EFDR);      
	t &= ~0xC0;               
	outb_p(t, WDT_EFDR);    

	w83627hf_unselect_wd_register();
}
示例#3
0
static int wdt_readproc(char *page, char **start, off_t off, int count,
		int *eof, void *data)
{
	int len;
	unsigned char remaining;
	unsigned char fired;
	spin_lock(&io_lock);
	w83627hf_select_wd_register();
	outb_p(0xF6, WDT_EFIR);/* get current timer val */
	remaining=inb_p(WDT_EFDR);
	outb_p(0xF7, WDT_EFIR);
	fired=inb_p(WDT_EFDR);
	/* clear that bit (bit 4) */
	outb_p(fired&(~0x10),WDT_EFDR);
	w83627hf_unselect_wd_register();
	spin_unlock(&io_lock);
	fired=(fired&0x10)!=0;
	len=snprintf(page,PAGE_SIZE,
			"W83627HF WDT\n"
			"active=%d\n"
			"iobase=%04X\n"
			"nowayout=%d\n"
			"timeout=%d\n"
			"remaining=%d\n"
			"fired=%d\n",
			wdt_is_open,wdt_io,nowayout,timeout,remaining,fired);
	*eof=1;
	return len;
}
static void w83627hf_init(void)
{
	unsigned char t;

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER); /* Select CRF6 */
	t = inb_p(WDT_EFDR);      /* read CRF6 */
	if (t != 0) {
		pr_info("Watchdog already running. Resetting timeout to %d sec\n",
			timeout);
		outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
	}

	outb_p(0xF5, WDT_EFER); /* Select CRF5 */
	t = inb_p(WDT_EFDR);      /* read CRF5 */
	t &= ~0x0C;               /* set second mode & disable keyboard
				    turning off watchdog */
	t |= 0x02;		  /* enable the WDTO# output low pulse
				    to the KBRST# pin (PIN60) */
	outb_p(t, WDT_EFDR);    /* Write back to CRF5 */

	outb_p(0xF7, WDT_EFER); /* Select CRF7 */
	t = inb_p(WDT_EFDR);      /* read CRF7 */
	t &= ~0xC0;               /* disable keyboard & mouse turning off
				    watchdog */
	outb_p(t, WDT_EFDR);    /* Write back to CRF7 */

	w83627hf_unselect_wd_register();
}
示例#5
0
static void
wdt_ctrl(int timeout)
{
	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
	outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */

	w83627hf_unselect_wd_register();
}
示例#6
0
static void wdt_ctrl(int timeout)
{
	spin_lock(&io_lock);

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER);    
	outb_p(timeout, WDT_EFDR); 

	w83627hf_unselect_wd_register();

	spin_unlock(&io_lock);
}
static void wdt_set_time(int timeout)
{
	spin_lock(&io_lock);

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
	outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */

	w83627hf_unselect_wd_register();

	spin_unlock(&io_lock);
}
示例#8
0
/* tyan motherboards seem to set F5 to 0x4C ?
 * So explicitly init to appropriate value. */
static void
w83627hf_init(void)
{
	unsigned char t;

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER); /* Select CRF6 */
	outb_p(0, WDT_EFDR);    /* set to 0 initially */
	outb_p(0xF5, WDT_EFER); /* Select CRF5 */
	t=inb_p(WDT_EFDR);      /* read CRF5 */
	t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
	outb_p(t, WDT_EFDR);    /* Write back to CRF5 */

	w83627hf_unselect_wd_register();
}
static int wdt_get_time(void)
{
	int timeleft;

	spin_lock(&io_lock);

	w83627hf_select_wd_register();

	outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
	timeleft = inb_p(WDT_EFDR); /* Read Timeout counter to CRF6 */

	w83627hf_unselect_wd_register();

	spin_unlock(&io_lock);

	return timeleft;
}