coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.c File Reference
#include <device/mmio.h>
#include <console/console.h>
#include <soc/addressmap.h>
#include <soc/usb.h>
#include <timer.h>
Include dependency graph for usb.c:

Go to the source code of this file.

Macros

#define USBTAG   "[SSUSB] "
 
#define u3p_msg(fmt, arg...)   printk(BIOS_INFO, USBTAG fmt, ##arg)
 
#define u3p_err(fmt, arg...)   printk(BIOS_ERR, USBTAG fmt, ##arg)
 

Functions

static void phy_index_power_on (int index)
 
static void u3phy_power_on (void)
 
static int check_ip_clk_status (void)
 
static int u3phy_ports_enable (void)
 
static void ssusb_soft_reset (void)
 
__weak void mtk_usb_prepare (void)
 
__weak void mtk_usb_adjust_phy_shift (void)
 
void setup_usb_host (void)
 

Variables

static struct ssusb_ippc_regsippc_regs = (void *)(SSUSB_IPPC_BASE)
 
static struct ssusb_sif_portphy_ports = (void *)(SSUSB_SIF_BASE)
 

Macro Definition Documentation

◆ u3p_err

#define u3p_err (   fmt,
  arg... 
)    printk(BIOS_ERR, USBTAG fmt, ##arg)

Definition at line 11 of file usb.c.

◆ u3p_msg

#define u3p_msg (   fmt,
  arg... 
)    printk(BIOS_INFO, USBTAG fmt, ##arg)

Definition at line 10 of file usb.c.

◆ USBTAG

#define USBTAG   "[SSUSB] "

Definition at line 9 of file usb.c.

Function Documentation

◆ check_ip_clk_status()

static int check_ip_clk_status ( void  )
static

◆ mtk_usb_adjust_phy_shift()

__weak void mtk_usb_adjust_phy_shift ( void  )

Definition at line 148 of file usb.c.

Referenced by setup_usb_host().

Here is the caller graph for this function:

◆ mtk_usb_prepare()

__weak void mtk_usb_prepare ( void  )

Definition at line 143 of file usb.c.

Referenced by setup_usb_host().

Here is the caller graph for this function:

◆ phy_index_power_on()

◆ 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:

◆ ssusb_soft_reset()

static void ssusb_soft_reset ( void  )
inlinestatic

Definition at line 136 of file usb.c.

References clrbits32, CTRL0_IP_SW_RST, ssusb_ippc_regs::ip_pw_ctr0, ippc_regs, and setbits32.

Referenced by setup_usb_host().

Here is the caller graph for this function:

◆ u3phy_ports_enable()

◆ u3phy_power_on()

static void u3phy_power_on ( void  )
static

Definition at line 72 of file usb.c.

References phy_index_power_on(), and USB_PORT_NUMBER.

Referenced by setup_usb_host().

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

Variable Documentation

◆ ippc_regs

struct ssusb_ippc_regs* ippc_regs = (void *)(SSUSB_IPPC_BASE)
static

Definition at line 13 of file usb.c.

Referenced by check_ip_clk_status(), ssusb_soft_reset(), and u3phy_ports_enable().

◆ phy_ports

struct ssusb_sif_port* phy_ports = (void *)(SSUSB_SIF_BASE)
static

Definition at line 14 of file usb.c.

Referenced by phy_index_power_on().