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