19609082e62d5b290b236c40230589c2e0109309
[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
16         /* Enable pci error detecting */
17         uint32_t dword;
18
19         /* System error enable */
20         dword = pci_read_config32(dev, 0x04);
21         dword |= (1<<8); /* System error enable */
22         dword |= (1<<30); /* Clear possible errors */
23         pci_write_config32(dev, 0x04, dword);
24
25 }
26
27 static struct pci_operations lops_pci = {
28         .set_subsystem = 0,
29 };
30
31 static struct device_operations pcie_ops  = {
32         .read_resources   = pci_bus_read_resources,
33         .set_resources    = pci_dev_set_resources,
34         .enable_resources = pci_bus_enable_resources,
35         .init             = pcie_init,
36         .scan_bus         = pci_scan_bridge,
37 //      .enable           = ck804_enable,
38         .ops_pci          = &lops_pci,
39 };
40
41 static const struct pci_driver pcie_driver __pci_driver = {
42         .ops    = &pcie_ops,
43         .vendor = PCI_VENDOR_ID_NVIDIA,
44         .device = PCI_DEVICE_ID_NVIDIA_CK804_PCI_E,
45 };
46