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