Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-30
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_pci.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 pci_init(struct device *dev)
14 {
15
16         uint32_t dword;
17         
18         /* System error enable */
19         dword = pci_read_config32(dev, 0x04);
20         dword |= (1<<8); /* System error enable */
21         dword |= (1<<30); /* Clear possible errors */
22         pci_write_config32(dev, 0x04, dword);
23
24 #if 0
25         word = pci_read_config16(dev, 0x48);
26         word |= (1<<0); /* MRL2MRM */
27         word |= (1<<2); /* MR2MRM */
28         pci_write_config16(dev, 0x48, word);
29 #endif
30
31 #if 1
32         dword = pci_read_config32(dev, 0x4c);
33         dword |= 0x00440000; /*TABORT_SER_ENABLE Park Last Enable.*/
34         pci_write_config32(dev, 0x4c, dword);
35 #endif
36
37         dword = dev_root.resource[1].base & (0xffff0000UL);
38         printk_debug("dev_root mem base = 0x%010Lx\n", dev_root.resource[1].base);      
39
40         printk_debug("[0x50] <-- 0x%08x\n", dword);
41         pci_write_config32(dev, 0x50, dword); //TOM
42
43 }
44
45 static struct pci_operations lops_pci = {
46         .set_subsystem = 0,
47 };
48
49 static struct device_operations pci_ops  = {
50         .read_resources   = pci_bus_read_resources,
51         .set_resources    = pci_dev_set_resources,
52         .enable_resources = pci_bus_enable_resources,
53         .init             = pci_init,
54         .scan_bus         = pci_scan_bridge,
55 //      .enable           = ck804_enable,
56         .ops_pci          = &lops_pci,
57 };
58
59 static struct pci_driver pci_driver __pci_driver = {
60         .ops    = &pci_ops,
61         .vendor = PCI_VENDOR_ID_NVIDIA,
62         .device = PCI_DEVICE_ID_NVIDIA_CK804_PCI,
63 };
64