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

Go to the source code of this file.

Data Structures

struct  mipi_tx_regs
 
struct  lvds_tx1_regs
 

Macros

#define MTK_DSI_MIPI_RATIO_NUMERATOR   102
 
#define MTK_DSI_MIPI_RATIO_DENOMINATOR   100
 
#define MTK_DSI_DATA_RATE_MIN_MHZ   50
 
#define MTK_DSI_HAVE_SIZE_CON   0
 
#define PIXEL_STREAM_CUSTOM_HEADER   0
 

Enumerations

enum  {
  RG_DSI0_LDOCORE_EN = BIT(0) , RG_DSI0_CKG_LDOOUT_EN = BIT(1) , RG_DSI0_BCLK_SEL = (3 << 2) , RG_DSI0_LD_IDX_SEL = (7 << 4) ,
  RG_DSI0_PHYCLK_SEL = (2 << 8) , RG_DSI0_DSICLK_FREQ_SEL = BIT(10) , RG_DSI0_LPTX_CLMP_EN = BIT(11)
}
 
enum  {
  LDOOUT_EN = BIT(0) , CKLANE_EN = BIT(1) , IPLUS1 = BIT(2) , LPTX_IPLUS2 = BIT(3) ,
  LPTX_IMINUS = BIT(4) , LPCD_IPLUS = BIT(5) , LPCD_IMLUS = BIT(6) , RT_CODE = (0xf << 8)
}
 
enum  {
  RG_DSI_LNT_INTR_EN = BIT(0) , RG_DSI_LNT_HS_BIAS_EN = BIT(1) , RG_DSI_LNT_IMP_CAL_EN = BIT(2) , RG_DSI_LNT_TESTMODE_EN = BIT(3) ,
  RG_DSI_LNT_IMP_CAL_CODE = (0xf << 4) , RG_DSI_LNT_AIO_SEL = (7 << 8) , RG_DSI_PAD_TIE_LOW_EN = BIT(11) , RG_DSI_DEBUG_INPUT_EN = BIT(12) ,
  RG_DSI_PRESERVE = (7 << 13)
}
 
enum  {
  RG_DSI_BG_CORE_EN = BIT(0) , RG_DSI_BG_CKEN = BIT(1) , RG_DSI_BG_DIV = (0x3 << 2) , RG_DSI_BG_FAST_CHARGE = BIT(4) ,
  RG_DSI_V12_SEL = (7 << 5) , RG_DSI_V10_SEL = (7 << 8) , RG_DSI_V072_SEL = (7 << 11) , RG_DSI_V04_SEL = (7 << 14) ,
  RG_DSI_V032_SEL = (7 << 17) , RG_DSI_V02_SEL = (7 << 20) , rsv_23 = BIT(23) , RG_DSI_BG_R1_TRIM = (0xf << 24) ,
  RG_DSI_BG_R2_TRIM = (0xf << 28)
}
 
enum  {
  RG_DSI0_MPPLL_PLL_EN = BIT(0) , RG_DSI0_MPPLL_PREDIV = (3 << 1) , RG_DSI0_MPPLL_TXDIV0 = (3 << 3) , RG_DSI0_MPPLL_TXDIV1 = (3 << 5) ,
  RG_DSI0_MPPLL_POSDIV = (7 << 7) , RG_DSI0_MPPLL_MONVC_EN = BIT(10) , RG_DSI0_MPPLL_MONREF_EN = BIT(11) , RG_DSI0_MPPLL_VOD_EN = BIT(12)
}
 
enum  { RG_DSI0_MPPLL_SDM_FRA_EN = BIT(0) , RG_DSI0_MPPLL_SDM_SSC_PH_INIT = BIT(1) , RG_DSI0_MPPLL_SDM_SSC_EN = BIT(2) , RG_DSI0_MPPLL_SDM_SSC_PRD = (0xffff << 16) }
 
enum  { RG_DSI_MPPLL_SDM_PWR_ON = BIT(0) , RG_DSI_MPPLL_SDM_ISO_EN = BIT(1) , RG_DSI_MPPLL_SDM_PWR_ACK = BIT(8) }
 
enum  {
  RG_LVDSTX_21EDG = BIT(0) , RG_LVDSTX_21LEV = BIT(1) , RG_LVDSTX_51EDG = BIT(2) , RG_LVDSTX_51LEV = BIT(3) ,
  RG_AD_LVDSTX_PWR_ACK = BIT(4) , RG_DA_LVDS_ISO_EN = BIT(8) , RG_DA_LVDSTX_PWR_ON = BIT(9)
}
 

Functions

 check_member (mipi_tx_regs, dsi_top_con, 0x40)
 
 check_member (mipi_tx_regs, dsi_pll_pwr, 0x68)
 
void mtk_dsi_pin_drv_ctrl (void)
 

Variables

static struct mipi_tx_regs *const mipi_tx0 = (void *)MIPI_TX0_BASE
 
static struct mipi_tx_regs *const mipi_tx1 = (void *)MIPI_TX0_BASE
 
static struct lvds_tx1_regs *const lvds_tx1 = (void *)(MIPI_TX0_BASE + 0x800)
 
static struct lvds_tx1_regs *const lvds_tx2 = (void *)(MIPI_TX1_BASE + 0x800)
 

Macro Definition Documentation

◆ MTK_DSI_DATA_RATE_MIN_MHZ

#define MTK_DSI_DATA_RATE_MIN_MHZ   50

Definition at line 12 of file dsi.h.

◆ MTK_DSI_HAVE_SIZE_CON

#define MTK_DSI_HAVE_SIZE_CON   0

Definition at line 13 of file dsi.h.

◆ MTK_DSI_MIPI_RATIO_DENOMINATOR

#define MTK_DSI_MIPI_RATIO_DENOMINATOR   100

Definition at line 11 of file dsi.h.

◆ MTK_DSI_MIPI_RATIO_NUMERATOR

#define MTK_DSI_MIPI_RATIO_NUMERATOR   102

Definition at line 10 of file dsi.h.

◆ PIXEL_STREAM_CUSTOM_HEADER

#define PIXEL_STREAM_CUSTOM_HEADER   0

Definition at line 14 of file dsi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI0_LDOCORE_EN 
RG_DSI0_CKG_LDOOUT_EN 
RG_DSI0_BCLK_SEL 
RG_DSI0_LD_IDX_SEL 
RG_DSI0_PHYCLK_SEL 
RG_DSI0_DSICLK_FREQ_SEL 
RG_DSI0_LPTX_CLMP_EN 

Definition at line 55 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
LDOOUT_EN 
CKLANE_EN 
IPLUS1 
LPTX_IPLUS2 
LPTX_IMINUS 
LPCD_IPLUS 
LPCD_IMLUS 
RT_CODE 

Definition at line 66 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI_LNT_INTR_EN 
RG_DSI_LNT_HS_BIAS_EN 
RG_DSI_LNT_IMP_CAL_EN 
RG_DSI_LNT_TESTMODE_EN 
RG_DSI_LNT_IMP_CAL_CODE 
RG_DSI_LNT_AIO_SEL 
RG_DSI_PAD_TIE_LOW_EN 
RG_DSI_DEBUG_INPUT_EN 
RG_DSI_PRESERVE 

Definition at line 78 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI_BG_CORE_EN 
RG_DSI_BG_CKEN 
RG_DSI_BG_DIV 
RG_DSI_BG_FAST_CHARGE 
RG_DSI_V12_SEL 
RG_DSI_V10_SEL 
RG_DSI_V072_SEL 
RG_DSI_V04_SEL 
RG_DSI_V032_SEL 
RG_DSI_V02_SEL 
rsv_23 
RG_DSI_BG_R1_TRIM 
RG_DSI_BG_R2_TRIM 

Definition at line 91 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI0_MPPLL_PLL_EN 
RG_DSI0_MPPLL_PREDIV 
RG_DSI0_MPPLL_TXDIV0 
RG_DSI0_MPPLL_TXDIV1 
RG_DSI0_MPPLL_POSDIV 
RG_DSI0_MPPLL_MONVC_EN 
RG_DSI0_MPPLL_MONREF_EN 
RG_DSI0_MPPLL_VOD_EN 

Definition at line 108 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI0_MPPLL_SDM_FRA_EN 
RG_DSI0_MPPLL_SDM_SSC_PH_INIT 
RG_DSI0_MPPLL_SDM_SSC_EN 
RG_DSI0_MPPLL_SDM_SSC_PRD 

Definition at line 120 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_DSI_MPPLL_SDM_PWR_ON 
RG_DSI_MPPLL_SDM_ISO_EN 
RG_DSI_MPPLL_SDM_PWR_ACK 

Definition at line 128 of file dsi.h.

◆ anonymous enum

anonymous enum
Enumerator
RG_LVDSTX_21EDG 
RG_LVDSTX_21LEV 
RG_LVDSTX_51EDG 
RG_LVDSTX_51LEV 
RG_AD_LVDSTX_PWR_ACK 
RG_DA_LVDS_ISO_EN 
RG_DA_LVDSTX_PWR_ON 

Definition at line 150 of file dsi.h.

Function Documentation

◆ check_member() [1/2]

check_member ( mipi_tx_regs  ,
dsi_pll_pwr  ,
0x68   
)

◆ check_member() [2/2]

check_member ( mipi_tx_regs  ,
dsi_top_con  ,
0x40   
)

◆ mtk_dsi_pin_drv_ctrl()

void mtk_dsi_pin_drv_ctrl ( void  )

Definition at line 116 of file dsi.c.

References BIOS_ERR, clrbits32, lvds_tx1, printk, read32(), RG_AD_LVDSTX_PWR_ACK, RG_DA_LVDS_ISO_EN, RG_DA_LVDSTX_PWR_ON, setbits32, stopwatch_expired(), stopwatch_init_usecs_expire(), and lvds_tx1_regs::vopll_ctl3.

Referenced by mainboard_init().

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

Variable Documentation

◆ lvds_tx1

struct lvds_tx1_regs* const lvds_tx1 = (void *)(MIPI_TX0_BASE + 0x800)
static

Definition at line 146 of file dsi.h.

Referenced by mtk_dsi_pin_drv_ctrl().

◆ lvds_tx2

struct lvds_tx1_regs* const lvds_tx2 = (void *)(MIPI_TX1_BASE + 0x800)
static

Definition at line 147 of file dsi.h.

◆ mipi_tx0

struct mipi_tx_regs* const mipi_tx0 = (void *)MIPI_TX0_BASE
static

Definition at line 51 of file dsi.h.

Referenced by mtk_dsi_configure_mipi_tx().

◆ mipi_tx1

struct mipi_tx_regs* const mipi_tx1 = (void *)MIPI_TX0_BASE
static

Definition at line 52 of file dsi.h.