Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 4 | * |
| 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 Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 13 | */ |
| 14 | |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 15 | #include <device/device.h> |
| 16 | #include <device/pci.h> |
| 17 | #include <device/pci_ids.h> |
| 18 | #include <device/pci_ops.h> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 19 | #include "i82801dx.h" |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 20 | |
| 21 | static 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 Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 27 | dword |= (1 << 8); /* SERR# Enable */ |
| 28 | dword |= (1 << 6); /* Parity Error Response */ |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 29 | pci_write_config32(dev, 0x04, dword); |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 30 | } |
| 31 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 32 | static struct device_operations pci_ops = { |
| 33 | .read_resources = pci_bus_read_resources, |
| 34 | .set_resources = pci_dev_set_resources, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 35 | .enable_resources = pci_bus_enable_resources, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 36 | .init = pci_init, |
| 37 | .scan_bus = pci_scan_bridge, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 40 | /* 82801DB */ |
| 41 | static 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 */ |
| 48 | static const struct pci_driver pci_driver_dbm __pci_driver = { |
| 49 | .ops = &pci_ops, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 50 | .vendor = PCI_VENDOR_ID_INTEL, |
Uwe Hermann | a29ec06 | 2007-11-04 03:21:37 +0000 | [diff] [blame] | 51 | .device = PCI_DEVICE_ID_INTEL_82801DBM_PCI, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 52 | }; |