f6c5400b85b9485f84b38dc00be590845151374c
[coreboot.git] / src / southbridge / nvidia / mcp55 / mcp55_ht.c
1 /*
2  * This file is part of the LinuxBIOS project.
3  *
4  * Copyright (C) 2004 Tyan Computer
5  * Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer.
6  * Copyright (C) 2006,2007 AMD
7  * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
22  */
23
24 #include <console/console.h>
25 #include <device/device.h>
26 #include <device/pci.h>
27 #include <device/pci_ids.h>
28 #include <device/pci_ops.h>
29 #include "mcp55.h"
30
31 static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
32 {
33         pci_write_config32(dev, 0x40,
34                 ((device & 0xffff) << 16) | (vendor & 0xffff));
35 }
36 static struct pci_operations lops_pci = {
37         .set_subsystem  = lpci_set_subsystem,
38 };
39
40 static struct device_operations ht_ops  = {
41         .read_resources = pci_dev_read_resources,
42         .set_resources  = pci_dev_set_resources,
43         .enable_resources       = pci_dev_enable_resources,
44         .init           = 0,
45         .scan_bus       = 0,
46         .ops_pci        = &lops_pci,
47 };
48
49 static struct pci_driver ht_driver __pci_driver = {
50         .ops    = &ht_ops,
51         .vendor = PCI_VENDOR_ID_NVIDIA,
52         .device = PCI_DEVICE_ID_NVIDIA_MCP55_HT,
53 };
54