Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 1 | #include <console/console.h> |
| 2 | #include <device/device.h> |
| 3 | #include <device/pci.h> |
| 4 | #include <device/pci_ids.h> |
| 5 | #include <device/pci_ops.h> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 6 | #include "i82801ex.h" |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 7 | |
| 8 | static void pci_init(struct device *dev) |
| 9 | { |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 10 | uint16_t word; |
| 11 | |
| 12 | /* Clear system errors */ |
| 13 | word = pci_read_config16(dev, 0x06); |
| 14 | word |= 0xf900; /* Clear possible errors */ |
| 15 | pci_write_config16(dev, 0x06, word); |
| 16 | |
Stefan Reinauer | 966d0e6 | 2006-04-06 21:37:10 +0000 | [diff] [blame] | 17 | #if 0 |
| 18 | /* System error enable */ |
Stefan Reinauer | 68f542c | 2010-03-17 02:48:24 +0000 | [diff] [blame] | 19 | uint32_t dword; |
Stefan Reinauer | 966d0e6 | 2006-04-06 21:37:10 +0000 | [diff] [blame] | 20 | dword = pci_read_config32(dev, 0x04); |
| 21 | dword |= (1<<8); /* SERR# Enable */ |
| 22 | dword |= (1<<6); /* Parity Error Response */ |
| 23 | pci_write_config32(dev, 0x04, dword); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 24 | #endif |
| 25 | |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 26 | word = pci_read_config16(dev, 0x1e); |
| 27 | word |= 0xf800; /* Clear possible errors */ |
| 28 | pci_write_config16(dev, 0x1e, word); |
| 29 | } |
| 30 | |
| 31 | static struct device_operations pci_ops = { |
| 32 | .read_resources = pci_bus_read_resources, |
| 33 | .set_resources = pci_dev_set_resources, |
| 34 | .enable_resources = pci_bus_enable_resources, |
| 35 | .init = pci_init, |
| 36 | .scan_bus = pci_scan_bridge, |
| 37 | .ops_pci = 0, |
| 38 | }; |
| 39 | |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 40 | static const struct pci_driver pci_driver __pci_driver = { |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 41 | .ops = &pci_ops, |
| 42 | .vendor = PCI_VENDOR_ID_INTEL, |
| 43 | .device = PCI_DEVICE_ID_INTEL_82801ER_PCI, |
| 44 | }; |