blob: 72fdd93cfa4483d8f4e9a0516872208b8aaeb386 [file] [log] [blame]
Yinghai Luc65bd562007-02-01 00:10:05 +00001/*
Stefan Reinauer7e61e452008-01-18 10:35:56 +00002 * This file is part of the coreboot project.
Yinghai Luc65bd562007-02-01 00:10:05 +00003 *
4 * Copyright (C) 2004 Tyan Computer
5 * Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer.
6 * Copyright (C) 2006,2007 AMD
7 * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
Yinghai Luc65bd562007-02-01 00:10:05 +000018 */
19
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>
25#include "mcp55.h"
26
27static void pcie_init(struct device *dev)
28{
Yinghai Luc65bd562007-02-01 00:10:05 +000029 /* Enable pci error detecting */
Uwe Hermannc7f0c8f2011-01-04 19:51:33 +000030 u32 dword;
Yinghai Luc65bd562007-02-01 00:10:05 +000031
32 /* System error enable */
33 dword = pci_read_config32(dev, 0x04);
34 dword |= (1<<8); /* System error enable */
35 dword |= (1<<30); /* Clear possible errors */
36 pci_write_config32(dev, 0x04, dword);
37
38}
39
Yinghai Luc65bd562007-02-01 00:10:05 +000040static struct device_operations pcie_ops = {
41 .read_resources = pci_bus_read_resources,
42 .set_resources = pci_dev_set_resources,
43 .enable_resources = pci_bus_enable_resources,
44 .init = pcie_init,
45 .scan_bus = pci_scan_bridge,
46// .enable = mcp55_enable,
Yinghai Luc65bd562007-02-01 00:10:05 +000047};
48
Patrick Georgiefff7332012-07-26 19:48:23 +020049static const unsigned short pcie_ids[] = {
50 PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_B_C,
51 PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_E,
52 PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_A,
53 PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_F,
54 PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_D,
55 0
56};
57
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000058static const struct pci_driver pciebc_driver __pci_driver = {
Yinghai Luc65bd562007-02-01 00:10:05 +000059 .ops = &pcie_ops,
60 .vendor = PCI_VENDOR_ID_NVIDIA,
Patrick Georgiefff7332012-07-26 19:48:23 +020061 .devices= pcie_ids,
Yinghai Luc65bd562007-02-01 00:10:05 +000062};