71240e99603aa6e6bf2034a8e02a7af0d46abe31
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_pcie.c
1 /*
2  * Copyright 2004 Tyan Computer
3  *  by yhlu@tyan.com
4  */
5
6 #include <console/console.h>
7 #include <device/device.h>
8 #include <device/pci.h>
9 #include <device/pci_ids.h>
10 #include <device/pci_ops.h>
11 #include "ck804.h"
12
13 static void pcie_init(struct device *dev)
14 {
15         uint32_t dword;
16
17         /* Enable PCI error detecting. */
18         dword = pci_read_config32(dev, 0x04);
19         dword |= (1 << 8);      /* System error enable */
20         dword |= (1 << 30);     /* Clear possible errors */
21         pci_write_config32(dev, 0x04, dword);
22 }
23
24 static struct pci_operations lops_pci = {
25         .set_subsystem = 0,
26 };
27
28 static struct device_operations pcie_ops = {
29         .read_resources   = pci_bus_read_resources,
30         .set_resources    = pci_dev_set_resources,
31         .enable_resources = pci_bus_enable_resources,
32         .init             = pcie_init,
33         .scan_bus         = pci_scan_bridge,
34         // .enable        = ck804_enable,
35         .ops_pci          = &lops_pci,
36 };
37
38 static const struct pci_driver pcie_driver __pci_driver = {
39         .ops    = &pcie_ops,
40         .vendor = PCI_VENDOR_ID_NVIDIA,
41         .device = PCI_DEVICE_ID_NVIDIA_CK804_PCI_E,
42 };