Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2004 Ronald G. Minnich |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 20 | #include <console/console.h> |
| 21 | #include <device/device.h> |
| 22 | #include <device/pci.h> |
| 23 | #include <device/pci_ids.h> |
| 24 | #include <device/pci_ops.h> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 25 | #include "i82801dx.h" |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 26 | |
| 27 | static void pci_init(struct device *dev) |
| 28 | { |
| 29 | /* Enable pci error detecting */ |
| 30 | uint32_t dword; |
| 31 | /* System error enable */ |
| 32 | dword = pci_read_config32(dev, 0x04); |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame^] | 33 | dword |= (1 << 8); /* SERR# Enable */ |
| 34 | dword |= (1 << 6); /* Parity Error Response */ |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 35 | pci_write_config32(dev, 0x04, dword); |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame^] | 38 | static struct device_operations pci_ops = { |
| 39 | .read_resources = pci_bus_read_resources, |
| 40 | .set_resources = pci_dev_set_resources, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 41 | .enable_resources = pci_bus_enable_resources, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame^] | 42 | .init = pci_init, |
| 43 | .scan_bus = pci_scan_bridge, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame^] | 46 | /* 82801DB */ |
| 47 | static const struct pci_driver pci_driver_db __pci_driver = { |
| 48 | .ops = &pci_ops, |
| 49 | .vendor = PCI_VENDOR_ID_INTEL, |
| 50 | .device = PCI_DEVICE_ID_INTEL_82801DB_PCI, |
| 51 | }; |
| 52 | |
| 53 | /* 82801DBM/DBL */ |
| 54 | static const struct pci_driver pci_driver_dbm __pci_driver = { |
| 55 | .ops = &pci_ops, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 56 | .vendor = PCI_VENDOR_ID_INTEL, |
Uwe Hermann | a29ec06 | 2007-11-04 03:21:37 +0000 | [diff] [blame] | 57 | .device = PCI_DEVICE_ID_INTEL_82801DBM_PCI, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 58 | }; |