2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2012-07-02 01:16:02 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Samsung Electronics
|
|
|
|
*
|
|
|
|
* Author: Donghwa Lee <dh09.lee@samsung.com>
|
|
|
|
*/
|
|
|
|
|
2017-05-17 23:18:07 +00:00
|
|
|
#include <common.h>
|
2016-02-22 04:09:01 +00:00
|
|
|
#include <dm.h>
|
2012-07-02 01:16:02 +00:00
|
|
|
#include <common.h>
|
2016-02-22 04:09:01 +00:00
|
|
|
#include <display.h>
|
|
|
|
#include <fdtdec.h>
|
2020-05-10 17:40:05 +00:00
|
|
|
#include <log.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2020-05-10 17:40:11 +00:00
|
|
|
#include <linux/delay.h>
|
2018-03-04 16:20:11 +00:00
|
|
|
#include <linux/libfdt.h>
|
2012-07-02 01:16:02 +00:00
|
|
|
#include <malloc.h>
|
2016-02-22 04:09:01 +00:00
|
|
|
#include <video_bridge.h>
|
2014-06-24 08:10:03 +00:00
|
|
|
#include <linux/compat.h>
|
2012-07-02 01:16:02 +00:00
|
|
|
#include <linux/err.h>
|
|
|
|
#include <asm/arch/clk.h>
|
|
|
|
#include <asm/arch/cpu.h>
|
|
|
|
#include <asm/arch/dp_info.h>
|
|
|
|
#include <asm/arch/dp.h>
|
2016-02-22 04:09:01 +00:00
|
|
|
#include <asm/arch/pinmux.h>
|
2016-02-22 04:08:57 +00:00
|
|
|
#include <asm/arch/power.h>
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
#include "exynos_dp_lowlevel.h"
|
|
|
|
|
2013-02-21 23:53:06 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2012-07-02 01:16:02 +00:00
|
|
|
static void exynos_dp_disp_info(struct edp_disp_info *disp_info)
|
|
|
|
{
|
|
|
|
disp_info->h_total = disp_info->h_res + disp_info->h_sync_width +
|
|
|
|
disp_info->h_back_porch + disp_info->h_front_porch;
|
|
|
|
disp_info->v_total = disp_info->v_res + disp_info->v_sync_width +
|
|
|
|
disp_info->v_back_porch + disp_info->v_front_porch;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static int exynos_dp_init_dp(struct exynos_dp *regs)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
int ret;
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_reset(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* SW defined function Normal operation */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_sw_func(regs, DP_ENABLE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_init_analog_func(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS)
|
|
|
|
return ret;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_init_hpd(regs);
|
|
|
|
exynos_dp_init_aux(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char exynos_dp_calc_edid_check_sum(unsigned char *edid_data)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
unsigned char sum = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < EDID_BLOCK_LENGTH; i++)
|
|
|
|
sum = sum + edid_data[i];
|
|
|
|
|
|
|
|
return sum;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_read_edid(struct exynos_dp *regs)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned char edid[EDID_BLOCK_LENGTH * 2];
|
|
|
|
unsigned int extend_block = 0;
|
|
|
|
unsigned char sum;
|
|
|
|
unsigned char test_vector;
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* EDID device address is 0x50.
|
|
|
|
* However, if necessary, you must have set upper address
|
|
|
|
* into E-EDID in I2C device, 0x30.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Read Extension Flag, Number of 128-byte EDID extension blocks */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_read_byte_from_i2c(regs, I2C_EDID_DEVICE_ADDR,
|
2016-02-22 04:08:44 +00:00
|
|
|
EDID_EXTENSION_FLAG, &extend_block);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
if (extend_block > 0) {
|
|
|
|
printf("DP EDID data includes a single extension!\n");
|
|
|
|
|
|
|
|
/* Read EDID data */
|
2016-02-22 04:09:00 +00:00
|
|
|
retval = exynos_dp_read_bytes_from_i2c(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
I2C_EDID_DEVICE_ADDR,
|
2012-07-02 01:16:02 +00:00
|
|
|
EDID_HEADER_PATTERN,
|
|
|
|
EDID_BLOCK_LENGTH,
|
|
|
|
&edid[EDID_HEADER_PATTERN]);
|
|
|
|
if (retval != 0) {
|
|
|
|
printf("DP EDID Read failed!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
sum = exynos_dp_calc_edid_check_sum(edid);
|
|
|
|
if (sum != 0) {
|
|
|
|
printf("DP EDID bad checksum!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read additional EDID data */
|
2016-02-22 04:09:00 +00:00
|
|
|
retval = exynos_dp_read_bytes_from_i2c(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
I2C_EDID_DEVICE_ADDR,
|
2012-07-02 01:16:02 +00:00
|
|
|
EDID_BLOCK_LENGTH,
|
|
|
|
EDID_BLOCK_LENGTH,
|
|
|
|
&edid[EDID_BLOCK_LENGTH]);
|
|
|
|
if (retval != 0) {
|
|
|
|
printf("DP EDID Read failed!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
sum = exynos_dp_calc_edid_check_sum(&edid[EDID_BLOCK_LENGTH]);
|
|
|
|
if (sum != 0) {
|
|
|
|
printf("DP EDID bad checksum!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_read_byte_from_dpcd(regs, DPCD_TEST_REQUEST,
|
2016-02-22 04:08:44 +00:00
|
|
|
&test_vector);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (test_vector & DPCD_TEST_EDID_READ) {
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TEST_EDID_CHECKSUM,
|
2012-07-02 01:16:02 +00:00
|
|
|
edid[EDID_BLOCK_LENGTH + EDID_CHECKSUM]);
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TEST_RESPONSE,
|
2012-07-02 01:16:02 +00:00
|
|
|
DPCD_TEST_EDID_CHECKSUM_WRITE);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
debug("DP EDID data does not include any extensions.\n");
|
|
|
|
|
|
|
|
/* Read EDID data */
|
2016-02-22 04:09:00 +00:00
|
|
|
retval = exynos_dp_read_bytes_from_i2c(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
I2C_EDID_DEVICE_ADDR,
|
2012-07-02 01:16:02 +00:00
|
|
|
EDID_HEADER_PATTERN,
|
|
|
|
EDID_BLOCK_LENGTH,
|
|
|
|
&edid[EDID_HEADER_PATTERN]);
|
|
|
|
|
|
|
|
if (retval != 0) {
|
|
|
|
printf("DP EDID Read failed!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
sum = exynos_dp_calc_edid_check_sum(edid);
|
|
|
|
if (sum != 0) {
|
|
|
|
printf("DP EDID bad checksum!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_read_byte_from_dpcd(regs, DPCD_TEST_REQUEST,
|
2012-07-02 01:16:02 +00:00
|
|
|
&test_vector);
|
|
|
|
if (test_vector & DPCD_TEST_EDID_READ) {
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TEST_EDID_CHECKSUM, edid[EDID_CHECKSUM]);
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TEST_RESPONSE,
|
2012-07-02 01:16:02 +00:00
|
|
|
DPCD_TEST_EDID_CHECKSUM_WRITE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
debug("DP EDID Read success!\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_handle_edid(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned char buf[12];
|
|
|
|
unsigned int ret;
|
|
|
|
unsigned char temp;
|
|
|
|
unsigned char retry_cnt;
|
|
|
|
unsigned char dpcd_rev[16];
|
|
|
|
unsigned char lane_bw[16];
|
|
|
|
unsigned char lane_cnt[16];
|
|
|
|
|
|
|
|
memset(dpcd_rev, 0, 16);
|
|
|
|
memset(lane_bw, 0, 16);
|
|
|
|
memset(lane_cnt, 0, 16);
|
|
|
|
memset(buf, 0, 12);
|
|
|
|
|
|
|
|
retry_cnt = 5;
|
|
|
|
while (retry_cnt) {
|
|
|
|
/* Read DPCD 0x0000-0x000b */
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_bytes_from_dpcd(regs, DPCD_DPCD_REV, 12,
|
2016-02-22 04:08:44 +00:00
|
|
|
buf);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
if (retry_cnt == 0) {
|
|
|
|
printf("DP read_byte_from_dpcd() failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
retry_cnt--;
|
|
|
|
} else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* */
|
|
|
|
temp = buf[DPCD_DPCD_REV];
|
|
|
|
if (temp == DP_DPCD_REV_10 || temp == DP_DPCD_REV_11)
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->dpcd_rev = temp;
|
2012-07-02 01:16:02 +00:00
|
|
|
else {
|
|
|
|
printf("DP Wrong DPCD Rev : %x\n", temp);
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
temp = buf[DPCD_MAX_LINK_RATE];
|
|
|
|
if (temp == DP_LANE_BW_1_62 || temp == DP_LANE_BW_2_70)
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lane_bw = temp;
|
2012-07-02 01:16:02 +00:00
|
|
|
else {
|
|
|
|
printf("DP Wrong MAX LINK RATE : %x\n", temp);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2015-12-16 16:31:23 +00:00
|
|
|
/* Refer VESA Display Port Standard Ver1.1a Page 120 */
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->dpcd_rev == DP_DPCD_REV_11) {
|
2012-07-02 01:16:02 +00:00
|
|
|
temp = buf[DPCD_MAX_LANE_COUNT] & 0x1f;
|
|
|
|
if (buf[DPCD_MAX_LANE_COUNT] & 0x80)
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->dpcd_efc = 1;
|
2012-07-02 01:16:02 +00:00
|
|
|
else
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->dpcd_efc = 0;
|
2012-07-02 01:16:02 +00:00
|
|
|
} else {
|
|
|
|
temp = buf[DPCD_MAX_LANE_COUNT];
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->dpcd_efc = 0;
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (temp == DP_LANE_CNT_1 || temp == DP_LANE_CNT_2 ||
|
|
|
|
temp == DP_LANE_CNT_4) {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lane_cnt = temp;
|
2012-07-02 01:16:02 +00:00
|
|
|
} else {
|
|
|
|
printf("DP Wrong MAX LANE COUNT : %x\n", temp);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_edid(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP exynos_dp_read_edid() failed\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static void exynos_dp_init_training(struct exynos_dp *regs)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* MACRO_RST must be applied after the PLL_LOCK to avoid
|
|
|
|
* the DP inter pair skew issue for at least 10 us
|
|
|
|
*/
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_reset_macro(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* All DP analog module power up */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_analog_power_down(regs, POWER_ALL, 0);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_link_start(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned char buf[5];
|
|
|
|
unsigned int ret = 0;
|
|
|
|
|
|
|
|
debug("DP: %s was called\n", __func__);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_CR;
|
|
|
|
priv->lt_info.ep_loop = 0;
|
|
|
|
priv->lt_info.cr_loop[0] = 0;
|
|
|
|
priv->lt_info.cr_loop[1] = 0;
|
|
|
|
priv->lt_info.cr_loop[2] = 0;
|
|
|
|
priv->lt_info.cr_loop[3] = 0;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Set sink to D0 (Sink Not Ready) mode. */
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_byte_to_dpcd(regs, DPCD_SINK_POWER_STATE,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_SET_POWER_STATE_D0);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP write_dpcd_byte failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-12-16 16:31:23 +00:00
|
|
|
/* Set link rate and count as you want to establish */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_link_bandwidth(regs, priv->lane_bw);
|
|
|
|
exynos_dp_set_lane_count(regs, priv->lane_cnt);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Setup RX configuration */
|
2016-02-22 04:09:00 +00:00
|
|
|
buf[0] = priv->lane_bw;
|
|
|
|
buf[1] = priv->lane_cnt;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_bytes_to_dpcd(regs, DPCD_LINK_BW_SET, 2, buf);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP write_dpcd_byte failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_lane_pre_emphasis(regs, PRE_EMPHASIS_LEVEL_0,
|
|
|
|
priv->lane_cnt);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Set training pattern 1 */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_training_pattern(regs, TRAINING_PTN1);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Set RX training pattern */
|
|
|
|
buf[0] = DPCD_SCRAMBLING_DISABLED | DPCD_TRAINING_PATTERN_1;
|
|
|
|
|
|
|
|
buf[1] = DPCD_PRE_EMPHASIS_SET_PATTERN_2_LEVEL_0 |
|
|
|
|
DPCD_VOLTAGE_SWING_SET_PATTERN_1_LEVEL_0;
|
|
|
|
buf[2] = DPCD_PRE_EMPHASIS_SET_PATTERN_2_LEVEL_0 |
|
|
|
|
DPCD_VOLTAGE_SWING_SET_PATTERN_1_LEVEL_0;
|
|
|
|
buf[3] = DPCD_PRE_EMPHASIS_SET_PATTERN_2_LEVEL_0 |
|
|
|
|
DPCD_VOLTAGE_SWING_SET_PATTERN_1_LEVEL_0;
|
|
|
|
buf[4] = DPCD_PRE_EMPHASIS_SET_PATTERN_2_LEVEL_0 |
|
|
|
|
DPCD_VOLTAGE_SWING_SET_PATTERN_1_LEVEL_0;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_bytes_to_dpcd(regs, DPCD_TRAINING_PATTERN_SET,
|
2016-02-22 04:08:44 +00:00
|
|
|
5, buf);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP write_dpcd_byte failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_training_pattern_dis(struct exynos_dp *regs)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_training_pattern(regs, DP_NONE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_byte_to_dpcd(regs, DPCD_TRAINING_PATTERN_SET,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TRAINING_PATTERN_DISABLED);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2015-12-16 16:31:23 +00:00
|
|
|
printf("DP request_link_training_req failed\n");
|
2012-07-02 01:16:02 +00:00
|
|
|
return -EAGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:08:44 +00:00
|
|
|
static unsigned int exynos_dp_enable_rx_to_enhanced_mode(
|
2016-02-22 04:09:00 +00:00
|
|
|
struct exynos_dp *regs, unsigned char enable)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned char data;
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_byte_from_dpcd(regs, DPCD_LANE_COUNT_SET,
|
2016-02-22 04:08:44 +00:00
|
|
|
&data);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read_from_dpcd failed\n");
|
|
|
|
return -EAGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable)
|
|
|
|
data = DPCD_ENHANCED_FRAME_EN | DPCD_LN_COUNT_SET(data);
|
|
|
|
else
|
|
|
|
data = DPCD_LN_COUNT_SET(data);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_byte_to_dpcd(regs, DPCD_LANE_COUNT_SET, data);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP write_to_dpcd failed\n");
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_set_enhanced_mode(struct exynos_dp *regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
unsigned char enhance_mode)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_enable_rx_to_enhanced_mode(regs, enhance_mode);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP rx_enhance_mode failed\n");
|
|
|
|
return -EAGAIN;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_enhanced_mode(regs, enhance_mode);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static int exynos_dp_read_dpcd_lane_stat(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv,
|
2016-02-22 04:08:44 +00:00
|
|
|
unsigned char *status)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned int ret, i;
|
|
|
|
unsigned char buf[2];
|
|
|
|
unsigned char lane_stat[DP_LANE_CNT_4] = {0,};
|
|
|
|
unsigned char shift_val[DP_LANE_CNT_4] = {0,};
|
|
|
|
|
|
|
|
shift_val[0] = 0;
|
|
|
|
shift_val[1] = 4;
|
|
|
|
shift_val[2] = 0;
|
|
|
|
shift_val[3] = 4;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_bytes_from_dpcd(regs, DPCD_LANE0_1_STATUS, 2,
|
2016-02-22 04:08:44 +00:00
|
|
|
buf);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read lane status failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
for (i = 0; i < priv->lane_cnt; i++) {
|
2012-07-02 01:16:02 +00:00
|
|
|
lane_stat[i] = (buf[(i / 2)] >> shift_val[i]) & 0x0f;
|
|
|
|
if (lane_stat[0] != lane_stat[i]) {
|
|
|
|
printf("Wrong lane status\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*status = lane_stat[0];
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_read_dpcd_adj_req(struct exynos_dp *regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
unsigned char lane_num, unsigned char *sw, unsigned char *em)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
unsigned char buf;
|
|
|
|
unsigned int dpcd_addr;
|
|
|
|
unsigned char shift_val[DP_LANE_CNT_4] = {0, 4, 0, 4};
|
|
|
|
|
2015-12-16 16:31:23 +00:00
|
|
|
/* lane_num value is used as array index, so this range 0 ~ 3 */
|
2012-07-02 01:16:02 +00:00
|
|
|
dpcd_addr = DPCD_ADJUST_REQUEST_LANE0_1 + (lane_num / 2);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_byte_from_dpcd(regs, dpcd_addr, &buf);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read adjust request failed\n");
|
|
|
|
return -EAGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
*sw = ((buf >> shift_val[lane_num]) & 0x03);
|
|
|
|
*em = ((buf >> shift_val[lane_num]) & 0x0c) >> 2;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static int exynos_dp_equalizer_err_link(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_training_pattern_dis(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2015-12-16 16:31:23 +00:00
|
|
|
printf("DP training_pattern_disable() failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_set_enhanced_mode(regs, priv->dpcd_efc);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP set_enhanced_mode() failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static int exynos_dp_reduce_link_rate(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->lane_bw == DP_LANE_BW_2_70) {
|
|
|
|
priv->lane_bw = DP_LANE_BW_1_62;
|
2012-07-02 01:16:02 +00:00
|
|
|
printf("DP Change lane bw to 1.62Gbps\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_START;
|
2012-07-02 01:16:02 +00:00
|
|
|
ret = EXYNOS_DP_SUCCESS;
|
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_training_pattern_dis(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS)
|
|
|
|
printf("DP training_patter_disable() failed\n");
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_set_enhanced_mode(regs, priv->dpcd_efc);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS)
|
|
|
|
printf("DP set_enhanced_mode() failed\n");
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_process_clock_recovery(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
unsigned char lane_stat;
|
|
|
|
unsigned char lt_ctl_val[DP_LANE_CNT_4] = {0, };
|
|
|
|
unsigned int i;
|
|
|
|
unsigned char adj_req_sw;
|
|
|
|
unsigned char adj_req_em;
|
|
|
|
unsigned char buf[5];
|
|
|
|
|
|
|
|
debug("DP: %s was called\n", __func__);
|
|
|
|
mdelay(1);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_dpcd_lane_stat(regs, priv, &lane_stat);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read lane status failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lane_stat & DP_LANE_STAT_CR_DONE) {
|
|
|
|
debug("DP clock Recovery training succeed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_training_pattern(regs, TRAINING_PTN2);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
for (i = 0; i < priv->lane_cnt; i++) {
|
|
|
|
ret = exynos_dp_read_dpcd_adj_req(regs, i,
|
2016-02-22 04:08:44 +00:00
|
|
|
&adj_req_sw, &adj_req_em);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
lt_ctl_val[i] = 0;
|
|
|
|
lt_ctl_val[i] = adj_req_em << 3 | adj_req_sw;
|
|
|
|
|
|
|
|
if ((adj_req_sw == VOLTAGE_LEVEL_3)
|
|
|
|
|| (adj_req_em == PRE_EMPHASIS_LEVEL_3)) {
|
|
|
|
lt_ctl_val[i] |= MAX_DRIVE_CURRENT_REACH_3 |
|
|
|
|
MAX_PRE_EMPHASIS_REACH_3;
|
|
|
|
}
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_lanex_pre_emphasis(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
lt_ctl_val[i], i);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buf[0] = DPCD_SCRAMBLING_DISABLED | DPCD_TRAINING_PATTERN_2;
|
|
|
|
buf[1] = lt_ctl_val[0];
|
|
|
|
buf[2] = lt_ctl_val[1];
|
|
|
|
buf[3] = lt_ctl_val[2];
|
|
|
|
buf[4] = lt_ctl_val[3];
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_bytes_to_dpcd(regs,
|
2012-07-02 01:16:02 +00:00
|
|
|
DPCD_TRAINING_PATTERN_SET, 5, buf);
|
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2015-12-16 16:31:23 +00:00
|
|
|
printf("DP write training pattern1 failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
} else
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_ET;
|
2012-07-02 01:16:02 +00:00
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
for (i = 0; i < priv->lane_cnt; i++) {
|
2016-02-22 04:08:44 +00:00
|
|
|
lt_ctl_val[i] = exynos_dp_get_lanex_pre_emphasis(
|
2016-02-22 04:09:00 +00:00
|
|
|
regs, i);
|
|
|
|
ret = exynos_dp_read_dpcd_adj_req(regs, i,
|
2012-07-02 01:16:02 +00:00
|
|
|
&adj_req_sw, &adj_req_em);
|
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read adj req failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((adj_req_sw == VOLTAGE_LEVEL_3) ||
|
|
|
|
(adj_req_em == PRE_EMPHASIS_LEVEL_3))
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_reduce_link_rate(regs,
|
|
|
|
priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
if ((DRIVE_CURRENT_SET_0_GET(lt_ctl_val[i]) ==
|
|
|
|
adj_req_sw) &&
|
|
|
|
(PRE_EMPHASIS_SET_0_GET(lt_ctl_val[i]) ==
|
|
|
|
adj_req_em)) {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.cr_loop[i]++;
|
|
|
|
if (priv->lt_info.cr_loop[i] == MAX_CR_LOOP)
|
2012-07-02 01:16:02 +00:00
|
|
|
ret = exynos_dp_reduce_link_rate(
|
2016-02-22 04:09:00 +00:00
|
|
|
regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
lt_ctl_val[i] = 0;
|
|
|
|
lt_ctl_val[i] = adj_req_em << 3 | adj_req_sw;
|
|
|
|
|
|
|
|
if ((adj_req_sw == VOLTAGE_LEVEL_3) ||
|
|
|
|
(adj_req_em == PRE_EMPHASIS_LEVEL_3)) {
|
|
|
|
lt_ctl_val[i] |= MAX_DRIVE_CURRENT_REACH_3 |
|
|
|
|
MAX_PRE_EMPHASIS_REACH_3;
|
|
|
|
}
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_lanex_pre_emphasis(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
lt_ctl_val[i], i);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_bytes_to_dpcd(regs,
|
2012-07-02 01:16:02 +00:00
|
|
|
DPCD_TRAINING_LANE0_SET, 4, lt_ctl_val);
|
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2015-12-16 16:31:23 +00:00
|
|
|
printf("DP write training pattern2 failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:08:44 +00:00
|
|
|
static unsigned int exynos_dp_process_equalizer_training(
|
2016-02-22 04:09:00 +00:00
|
|
|
struct exynos_dp *regs, struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2018-03-19 06:46:08 +00:00
|
|
|
unsigned int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
unsigned char lane_stat, adj_req_sw, adj_req_em, i;
|
|
|
|
unsigned char lt_ctl_val[DP_LANE_CNT_4] = {0,};
|
|
|
|
unsigned char interlane_aligned = 0;
|
|
|
|
unsigned char f_bw;
|
|
|
|
unsigned char f_lane_cnt;
|
|
|
|
unsigned char sink_stat;
|
|
|
|
|
|
|
|
mdelay(1);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_dpcd_lane_stat(regs, priv, &lane_stat);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read lane status failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
debug("DP lane stat : %x\n", lane_stat);
|
|
|
|
|
|
|
|
if (lane_stat & DP_LANE_STAT_CR_DONE) {
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_read_byte_from_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_LN_ALIGN_UPDATED,
|
|
|
|
&sink_stat);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
interlane_aligned = (sink_stat & DPCD_INTERLANE_ALIGN_DONE);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
for (i = 0; i < priv->lane_cnt; i++) {
|
|
|
|
ret = exynos_dp_read_dpcd_adj_req(regs, i,
|
2012-07-02 01:16:02 +00:00
|
|
|
&adj_req_sw, &adj_req_em);
|
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP read adj req 1 failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
lt_ctl_val[i] = 0;
|
|
|
|
lt_ctl_val[i] = adj_req_em << 3 | adj_req_sw;
|
|
|
|
|
|
|
|
if ((adj_req_sw == VOLTAGE_LEVEL_3) ||
|
|
|
|
(adj_req_em == PRE_EMPHASIS_LEVEL_3)) {
|
|
|
|
lt_ctl_val[i] |= MAX_DRIVE_CURRENT_REACH_3;
|
|
|
|
lt_ctl_val[i] |= MAX_PRE_EMPHASIS_REACH_3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (((lane_stat&DP_LANE_STAT_CE_DONE) &&
|
|
|
|
(lane_stat&DP_LANE_STAT_SYM_LOCK))
|
|
|
|
&& (interlane_aligned == DPCD_INTERLANE_ALIGN_DONE)) {
|
|
|
|
debug("DP Equalizer training succeed\n");
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
f_bw = exynos_dp_get_link_bandwidth(regs);
|
|
|
|
f_lane_cnt = exynos_dp_get_lane_count(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
debug("DP final BandWidth : %x\n", f_bw);
|
|
|
|
debug("DP final Lane Count : %x\n", f_lane_cnt);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FINISHED;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_equalizer_err_link(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.ep_loop++;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->lt_info.ep_loop > MAX_EQ_LOOP) {
|
|
|
|
if (priv->lane_bw == DP_LANE_BW_2_70) {
|
2012-07-02 01:16:02 +00:00
|
|
|
ret = exynos_dp_reduce_link_rate(
|
2016-02-22 04:09:00 +00:00
|
|
|
regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status =
|
2012-07-02 01:16:02 +00:00
|
|
|
DP_LT_FAIL;
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_equalizer_err_link(regs,
|
|
|
|
priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
for (i = 0; i < priv->lane_cnt; i++)
|
2012-07-02 01:16:02 +00:00
|
|
|
exynos_dp_set_lanex_pre_emphasis(
|
2016-02-22 04:09:00 +00:00
|
|
|
regs, lt_ctl_val[i], i);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_write_bytes_to_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TRAINING_LANE0_SET,
|
|
|
|
4, lt_ctl_val);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP set lt pattern failed\n");
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status =
|
2012-07-02 01:16:02 +00:00
|
|
|
DP_LT_FAIL;
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_equalizer_err_link(regs,
|
|
|
|
priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-02-22 04:09:00 +00:00
|
|
|
} else if (priv->lane_bw == DP_LANE_BW_2_70) {
|
|
|
|
ret = exynos_dp_reduce_link_rate(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_FAIL;
|
|
|
|
exynos_dp_equalizer_err_link(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_sw_link_training(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned int ret = 0;
|
|
|
|
int training_finished;
|
|
|
|
|
|
|
|
/* Turn off unnecessary lane */
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->lane_cnt == 1)
|
|
|
|
exynos_dp_set_analog_power_down(regs, CH1_BLOCK, 1);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
training_finished = 0;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = DP_LT_START;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Process here */
|
|
|
|
while (!training_finished) {
|
2016-02-22 04:09:00 +00:00
|
|
|
switch (priv->lt_info.lt_status) {
|
2012-07-02 01:16:02 +00:00
|
|
|
case DP_LT_START:
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_link_start(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP LT:link start failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DP_LT_CR:
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_process_clock_recovery(regs,
|
|
|
|
priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP LT:clock recovery failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DP_LT_ET:
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_process_equalizer_training(regs,
|
|
|
|
priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP LT:equalizer training failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DP_LT_FINISHED:
|
|
|
|
training_finished = 1;
|
|
|
|
break;
|
|
|
|
case DP_LT_FAIL:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_set_link_train(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned int ret;
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_init_training(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_sw_link_training(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS)
|
2015-12-16 16:31:23 +00:00
|
|
|
printf("DP dp_sw_link_training() failed\n");
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static void exynos_dp_enable_scramble(struct exynos_dp *regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
unsigned int enable)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned char data;
|
|
|
|
|
|
|
|
if (enable) {
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_scrambling(regs, DP_ENABLE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_read_byte_from_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TRAINING_PATTERN_SET, &data);
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs, DPCD_TRAINING_PATTERN_SET,
|
2012-07-02 01:16:02 +00:00
|
|
|
(u8)(data & ~DPCD_SCRAMBLING_DISABLED));
|
|
|
|
} else {
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_scrambling(regs, DP_DISABLE);
|
|
|
|
exynos_dp_read_byte_from_dpcd(regs,
|
2016-02-22 04:08:44 +00:00
|
|
|
DPCD_TRAINING_PATTERN_SET, &data);
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_write_byte_to_dpcd(regs, DPCD_TRAINING_PATTERN_SET,
|
2012-07-02 01:16:02 +00:00
|
|
|
(u8)(data | DPCD_SCRAMBLING_DISABLED));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
static unsigned int exynos_dp_config_video(struct exynos_dp *regs,
|
|
|
|
struct exynos_dp_priv *priv)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
|
|
|
unsigned int ret = 0;
|
|
|
|
unsigned int retry_cnt;
|
|
|
|
|
|
|
|
mdelay(1);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->video_info.master_mode) {
|
2012-07-02 01:16:02 +00:00
|
|
|
printf("DP does not support master mode\n");
|
|
|
|
return -ENODEV;
|
|
|
|
} else {
|
|
|
|
/* debug slave */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_config_video_slave_mode(regs,
|
|
|
|
&priv->video_info);
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_video_color_format(regs, &priv->video_info);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->video_info.bist_mode) {
|
|
|
|
if (exynos_dp_config_video_bist(regs, priv) != 0)
|
2012-07-02 01:16:02 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_get_pll_lock_status(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != PLL_LOCKED) {
|
|
|
|
printf("DP PLL is not locked yet\n");
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->video_info.master_mode == 0) {
|
2012-07-02 01:16:02 +00:00
|
|
|
retry_cnt = 10;
|
|
|
|
while (retry_cnt) {
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_is_slave_video_stream_clock_on(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
if (retry_cnt == 0) {
|
|
|
|
printf("DP stream_clock_on failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
retry_cnt--;
|
|
|
|
mdelay(1);
|
|
|
|
} else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set to use the register calculated M/N video */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_video_cr_mn(regs, CALCULATED_M, 0, 0);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* For video bist, Video timing must be generated by register */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_video_timing_mode(regs, VIDEO_TIMING_FROM_CAPTURE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Enable video bist */
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->video_info.bist_pattern != COLOR_RAMP &&
|
|
|
|
priv->video_info.bist_pattern != BALCK_WHITE_V_LINES &&
|
|
|
|
priv->video_info.bist_pattern != COLOR_SQUARE)
|
|
|
|
exynos_dp_enable_video_bist(regs,
|
|
|
|
priv->video_info.bist_mode);
|
2012-07-02 01:16:02 +00:00
|
|
|
else
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_video_bist(regs, DP_DISABLE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Disable video mute */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_video_mute(regs, DP_DISABLE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Configure video Master or Slave mode */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_video_master(regs,
|
|
|
|
priv->video_info.master_mode);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
/* Enable video */
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_start_video(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
if (priv->video_info.master_mode == 0) {
|
2012-07-02 01:16:02 +00:00
|
|
|
retry_cnt = 100;
|
|
|
|
while (retry_cnt) {
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_is_video_stream_on(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
if (retry_cnt == 0) {
|
|
|
|
printf("DP Timeout of video stream\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
retry_cnt--;
|
|
|
|
mdelay(5);
|
|
|
|
} else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2020-12-03 23:55:21 +00:00
|
|
|
static int exynos_dp_of_to_plat(struct udevice *dev)
|
2013-02-21 23:53:06 +00:00
|
|
|
{
|
2016-02-22 04:09:01 +00:00
|
|
|
struct exynos_dp_priv *priv = dev_get_priv(dev);
|
|
|
|
const void *blob = gd->fdt_blob;
|
2017-01-17 23:52:55 +00:00
|
|
|
unsigned int node = dev_of_offset(dev);
|
2016-02-22 04:09:01 +00:00
|
|
|
fdt_addr_t addr;
|
2013-02-21 23:53:06 +00:00
|
|
|
|
2020-07-17 05:36:48 +00:00
|
|
|
addr = dev_read_addr(dev);
|
2016-02-22 04:09:01 +00:00
|
|
|
if (addr == FDT_ADDR_T_NONE) {
|
|
|
|
debug("Can't get the DP base address\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
priv->regs = (struct exynos_dp *)addr;
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.h_res = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,h-res", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.h_sync_width = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,h-sync-width", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.h_back_porch = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,h-back-porch", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.h_front_porch = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,h-front-porch", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.v_res = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-res", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.v_sync_width = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-sync-width", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.v_back_porch = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-back-porch", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.v_front_porch = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-front-porch", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->disp_info.v_sync_rate = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-sync-rate", 0);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->lt_info.lt_status = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,lt-status", 0);
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.master_mode = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,master-mode", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.bist_mode = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,bist-mode", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.bist_pattern = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,bist-pattern", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.h_sync_polarity = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,h-sync-polarity", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.v_sync_polarity = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,v-sync-polarity", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.interlaced = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,interlaced", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.color_space = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,color-space", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.dynamic_range = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,dynamic-range", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.ycbcr_coeff = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,ycbcr-coeff", 0);
|
2016-02-22 04:09:00 +00:00
|
|
|
priv->video_info.color_depth = fdtdec_get_int(blob, node,
|
2013-02-21 23:53:06 +00:00
|
|
|
"samsung,color-depth", 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
static int exynos_dp_bridge_init(struct udevice *dev)
|
2012-07-02 01:16:02 +00:00
|
|
|
{
|
2016-02-22 04:09:01 +00:00
|
|
|
const int max_tries = 10;
|
|
|
|
int num_tries;
|
|
|
|
int ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
debug("%s\n", __func__);
|
|
|
|
ret = video_bridge_attach(dev);
|
|
|
|
if (ret) {
|
|
|
|
debug("video bridge init failed: %d\n", ret);
|
|
|
|
return ret;
|
2012-07-02 01:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
/*
|
|
|
|
* We need to wait for 90ms after bringing up the bridge since there
|
|
|
|
* is a phantom "high" on the HPD chip during its bootup. The phantom
|
|
|
|
* high comes within 7ms of de-asserting PD and persists for at least
|
|
|
|
* 15ms. The real high comes roughly 50ms after PD is de-asserted. The
|
|
|
|
* phantom high makes it hard for us to know when the NXP chip is up.
|
|
|
|
*/
|
|
|
|
mdelay(90);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
for (num_tries = 0; num_tries < max_tries; num_tries++) {
|
|
|
|
/* Check HPD. If it's high, or we don't have it, all is well */
|
|
|
|
ret = video_bridge_check_attached(dev);
|
|
|
|
if (!ret || ret == -ENOENT)
|
|
|
|
return 0;
|
2016-02-22 04:08:44 +00:00
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
debug("%s: eDP bridge failed to come up; try %d of %d\n",
|
|
|
|
__func__, num_tries, max_tries);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Immediately go into bridge reset if the hp line is not high */
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int exynos_dp_bridge_setup(const void *blob)
|
|
|
|
{
|
|
|
|
const int max_tries = 2;
|
|
|
|
int num_tries;
|
|
|
|
struct udevice *dev;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Configure I2C registers for Parade bridge */
|
|
|
|
ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, &dev);
|
|
|
|
if (ret) {
|
|
|
|
debug("video bridge init failed: %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strncmp(dev->driver->name, "parade", 6)) {
|
|
|
|
/* Mux HPHPD to the special hotplug detect mode */
|
|
|
|
exynos_pinmux_config(PERIPH_ID_DPHPD, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (num_tries = 0; num_tries < max_tries; num_tries++) {
|
|
|
|
ret = exynos_dp_bridge_init(dev);
|
|
|
|
if (!ret)
|
|
|
|
return 0;
|
|
|
|
if (num_tries == max_tries - 1)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we're here, the bridge chip failed to initialise.
|
|
|
|
* Power down the bridge in an attempt to reset.
|
|
|
|
*/
|
|
|
|
video_bridge_set_active(dev, false);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Arbitrarily wait 300ms here with DP_N low. Don't know for
|
|
|
|
* sure how long we should wait, but we're being paranoid.
|
|
|
|
*/
|
|
|
|
mdelay(300);
|
|
|
|
}
|
2013-02-21 23:53:04 +00:00
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
int exynos_dp_enable(struct udevice *dev, int panel_bpp,
|
|
|
|
const struct display_timing *timing)
|
|
|
|
{
|
|
|
|
struct exynos_dp_priv *priv = dev_get_priv(dev);
|
|
|
|
struct exynos_dp *regs = priv->regs;
|
|
|
|
unsigned int ret;
|
|
|
|
|
|
|
|
debug("%s: start\n", __func__);
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_disp_info(&priv->disp_info);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:01 +00:00
|
|
|
ret = exynos_dp_bridge_setup(gd->fdt_blob);
|
|
|
|
if (ret && ret != -ENODEV)
|
|
|
|
printf("LCD bridge failed to enable: %d\n", ret);
|
|
|
|
|
2016-02-22 04:08:57 +00:00
|
|
|
exynos_dp_phy_ctrl(1);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_init_dp(regs);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP exynos_dp_init_dp() failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_handle_edid(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("EDP handle_edid fail\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
ret = exynos_dp_set_link_train(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("DP link training fail\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_enable_scramble(regs, DP_ENABLE);
|
|
|
|
exynos_dp_enable_rx_to_enhanced_mode(regs, DP_ENABLE);
|
|
|
|
exynos_dp_enable_enhanced_mode(regs, DP_ENABLE);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_set_link_bandwidth(regs, priv->lane_bw);
|
|
|
|
exynos_dp_set_lane_count(regs, priv->lane_cnt);
|
2012-07-02 01:16:02 +00:00
|
|
|
|
2016-02-22 04:09:00 +00:00
|
|
|
exynos_dp_init_video(regs);
|
|
|
|
ret = exynos_dp_config_video(regs, priv);
|
2012-07-02 01:16:02 +00:00
|
|
|
if (ret != EXYNOS_DP_SUCCESS) {
|
|
|
|
printf("Exynos DP init failed\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-07-03 00:16:14 +00:00
|
|
|
debug("Exynos DP init done\n");
|
2012-07-02 01:16:02 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2016-02-22 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
static const struct dm_display_ops exynos_dp_ops = {
|
|
|
|
.enable = exynos_dp_enable,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct udevice_id exynos_dp_ids[] = {
|
|
|
|
{ .compatible = "samsung,exynos5-dp" },
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
U_BOOT_DRIVER(exynos_dp) = {
|
2017-10-28 03:08:51 +00:00
|
|
|
.name = "exynos_dp",
|
2016-02-22 04:09:01 +00:00
|
|
|
.id = UCLASS_DISPLAY,
|
|
|
|
.of_match = exynos_dp_ids,
|
|
|
|
.ops = &exynos_dp_ops,
|
2020-12-03 23:55:21 +00:00
|
|
|
.of_to_plat = exynos_dp_of_to_plat,
|
2020-12-03 23:55:17 +00:00
|
|
|
.priv_auto = sizeof(struct exynos_dp_priv),
|
2016-02-22 04:09:01 +00:00
|
|
|
};
|