Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 1 | #include <console/console.h> |
Stefan Reinauer | d4ab7c5 | 2010-03-17 02:09:12 +0000 | [diff] [blame] | 2 | #include <watchdog.h> |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 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); |
Stefan Reinauer | 64ed2b7 | 2010-03-31 14:47:43 +0000 | [diff] [blame] | 27 | printk(BIOS_DEBUG, "Watchdog ICH5 disabled\n"); |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 28 | } |