coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb_common.h File Reference
#include <stddef.h>
Include dependency graph for usb_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ssusb_ippc_regs
 
struct  sif_u2_phy_com
 
struct  sif_u3phyd
 
struct  sif_u3phya
 
struct  sif_u3phya_da
 

Macros

#define CTRL0_IP_SW_RST   (0x1 << 0)
 
#define CTRL1_IP_HOST_PDN   (0x1 << 0)
 
#define STS1_U3_MAC_RST   (0x1 << 16)
 
#define STS1_SYS125_RST   (0x1 << 10)
 
#define STS1_REF_RST   (0x1 << 8)
 
#define STS1_SYSPLL_STABLE   (0x1 << 0)
 
#define STS2_U2_MAC_RST   (0x1 << 0)
 
#define CAP_U3_PORT_NUM(p)   ((p) & 0xff)
 
#define CAP_U2_PORT_NUM(p)   (((p) >> 8) & 0xff)
 
#define CTRL_U3_PORT_HOST_SEL   (0x1 << 2)
 
#define CTRL_U3_PORT_PDN   (0x1 << 1)
 
#define CTRL_U3_PORT_DIS   (0x1 << 0)
 
#define CTRL_U2_PORT_HOST_SEL   (0x1 << 2)
 
#define CTRL_U2_PORT_PDN   (0x1 << 1)
 
#define CTRL_U2_PORT_DIS   (0x1 << 0)
 
#define PA5_RG_U2_HSTX_SRCTRL   (0x7 << 12)
 
#define PA5_RG_U2_HSTX_SRCTRL_VAL(x)   ((0x7 & (x)) << 12)
 
#define PA5_RG_U2_HS_100U_U3_EN   (0x1 << 11)
 
#define PA6_RG_U2_ISO_EN   (0x1 << 31)
 
#define PA6_RG_U2_BC11_SW_EN   (0x1 << 23)
 
#define PA6_RG_U2_OTG_VBUSCMP_EN   (0x1 << 20)
 
#define PA6_RG_U2_DISCTH   (0xf << 4)
 
#define PA6_RG_U2_DISCTH_VAL(x)   ((0xf & (x)) << 4)
 
#define PA6_RG_U2_SQTH   (0xf << 0)
 
#define PA6_RG_U2_SQTH_VAL(x)   ((0xf & (x)) << 0)
 
#define P2C_RG_USB20_GPIO_CTL   (0x1 << 9)
 
#define P2C_USB20_GPIO_MODE   (0x1 << 8)
 
#define P2C_U2_GPIO_CTR_MSK   (P2C_RG_USB20_GPIO_CTL | P2C_USB20_GPIO_MODE)
 
#define P2C_FORCE_UART_EN   (0x1 << 26)
 
#define P2C_FORCE_DATAIN   (0x1 << 23)
 
#define P2C_FORCE_DM_PULLDOWN   (0x1 << 21)
 
#define P2C_FORCE_DP_PULLDOWN   (0x1 << 20)
 
#define P2C_FORCE_XCVRSEL   (0x1 << 19)
 
#define P2C_FORCE_SUSPENDM   (0x1 << 18)
 
#define P2C_FORCE_TERMSEL   (0x1 << 17)
 
#define P2C_RG_DATAIN   (0xf << 10)
 
#define P2C_RG_DATAIN_VAL(x)   ((0xf & (x)) << 10)
 
#define P2C_RG_DMPULLDOWN   (0x1 << 7)
 
#define P2C_RG_DPPULLDOWN   (0x1 << 6)
 
#define P2C_RG_XCVRSEL   (0x3 << 4)
 
#define P2C_RG_XCVRSEL_VAL(x)   ((0x3 & (x)) << 4)
 
#define P2C_RG_SUSPENDM   (0x1 << 3)
 
#define P2C_RG_TERMSEL   (0x1 << 2)
 
#define P2C_DTM0_PART_MASK
 
#define P2C_RG_UART_EN   (0x1 << 16)
 
#define P2C_RG_VBUSVALID   (0x1 << 5)
 
#define P2C_RG_SESSEND   (0x1 << 4)
 
#define P2C_RG_AVALID   (0x1 << 2)
 
#define P3A_RG_U3_VUSB10_ON   (1 << 5)
 
#define P3A_RG_TX_EIDLE_CM   (0xf << 28)
 
#define P3A_RG_TX_EIDLE_CM_VAL(x)   ((0xf & (x)) << 28)
 
#define P3A_RG_RX_DAC_MUX   (0x1f << 1)
 
#define P3A_RG_RX_DAC_MUX_VAL(x)   ((0x1f & (x)) << 1)
 
#define P3A_RG_XTAL_EXT_EN_U3   (0x3 << 10)
 
#define P3A_RG_XTAL_EXT_EN_U3_VAL(x)   ((0x3 & (x)) << 10)
 
#define P3D_RG_CDR_BIR_LTD1   (0x1f << 24)
 
#define P3D_RG_CDR_BIR_LTD1_VAL(x)   ((0x1f & (x)) << 24)
 
#define P3D_RG_CDR_BIR_LTD0   (0x1f << 8)
 
#define P3D_RG_CDR_BIR_LTD0_VAL(x)   ((0x1f & (x)) << 8)
 

Functions

 check_member (sif_u2_phy_com, u2phydtm0, 0x68)
 
void mtk_usb_prepare (void)
 
void mtk_usb_adjust_phy_shift (void)
 
void setup_usb_host (void)
 

Macro Definition Documentation

◆ CAP_U2_PORT_NUM

#define CAP_U2_PORT_NUM (   p)    (((p) >> 8) & 0xff)

Definition at line 25 of file usb_common.h.

◆ CAP_U3_PORT_NUM

#define CAP_U3_PORT_NUM (   p)    ((p) & 0xff)

Definition at line 24 of file usb_common.h.

◆ CTRL0_IP_SW_RST

#define CTRL0_IP_SW_RST   (0x1 << 0)

Definition at line 9 of file usb_common.h.

◆ CTRL1_IP_HOST_PDN

#define CTRL1_IP_HOST_PDN   (0x1 << 0)

Definition at line 12 of file usb_common.h.

◆ CTRL_U2_PORT_DIS

#define CTRL_U2_PORT_DIS   (0x1 << 0)

Definition at line 35 of file usb_common.h.

◆ CTRL_U2_PORT_HOST_SEL

#define CTRL_U2_PORT_HOST_SEL   (0x1 << 2)

Definition at line 33 of file usb_common.h.

◆ CTRL_U2_PORT_PDN

#define CTRL_U2_PORT_PDN   (0x1 << 1)

Definition at line 34 of file usb_common.h.

◆ CTRL_U3_PORT_DIS

#define CTRL_U3_PORT_DIS   (0x1 << 0)

Definition at line 30 of file usb_common.h.

◆ CTRL_U3_PORT_HOST_SEL

#define CTRL_U3_PORT_HOST_SEL   (0x1 << 2)

Definition at line 28 of file usb_common.h.

◆ CTRL_U3_PORT_PDN

#define CTRL_U3_PORT_PDN   (0x1 << 1)

Definition at line 29 of file usb_common.h.

◆ P2C_DTM0_PART_MASK

#define P2C_DTM0_PART_MASK
Value:
P2C_FORCE_DP_PULLDOWN | P2C_FORCE_XCVRSEL | \
P2C_FORCE_TERMSEL | P2C_RG_DMPULLDOWN | \
P2C_RG_TERMSEL)
#define P2C_FORCE_DM_PULLDOWN
Definition: usb_common.h:73
#define P2C_RG_DMPULLDOWN
Definition: usb_common.h:80
#define P2C_FORCE_XCVRSEL
Definition: usb_common.h:75
#define P2C_FORCE_DATAIN
Definition: usb_common.h:72

Definition at line 86 of file usb_common.h.

◆ P2C_FORCE_DATAIN

#define P2C_FORCE_DATAIN   (0x1 << 23)

Definition at line 72 of file usb_common.h.

◆ P2C_FORCE_DM_PULLDOWN

#define P2C_FORCE_DM_PULLDOWN   (0x1 << 21)

Definition at line 73 of file usb_common.h.

◆ P2C_FORCE_DP_PULLDOWN

#define P2C_FORCE_DP_PULLDOWN   (0x1 << 20)

Definition at line 74 of file usb_common.h.

◆ P2C_FORCE_SUSPENDM

#define P2C_FORCE_SUSPENDM   (0x1 << 18)

Definition at line 76 of file usb_common.h.

◆ P2C_FORCE_TERMSEL

#define P2C_FORCE_TERMSEL   (0x1 << 17)

Definition at line 77 of file usb_common.h.

◆ P2C_FORCE_UART_EN

#define P2C_FORCE_UART_EN   (0x1 << 26)

Definition at line 71 of file usb_common.h.

◆ P2C_FORCE_XCVRSEL

#define P2C_FORCE_XCVRSEL   (0x1 << 19)

Definition at line 75 of file usb_common.h.

◆ P2C_RG_AVALID

#define P2C_RG_AVALID   (0x1 << 2)

Definition at line 96 of file usb_common.h.

◆ P2C_RG_DATAIN

#define P2C_RG_DATAIN   (0xf << 10)

Definition at line 78 of file usb_common.h.

◆ P2C_RG_DATAIN_VAL

#define P2C_RG_DATAIN_VAL (   x)    ((0xf & (x)) << 10)

Definition at line 79 of file usb_common.h.

◆ P2C_RG_DMPULLDOWN

#define P2C_RG_DMPULLDOWN   (0x1 << 7)

Definition at line 80 of file usb_common.h.

◆ P2C_RG_DPPULLDOWN

#define P2C_RG_DPPULLDOWN   (0x1 << 6)

Definition at line 81 of file usb_common.h.

◆ P2C_RG_SESSEND

#define P2C_RG_SESSEND   (0x1 << 4)

Definition at line 95 of file usb_common.h.

◆ P2C_RG_SUSPENDM

#define P2C_RG_SUSPENDM   (0x1 << 3)

Definition at line 84 of file usb_common.h.

◆ P2C_RG_TERMSEL

#define P2C_RG_TERMSEL   (0x1 << 2)

Definition at line 85 of file usb_common.h.

◆ P2C_RG_UART_EN

#define P2C_RG_UART_EN   (0x1 << 16)

Definition at line 93 of file usb_common.h.

◆ P2C_RG_USB20_GPIO_CTL

#define P2C_RG_USB20_GPIO_CTL   (0x1 << 9)

Definition at line 66 of file usb_common.h.

◆ P2C_RG_VBUSVALID

#define P2C_RG_VBUSVALID   (0x1 << 5)

Definition at line 94 of file usb_common.h.

◆ P2C_RG_XCVRSEL

#define P2C_RG_XCVRSEL   (0x3 << 4)

Definition at line 82 of file usb_common.h.

◆ P2C_RG_XCVRSEL_VAL

#define P2C_RG_XCVRSEL_VAL (   x)    ((0x3 & (x)) << 4)

Definition at line 83 of file usb_common.h.

◆ P2C_U2_GPIO_CTR_MSK

#define P2C_U2_GPIO_CTR_MSK   (P2C_RG_USB20_GPIO_CTL | P2C_USB20_GPIO_MODE)

Definition at line 68 of file usb_common.h.

◆ P2C_USB20_GPIO_MODE

#define P2C_USB20_GPIO_MODE   (0x1 << 8)

Definition at line 67 of file usb_common.h.

◆ P3A_RG_RX_DAC_MUX

#define P3A_RG_RX_DAC_MUX   (0x1f << 1)

Definition at line 106 of file usb_common.h.

◆ P3A_RG_RX_DAC_MUX_VAL

#define P3A_RG_RX_DAC_MUX_VAL (   x)    ((0x1f & (x)) << 1)

Definition at line 107 of file usb_common.h.

◆ P3A_RG_TX_EIDLE_CM

#define P3A_RG_TX_EIDLE_CM   (0xf << 28)

Definition at line 102 of file usb_common.h.

◆ P3A_RG_TX_EIDLE_CM_VAL

#define P3A_RG_TX_EIDLE_CM_VAL (   x)    ((0xf & (x)) << 28)

Definition at line 103 of file usb_common.h.

◆ P3A_RG_U3_VUSB10_ON

#define P3A_RG_U3_VUSB10_ON   (1 << 5)

Definition at line 99 of file usb_common.h.

◆ P3A_RG_XTAL_EXT_EN_U3

#define P3A_RG_XTAL_EXT_EN_U3   (0x3 << 10)

Definition at line 110 of file usb_common.h.

◆ P3A_RG_XTAL_EXT_EN_U3_VAL

#define P3A_RG_XTAL_EXT_EN_U3_VAL (   x)    ((0x3 & (x)) << 10)

Definition at line 111 of file usb_common.h.

◆ P3D_RG_CDR_BIR_LTD0

#define P3D_RG_CDR_BIR_LTD0   (0x1f << 8)

Definition at line 116 of file usb_common.h.

◆ P3D_RG_CDR_BIR_LTD0_VAL

#define P3D_RG_CDR_BIR_LTD0_VAL (   x)    ((0x1f & (x)) << 8)

Definition at line 117 of file usb_common.h.

◆ P3D_RG_CDR_BIR_LTD1

#define P3D_RG_CDR_BIR_LTD1   (0x1f << 24)

Definition at line 114 of file usb_common.h.

◆ P3D_RG_CDR_BIR_LTD1_VAL

#define P3D_RG_CDR_BIR_LTD1_VAL (   x)    ((0x1f & (x)) << 24)

Definition at line 115 of file usb_common.h.

◆ PA5_RG_U2_HS_100U_U3_EN

#define PA5_RG_U2_HS_100U_U3_EN   (0x1 << 11)

Definition at line 54 of file usb_common.h.

◆ PA5_RG_U2_HSTX_SRCTRL

#define PA5_RG_U2_HSTX_SRCTRL   (0x7 << 12)

Definition at line 52 of file usb_common.h.

◆ PA5_RG_U2_HSTX_SRCTRL_VAL

#define PA5_RG_U2_HSTX_SRCTRL_VAL (   x)    ((0x7 & (x)) << 12)

Definition at line 53 of file usb_common.h.

◆ PA6_RG_U2_BC11_SW_EN

#define PA6_RG_U2_BC11_SW_EN   (0x1 << 23)

Definition at line 58 of file usb_common.h.

◆ PA6_RG_U2_DISCTH

#define PA6_RG_U2_DISCTH   (0xf << 4)

Definition at line 60 of file usb_common.h.

◆ PA6_RG_U2_DISCTH_VAL

#define PA6_RG_U2_DISCTH_VAL (   x)    ((0xf & (x)) << 4)

Definition at line 61 of file usb_common.h.

◆ PA6_RG_U2_ISO_EN

#define PA6_RG_U2_ISO_EN   (0x1 << 31)

Definition at line 57 of file usb_common.h.

◆ PA6_RG_U2_OTG_VBUSCMP_EN

#define PA6_RG_U2_OTG_VBUSCMP_EN   (0x1 << 20)

Definition at line 59 of file usb_common.h.

◆ PA6_RG_U2_SQTH

#define PA6_RG_U2_SQTH   (0xf << 0)

Definition at line 62 of file usb_common.h.

◆ PA6_RG_U2_SQTH_VAL

#define PA6_RG_U2_SQTH_VAL (   x)    ((0xf & (x)) << 0)

Definition at line 63 of file usb_common.h.

◆ STS1_REF_RST

#define STS1_REF_RST   (0x1 << 8)

Definition at line 17 of file usb_common.h.

◆ STS1_SYS125_RST

#define STS1_SYS125_RST   (0x1 << 10)

Definition at line 16 of file usb_common.h.

◆ STS1_SYSPLL_STABLE

#define STS1_SYSPLL_STABLE   (0x1 << 0)

Definition at line 18 of file usb_common.h.

◆ STS1_U3_MAC_RST

#define STS1_U3_MAC_RST   (0x1 << 16)

Definition at line 15 of file usb_common.h.

◆ STS2_U2_MAC_RST

#define STS2_U2_MAC_RST   (0x1 << 0)

Definition at line 21 of file usb_common.h.

Function Documentation

◆ check_member()

check_member ( sif_u2_phy_com  ,
u2phydtm0  ,
0x68   
)

◆ mtk_usb_adjust_phy_shift()

void mtk_usb_adjust_phy_shift ( void  )

◆ mtk_usb_prepare()

void mtk_usb_prepare ( void  )

◆ setup_usb_host()

void setup_usb_host ( void  )

Definition at line 153 of file usb.c.

References mtk_usb_adjust_phy_shift(), mtk_usb_prepare(), ssusb_soft_reset(), u3p_err, u3p_msg, u3phy_ports_enable(), and u3phy_power_on().

Referenced by configure_usb(), mainboard_init(), setup_usb(), and setup_usb_host0().

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