blob: 9b331be6d48435536d451029bb43ab0d53c452f3 [file] [log] [blame]
Martin Rothebace9f2018-05-26 18:56:17 -06001/*
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 Lu70093f72004-07-01 03:55:03 +000014#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 HAOUAS17c59f52018-05-13 13:38:38 +020022static void p64h2_pcix_init(struct device *dev)
Yinghai Lu70093f72004-07-01 03:55:03 +000023{
Stefan Reinauerc269d232010-03-30 21:48:23 +000024 u32 dword;
25 u8 byte;
Yinghai Lu70093f72004-07-01 03:55:03 +000026
Stefan Reinauerc269d232010-03-30 21:48:23 +000027 /* 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 Lu70093f72004-07-01 03:55:03 +000030 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}
38static struct device_operations pcix_ops = {
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020039 .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 Lu13f1c2a2005-07-08 02:49:49 +000044 .reset_bus = pci_bus_reset,
Yinghai Lu70093f72004-07-01 03:55:03 +000045};
46
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000047static const struct pci_driver pcix_driver __pci_driver = {
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020048 .ops = &pcix_ops,
49 .vendor = PCI_VENDOR_ID_INTEL,
50 .device = PCI_DEVICE_ID_INTEL_82870_1F0,
Stefan Reinauer14e22772010-04-27 06:56:47 +000051};