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

Go to the source code of this file.

Macros

#define MIN_HFP_BYTE   2
 
#define MIN_HBP_BYTE   2
 

Functions

static unsigned int mtk_dsi_get_bits_per_pixel (u32 format)
 
static u32 mtk_dsi_get_data_rate (u32 bits_per_pixel, u32 lanes, const struct edid *edid)
 
__weak void mtk_dsi_override_phy_timing (struct mtk_phy_timing *timing)
 
static void mtk_dsi_phy_timing (u32 data_rate, struct mtk_phy_timing *timing)
 
static void mtk_dsi_clk_hs_mode_enable (void)
 
static void mtk_dsi_clk_hs_mode_disable (void)
 
static void mtk_dsi_set_mode (u32 mode_flags)
 
static void mtk_dsi_rxtx_control (u32 mode_flags, u32 lanes)
 
static void mtk_dsi_config_vdo_timing (u32 mode_flags, u32 format, u32 lanes, const struct edid *edid, const struct mtk_phy_timing *phy_timing)
 
static void mtk_dsi_start (void)
 
static bool mtk_dsi_is_read_command (enum mipi_dsi_transaction type)
 
static enum cb_err mtk_dsi_cmdq (enum mipi_dsi_transaction type, const u8 *data, u8 len)
 
static void mtk_dsi_reset_dphy (void)
 
int mtk_dsi_init (u32 mode_flags, u32 format, u32 lanes, const struct edid *edid, const u8 *init_commands)
 

Macro Definition Documentation

◆ MIN_HBP_BYTE

#define MIN_HBP_BYTE   2

Definition at line 14 of file dsi.c.

◆ MIN_HFP_BYTE

#define MIN_HFP_BYTE   2

Definition at line 13 of file dsi.c.

Function Documentation

◆ mtk_dsi_clk_hs_mode_disable()

static void mtk_dsi_clk_hs_mode_disable ( void  )
static

Definition at line 116 of file dsi.c.

References clrbits32, dsi0, dsi_regs::dsi_phy_lccon, and LC_HS_TX_EN.

Referenced by mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_clk_hs_mode_enable()

static void mtk_dsi_clk_hs_mode_enable ( void  )
static

Definition at line 111 of file dsi.c.

References dsi0, dsi_regs::dsi_phy_lccon, LC_HS_TX_EN, and setbits32.

Referenced by mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_cmdq()

static enum cb_err mtk_dsi_cmdq ( enum mipi_dsi_transaction  type,
const u8 data,
u8  len 
)
static

Definition at line 293 of file dsi.c.

References MIPI_DSI_DCS_READ, MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM, MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM, MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM, and type.

Referenced by mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_config_vdo_timing()

◆ mtk_dsi_get_bits_per_pixel()

static unsigned int mtk_dsi_get_bits_per_pixel ( u32  format)
static

Definition at line 16 of file dsi.c.

References BIOS_WARNING, MIPI_DSI_FMT_RGB565, MIPI_DSI_FMT_RGB666, MIPI_DSI_FMT_RGB666_PACKED, MIPI_DSI_FMT_RGB888, and printk.

Referenced by mtk_dsi_config_vdo_timing(), and mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_get_data_rate()

static u32 mtk_dsi_get_data_rate ( u32  bits_per_pixel,
u32  lanes,
const struct edid edid 
)
static

Definition at line 32 of file dsi.c.

References BIOS_ERR, BIOS_INFO, DIV_ROUND_UP, MHz, edid::mode, MTK_DSI_DATA_RATE_MIN_MHZ, MTK_DSI_MIPI_RATIO_DENOMINATOR, MTK_DSI_MIPI_RATIO_NUMERATOR, edid_mode::pixel_clock, and printk.

Referenced by mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_init()

int mtk_dsi_init ( u32  mode_flags,
u32  format,
u32  lanes,
const struct edid edid,
const u8 init_commands 
)

◆ mtk_dsi_is_read_command()

static bool mtk_dsi_is_read_command ( enum mipi_dsi_transaction  type)
static

Definition at line 293 of file dsi.c.

◆ mtk_dsi_override_phy_timing()

__weak void mtk_dsi_override_phy_timing ( struct mtk_phy_timing timing)

Definition at line 62 of file dsi.c.

Referenced by mtk_dsi_phy_timing().

Here is the caller graph for this function:

◆ mtk_dsi_phy_timing()

◆ mtk_dsi_reset_dphy()

static void mtk_dsi_reset_dphy ( void  )
static

Definition at line 354 of file dsi.c.

References clrbits32, DPHY_RESET, dsi0, dsi_regs::dsi_con_ctrl, and setbits32.

Referenced by mtk_dsi_init().

Here is the caller graph for this function:

◆ mtk_dsi_rxtx_control()

static void mtk_dsi_rxtx_control ( u32  mode_flags,
u32  lanes 
)
static

Definition at line 138 of file dsi.c.

References dsi0, dsi_regs::dsi_txrx_ctrl, EOTP_DISABLE, MIPI_DSI_CLOCK_NON_CONTINUOUS, MIPI_DSI_MODE_EOT_PACKET, NON_CONTINUOUS_CLK, and write32().

Referenced by mtk_dsi_init().

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

◆ mtk_dsi_set_mode()

static void mtk_dsi_set_mode ( u32  mode_flags)
static

Definition at line 121 of file dsi.c.

References BURST_MODE, dsi0, dsi_regs::dsi_mode_ctrl, MIPI_DSI_MODE_VIDEO, MIPI_DSI_MODE_VIDEO_BURST, MIPI_DSI_MODE_VIDEO_SYNC_PULSE, SYNC_PULSE_MODE, and write32().

Referenced by mtk_dsi_init().

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

◆ mtk_dsi_start()

static void mtk_dsi_start ( void  )
static

Definition at line 286 of file dsi.c.

References dsi0, dsi_regs::dsi_start, and write32().

Referenced by mtk_dsi_init().

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