blob: 2cc1b9d4780de5c1db8439465b2fc9e390f05117 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer8702ab52010-03-14 17:01:08 +00002
Ronald G. Minnich182615d2004-08-24 16:20:46 +00003#include <device/device.h>
4#include <device/pci.h>
5#include <device/pci_ids.h>
6#include <device/pci_ops.h>
Stefan Reinauer138be832010-02-27 01:50:21 +00007#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +00008
9static 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 Reinauer8702ab52010-03-14 17:01:08 +000015 dword |= (1 << 8); /* SERR# Enable */
16 dword |= (1 << 6); /* Parity Error Response */
Ronald G. Minnich182615d2004-08-24 16:20:46 +000017 pci_write_config32(dev, 0x04, dword);
Ronald G. Minnich182615d2004-08-24 16:20:46 +000018}
19
Stefan Reinauer8702ab52010-03-14 17:01:08 +000020static struct device_operations pci_ops = {
21 .read_resources = pci_bus_read_resources,
22 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000023 .enable_resources = pci_bus_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000024 .init = pci_init,
25 .scan_bus = pci_scan_bridge,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000026};
27
Stefan Reinauer8702ab52010-03-14 17:01:08 +000028/* 82801DB */
29static const struct pci_driver pci_driver_db __pci_driver = {
30 .ops = &pci_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010031 .vendor = PCI_VID_INTEL,
32 .device = PCI_DID_INTEL_82801DB_PCI,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000033};
34
35/* 82801DBM/DBL */
36static const struct pci_driver pci_driver_dbm __pci_driver = {
37 .ops = &pci_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010038 .vendor = PCI_VID_INTEL,
39 .device = PCI_DID_INTEL_82801DBM_PCI,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000040};