This does the following:
[coreboot.git] / src / southbridge / intel / i82801ex / i82801ex_watchdog.c
1 #include <console/console.h>
2 #include <arch/io.h>
3 #include <device/device.h>
4 #include <device/pci.h>
5
6 void watchdog_off(void)
7 {
8         device_t dev;
9         unsigned long value,base;
10
11         /* turn off the ICH5 watchdog */
12         dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
13         /* Enable I/O space */
14         value = pci_read_config16(dev, 0x04);
15         value |= (1 << 10);
16         pci_write_config16(dev, 0x04, value);
17         /* Get TCO base */
18         base = (pci_read_config32(dev, 0x40) & 0x0fffe) + 0x60;
19         /* Disable the watchdog timer */
20         value = inw(base + 0x08);
21         value |= 1 << 11;
22         outw(value, base + 0x08);
23         /* Clear TCO timeout status */
24         outw(0x0008, base + 0x04);
25         outw(0x0002, base + 0x06);
26         printk_debug("Watchdog ICH5 disabled\r\n");
27 }
28