coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.h File Reference
#include <types.h>
Include dependency graph for usb.h:

Go to the source code of this file.

Data Structures

struct  usb_board_data
 

Macros

#define PIPE_UTMI_CLK_SEL   BIT(0)
 
#define PIPE3_PHYSTATUS_SW   BIT(3)
 
#define PIPE_UTMI_CLK_DIS   BIT(8)
 
#define DWC3_GUSB3PIPECTL_DELAYP1TRANS   BIT(18)
 
#define DWC3_GUSB3PIPECTL_UX_EXIT_IN_PX   BIT(27)
 
#define DWC3_GCTL_PRTCAPDIR(n)   ((n) << 12)
 
#define DWC3_GCTL_PRTCAP_OTG   3
 
#define DWC3_GCTL_PRTCAP_HOST   1
 
#define DWC3_GUSB2PHYCFG_USBTRDTIM(n)   ((n) << 10)
 
#define DWC3_GUSB2PHYCFG_USB2TRDTIM_MASK   DWC3_GUSB2PHYCFG_USBTRDTIM(0xf)
 
#define DWC3_GUSB2PHYCFG_PHYIF(n)   ((n) << 3)
 
#define DWC3_GUSB2PHYCFG_PHYIF_MASK   DWC3_GUSB2PHYCFG_PHYIF(1)
 
#define USBTRDTIM_UTMI_8_BIT   9
 
#define UTMI_PHYIF_8_BIT   0
 
#define DWC3_GCTL_SCALEDOWN(n)   ((n) << 4)
 
#define DWC3_GCTL_SCALEDOWN_MASK   DWC3_GCTL_SCALEDOWN(3)
 
#define DWC3_GCTL_DISSCRAMBLE   (1 << 3)
 
#define DWC3_GCTL_U2EXIT_LFPS   (1 << 2)
 
#define DWC3_GCTL_DSBLCLKGTNG   (1 << 0)
 
#define USB2PHY_TCSR_CTRL   0x01
 
#define USB2PHY_REFCLK_CTRL   0x0d
 
#define USB2PHY_UTMI_CTRL5   0x12
 
#define USB2PHY_PARAMETER_OVERRIDE_X0   0x63
 
#define USB2PHY_PARAMETER_OVERRIDE_X1   0x03
 
#define USB2PHY_PARAMETER_OVERRIDE_X2   0x1d
 
#define USB2PHY_PARAMETER_OVERRIDE_X3   0x03
 
#define USB2PHY_HS_PHY_CTRL1   0x23
 
#define QUSB2PHY_HS_PHY_CTRL_COMMON0   0x08
 
#define QUSB2PHY_HS_PHY_CTRL_COMMON1   0xdc
 
#define USB2PHY_HS_PHY_CTRL2   0xe0
 
#define USB2PHY_UTMI_CTRL5_POR_CLEAR   0x10
 
#define USB2PHY_HS_PHY_CTRL2_SUSPEND_N_SEL   0x60
 

Enumerations

enum  usb_port { HSUSB_SS_PORT_0 , HSUSB_HS_PORT_1 }
 

Functions

void setup_usb_host (enum usb_port port, struct usb_board_data *data)
 
void reset_usb (enum usb_port port)
 

Macro Definition Documentation

◆ DWC3_GCTL_DISSCRAMBLE

#define DWC3_GCTL_DISSCRAMBLE   (1 << 3)

Definition at line 29 of file usb.h.

◆ DWC3_GCTL_DSBLCLKGTNG

#define DWC3_GCTL_DSBLCLKGTNG   (1 << 0)

Definition at line 31 of file usb.h.

◆ DWC3_GCTL_PRTCAP_HOST

#define DWC3_GCTL_PRTCAP_HOST   1

Definition at line 17 of file usb.h.

◆ DWC3_GCTL_PRTCAP_OTG

#define DWC3_GCTL_PRTCAP_OTG   3

Definition at line 16 of file usb.h.

◆ DWC3_GCTL_PRTCAPDIR

#define DWC3_GCTL_PRTCAPDIR (   n)    ((n) << 12)

Definition at line 15 of file usb.h.

◆ DWC3_GCTL_SCALEDOWN

#define DWC3_GCTL_SCALEDOWN (   n)    ((n) << 4)

Definition at line 27 of file usb.h.

◆ DWC3_GCTL_SCALEDOWN_MASK

#define DWC3_GCTL_SCALEDOWN_MASK   DWC3_GCTL_SCALEDOWN(3)

Definition at line 28 of file usb.h.

◆ DWC3_GCTL_U2EXIT_LFPS

#define DWC3_GCTL_U2EXIT_LFPS   (1 << 2)

Definition at line 30 of file usb.h.

◆ DWC3_GUSB2PHYCFG_PHYIF

#define DWC3_GUSB2PHYCFG_PHYIF (   n)    ((n) << 3)

Definition at line 22 of file usb.h.

◆ DWC3_GUSB2PHYCFG_PHYIF_MASK

#define DWC3_GUSB2PHYCFG_PHYIF_MASK   DWC3_GUSB2PHYCFG_PHYIF(1)

Definition at line 23 of file usb.h.

◆ DWC3_GUSB2PHYCFG_USB2TRDTIM_MASK

#define DWC3_GUSB2PHYCFG_USB2TRDTIM_MASK   DWC3_GUSB2PHYCFG_USBTRDTIM(0xf)

Definition at line 21 of file usb.h.

◆ DWC3_GUSB2PHYCFG_USBTRDTIM

#define DWC3_GUSB2PHYCFG_USBTRDTIM (   n)    ((n) << 10)

Definition at line 20 of file usb.h.

◆ DWC3_GUSB3PIPECTL_DELAYP1TRANS

#define DWC3_GUSB3PIPECTL_DELAYP1TRANS   BIT(18)

Definition at line 13 of file usb.h.

◆ DWC3_GUSB3PIPECTL_UX_EXIT_IN_PX

#define DWC3_GUSB3PIPECTL_UX_EXIT_IN_PX   BIT(27)

Definition at line 14 of file usb.h.

◆ PIPE3_PHYSTATUS_SW

#define PIPE3_PHYSTATUS_SW   BIT(3)

Definition at line 9 of file usb.h.

◆ PIPE_UTMI_CLK_DIS

#define PIPE_UTMI_CLK_DIS   BIT(8)

Definition at line 10 of file usb.h.

◆ PIPE_UTMI_CLK_SEL

#define PIPE_UTMI_CLK_SEL   BIT(0)

Definition at line 8 of file usb.h.

◆ QUSB2PHY_HS_PHY_CTRL_COMMON0

#define QUSB2PHY_HS_PHY_CTRL_COMMON0   0x08

Definition at line 42 of file usb.h.

◆ QUSB2PHY_HS_PHY_CTRL_COMMON1

#define QUSB2PHY_HS_PHY_CTRL_COMMON1   0xdc

Definition at line 43 of file usb.h.

◆ USB2PHY_HS_PHY_CTRL1

#define USB2PHY_HS_PHY_CTRL1   0x23

Definition at line 41 of file usb.h.

◆ USB2PHY_HS_PHY_CTRL2

#define USB2PHY_HS_PHY_CTRL2   0xe0

Definition at line 44 of file usb.h.

◆ USB2PHY_HS_PHY_CTRL2_SUSPEND_N_SEL

#define USB2PHY_HS_PHY_CTRL2_SUSPEND_N_SEL   0x60

Definition at line 46 of file usb.h.

◆ USB2PHY_PARAMETER_OVERRIDE_X0

#define USB2PHY_PARAMETER_OVERRIDE_X0   0x63

Definition at line 37 of file usb.h.

◆ USB2PHY_PARAMETER_OVERRIDE_X1

#define USB2PHY_PARAMETER_OVERRIDE_X1   0x03

Definition at line 38 of file usb.h.

◆ USB2PHY_PARAMETER_OVERRIDE_X2

#define USB2PHY_PARAMETER_OVERRIDE_X2   0x1d

Definition at line 39 of file usb.h.

◆ USB2PHY_PARAMETER_OVERRIDE_X3

#define USB2PHY_PARAMETER_OVERRIDE_X3   0x03

Definition at line 40 of file usb.h.

◆ USB2PHY_REFCLK_CTRL

#define USB2PHY_REFCLK_CTRL   0x0d

Definition at line 35 of file usb.h.

◆ USB2PHY_TCSR_CTRL

#define USB2PHY_TCSR_CTRL   0x01

Definition at line 34 of file usb.h.

◆ USB2PHY_UTMI_CTRL5

#define USB2PHY_UTMI_CTRL5   0x12

Definition at line 36 of file usb.h.

◆ USB2PHY_UTMI_CTRL5_POR_CLEAR

#define USB2PHY_UTMI_CTRL5_POR_CLEAR   0x10

Definition at line 45 of file usb.h.

◆ USBTRDTIM_UTMI_8_BIT

#define USBTRDTIM_UTMI_8_BIT   9

Definition at line 24 of file usb.h.

◆ UTMI_PHYIF_8_BIT

#define UTMI_PHYIF_8_BIT   0

Definition at line 25 of file usb.h.

Enumeration Type Documentation

◆ usb_port

enum usb_port
Enumerator
HSUSB_SS_PORT_0 
HSUSB_HS_PORT_1 

Definition at line 56 of file usb.h.

Function Documentation

◆ reset_usb()

void reset_usb ( enum usb_port  port)

Definition at line 116 of file usb.c.

References BIOS_INFO, clock_reset_bcr(), printk, usb_dwc3_cfg::usb3_bcr, and usb_host_base.

Here is the call graph for this function:

◆ setup_usb_host()