1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
8 static void ehci_init(struct device *dev)
12 printk(BIOS_DEBUG, "EHCI: Setting up controller.. ");
13 cmd = pci_read_config32(dev, PCI_COMMAND);
14 pci_write_config32(dev, PCI_COMMAND,
15 cmd | PCI_COMMAND_MASTER);
17 printk(BIOS_DEBUG, "done.\n");
20 static void ehci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
23 access_cntl = pci_read_config8(dev, 0x80);
24 /* Enable writes to protected registers */
25 pci_write_config8(dev, 0x80, access_cntl | 1);
26 /* Write the subsystem vendor and device id */
27 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
28 ((device & 0xffff) << 16) | (vendor & 0xffff));
29 /* Restore protection */
30 pci_write_config8(dev, 0x80, access_cntl);
33 static struct pci_operations lops_pci = {
34 .set_subsystem = &ehci_set_subsystem,
36 static struct device_operations ehci_ops = {
37 .read_resources = pci_dev_read_resources,
38 .set_resources = pci_dev_set_resources,
39 .enable_resources = pci_dev_enable_resources,
42 .enable = esb6300_enable,
46 static const struct pci_driver ehci_driver __pci_driver = {
48 .vendor = PCI_VENDOR_ID_INTEL,
49 .device = PCI_DEVICE_ID_INTEL_6300ESB_EHCI,