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 <device/device.h> |
| 15 | #include <device/pci.h> |
| 16 | #include <device/pci_ids.h> |
| 17 | #include <device/pci_ops.h> |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 18 | #include "82870.h" |
| 19 | |
Elyes HAOUAS | 17c59f5 | 2018-05-13 13:38:38 +0200 | [diff] [blame] | 20 | static void p64h2_pcix_init(struct device *dev) |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 21 | { |
Stefan Reinauer | c269d23 | 2010-03-30 21:48:23 +0000 | [diff] [blame] | 22 | u32 dword; |
| 23 | u8 byte; |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 24 | |
Stefan Reinauer | c269d23 | 2010-03-30 21:48:23 +0000 | [diff] [blame] | 25 | /* The purpose of changes to HCCR, ACNF, and MTT is to speed |
| 26 | * up the PCI bus for cards having high speed transfers. |
| 27 | */ |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 28 | dword = 0xc2040002; |
| 29 | pci_write_config32(dev, HCCR, dword); |
| 30 | dword = 0x0000c3bf; |
| 31 | pci_write_config32(dev, ACNF, dword); |
| 32 | byte = 0x08; |
| 33 | pci_write_config8(dev, MTT, byte); |
| 34 | |
| 35 | } |
| 36 | static struct device_operations pcix_ops = { |
Elyes HAOUAS | ba28e8d | 2016-08-31 19:22:16 +0200 | [diff] [blame] | 37 | .read_resources = pci_bus_read_resources, |
| 38 | .set_resources = pci_dev_set_resources, |
| 39 | .enable_resources = pci_bus_enable_resources, |
| 40 | .init = p64h2_pcix_init, |
| 41 | .scan_bus = pci_scan_bridge, |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 42 | .reset_bus = pci_bus_reset, |
Yinghai Lu | 70093f7 | 2004-07-01 03:55:03 +0000 | [diff] [blame] | 43 | }; |
| 44 | |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 45 | static const struct pci_driver pcix_driver __pci_driver = { |
Elyes HAOUAS | ba28e8d | 2016-08-31 19:22:16 +0200 | [diff] [blame] | 46 | .ops = &pcix_ops, |
| 47 | .vendor = PCI_VENDOR_ID_INTEL, |
| 48 | .device = PCI_DEVICE_ID_INTEL_82870_1F0, |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 49 | }; |
Kyösti Mälkki | 08c76e1 | 2019-08-25 13:05:46 +0300 | [diff] [blame^] | 50 | |
| 51 | struct chip_operations southbridge_intel_i82870_ops = { |
| 52 | CHIP_NAME("Intel 82870") |
| 53 | }; |