coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tcss.c File Reference
#include <bootmode.h>
#include <console/console.h>
#include <device/pci.h>
#include <intelblocks/p2sb.h>
#include <intelblocks/pcr.h>
#include <intelblocks/pmc_ipc.h>
#include <intelblocks/systemagent.h>
#include <intelblocks/tcss.h>
#include <inttypes.h>
#include <security/vboot/vboot_common.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
#include <soc/tcss.h>
#include <drivers/intel/pmc_mux/conn/chip.h>
Include dependency graph for tcss.c:

Go to the source code of this file.

Macros

#define __SIMPLE_DEVICE__
 
#define BIAS_CTRL_VW_INDEX_SHIFT   16
 
#define BIAS_CTRL_BIT_POS_SHIFT   8
 
#define WAIT_FOR_DISPLAYPORT_TIMEOUT_MS   1000
 
#define WAIT_FOR_HPD_TIMEOUT_MS   3000
 

Functions

static uint32_t tcss_make_conn_cmd (int u, int u3, int u2, int ufp, int hsl, int sbu, int acc)
 
static uint32_t tcss_make_alt_mode_cmd_buf_0 (int u, int u3, int m)
 
static uint32_t tcss_make_alt_mode_cmd_buf_1 (int p, int c, int ufp, int dp)
 
static uint32_t tcss_make_safe_mode_cmd (int u, int u3)
 
static uint32_t tcss_make_hpd_mode_cmd (int u, int u3, int hpd_lvl, int hpd_irq)
 
static int send_pmc_req (int cmd_type, const struct pmc_ipc_buffer *req, struct pmc_ipc_buffer *res, uint32_t size)
 
static int send_pmc_disconnect_request (int port, const struct tcss_port_map *port_map)
 
static int send_pmc_connect_request (int port, const struct usbc_mux_info *mux_data, const struct tcss_port_map *port_map)
 
static int send_pmc_safe_mode_request (int port, const struct usbc_mux_info *mux_data, const struct tcss_port_map *port_map)
 
static int send_pmc_dp_hpd_request (int port, const struct usbc_mux_info *mux_data, const struct tcss_port_map *port_map)
 
static int send_pmc_dp_mode_request (int port, const struct usbc_mux_info *mux_data, const struct tcss_port_map *port_map)
 
static void tcss_init_mux (int port, const struct tcss_port_map *port_map)
 
static void tcss_configure_dp_mode (const struct tcss_port_map *port_map, size_t num_ports)
 
static uint32_t calc_bias_ctrl_reg_value (gpio_t pad)
 
void tcss_configure_aux_bias_pads_regbar (const struct typec_aux_bias_pads *pads)
 
void ioe_tcss_configure_aux_bias_pads_sbi (const struct typec_aux_bias_pads *pads)
 
const struct tcss_port_maptcss_get_port_info (size_t *num_ports)
 
void tcss_configure (const struct typec_aux_bias_pads aux_bias_pads[MAX_TYPE_C_PORTS])
 
bool tcss_valid_tbt_auth (void)
 
bool ioe_tcss_valid_tbt_auth (void)
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 3 of file tcss.c.

◆ BIAS_CTRL_BIT_POS_SHIFT

#define BIAS_CTRL_BIT_POS_SHIFT   8

Definition at line 21 of file tcss.c.

◆ BIAS_CTRL_VW_INDEX_SHIFT

#define BIAS_CTRL_VW_INDEX_SHIFT   16

Definition at line 20 of file tcss.c.

◆ WAIT_FOR_DISPLAYPORT_TIMEOUT_MS

#define WAIT_FOR_DISPLAYPORT_TIMEOUT_MS   1000

Definition at line 22 of file tcss.c.

◆ WAIT_FOR_HPD_TIMEOUT_MS

#define WAIT_FOR_HPD_TIMEOUT_MS   3000

Definition at line 23 of file tcss.c.

Function Documentation

◆ calc_bias_ctrl_reg_value()

static uint32_t calc_bias_ctrl_reg_value ( gpio_t  pad)
static

Definition at line 346 of file tcss.c.

References BIAS_CTRL_BIT_POS_SHIFT, BIAS_CTRL_VW_INDEX_SHIFT, gpio_get_pad_cpu_portid(), and gpio_get_vw_info().

Referenced by ioe_tcss_configure_aux_bias_pads_sbi(), and tcss_configure_aux_bias_pads_regbar().

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

◆ ioe_tcss_configure_aux_bias_pads_sbi()

void ioe_tcss_configure_aux_bias_pads_sbi ( const struct typec_aux_bias_pads pads)

Definition at line 371 of file tcss.c.

References calc_bias_ctrl_reg_value(), ioe_p2sb_sbi_write(), IOM_AUX_BIAS_CTRL_PULLDOWN_OFFSET, IOM_AUX_BIAS_CTRL_PULLUP_OFFSET, MAX_TYPE_C_PORTS, and PID_IOM.

Here is the call graph for this function:

◆ ioe_tcss_valid_tbt_auth()

bool ioe_tcss_valid_tbt_auth ( void  )

Definition at line 441 of file tcss.c.

References ioe_p2sb_sbi_read(), IOM_CSME_IMR_TBT_STATUS, PID_IOM, and TBT_VALID_AUTHENTICATION.

Here is the call graph for this function:

◆ send_pmc_connect_request()

static int send_pmc_connect_request ( int  port,
const struct usbc_mux_info mux_data,
const struct tcss_port_map port_map 
)
static

◆ send_pmc_disconnect_request()

static int send_pmc_disconnect_request ( int  port,
const struct tcss_port_map port_map 
)
static

Definition at line 118 of file tcss.c.

References BIOS_DEBUG, pmc_ipc_buffer::buf, CONNECT_REQ, GET_TCSS_CD_FIELD, PMC_IPC_DISC_REQ_SIZE, PMC_IPC_TCSS_DISC_REQ_RES, printk, send_pmc_req(), tcss_make_conn_cmd(), tcss_port_map::usb2_port, and tcss_port_map::usb3_port.

Referenced by tcss_init_mux().

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

◆ send_pmc_dp_hpd_request()

static int send_pmc_dp_hpd_request ( int  port,
const struct usbc_mux_info mux_data,
const struct tcss_port_map port_map 
)
static

Definition at line 189 of file tcss.c.

References pmc_ipc_buffer::buf, usbc_mux_info::hpd_irq, usbc_mux_info::hpd_lvl, HPD_REQ, PMC_IPC_HPD_REQ_SIZE, PMC_IPC_TCSS_HPD_REQ_RES, send_pmc_req(), tcss_make_hpd_mode_cmd(), and tcss_port_map::usb3_port.

Referenced by send_pmc_dp_mode_request().

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

◆ send_pmc_dp_mode_request()

static int send_pmc_dp_mode_request ( int  port,
const struct usbc_mux_info mux_data,
const struct tcss_port_map port_map 
)
static

◆ send_pmc_req()

static int send_pmc_req ( int  cmd_type,
const struct pmc_ipc_buffer req,
struct pmc_ipc_buffer res,
uint32_t  size 
)
static

◆ send_pmc_safe_mode_request()

static int send_pmc_safe_mode_request ( int  port,
const struct usbc_mux_info mux_data,
const struct tcss_port_map port_map 
)
static

Definition at line 170 of file tcss.c.

References BIOS_DEBUG, pmc_ipc_buffer::buf, GET_TCSS_CD_FIELD, PMC_IPC_SAFE_REQ_SIZE, PMC_IPC_TCSS_SAFE_MODE_REQ_RES, printk, SAFE_REQ, send_pmc_req(), tcss_make_safe_mode_cmd(), and tcss_port_map::usb3_port.

Referenced by tcss_configure_dp_mode().

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

◆ tcss_configure()

void tcss_configure ( const struct typec_aux_bias_pads  aux_bias_pads[MAX_TYPE_C_PORTS])

Definition at line 415 of file tcss.c.

References CONFIG, soc_tcss_ops::configure_aux_bias_pads, NULL, tcss_configure_dp_mode(), tcss_get_port_info(), tcss_init_mux(), and tcss_ops.

Referenced by platform_fsp_multi_phase_init_cb().

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

◆ tcss_configure_aux_bias_pads_regbar()

void tcss_configure_aux_bias_pads_regbar ( const struct typec_aux_bias_pads pads)

Definition at line 358 of file tcss.c.

References calc_bias_ctrl_reg_value(), IOM_AUX_BIAS_CTRL_PULLDOWN_OFFSET, IOM_AUX_BIAS_CTRL_PULLUP_OFFSET, MAX_TYPE_C_PORTS, PID_IOM, and REGBAR32.

Here is the call graph for this function:

◆ tcss_configure_dp_mode()

static void tcss_configure_dp_mode ( const struct tcss_port_map port_map,
size_t  num_ports 
)
static

Definition at line 288 of file tcss.c.

References BIOS_ERR, BIOS_INFO, BIT, display_init_required(), NULL, ops, printk, send_pmc_connect_request(), send_pmc_dp_mode_request(), send_pmc_safe_mode_request(), usbc_get_ops(), WAIT_FOR_DISPLAYPORT_TIMEOUT_MS, and WAIT_FOR_HPD_TIMEOUT_MS.

Referenced by tcss_configure().

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

◆ tcss_get_port_info()

const struct tcss_port_map* tcss_get_port_info ( size_t num_ports)

Definition at line 384 of file tcss.c.

References ARRAY_SIZE, CONFIG, DEVICE_PATH_GENERIC, DEVICE_PATH_PCI, find_dev_nested_path(), intel_pmc_mux_conn_get_ports(), is_dev_enabled(), MAX_TYPE_C_PORTS, PCH_DEVFN_PMC, pci_root_bus(), device_path::type, tcss_port_map::usb2_port, and tcss_port_map::usb3_port.

Referenced by tcss_configure().

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

◆ tcss_init_mux()

static void tcss_init_mux ( int  port,
const struct tcss_port_map port_map 
)
static

Definition at line 279 of file tcss.c.

References BIOS_ERR, printk, and send_pmc_disconnect_request().

Referenced by tcss_configure().

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

◆ tcss_make_alt_mode_cmd_buf_0()

static uint32_t tcss_make_alt_mode_cmd_buf_0 ( int  u,
int  u3,
int  m 
)
static

Definition at line 37 of file tcss.c.

References m, MODE, and TCSS_ALT_FIELD.

Referenced by send_pmc_dp_mode_request().

Here is the caller graph for this function:

◆ tcss_make_alt_mode_cmd_buf_1()

static uint32_t tcss_make_alt_mode_cmd_buf_1 ( int  p,
int  c,
int  ufp,
int  dp 
)
static

Definition at line 45 of file tcss.c.

References c, and TCSS_ALT_FIELD.

Referenced by send_pmc_dp_mode_request().

Here is the caller graph for this function:

◆ tcss_make_conn_cmd()

static uint32_t tcss_make_conn_cmd ( int  u,
int  u3,
int  u2,
int  ufp,
int  hsl,
int  sbu,
int  acc 
)
static

Definition at line 25 of file tcss.c.

References TCSS_CD_FIELD.

Referenced by send_pmc_connect_request(), and send_pmc_disconnect_request().

Here is the caller graph for this function:

◆ tcss_make_hpd_mode_cmd()

static uint32_t tcss_make_hpd_mode_cmd ( int  u,
int  u3,
int  hpd_lvl,
int  hpd_irq 
)
static

Definition at line 60 of file tcss.c.

References TCSS_HPD_FIELD.

Referenced by send_pmc_dp_hpd_request().

Here is the caller graph for this function:

◆ tcss_make_safe_mode_cmd()

static uint32_t tcss_make_safe_mode_cmd ( int  u,
int  u3 
)
static

Definition at line 53 of file tcss.c.

References TCSS_CD_FIELD.

Referenced by send_pmc_safe_mode_request().

Here is the caller graph for this function:

◆ tcss_valid_tbt_auth()

bool tcss_valid_tbt_auth ( void  )

Definition at line 436 of file tcss.c.

References IOM_CSME_IMR_TBT_STATUS, PID_IOM, REGBAR32, and TBT_VALID_AUTHENTICATION.