Ever wondered where those "setting incorrect section attributes for
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_usb2.c
1 /*
2  * Copyright 2004 Tyan Computer
3  *  by yhlu@tyan.com
4  */
5 #include <console/console.h>
6 #include <device/device.h>
7 #include <device/pci.h>
8 #include <device/pci_ids.h>
9 #include <device/pci_ops.h>
10 #include "ck804.h"
11
12 static void usb2_init(struct device *dev)
13 {
14
15         uint32_t dword;
16         dword = pci_read_config32(dev, 0xf8);
17         dword |= 40; 
18         pci_write_config32(dev, 0xf8, dword);
19 }
20
21 static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
22 {       
23         pci_write_config32(dev, 0x40, 
24                 ((device & 0xffff) << 16) | (vendor & 0xffff));
25 }
26 static struct pci_operations lops_pci = {
27         .set_subsystem = lpci_set_subsystem,
28 };
29
30 static struct device_operations usb2_ops  = {
31         .read_resources   = pci_dev_read_resources,
32         .set_resources    = pci_dev_set_resources,
33         .enable_resources = pci_dev_enable_resources,
34         .init             = usb2_init,
35 //      .enable           = ck804_enable,
36         .scan_bus         = 0,
37         .ops_pci          = &lops_pci,
38 };
39
40 static const struct pci_driver usb2_driver __pci_driver = {
41         .ops    = &usb2_ops,
42         .vendor = PCI_VENDOR_ID_NVIDIA,
43         .device = PCI_DEVICE_ID_NVIDIA_CK804_USB2,
44 };