Commit 0136684f authored by Calvin Hou's avatar Calvin Hou Committed by Alex Deucher

drm/amd/display: Pass override OUI in to dc_init_data

[WHY]
Vendor dongle requires propietary OUI and handshake sequence.

[HOW]
Add a new structure to dc_init_data, to allow creator to pass
an override vendor_oui. This value will be written to DP_SOURCE_OUI
instead of AMD signature, when dpcd_set_source_specific_data is
called.
Signed-off-by: default avatarCalvin Hou <Calvin.Hou@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5c4a6d62
...@@ -701,7 +701,7 @@ static bool dc_construct(struct dc *dc, ...@@ -701,7 +701,7 @@ static bool dc_construct(struct dc *dc,
dc_ctx->created_bios = true; dc_ctx->created_bios = true;
} }
dc->vendor_signature = init_params->vendor_signature;
/* Create GPIO service */ /* Create GPIO service */
dc_ctx->gpio_service = dal_gpio_service_create( dc_ctx->gpio_service = dal_gpio_service_create(
......
...@@ -4179,25 +4179,32 @@ void dp_set_fec_enable(struct dc_link *link, bool enable) ...@@ -4179,25 +4179,32 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
void dpcd_set_source_specific_data(struct dc_link *link) void dpcd_set_source_specific_data(struct dc_link *link)
{ {
struct dpcd_amd_signature amd_signature;
const uint32_t post_oui_delay = 30; // 30ms const uint32_t post_oui_delay = 30; // 30ms
amd_signature.AMD_IEEE_TxSignature_byte1 = 0x0; if (!link->dc->vendor_signature.is_valid) {
amd_signature.AMD_IEEE_TxSignature_byte2 = 0x0; struct dpcd_amd_signature amd_signature;
amd_signature.AMD_IEEE_TxSignature_byte3 = 0x1A; amd_signature.AMD_IEEE_TxSignature_byte1 = 0x0;
amd_signature.device_id_byte1 = amd_signature.AMD_IEEE_TxSignature_byte2 = 0x0;
(uint8_t)(link->ctx->asic_id.chip_id); amd_signature.AMD_IEEE_TxSignature_byte3 = 0x1A;
amd_signature.device_id_byte2 = amd_signature.device_id_byte1 =
(uint8_t)(link->ctx->asic_id.chip_id >> 8); (uint8_t)(link->ctx->asic_id.chip_id);
memset(&amd_signature.zero, 0, 4); amd_signature.device_id_byte2 =
amd_signature.dce_version = (uint8_t)(link->ctx->asic_id.chip_id >> 8);
(uint8_t)(link->ctx->dce_version); memset(&amd_signature.zero, 0, 4);
amd_signature.dal_version_byte1 = 0x0; // needed? where to get? amd_signature.dce_version =
amd_signature.dal_version_byte2 = 0x0; // needed? where to get? (uint8_t)(link->ctx->dce_version);
amd_signature.dal_version_byte1 = 0x0; // needed? where to get?
core_link_write_dpcd(link, DP_SOURCE_OUI, amd_signature.dal_version_byte2 = 0x0; // needed? where to get?
(uint8_t *)(&amd_signature),
sizeof(amd_signature)); core_link_write_dpcd(link, DP_SOURCE_OUI,
(uint8_t *)(&amd_signature),
sizeof(amd_signature));
} else {
core_link_write_dpcd(link, DP_SOURCE_OUI,
link->dc->vendor_signature.data.raw,
sizeof(link->dc->vendor_signature.data.raw));
}
// Sink may need to configure internals based on vendor, so allow some // Sink may need to configure internals based on vendor, so allow some
// time before proceeding with possibly vendor specific transactions // time before proceeding with possibly vendor specific transactions
......
...@@ -527,6 +527,7 @@ struct dc { ...@@ -527,6 +527,7 @@ struct dc {
struct compressor *fbc_compressor; struct compressor *fbc_compressor;
struct dc_debug_data debug_data; struct dc_debug_data debug_data;
struct dpcd_vendor_signature vendor_signature;
const char *build_id; const char *build_id;
struct vm_helper *vm_helper; struct vm_helper *vm_helper;
...@@ -573,6 +574,7 @@ struct dc_init_data { ...@@ -573,6 +574,7 @@ struct dc_init_data {
* available in FW * available in FW
*/ */
const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box; const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
struct dpcd_vendor_signature vendor_signature;
}; };
struct dc_callback_init { struct dc_callback_init {
......
...@@ -432,6 +432,20 @@ struct dp_sink_hw_fw_revision { ...@@ -432,6 +432,20 @@ struct dp_sink_hw_fw_revision {
uint8_t ieee_fw_rev[2]; uint8_t ieee_fw_rev[2];
}; };
struct dpcd_vendor_signature {
bool is_valid;
union dpcd_ieee_vendor_signature {
struct {
uint8_t ieee_oui[3];/*24-bit IEEE OUI*/
uint8_t ieee_device_id[6];/*usually 6-byte ASCII name*/
uint8_t ieee_hw_rev;
uint8_t ieee_fw_rev[2];
};
uint8_t raw[12];
} data;
};
struct dpcd_amd_signature { struct dpcd_amd_signature {
uint8_t AMD_IEEE_TxSignature_byte1; uint8_t AMD_IEEE_TxSignature_byte1;
uint8_t AMD_IEEE_TxSignature_byte2; uint8_t AMD_IEEE_TxSignature_byte2;
......
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