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