Martin Roth | ebace9f | 2018-05-26 18:56:17 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; version 2 of the License. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 14 | #include <console/console.h> |
| 15 | #include <device/device.h> |
| 16 | #include <device/pci.h> |
| 17 | #include <device/pci_ids.h> |
| 18 | #include <device/pci_ops.h> |
| 19 | #include <pc80/mc146818rtc.h> |
| 20 | #include "82870.h" |
| 21 | |
Elyes HAOUAS | 17c59f5 | 2018-05-13 13:38:38 +0200 | [diff] [blame] | 22 | static void p64h2_pcix_init(struct device *dev) |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 23 | { |
Stefan Reinauer | c269d23 | 2010-03-30 21:48:23 +0000 | [diff] [blame] | 24 | u32 dword; |
| 25 | u8 byte; |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 26 | |
Stefan Reinauer | c269d23 | 2010-03-30 21:48:23 +0000 | [diff] [blame] | 27 | /* The purpose of changes to HCCR, ACNF, and MTT is to speed |
| 28 | * up the PCI bus for cards having high speed transfers. |
| 29 | */ |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 30 | dword = 0xc2040002; |
| 31 | pci_write_config32(dev, HCCR, dword); |
| 32 | dword = 0x0000c3bf; |
| 33 | pci_write_config32(dev, ACNF, dword); |
| 34 | byte = 0x08; |
| 35 | pci_write_config8(dev, MTT, byte); |
| 36 | |
| 37 | } |
| 38 | static struct device_operations pcix_ops = { |
Elyes HAOUAS | ba28e8d | 2016-08-31 19:22:16 +0200 | [diff] [blame] | 39 | .read_resources = pci_bus_read_resources, |
| 40 | .set_resources = pci_dev_set_resources, |
| 41 | .enable_resources = pci_bus_enable_resources, |
| 42 | .init = p64h2_pcix_init, |
| 43 | .scan_bus = pci_scan_bridge, |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 44 | .reset_bus = pci_bus_reset, |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 47 | static const struct pci_driver pcix_driver __pci_driver = { |
Elyes HAOUAS | ba28e8d | 2016-08-31 19:22:16 +0200 | [diff] [blame] | 48 | .ops = &pcix_ops, |
| 49 | .vendor = PCI_VENDOR_ID_INTEL, |
| 50 | .device = PCI_DEVICE_ID_INTEL_82870_1F0, |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 51 | }; |