coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dp_lowlevel.c File Reference
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <soc/dp.h>
#include <soc/fimd.h>
#include <soc/i2c.h>
#include <soc/power.h>
#include <soc/sysreg.h>
Include dependency graph for dp_lowlevel.c:

Go to the source code of this file.

Macros

#define lwrite32(a, b)   write32((void *)(b), (unsigned long)(a))
 
#define lread32(a)   read32((void *)(a))
 

Functions

static void exynos_dp_enable_video_input (u32 enable)
 
void exynos_dp_disable_video_bist (void)
 
void exynos_dp_enable_video_mute (unsigned int enable)
 
static void exynos_dp_init_analog_param (void)
 
static void exynos_dp_init_interrupt (void)
 
void exynos_dp_reset (void)
 
void exynos_dp_enable_sw_func (unsigned int enable)
 
unsigned int exynos_dp_set_analog_power_down (unsigned int block, u32 enable)
 
unsigned int exynos_dp_get_pll_lock_status (void)
 
static void exynos_dp_set_pll_power (unsigned int enable)
 
int exynos_dp_init_analog_func (void)
 
void exynos_dp_init_hpd (void)
 
static void exynos_dp_reset_aux (void)
 
void exynos_dp_init_aux (void)
 
void exynos_dp_config_interrupt (void)
 
unsigned int exynos_dp_get_plug_in_status (void)
 
unsigned int exynos_dp_detect_hpd (void)
 
unsigned int exynos_dp_start_aux_transaction (void)
 
unsigned int exynos_dp_write_byte_to_dpcd (u32 reg_addr, u8 data)
 
unsigned int exynos_dp_read_byte_from_dpcd (u32 reg_addr, unsigned char *data)
 
unsigned int exynos_dp_write_bytes_to_dpcd (u32 reg_addr, unsigned int count, unsigned char data[])
 
unsigned int exynos_dp_read_bytes_from_dpcd (u32 reg_addr, unsigned int count, unsigned char data[])
 
int exynos_dp_select_i2c_device (u32 device_addr, u32 reg_addr)
 
int exynos_dp_read_byte_from_i2c (u32 device_addr, u32 reg_addr, unsigned int *data)
 
int exynos_dp_read_bytes_from_i2c (u32 device_addr, u32 reg_addr, unsigned int count, unsigned char edid[])
 
void exynos_dp_reset_macro (void)
 
void exynos_dp_set_link_bandwidth (unsigned char bwtype)
 
unsigned char exynos_dp_get_link_bandwidth (void)
 
void exynos_dp_set_lane_count (unsigned char count)
 
unsigned int exynos_dp_get_lane_count (void)
 
unsigned char exynos_dp_get_lanex_pre_emphasis (unsigned char lanecnt)
 
void exynos_dp_set_lanex_pre_emphasis (unsigned char request_val, unsigned char lanecnt)
 
void exynos_dp_set_lane_pre_emphasis (unsigned int level, unsigned char lanecnt)
 
void exynos_dp_set_training_pattern (unsigned int pattern)
 
void exynos_dp_enable_enhanced_mode (unsigned char enable)
 
void exynos_dp_enable_scrambling (unsigned int enable)
 
int exynos_dp_init_video (void)
 
void exynos_dp_config_video_slave_mode (struct edp_video_info *video_info)
 
void exynos_dp_set_video_color_format (struct edp_video_info *video_info)
 
unsigned int exynos_dp_is_slave_video_stream_clock_on (void)
 
void exynos_dp_set_video_cr_mn (unsigned int type, unsigned int m_value, unsigned int n_value)
 
void exynos_dp_set_video_timing_mode (unsigned int type)
 
void exynos_dp_enable_video_master (unsigned int enable)
 
void exynos_dp_start_video (void)
 
unsigned int exynos_dp_is_video_stream_on (void)
 
void dp_phy_control (unsigned int enable)
 

Variables

static struct exynos_dp *const dp_regs = (void *)EXYNOS5_DP1_BASE
 

Macro Definition Documentation

◆ lread32

#define lread32 (   a)    read32((void *)(a))

Definition at line 37 of file dp_lowlevel.c.

◆ lwrite32

#define lwrite32 (   a,
 
)    write32((void *)(b), (unsigned long)(a))

Definition at line 36 of file dp_lowlevel.c.

Function Documentation

◆ dp_phy_control()

void dp_phy_control ( unsigned int  enable)

Definition at line 1141 of file dp_lowlevel.c.

References exynos5_power::dptx_phy_control, EXYNOS_DP_PHY_ENABLE, exynos_power, lread32, and lwrite32.

Referenced by exynos_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_config_interrupt()

◆ exynos_dp_config_video_slave_mode()

◆ exynos_dp_detect_hpd()

unsigned int exynos_dp_detect_hpd ( void  )

Definition at line 400 of file dp_lowlevel.c.

References DP_TIMEOUT_LOOP_COUNT, exynos_dp_get_plug_in_status(), EXYNOS_DP_SUCCESS, and mdelay().

Here is the call graph for this function:

◆ exynos_dp_disable_video_bist()

void exynos_dp_disable_video_bist ( void  )

Definition at line 54 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, VIDEO_BIST_MASK, and exynos_dp::video_ctl4.

Referenced by exynos_dp_config_video(), and exynos_dp_reset().

Here is the caller graph for this function:

◆ exynos_dp_enable_enhanced_mode()

void exynos_dp_enable_enhanced_mode ( unsigned char  enable)

Definition at line 946 of file dp_lowlevel.c.

References dp_regs, ENHANCED, lread32, lwrite32, and exynos_dp::sys_ctl4.

Referenced by exynos_dp_set_enhanced_mode(), and exynos_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_enable_scrambling()

void exynos_dp_enable_scrambling ( unsigned int  enable)

Definition at line 959 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, SCRAMBLING_DISABLE, and exynos_dp::training_ptn_set.

Referenced by exynos_dp_enable_scramble().

Here is the caller graph for this function:

◆ exynos_dp_enable_sw_func()

void exynos_dp_enable_sw_func ( unsigned int  enable)

Definition at line 175 of file dp_lowlevel.c.

References dp_regs, exynos_dp::func_en1, lread32, lwrite32, and SW_FUNC_EN_N.

Referenced by exynos_dp_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_enable_video_input()

static void exynos_dp_enable_video_input ( u32  enable)
static

Definition at line 40 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, exynos_dp::video_ctl1, and VIDEO_EN_MASK.

Referenced by exynos_dp_reset().

Here is the caller graph for this function:

◆ exynos_dp_enable_video_master()

void exynos_dp_enable_video_master ( unsigned int  enable)

Definition at line 1099 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, exynos_dp::soc_general_ctl, VIDEO_MASTER_MODE_EN, VIDEO_MODE_MASK, VIDEO_MODE_MASTER_MODE, and VIDEO_MODE_SLAVE_MODE.

Referenced by exynos_dp_config_video().

Here is the caller graph for this function:

◆ exynos_dp_enable_video_mute()

void exynos_dp_enable_video_mute ( unsigned int  enable)

Definition at line 62 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, exynos_dp::video_ctl1, and VIDEO_MUTE_MASK.

Referenced by exynos_dp_config_video(), and exynos_dp_reset().

Here is the caller graph for this function:

◆ exynos_dp_get_lane_count()

unsigned int exynos_dp_get_lane_count ( void  )

Definition at line 861 of file dp_lowlevel.c.

References dp_regs, exynos_dp::lane_count_set, and lread32.

Referenced by exynos_dp_process_equalizer_training().

Here is the caller graph for this function:

◆ exynos_dp_get_lanex_pre_emphasis()

unsigned char exynos_dp_get_lanex_pre_emphasis ( unsigned char  lanecnt)

◆ exynos_dp_get_link_bandwidth()

unsigned char exynos_dp_get_link_bandwidth ( void  )

Definition at line 839 of file dp_lowlevel.c.

References dp_regs, exynos_dp::link_bw_set, and lread32.

Referenced by exynos_dp_process_equalizer_training().

Here is the caller graph for this function:

◆ exynos_dp_get_pll_lock_status()

unsigned int exynos_dp_get_pll_lock_status ( void  )

Definition at line 241 of file dp_lowlevel.c.

References exynos_dp::debug_ctl, dp_regs, lread32, PLL_LOCK, PLL_LOCKED, and PLL_UNLOCKED.

Referenced by exynos_dp_config_video(), and exynos_dp_init_analog_func().

Here is the caller graph for this function:

◆ exynos_dp_get_plug_in_status()

unsigned int exynos_dp_get_plug_in_status ( void  )

Definition at line 389 of file dp_lowlevel.c.

References dp_regs, HPD_STATUS, lread32, and exynos_dp::sys_ctl3.

Referenced by exynos_dp_detect_hpd().

Here is the caller graph for this function:

◆ exynos_dp_init_analog_func()

◆ exynos_dp_init_analog_param()

◆ exynos_dp_init_aux()

◆ exynos_dp_init_hpd()

void exynos_dp_init_hpd ( void  )

Definition at line 317 of file dp_lowlevel.c.

References exynos_dp::common_int_sta4, dp_regs, F_HPD, HOTPLUG_CHG, HPD_CTRL, HPD_LOST, INT_HPD, exynos_dp::int_sta, lread32, lwrite32, PLUG, and exynos_dp::sys_ctl3.

Referenced by exynos_dp_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_init_interrupt()

◆ exynos_dp_init_video()

int exynos_dp_init_video ( void  )

Definition at line 971 of file dp_lowlevel.c.

References exynos_dp::common_int_sta1, DET_CTRL, dp_regs, lwrite32, exynos_dp::sys_ctl1, VID_CLK_CHG, VID_FORMAT_CHG, and VSYNC_DET.

Referenced by exynos_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_is_slave_video_stream_clock_on()

unsigned int exynos_dp_is_slave_video_stream_clock_on ( void  )

Definition at line 1039 of file dp_lowlevel.c.

References BIOS_DEBUG, DET_STA, dp_regs, EXYNOS_DP_SUCCESS, lread32, lwrite32, printk, and exynos_dp::sys_ctl1.

Referenced by exynos_dp_config_video().

Here is the caller graph for this function:

◆ exynos_dp_is_video_stream_on()

unsigned int exynos_dp_is_video_stream_on ( void  )

Definition at line 1125 of file dp_lowlevel.c.

References dp_regs, EXYNOS_DP_SUCCESS, lread32, lwrite32, STRM_VALID, and exynos_dp::sys_ctl3.

Referenced by exynos_dp_config_video().

Here is the caller graph for this function:

◆ exynos_dp_read_byte_from_dpcd()

◆ exynos_dp_read_byte_from_i2c()

int exynos_dp_read_byte_from_i2c ( u32  device_addr,
u32  reg_addr,
unsigned int *  data 
)

◆ exynos_dp_read_bytes_from_dpcd()

◆ exynos_dp_read_bytes_from_i2c()

int exynos_dp_read_bytes_from_i2c ( u32  device_addr,
u32  reg_addr,
unsigned int  count,
unsigned char  edid[] 
)

◆ exynos_dp_reset()

◆ exynos_dp_reset_aux()

static void exynos_dp_reset_aux ( void  )
inlinestatic

Definition at line 333 of file dp_lowlevel.c.

References AUX_FUNC_EN_N, dp_regs, exynos_dp::func_en2, lread32, and lwrite32.

Referenced by exynos_dp_init_aux().

Here is the caller graph for this function:

◆ exynos_dp_reset_macro()

void exynos_dp_reset_macro ( void  )

Definition at line 813 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, MACRO_RST, exynos_dp::phy_test, and udelay().

Referenced by exynos_dp_init_training().

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

◆ exynos_dp_select_i2c_device()

int exynos_dp_select_i2c_device ( u32  device_addr,
u32  reg_addr 
)

◆ exynos_dp_set_analog_power_down()

unsigned int exynos_dp_set_analog_power_down ( unsigned int  block,
u32  enable 
)

◆ exynos_dp_set_lane_count()

void exynos_dp_set_lane_count ( unsigned char  count)

Definition at line 850 of file dp_lowlevel.c.

References count, DP_LANE_CNT_1, DP_LANE_CNT_2, DP_LANE_CNT_4, dp_regs, exynos_dp::lane_count_set, and lwrite32.

Referenced by exynos_dp_link_start(), and exynos_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_set_lane_pre_emphasis()

◆ exynos_dp_set_lanex_pre_emphasis()

void exynos_dp_set_lanex_pre_emphasis ( unsigned char  request_val,
unsigned char  lanecnt 
)

◆ exynos_dp_set_link_bandwidth()

void exynos_dp_set_link_bandwidth ( unsigned char  bwtype)

Definition at line 828 of file dp_lowlevel.c.

References DP_LANE_BW_1_62, DP_LANE_BW_2_70, dp_regs, exynos_dp::link_bw_set, and lwrite32.

Referenced by exynos_dp_link_start(), and exynos_init_dp().

Here is the caller graph for this function:

◆ exynos_dp_set_pll_power()

static void exynos_dp_set_pll_power ( unsigned int  enable)
static

Definition at line 253 of file dp_lowlevel.c.

References DP_PLL_PD, dp_regs, lread32, lwrite32, and exynos_dp::pll_ctl.

Referenced by exynos_dp_init_analog_func().

Here is the caller graph for this function:

◆ exynos_dp_set_training_pattern()

◆ exynos_dp_set_video_color_format()

◆ exynos_dp_set_video_cr_mn()

void exynos_dp_set_video_cr_mn ( unsigned int  type,
unsigned int  m_value,
unsigned int  n_value 
)

◆ exynos_dp_set_video_timing_mode()

void exynos_dp_set_video_timing_mode ( unsigned int  type)

Definition at line 1086 of file dp_lowlevel.c.

References dp_regs, FORMAT_SEL, lread32, lwrite32, type, exynos_dp::video_ctl10, and VIDEO_TIMING_FROM_CAPTURE.

Referenced by exynos_dp_config_video().

Here is the caller graph for this function:

◆ exynos_dp_start_aux_transaction()

◆ exynos_dp_start_video()

void exynos_dp_start_video ( void  )

Definition at line 1115 of file dp_lowlevel.c.

References dp_regs, lread32, lwrite32, exynos_dp::video_ctl1, and VIDEO_EN.

Referenced by exynos_dp_config_video().

Here is the caller graph for this function:

◆ exynos_dp_write_byte_to_dpcd()

◆ exynos_dp_write_bytes_to_dpcd()

Variable Documentation

◆ dp_regs