05494642c9438114e837d9a9670a5fe6fecdcc53
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_ht.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 lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
14 {
15         pci_write_config32(dev, 0x40,
16                            ((device & 0xffff) << 16) | (vendor & 0xffff));
17 }
18
19 static struct pci_operations lops_pci = {
20         .set_subsystem = lpci_set_subsystem,
21 };
22
23 static struct device_operations ht_ops = {
24         .read_resources   = pci_dev_read_resources,
25         .set_resources    = pci_dev_set_resources,
26         .enable_resources = pci_dev_enable_resources,
27         .init             = 0,
28         .scan_bus         = 0,
29         .ops_pci          = &lops_pci,
30 };
31
32 static const struct pci_driver ht_driver __pci_driver = {
33         .ops    = &ht_ops,
34         .vendor = PCI_VENDOR_ID_NVIDIA,
35         .device = PCI_DEVICE_ID_NVIDIA_CK804_HT,
36 };