2 * Copyright 2004 Tyan Computer
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>
13 static void pci_init(struct device *dev)
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);
25 word = pci_read_config16(dev, 0x48);
26 word |= (1<<0); /* MRL2MRM */
27 word |= (1<<2); /* MR2MRM */
28 pci_write_config16(dev, 0x48, word);
32 dword = pci_read_config32(dev, 0x4c);
33 dword |= 0x00440000; /*TABORT_SER_ENABLE Park Last Enable.*/
34 pci_write_config32(dev, 0x4c, dword);
37 dword = dev_root.resource[1].base & (0xffff0000UL);
38 printk_debug("dev_root mem base = 0x%010Lx\n", dev_root.resource[1].base);
40 printk_debug("[0x50] <-- 0x%08x\n", dword);
41 pci_write_config32(dev, 0x50, dword); //TOM
45 static struct pci_operations lops_pci = {
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,
54 .scan_bus = pci_scan_bridge,
55 // .enable = ck804_enable,
59 static struct pci_driver pci_driver __pci_driver = {
61 .vendor = PCI_VENDOR_ID_NVIDIA,
62 .device = PCI_DEVICE_ID_NVIDIA_CK804_PCI,