Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 2 | |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 3 | #include <device/device.h> |
| 4 | #include <device/pci.h> |
| 5 | #include <device/pci_ids.h> |
| 6 | #include <device/pci_ops.h> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 7 | #include "i82801dx.h" |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 8 | |
| 9 | static void pci_init(struct device *dev) |
| 10 | { |
| 11 | /* Enable pci error detecting */ |
| 12 | uint32_t dword; |
| 13 | /* System error enable */ |
| 14 | dword = pci_read_config32(dev, 0x04); |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 15 | dword |= (1 << 8); /* SERR# Enable */ |
| 16 | dword |= (1 << 6); /* Parity Error Response */ |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 17 | pci_write_config32(dev, 0x04, dword); |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 18 | } |
| 19 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 20 | static struct device_operations pci_ops = { |
| 21 | .read_resources = pci_bus_read_resources, |
| 22 | .set_resources = pci_dev_set_resources, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 23 | .enable_resources = pci_bus_enable_resources, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 24 | .init = pci_init, |
| 25 | .scan_bus = pci_scan_bridge, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 28 | /* 82801DB */ |
| 29 | static const struct pci_driver pci_driver_db __pci_driver = { |
| 30 | .ops = &pci_ops, |
| 31 | .vendor = PCI_VENDOR_ID_INTEL, |
| 32 | .device = PCI_DEVICE_ID_INTEL_82801DB_PCI, |
| 33 | }; |
| 34 | |
| 35 | /* 82801DBM/DBL */ |
| 36 | static const struct pci_driver pci_driver_dbm __pci_driver = { |
| 37 | .ops = &pci_ops, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 38 | .vendor = PCI_VENDOR_ID_INTEL, |
Uwe Hermann | a29ec06 | 2007-11-04 03:21:37 +0000 | [diff] [blame] | 39 | .device = PCI_DEVICE_ID_INTEL_82801DBM_PCI, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 40 | }; |