blob: 837e3401bcbbfb17c5a5d04c50168065d34e822e [file] [log] [blame]
Stefan Reinauer8702ab52010-03-14 17:01:08 +00001/*
2 * This file is part of the coreboot project.
3 *
Stefan Reinauer8702ab52010-03-14 17:01:08 +00004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Stefan Reinauer8702ab52010-03-14 17:01:08 +000013 */
14
Ronald G. Minnich182615d2004-08-24 16:20:46 +000015#include <device/device.h>
16#include <device/pci.h>
17#include <device/pci_ids.h>
18#include <device/pci_ops.h>
Stefan Reinauer138be832010-02-27 01:50:21 +000019#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +000020
21static void pci_init(struct device *dev)
22{
23 /* Enable pci error detecting */
24 uint32_t dword;
25 /* System error enable */
26 dword = pci_read_config32(dev, 0x04);
Stefan Reinauer8702ab52010-03-14 17:01:08 +000027 dword |= (1 << 8); /* SERR# Enable */
28 dword |= (1 << 6); /* Parity Error Response */
Ronald G. Minnich182615d2004-08-24 16:20:46 +000029 pci_write_config32(dev, 0x04, dword);
Ronald G. Minnich182615d2004-08-24 16:20:46 +000030}
31
Stefan Reinauer8702ab52010-03-14 17:01:08 +000032static struct device_operations pci_ops = {
33 .read_resources = pci_bus_read_resources,
34 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000035 .enable_resources = pci_bus_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000036 .init = pci_init,
37 .scan_bus = pci_scan_bridge,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000038};
39
Stefan Reinauer8702ab52010-03-14 17:01:08 +000040/* 82801DB */
41static const struct pci_driver pci_driver_db __pci_driver = {
42 .ops = &pci_ops,
43 .vendor = PCI_VENDOR_ID_INTEL,
44 .device = PCI_DEVICE_ID_INTEL_82801DB_PCI,
45};
46
47/* 82801DBM/DBL */
48static const struct pci_driver pci_driver_dbm __pci_driver = {
49 .ops = &pci_ops,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000050 .vendor = PCI_VENDOR_ID_INTEL,
Uwe Hermanna29ec062007-11-04 03:21:37 +000051 .device = PCI_DEVICE_ID_INTEL_82801DBM_PCI,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000052};