2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <console/console.h>
23 #include <device/device.h>
24 #include <device/pci.h>
27 void watchdog_off(void)
30 unsigned long value, base;
32 /* Turn off the ICH7 watchdog. */
33 dev = dev_find_slot(0, PCI_DEVFN(0x1f, 0));
35 /* Enable I/O space. */
36 value = pci_read_config16(dev, 0x04);
38 pci_write_config16(dev, 0x04, value);
41 base = (pci_read_config32(dev, 0x40) & 0x0fffe) + 0x60;
43 /* Disable the watchdog timer. */
44 value = inw(base + 0x08);
46 outw(value, base + 0x08);
48 /* Clear TCO timeout status. */
49 outw(0x0008, base + 0x04);
50 outw(0x0002, base + 0x06);
52 printk(BIOS_DEBUG, "ICH7 watchdog disabled\r\n");