coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb_xhci.c File Reference
#include <cpu/x86/smm.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include "chip.h"
#include "iobp.h"
#include "pch.h"
Include dependency graph for usb_xhci.c:

Go to the source code of this file.

Macros

#define XHCI_RESET_DELAY_US   1000 /* 1ms */
 
#define XHCI_RESET_TIMEOUT   100 /* 100ms */
 

Functions

static u8usb_xhci_mem_base (struct device *dev)
 
static int usb_xhci_port_count_usb3 (u8 *mem_base)
 
static void usb_xhci_reset_status_usb3 (u8 *mem_base, int port)
 
static void usb_xhci_reset_port_usb3 (u8 *mem_base, int port)
 
static void usb_xhci_reset_usb3 (struct device *dev, int all)
 
static void usb_xhci_clock_gating (struct device *dev)
 
static void usb_xhci_init (struct device *dev)
 

Variables

static struct device_operations usb_xhci_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pch_usb_xhci __pci_driver
 

Macro Definition Documentation

◆ XHCI_RESET_DELAY_US

#define XHCI_RESET_DELAY_US   1000 /* 1ms */

Definition at line 71 of file usb_xhci.c.

◆ XHCI_RESET_TIMEOUT

#define XHCI_RESET_TIMEOUT   100 /* 100ms */

Definition at line 72 of file usb_xhci.c.

Function Documentation

◆ usb_xhci_clock_gating()

static void usb_xhci_clock_gating ( struct device dev)
static

Definition at line 232 of file usb_xhci.c.

References pch_iobp_update(), pch_is_lp(), pci_and_config32(), pci_or_config16(), pci_read_config32(), pci_write_config16(), pci_write_config32(), and pci_write_config8().

Referenced by usb_xhci_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_xhci_init()

◆ usb_xhci_mem_base()

static u8* usb_xhci_mem_base ( struct device dev)
static

Definition at line 17 of file usb_xhci.c.

References PCI_BASE_ADDRESS_0, and pci_read_config32().

Referenced by usb_xhci_init(), and usb_xhci_reset_usb3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_xhci_port_count_usb3()

static int usb_xhci_port_count_usb3 ( u8 mem_base)
static

Definition at line 29 of file usb_xhci.c.

References pch_is_lp(), read32(), XHCI_USB3FUS, XHCI_USB3FUS_SS_MASK, and XHCI_USB3FUS_SS_SHIFT.

Referenced by usb_xhci_reset_usb3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_xhci_reset_port_usb3()

static void usb_xhci_reset_port_usb3 ( u8 mem_base,
int  port 
)
static

Definition at line 65 of file usb_xhci.c.

References read32(), write32(), XHCI_USB3_PORTSC, and XHCI_USB3_PORTSC_WPR.

Referenced by usb_xhci_reset_usb3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_xhci_reset_status_usb3()

static void usb_xhci_reset_status_usb3 ( u8 mem_base,
int  port 
)
static

Definition at line 54 of file usb_xhci.c.

References read32(), write32(), XHCI_USB3_PORTSC, XHCI_USB3_PORTSC_CHST, and XHCI_USB3_PORTSC_PED.

Referenced by usb_xhci_reset_usb3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_xhci_reset_usb3()

static void usb_xhci_reset_usb3 ( struct device dev,
int  all 
)
static

Variable Documentation

◆ __pci_driver

const struct pci_driver pch_usb_xhci __pci_driver
static
Initial value:
= {
.ops = &usb_xhci_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations usb_xhci_ops
Definition: usb_xhci.c:336
static const unsigned short pci_device_ids[]
Definition: usb_xhci.c:344

Definition at line 344 of file usb_xhci.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_LPT_H_XHCI
Definition: pci_ids.h:4112
#define PCI_DID_INTEL_LPT_LP_XHCI
Definition: pci_ids.h:4113

Definition at line 344 of file usb_xhci.c.

◆ usb_xhci_ops

struct device_operations usb_xhci_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = usb_xhci_init,
.ops_pci = &pci_dev_ops_pci,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
static void usb_xhci_init(struct device *dev)
Definition: usb_xhci.c:274

Definition at line 274 of file usb_xhci.c.