2 * Copyright 2016 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
32 LANE_COUNT_UNKNOWN = 0,
37 LANE_COUNT_DP_MAX = LANE_COUNT_FOUR
40 /* This is actually a reference clock (27MHz) multiplier
41 * 162MBps bandwidth for 1.62GHz like rate,
42 * 270MBps for 2.70GHz,
43 * 324MBps for 3.24Ghz,
48 LINK_RATE_UNKNOWN = 0,
50 LINK_RATE_HIGH = 0x0A,
51 LINK_RATE_RBR2 = 0x0C,
52 LINK_RATE_HIGH2 = 0x14,
53 LINK_RATE_HIGH3 = 0x1E
57 LINK_SPREAD_DISABLED = 0x00,
58 /* 0.5 % downspread 30 kHz */
59 LINK_SPREAD_05_DOWNSPREAD_30KHZ = 0x10,
60 /* 0.5 % downspread 33 kHz */
61 LINK_SPREAD_05_DOWNSPREAD_33KHZ = 0x11
64 enum dc_voltage_swing {
65 VOLTAGE_SWING_LEVEL0 = 0, /* direct HW translation! */
69 VOLTAGE_SWING_MAX_LEVEL = VOLTAGE_SWING_LEVEL3
72 enum dc_pre_emphasis {
73 PRE_EMPHASIS_DISABLED = 0, /* direct HW translation! */
77 PRE_EMPHASIS_MAX_LEVEL = PRE_EMPHASIS_LEVEL3
79 /* Post Cursor 2 is optional for transmitter
80 * and it applies only to the main link operating at HBR2
82 enum dc_post_cursor2 {
83 POST_CURSOR2_DISABLED = 0, /* direct HW translation! */
87 POST_CURSOR2_MAX_LEVEL = POST_CURSOR2_LEVEL3,
90 struct dc_link_settings {
91 enum dc_lane_count lane_count;
92 enum dc_link_rate link_rate;
93 enum dc_link_spread link_spread;
96 struct dc_lane_settings {
97 enum dc_voltage_swing VOLTAGE_SWING;
98 enum dc_pre_emphasis PRE_EMPHASIS;
99 enum dc_post_cursor2 POST_CURSOR2;
102 struct dc_link_training_settings {
103 struct dc_link_settings link;
104 struct dc_lane_settings lane_settings[LANE_COUNT_DP_MAX];
116 union max_lane_count {
118 uint8_t MAX_LANE_COUNT:5;
119 uint8_t POST_LT_ADJ_REQ_SUPPORTED:1;
120 uint8_t TPS3_SUPPORTED:1;
121 uint8_t ENHANCED_FRAME_CAP:1;
126 union max_down_spread {
128 uint8_t MAX_DOWN_SPREAD:1;
130 uint8_t NO_AUX_HANDSHAKE_LINK_TRAINING:1;
131 uint8_t TPS4_SUPPORTED:1;
144 union lane_count_set {
146 uint8_t LANE_COUNT_SET:5;
147 uint8_t POST_LT_ADJ_REQ_GRANTED:1;
149 uint8_t ENHANCED_FRAMING:1;
157 uint8_t CHANNEL_EQ_DONE_0:1;
158 uint8_t SYMBOL_LOCKED_0:1;
161 uint8_t CHANNEL_EQ_DONE_1:1;
162 uint8_t SYMBOL_LOCKED_1:1;
163 uint8_t RESERVED_1:1;
168 union device_service_irq {
170 uint8_t REMOTE_CONTROL_CMD_PENDING:1;
171 uint8_t AUTOMATED_TEST:1;
174 uint8_t DOWN_REP_MSG_RDY:1;
175 uint8_t UP_REQ_MSG_RDY:1;
176 uint8_t SINK_SPECIFIC:1;
184 uint8_t SINK_COUNT:6;
191 union lane_align_status_updated {
193 uint8_t INTERLANE_ALIGN_DONE:1;
194 uint8_t POST_LT_ADJ_REQ_IN_PROGRESS:1;
196 uint8_t DOWNSTREAM_PORT_STATUS_CHANGED:1;
197 uint8_t LINK_STATUS_UPDATED:1;
204 uint8_t VOLTAGE_SWING_LANE:2;
205 uint8_t PRE_EMPHASIS_LANE:2;
211 union dpcd_training_pattern {
213 uint8_t TRAINING_PATTERN_SET:4;
214 uint8_t RECOVERED_CLOCK_OUT_EN:1;
215 uint8_t SCRAMBLING_DISABLE:1;
216 uint8_t SYMBOL_ERROR_COUNT_SEL:2;
219 uint8_t TRAINING_PATTERN_SET:2;
220 uint8_t LINK_QUAL_PATTERN_SET:2;
226 /* Training Lane is used to configure downstream DP device's voltage swing
227 and pre-emphasis levels*/
228 /* The DPCD addresses are from 0x103 to 0x106*/
229 union dpcd_training_lane {
231 uint8_t VOLTAGE_SWING_SET:2;
232 uint8_t MAX_SWING_REACHED:1;
233 uint8_t PRE_EMPHASIS_SET:2;
234 uint8_t MAX_PRE_EMPHASIS_REACHED:1;
240 /* TMDS-converter related */
241 union dwnstream_port_caps_byte0 {
243 uint8_t DWN_STRM_PORTX_TYPE:3;
244 uint8_t DWN_STRM_PORTX_HPD:1;
250 /* these are the detailed types stored at DWN_STRM_PORTX_CAP (00080h)*/
251 enum dpcd_downstream_port_detailed_type {
252 DOWN_STREAM_DETAILED_DP = 0,
253 DOWN_STREAM_DETAILED_VGA,
254 DOWN_STREAM_DETAILED_DVI,
255 DOWN_STREAM_DETAILED_HDMI,
256 DOWN_STREAM_DETAILED_NONDDC,/* has no EDID (TV,CV)*/
257 DOWN_STREAM_DETAILED_DP_PLUS_PLUS
260 union dwnstream_port_caps_byte2 {
262 uint8_t MAX_BITS_PER_COLOR_COMPONENT:2;
268 union dp_downstream_port_present {
271 uint8_t PORT_PRESENT:1;
273 uint8_t FMT_CONVERSION:1;
274 uint8_t DETAILED_CAPS:1;
279 union dwnstream_port_caps_byte3_dvi {
283 uint8_t HIGH_COLOR_DEPTH:1;
289 union dwnstream_port_caps_byte3_hdmi {
291 uint8_t FRAME_SEQ_TO_FRAME_PACK:1;
292 uint8_t YCrCr422_PASS_THROUGH:1;
293 uint8_t YCrCr420_PASS_THROUGH:1;
294 uint8_t YCrCr422_CONVERSION:1;
295 uint8_t YCrCr420_CONVERSION:1;
301 /*4-byte structure for detailed capabilities of a down-stream port
302 (DP-to-TMDS converter).*/
303 union dwnstream_portxcaps {
305 union dwnstream_port_caps_byte0 byte0;
306 unsigned char max_TMDS_clock; //byte1
307 union dwnstream_port_caps_byte2 byte2;
310 union dwnstream_port_caps_byte3_dvi byteDVI;
311 union dwnstream_port_caps_byte3_hdmi byteHDMI;
315 unsigned char raw[4];
318 union downstream_port {
320 unsigned char present:1;
321 unsigned char type:2;
322 unsigned char format_conv:1;
323 unsigned char detailed_caps:1;
324 unsigned char reserved:3;
332 uint8_t RX_PORT0_STATUS:1;
333 uint8_t RX_PORT1_STATUS:1;
339 /*6-byte structure corresponding to 6 registers (200h-205h)
340 read during handling of HPD-IRQ*/
343 union sink_count sink_cnt;/* 200h */
344 union device_service_irq device_service_irq;/* 201h */
345 union lane_status lane01_status;/* 202h */
346 union lane_status lane23_status;/* 203h */
347 union lane_align_status_updated lane_status_updated;/* 204h */
348 union sink_status sink_status;
353 union down_stream_port_count {
355 uint8_t DOWN_STR_PORT_COUNT:4;
356 uint8_t RESERVED:2; /*Bits 5:4 = RESERVED. Read all 0s.*/
357 /*Bit 6 = MSA_TIMING_PAR_IGNORED
358 0 = Sink device requires the MSA timing parameters
359 1 = Sink device is capable of rendering incoming video
360 stream without MSA timing parameters*/
361 uint8_t IGNORE_MSA_TIMING_PARAM:1;
362 /*Bit 7 = OUI Support
363 0 = OUI not supported
365 (OUI and Device Identification mandatory for DP 1.2)*/
366 uint8_t OUI_SUPPORT:1;
371 union down_spread_ctrl {
373 uint8_t RESERVED1:4;/* Bit 3:0 = RESERVED. Read all 0s*/
374 /* Bits 4 = SPREAD_AMP. Spreading amplitude
375 0 = Main link signal is not downspread
376 1 = Main link signal is downspread <= 0.5%
377 with frequency in the range of 30kHz ~ 33kHz*/
378 uint8_t SPREAD_AMP:1;
379 uint8_t RESERVED2:2;/*Bit 6:5 = RESERVED. Read all 0s*/
380 /*Bit 7 = MSA_TIMING_PAR_IGNORE_EN
381 0 = Source device will send valid data for the MSA Timing Params
382 1 = Source device may send invalid data for these MSA Timing Params*/
383 uint8_t IGNORE_MSA_TIMING_PARAM:1;
388 union dpcd_edp_config {
390 uint8_t PANEL_MODE_EDP:1;
391 uint8_t FRAMING_CHANGE_ENABLE:1;
393 uint8_t PANEL_SELF_TEST_ENABLE:1;
398 struct dp_device_vendor_id {
399 uint8_t ieee_oui[3];/*24-bit IEEE OUI*/
400 uint8_t ieee_device_id[6];/*usually 6-byte ASCII name*/
403 struct dp_sink_hw_fw_revision {
405 uint8_t ieee_fw_rev[2];
408 /*DPCD register of DP receiver capability field bits-*/
409 union edp_configuration_cap {
411 uint8_t ALT_SCRAMBLER_RESET:1;
412 uint8_t FRAMING_CHANGE:1;
414 uint8_t DPCD_DISPLAY_CONTROL_CAPABLE:1;
420 union training_aux_rd_interval {
422 uint8_t TRAINIG_AUX_RD_INTERVAL:7;
423 uint8_t EXT_RECIEVER_CAP_FIELD_PRESENT:1;
428 /* Automated test structures */
431 uint8_t LINK_TRAINING :1;
432 uint8_t LINK_TEST_PATTRN :1;
433 uint8_t EDID_READ :1;
434 uint8_t PHY_TEST_PATTERN :1;
435 uint8_t AUDIO_TEST_PATTERN :1;
437 uint8_t TEST_STEREO_3D :1;
442 union test_response {
446 uint8_t EDID_CHECKSUM_WRITE:1;
452 union phy_test_pattern {
454 /* DpcdPhyTestPatterns. This field is 2 bits for DP1.1
455 * and 3 bits for DP1.2.
458 /* BY speci, bit7:2 is 0 for DP1.1. */
464 /* States of Compliance Test Specification (CTS DP1.2). */
465 union compliance_test_state {
467 unsigned char STEREO_3D_RUNNING : 1;
468 unsigned char RESERVED : 7;
473 union link_test_pattern {
475 /* dpcd_link_test_patterns */
476 unsigned char PATTERN :2;
477 unsigned char RESERVED:6;
483 struct dpcd_test_misc_bits {
484 unsigned char SYNC_CLOCK :1;
485 /* dpcd_test_color_format */
486 unsigned char CLR_FORMAT :2;
487 /* dpcd_test_dyn_range */
488 unsigned char DYN_RANGE :1;
489 unsigned char YCBCR :1;
490 /* dpcd_test_bit_depth */
491 unsigned char BPC :3;
496 #endif /* DC_DP_TYPES_H */