blob: 610ec1e5df7aa1e5d27352685f2f6058f1f9213a [file] [log] [blame]
Stefan Reinauer8702ab52010-03-14 17:01:08 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2004 Ronald G. Minnich
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
Ronald G. Minnich182615d2004-08-24 16:20:46 +000020#include <console/console.h>
21#include <device/device.h>
22#include <device/pci.h>
23#include <device/pci_ids.h>
24#include <device/pci_ops.h>
Stefan Reinauer138be832010-02-27 01:50:21 +000025#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +000026
27static void pci_init(struct device *dev)
28{
29 /* Enable pci error detecting */
30 uint32_t dword;
31 /* System error enable */
32 dword = pci_read_config32(dev, 0x04);
Stefan Reinauer8702ab52010-03-14 17:01:08 +000033 dword |= (1 << 8); /* SERR# Enable */
34 dword |= (1 << 6); /* Parity Error Response */
Ronald G. Minnich182615d2004-08-24 16:20:46 +000035 pci_write_config32(dev, 0x04, dword);
Ronald G. Minnich182615d2004-08-24 16:20:46 +000036}
37
Stefan Reinauer8702ab52010-03-14 17:01:08 +000038static struct device_operations pci_ops = {
39 .read_resources = pci_bus_read_resources,
40 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000041 .enable_resources = pci_bus_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000042 .init = pci_init,
43 .scan_bus = pci_scan_bridge,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000044};
45
Stefan Reinauer8702ab52010-03-14 17:01:08 +000046/* 82801DB */
47static const struct pci_driver pci_driver_db __pci_driver = {
48 .ops = &pci_ops,
49 .vendor = PCI_VENDOR_ID_INTEL,
50 .device = PCI_DEVICE_ID_INTEL_82801DB_PCI,
51};
52
53/* 82801DBM/DBL */
54static const struct pci_driver pci_driver_dbm __pci_driver = {
55 .ops = &pci_ops,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000056 .vendor = PCI_VENDOR_ID_INTEL,
Uwe Hermanna29ec062007-11-04 03:21:37 +000057 .device = PCI_DEVICE_ID_INTEL_82801DBM_PCI,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000058};