Commit 1e8635ea authored by Zeyu Fan's avatar Zeyu Fan Committed by Alex Deucher

drm/amd/display: Implement HDMI retimer settings for RV AM4 support.

Signed-off-by: default avatarZeyu Fan <Zeyu.Fan@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0cb8a881
...@@ -993,6 +993,8 @@ static struct device_id device_type_from_device_id(uint16_t device_id) ...@@ -993,6 +993,8 @@ static struct device_id device_type_from_device_id(uint16_t device_id)
struct device_id result_device_id; struct device_id result_device_id;
result_device_id.raw_device_tag = device_id;
switch (device_id) { switch (device_id) {
case ATOM_DISPLAY_LCD1_SUPPORT: case ATOM_DISPLAY_LCD1_SUPPORT:
result_device_id.device_type = DEVICE_TYPE_LCD; result_device_id.device_type = DEVICE_TYPE_LCD;
...@@ -1812,10 +1814,77 @@ static enum bp_result get_integrated_info_v11( ...@@ -1812,10 +1814,77 @@ static enum bp_result get_integrated_info_v11(
info_v11->extdispconninfo.path[i].hpdlut_index; info_v11->extdispconninfo.path[i].hpdlut_index;
info->ext_disp_conn_info.path[i].channel_mapping.raw = info->ext_disp_conn_info.path[i].channel_mapping.raw =
info_v11->extdispconninfo.path[i].channelmapping; info_v11->extdispconninfo.path[i].channelmapping;
info->ext_disp_conn_info.path[i].caps =
le16_to_cpu(info_v11->extdispconninfo.path[i].caps);
} }
info->ext_disp_conn_info.checksum = info->ext_disp_conn_info.checksum =
info_v11->extdispconninfo.checksum; info_v11->extdispconninfo.checksum;
info->dp0_ext_hdmi_slv_addr = info_v11->dp0_retimer_set.HdmiSlvAddr;
info->dp0_ext_hdmi_reg_num = info_v11->dp0_retimer_set.HdmiRegNum;
for (i = 0; i < info->dp0_ext_hdmi_reg_num; i++) {
info->dp0_ext_hdmi_reg_settings[i].i2c_reg_index =
info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
info->dp0_ext_hdmi_reg_settings[i].i2c_reg_val =
info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
}
info->dp0_ext_hdmi_6g_reg_num = info_v11->dp0_retimer_set.Hdmi6GRegNum;
for (i = 0; i < info->dp0_ext_hdmi_6g_reg_num; i++) {
info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
info_v11->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
info_v11->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
}
info->dp1_ext_hdmi_slv_addr = info_v11->dp1_retimer_set.HdmiSlvAddr;
info->dp1_ext_hdmi_reg_num = info_v11->dp1_retimer_set.HdmiRegNum;
for (i = 0; i < info->dp1_ext_hdmi_reg_num; i++) {
info->dp1_ext_hdmi_reg_settings[i].i2c_reg_index =
info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
info->dp1_ext_hdmi_reg_settings[i].i2c_reg_val =
info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
}
info->dp1_ext_hdmi_6g_reg_num = info_v11->dp1_retimer_set.Hdmi6GRegNum;
for (i = 0; i < info->dp1_ext_hdmi_6g_reg_num; i++) {
info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
info_v11->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
info_v11->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
}
info->dp2_ext_hdmi_slv_addr = info_v11->dp2_retimer_set.HdmiSlvAddr;
info->dp2_ext_hdmi_reg_num = info_v11->dp2_retimer_set.HdmiRegNum;
for (i = 0; i < info->dp2_ext_hdmi_reg_num; i++) {
info->dp2_ext_hdmi_reg_settings[i].i2c_reg_index =
info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
info->dp2_ext_hdmi_reg_settings[i].i2c_reg_val =
info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
}
info->dp2_ext_hdmi_6g_reg_num = info_v11->dp2_retimer_set.Hdmi6GRegNum;
for (i = 0; i < info->dp2_ext_hdmi_6g_reg_num; i++) {
info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
info_v11->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
info_v11->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
}
info->dp3_ext_hdmi_slv_addr = info_v11->dp3_retimer_set.HdmiSlvAddr;
info->dp3_ext_hdmi_reg_num = info_v11->dp3_retimer_set.HdmiRegNum;
for (i = 0; i < info->dp3_ext_hdmi_reg_num; i++) {
info->dp3_ext_hdmi_reg_settings[i].i2c_reg_index =
info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
info->dp3_ext_hdmi_reg_settings[i].i2c_reg_val =
info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
}
info->dp3_ext_hdmi_6g_reg_num = info_v11->dp3_retimer_set.Hdmi6GRegNum;
for (i = 0; i < info->dp3_ext_hdmi_6g_reg_num; i++) {
info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
info_v11->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
info_v11->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
}
/** TODO - review **/ /** TODO - review **/
#if 0 #if 0
info->boot_up_engine_clock = le32_to_cpu(info_v11->ulBootUpEngineClock) info->boot_up_engine_clock = le32_to_cpu(info_v11->ulBootUpEngineClock)
......
...@@ -815,6 +815,7 @@ struct dc_link { ...@@ -815,6 +815,7 @@ struct dc_link {
union ddi_channel_mapping ddi_channel_mapping; union ddi_channel_mapping ddi_channel_mapping;
struct connector_device_tag_info device_tag; struct connector_device_tag_info device_tag;
struct dpcd_caps dpcd_caps; struct dpcd_caps dpcd_caps;
unsigned short chip_caps;
unsigned int dpcd_sink_count; unsigned int dpcd_sink_count;
enum edp_revision edp_revision; enum edp_revision edp_revision;
......
...@@ -96,11 +96,6 @@ bool dm_helpers_submit_i2c( ...@@ -96,11 +96,6 @@ bool dm_helpers_submit_i2c(
const struct dc_link *link, const struct dc_link *link,
struct i2c_command *cmd); struct i2c_command *cmd);
enum dc_edid_status dm_helpers_read_local_edid( enum dc_edid_status dm_helpers_read_local_edid(
struct dc_context *ctx, struct dc_context *ctx,
struct dc_link *link, struct dc_link *link,
......
...@@ -65,6 +65,7 @@ enum dal_device_type { ...@@ -65,6 +65,7 @@ enum dal_device_type {
struct device_id { struct device_id {
enum dal_device_type device_type:16; enum dal_device_type device_type:16;
uint32_t enum_id:16; /* 1 based enum */ uint32_t enum_id:16; /* 1 based enum */
uint16_t raw_device_tag;
}; };
struct graphics_object_i2c_info { struct graphics_object_i2c_info {
...@@ -264,6 +265,20 @@ struct transmitter_configuration { ...@@ -264,6 +265,20 @@ struct transmitter_configuration {
#define NUMBER_OF_DISP_CLK_VOLTAGE 4 #define NUMBER_OF_DISP_CLK_VOLTAGE 4
#define NUMBER_OF_AVAILABLE_SCLK 5 #define NUMBER_OF_AVAILABLE_SCLK 5
struct i2c_reg_info {
unsigned char i2c_reg_index;
unsigned char i2c_reg_val;
};
struct ext_hdmi_settings {
unsigned char slv_addr;
unsigned char reg_num;
struct i2c_reg_info reg_settings[9];
unsigned char reg_num_6g;
struct i2c_reg_info reg_settings_6g[3];
};
/* V6 */ /* V6 */
struct integrated_info { struct integrated_info {
struct clock_voltage_caps { struct clock_voltage_caps {
...@@ -291,6 +306,8 @@ struct integrated_info { ...@@ -291,6 +306,8 @@ struct integrated_info {
struct graphics_object_id ext_encoder_obj_id; struct graphics_object_id ext_encoder_obj_id;
/* XBAR mapping of the PHY channels */ /* XBAR mapping of the PHY channels */
union ddi_channel_mapping channel_mapping; union ddi_channel_mapping channel_mapping;
unsigned short caps;
} path[MAX_NUMBER_OF_EXT_DISPLAY_PATH]; } path[MAX_NUMBER_OF_EXT_DISPLAY_PATH];
uint8_t gu_id[NUMBER_OF_UCHAR_FOR_GUID]; uint8_t gu_id[NUMBER_OF_UCHAR_FOR_GUID];
...@@ -357,6 +374,27 @@ struct integrated_info { ...@@ -357,6 +374,27 @@ struct integrated_info {
uint32_t lvds_pwr_off_seq_blon_to_vary_bl_in_4ms; uint32_t lvds_pwr_off_seq_blon_to_vary_bl_in_4ms;
uint32_t lvds_reserved1; uint32_t lvds_reserved1;
uint32_t lvds_bit_depth_control_val; uint32_t lvds_bit_depth_control_val;
//Start from V9
unsigned char dp0_ext_hdmi_slv_addr;
unsigned char dp0_ext_hdmi_reg_num;
struct i2c_reg_info dp0_ext_hdmi_reg_settings[9];
unsigned char dp0_ext_hdmi_6g_reg_num;
struct i2c_reg_info dp0_ext_hdmi_6g_reg_settings[3];
unsigned char dp1_ext_hdmi_slv_addr;
unsigned char dp1_ext_hdmi_reg_num;
struct i2c_reg_info dp1_ext_hdmi_reg_settings[9];
unsigned char dp1_ext_hdmi_6g_reg_num;
struct i2c_reg_info dp1_ext_hdmi_6g_reg_settings[3];
unsigned char dp2_ext_hdmi_slv_addr;
unsigned char dp2_ext_hdmi_reg_num;
struct i2c_reg_info dp2_ext_hdmi_reg_settings[9];
unsigned char dp2_ext_hdmi_6g_reg_num;
struct i2c_reg_info dp2_ext_hdmi_6g_reg_settings[3];
unsigned char dp3_ext_hdmi_slv_addr;
unsigned char dp3_ext_hdmi_reg_num;
struct i2c_reg_info dp3_ext_hdmi_reg_settings[9];
unsigned char dp3_ext_hdmi_6g_reg_num;
struct i2c_reg_info dp3_ext_hdmi_6g_reg_settings[3];
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment