ICH4 update, fix ATA init, drop SATA (chipset doesn't have SATA)
[coreboot.git] / src / southbridge / intel / i82801dx / i82801dx_tco_timer.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2008 Joseph Smith <joe@settoplinux.org>
5  *
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
9  * the License.
10  *
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.
15  *
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,
19  * MA 02110-1301 USA
20  */
21
22 static void i82801dx_halt_tco_timer(void)
23 {
24         device_t dev;
25         uint16_t halt_tco_timer;
26
27         /* Set the LPC device statically. */
28         dev = PCI_DEV(0x0, 0x1f, 0x0);
29
30         /* Temporarily set ACPI base address (I/O space). */
31         pci_write_config32(dev, PMBASE, (PMBASE_ADDR | 1));
32
33         /* Enable ACPI I/O. */
34         pci_write_config8(dev, ACPI_CNTL, 0x10);
35
36         /* Halt the TCO timer, preventing SMI and automatic reboot */
37         outw(inw(PMBASE_ADDR + TCOBASE + TCO1_CNT) | (1 << 11),
38              PMBASE_ADDR + TCOBASE + TCO1_CNT);
39 }