2 * This file is part of the LinuxBIOS project.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
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.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include <console/console.h>
20 #include <device/device.h>
21 #include <device/pci.h>
22 #include <device/pci_ids.h>
23 #include <device/pci_ops.h>
26 static void pci_init(struct device *dev)
31 /* Clear system errors */
32 word = pci_read_config16(dev, 0x06);
33 word |= 0xf900; /* Clear possible errors */
34 pci_write_config16(dev, 0x06, word);
37 /* System error enable */
38 dword = pci_read_config32(dev, 0x04);
39 dword |= (1<<8); /* SERR# Enable */
40 dword |= (1<<6); /* Parity Error Response */
41 pci_write_config32(dev, 0x04, dword);
44 word = pci_read_config16(dev, 0x1e);
45 word |= 0xf800; /* Clear possible errors */
46 pci_write_config16(dev, 0x1e, word);
49 static struct device_operations pci_ops = {
50 .read_resources = pci_bus_read_resources,
51 .set_resources = pci_dev_set_resources,
52 .enable_resources = pci_bus_enable_resources,
54 .scan_bus = pci_scan_bridge,
58 static const struct pci_driver pci_driver __pci_driver = {
60 .vendor = PCI_VENDOR_ID_INTEL,
61 .device = PCI_DEVICE_ID_INTEL_82801DB_PCI,