2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
5 * Copyright (C) 2011 Google Inc.
6 * Copyright (C) 2013 Sage Electronic Engineering, LLC.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; version 2 of
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #include <console/console.h>
21 #include <device/device.h>
22 #include <device/pci.h>
26 void watchdog_off(void)
31 /* Turn off the watchdog. */
32 dev
= dev_find_slot(0, PCI_DEVFN(0x1f, 0));
34 /* Enable I/O space. */
35 value
= pci_read_config16(dev
, 0x04);
37 pci_write_config16(dev
, 0x04, value
);
40 abase
= (pci_read_config32(dev
, ABASE
) & ~0xf);
42 /* Disable the watchdog timer. */
43 value
= inw(abase
+ 0x68);
45 outw(value
, abase
+ 0x68);
47 /* Clear TCO timeout status. */
48 outw(0x0008, abase
+ 0x64);
49 outw(0x0002, abase
+ 0x66);
51 printk(BIOS_DEBUG
, "TCO Watchdog disabled\n");