Debian Codegraph @

src/soc/intel/braswell/xhci.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/pci.h>
6 #include <device/pci_ids.h>
7 #include <reg_script.h>
8
9 #include <soc/iomap.h>
10 #include <soc/iosf.h>
11 #include <soc/pci_devs.h>
12 #include <soc/pm.h>
13 #include <soc/ramstage.h>
14 #include <soc/xhci.h>
15
16 #include "chip.h"
17
18 static void xhci_init(struct device *dev)
19 {
20 struct soc_intel_braswell_config *config = config_of(dev);
21
22 if (config->usb_comp_bg) {
23 struct reg_script ops[] = {
24 REG_IOSF_WRITE(IOSF_PORT_USBPHY, USBPHY_COMPBG, config->usb_comp_bg),
25 REG_SCRIPT_END
26 };
27 printk(BIOS_INFO, "Override USB2_COMPBG to: 0x%X\n", config->usb_comp_bg);
28 reg_script_run(ops);
29 }
30 }
31
32 static struct device_operations xhci_device_ops = {
33 .read_resources = pci_dev_read_resources,
34 .set_resources = pci_dev_set_resources,
35 .enable_resources = pci_dev_enable_resources,
36 .init = xhci_init,
37 .ops_pci = &soc_pci_ops,
38 };
39
40 static const struct pci_driver soc_xhci __pci_driver = {
41 .ops = &xhci_device_ops,
42 .vendor = PCI_VID_INTEL,
43 .device = XHCI_DEVID
44 };