162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright © 2008 Keith Packard 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission to use, copy, modify, distribute, and sell this software and its 562306a36Sopenharmony_ci * documentation for any purpose is hereby granted without fee, provided that 662306a36Sopenharmony_ci * the above copyright notice appear in all copies and that both that copyright 762306a36Sopenharmony_ci * notice and this permission notice appear in supporting documentation, and 862306a36Sopenharmony_ci * that the name of the copyright holders not be used in advertising or 962306a36Sopenharmony_ci * publicity pertaining to distribution of the software without specific, 1062306a36Sopenharmony_ci * written prior permission. The copyright holders make no representations 1162306a36Sopenharmony_ci * about the suitability of this software for any purpose. It is provided "as 1262306a36Sopenharmony_ci * is" without express or implied warranty. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 1562306a36Sopenharmony_ci * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 1662306a36Sopenharmony_ci * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 1762306a36Sopenharmony_ci * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 1862306a36Sopenharmony_ci * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 1962306a36Sopenharmony_ci * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 2062306a36Sopenharmony_ci * OF THIS SOFTWARE. 2162306a36Sopenharmony_ci */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#ifndef _DRM_DP_H_ 2462306a36Sopenharmony_ci#define _DRM_DP_H_ 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#include <linux/types.h> 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* 2962306a36Sopenharmony_ci * Unless otherwise noted, all values are from the DP 1.1a spec. Note that 3062306a36Sopenharmony_ci * DP and DPCD versions are independent. Differences from 1.0 are not noted, 3162306a36Sopenharmony_ci * 1.0 devices basically don't exist in the wild. 3262306a36Sopenharmony_ci * 3362306a36Sopenharmony_ci * Abbreviations, in chronological order: 3462306a36Sopenharmony_ci * 3562306a36Sopenharmony_ci * eDP: Embedded DisplayPort version 1 3662306a36Sopenharmony_ci * DPI: DisplayPort Interoperability Guideline v1.1a 3762306a36Sopenharmony_ci * 1.2: DisplayPort 1.2 3862306a36Sopenharmony_ci * MST: Multistream Transport - part of DP 1.2a 3962306a36Sopenharmony_ci * 4062306a36Sopenharmony_ci * 1.2 formally includes both eDP and DPI definitions. 4162306a36Sopenharmony_ci */ 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci/* MSA (Main Stream Attribute) MISC bits (as MISC1<<8|MISC0) */ 4462306a36Sopenharmony_ci#define DP_MSA_MISC_SYNC_CLOCK (1 << 0) 4562306a36Sopenharmony_ci#define DP_MSA_MISC_INTERLACE_VTOTAL_EVEN (1 << 8) 4662306a36Sopenharmony_ci#define DP_MSA_MISC_STEREO_NO_3D (0 << 9) 4762306a36Sopenharmony_ci#define DP_MSA_MISC_STEREO_PROG_RIGHT_EYE (1 << 9) 4862306a36Sopenharmony_ci#define DP_MSA_MISC_STEREO_PROG_LEFT_EYE (3 << 9) 4962306a36Sopenharmony_ci/* bits per component for non-RAW */ 5062306a36Sopenharmony_ci#define DP_MSA_MISC_6_BPC (0 << 5) 5162306a36Sopenharmony_ci#define DP_MSA_MISC_8_BPC (1 << 5) 5262306a36Sopenharmony_ci#define DP_MSA_MISC_10_BPC (2 << 5) 5362306a36Sopenharmony_ci#define DP_MSA_MISC_12_BPC (3 << 5) 5462306a36Sopenharmony_ci#define DP_MSA_MISC_16_BPC (4 << 5) 5562306a36Sopenharmony_ci/* bits per component for RAW */ 5662306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_6_BPC (1 << 5) 5762306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_7_BPC (2 << 5) 5862306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_8_BPC (3 << 5) 5962306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_10_BPC (4 << 5) 6062306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_12_BPC (5 << 5) 6162306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_14_BPC (6 << 5) 6262306a36Sopenharmony_ci#define DP_MSA_MISC_RAW_16_BPC (7 << 5) 6362306a36Sopenharmony_ci/* pixel encoding/colorimetry format */ 6462306a36Sopenharmony_ci#define _DP_MSA_MISC_COLOR(misc1_7, misc0_21, misc0_3, misc0_4) \ 6562306a36Sopenharmony_ci ((misc1_7) << 15 | (misc0_4) << 4 | (misc0_3) << 3 | ((misc0_21) << 1)) 6662306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_RGB _DP_MSA_MISC_COLOR(0, 0, 0, 0) 6762306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_CEA_RGB _DP_MSA_MISC_COLOR(0, 0, 1, 0) 6862306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_RGB_WIDE_FIXED _DP_MSA_MISC_COLOR(0, 3, 0, 0) 6962306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_RGB_WIDE_FLOAT _DP_MSA_MISC_COLOR(0, 3, 0, 1) 7062306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_Y_ONLY _DP_MSA_MISC_COLOR(1, 0, 0, 0) 7162306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_RAW _DP_MSA_MISC_COLOR(1, 1, 0, 0) 7262306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_YCBCR_422_BT601 _DP_MSA_MISC_COLOR(0, 1, 1, 0) 7362306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_YCBCR_422_BT709 _DP_MSA_MISC_COLOR(0, 1, 1, 1) 7462306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_YCBCR_444_BT601 _DP_MSA_MISC_COLOR(0, 2, 1, 0) 7562306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_YCBCR_444_BT709 _DP_MSA_MISC_COLOR(0, 2, 1, 1) 7662306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_XVYCC_422_BT601 _DP_MSA_MISC_COLOR(0, 1, 0, 0) 7762306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_XVYCC_422_BT709 _DP_MSA_MISC_COLOR(0, 1, 0, 1) 7862306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_XVYCC_444_BT601 _DP_MSA_MISC_COLOR(0, 2, 0, 0) 7962306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_XVYCC_444_BT709 _DP_MSA_MISC_COLOR(0, 2, 0, 1) 8062306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_OPRGB _DP_MSA_MISC_COLOR(0, 0, 1, 1) 8162306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_DCI_P3 _DP_MSA_MISC_COLOR(0, 3, 1, 0) 8262306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_COLOR_PROFILE _DP_MSA_MISC_COLOR(0, 3, 1, 1) 8362306a36Sopenharmony_ci#define DP_MSA_MISC_COLOR_VSC_SDP (1 << 14) 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci#define DP_AUX_MAX_PAYLOAD_BYTES 16 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci#define DP_AUX_I2C_WRITE 0x0 8862306a36Sopenharmony_ci#define DP_AUX_I2C_READ 0x1 8962306a36Sopenharmony_ci#define DP_AUX_I2C_WRITE_STATUS_UPDATE 0x2 9062306a36Sopenharmony_ci#define DP_AUX_I2C_MOT 0x4 9162306a36Sopenharmony_ci#define DP_AUX_NATIVE_WRITE 0x8 9262306a36Sopenharmony_ci#define DP_AUX_NATIVE_READ 0x9 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci#define DP_AUX_NATIVE_REPLY_ACK (0x0 << 0) 9562306a36Sopenharmony_ci#define DP_AUX_NATIVE_REPLY_NACK (0x1 << 0) 9662306a36Sopenharmony_ci#define DP_AUX_NATIVE_REPLY_DEFER (0x2 << 0) 9762306a36Sopenharmony_ci#define DP_AUX_NATIVE_REPLY_MASK (0x3 << 0) 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci#define DP_AUX_I2C_REPLY_ACK (0x0 << 2) 10062306a36Sopenharmony_ci#define DP_AUX_I2C_REPLY_NACK (0x1 << 2) 10162306a36Sopenharmony_ci#define DP_AUX_I2C_REPLY_DEFER (0x2 << 2) 10262306a36Sopenharmony_ci#define DP_AUX_I2C_REPLY_MASK (0x3 << 2) 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci/* DPCD Field Address Mapping */ 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci/* Receiver Capability */ 10762306a36Sopenharmony_ci#define DP_DPCD_REV 0x000 10862306a36Sopenharmony_ci# define DP_DPCD_REV_10 0x10 10962306a36Sopenharmony_ci# define DP_DPCD_REV_11 0x11 11062306a36Sopenharmony_ci# define DP_DPCD_REV_12 0x12 11162306a36Sopenharmony_ci# define DP_DPCD_REV_13 0x13 11262306a36Sopenharmony_ci# define DP_DPCD_REV_14 0x14 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci#define DP_MAX_LINK_RATE 0x001 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci#define DP_MAX_LANE_COUNT 0x002 11762306a36Sopenharmony_ci# define DP_MAX_LANE_COUNT_MASK 0x1f 11862306a36Sopenharmony_ci# define DP_TPS3_SUPPORTED (1 << 6) /* 1.2 */ 11962306a36Sopenharmony_ci# define DP_ENHANCED_FRAME_CAP (1 << 7) 12062306a36Sopenharmony_ci 12162306a36Sopenharmony_ci#define DP_MAX_DOWNSPREAD 0x003 12262306a36Sopenharmony_ci# define DP_MAX_DOWNSPREAD_0_5 (1 << 0) 12362306a36Sopenharmony_ci# define DP_STREAM_REGENERATION_STATUS_CAP (1 << 1) /* 2.0 */ 12462306a36Sopenharmony_ci# define DP_NO_AUX_HANDSHAKE_LINK_TRAINING (1 << 6) 12562306a36Sopenharmony_ci# define DP_TPS4_SUPPORTED (1 << 7) 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci#define DP_NORP 0x004 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci#define DP_DOWNSTREAMPORT_PRESENT 0x005 13062306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_PRESENT (1 << 0) 13162306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_TYPE_MASK 0x06 13262306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_TYPE_DP (0 << 1) 13362306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_TYPE_ANALOG (1 << 1) 13462306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_TYPE_TMDS (2 << 1) 13562306a36Sopenharmony_ci# define DP_DWN_STRM_PORT_TYPE_OTHER (3 << 1) 13662306a36Sopenharmony_ci# define DP_FORMAT_CONVERSION (1 << 3) 13762306a36Sopenharmony_ci# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */ 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci#define DP_MAIN_LINK_CHANNEL_CODING 0x006 14062306a36Sopenharmony_ci# define DP_CAP_ANSI_8B10B (1 << 0) 14162306a36Sopenharmony_ci# define DP_CAP_ANSI_128B132B (1 << 1) /* 2.0 */ 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#define DP_DOWN_STREAM_PORT_COUNT 0x007 14462306a36Sopenharmony_ci# define DP_PORT_COUNT_MASK 0x0f 14562306a36Sopenharmony_ci# define DP_MSA_TIMING_PAR_IGNORED (1 << 6) /* eDP */ 14662306a36Sopenharmony_ci# define DP_OUI_SUPPORT (1 << 7) 14762306a36Sopenharmony_ci 14862306a36Sopenharmony_ci#define DP_RECEIVE_PORT_0_CAP_0 0x008 14962306a36Sopenharmony_ci# define DP_LOCAL_EDID_PRESENT (1 << 1) 15062306a36Sopenharmony_ci# define DP_ASSOCIATED_TO_PRECEDING_PORT (1 << 2) 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ci#define DP_RECEIVE_PORT_0_BUFFER_SIZE 0x009 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci#define DP_RECEIVE_PORT_1_CAP_0 0x00a 15562306a36Sopenharmony_ci#define DP_RECEIVE_PORT_1_BUFFER_SIZE 0x00b 15662306a36Sopenharmony_ci 15762306a36Sopenharmony_ci#define DP_I2C_SPEED_CAP 0x00c /* DPI */ 15862306a36Sopenharmony_ci# define DP_I2C_SPEED_1K 0x01 15962306a36Sopenharmony_ci# define DP_I2C_SPEED_5K 0x02 16062306a36Sopenharmony_ci# define DP_I2C_SPEED_10K 0x04 16162306a36Sopenharmony_ci# define DP_I2C_SPEED_100K 0x08 16262306a36Sopenharmony_ci# define DP_I2C_SPEED_400K 0x10 16362306a36Sopenharmony_ci# define DP_I2C_SPEED_1M 0x20 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci#define DP_EDP_CONFIGURATION_CAP 0x00d /* XXX 1.2? */ 16662306a36Sopenharmony_ci# define DP_ALTERNATE_SCRAMBLER_RESET_CAP (1 << 0) 16762306a36Sopenharmony_ci# define DP_FRAMING_CHANGE_CAP (1 << 1) 16862306a36Sopenharmony_ci# define DP_DPCD_DISPLAY_CONTROL_CAPABLE (1 << 3) /* edp v1.2 or higher */ 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci#define DP_TRAINING_AUX_RD_INTERVAL 0x00e /* XXX 1.2? */ 17162306a36Sopenharmony_ci# define DP_TRAINING_AUX_RD_MASK 0x7F /* DP 1.3 */ 17262306a36Sopenharmony_ci# define DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT (1 << 7) /* DP 1.3 */ 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci#define DP_ADAPTER_CAP 0x00f /* 1.2 */ 17562306a36Sopenharmony_ci# define DP_FORCE_LOAD_SENSE_CAP (1 << 0) 17662306a36Sopenharmony_ci# define DP_ALTERNATE_I2C_PATTERN_CAP (1 << 1) 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci#define DP_SUPPORTED_LINK_RATES 0x010 /* eDP 1.4 */ 17962306a36Sopenharmony_ci# define DP_MAX_SUPPORTED_RATES 8 /* 16-bit little-endian */ 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci/* Multiple stream transport */ 18262306a36Sopenharmony_ci#define DP_FAUX_CAP 0x020 /* 1.2 */ 18362306a36Sopenharmony_ci# define DP_FAUX_CAP_1 (1 << 0) 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci#define DP_SINK_VIDEO_FALLBACK_FORMATS 0x020 /* 2.0 */ 18662306a36Sopenharmony_ci# define DP_FALLBACK_1024x768_60HZ_24BPP (1 << 0) 18762306a36Sopenharmony_ci# define DP_FALLBACK_1280x720_60HZ_24BPP (1 << 1) 18862306a36Sopenharmony_ci# define DP_FALLBACK_1920x1080_60HZ_24BPP (1 << 2) 18962306a36Sopenharmony_ci 19062306a36Sopenharmony_ci#define DP_MSTM_CAP 0x021 /* 1.2 */ 19162306a36Sopenharmony_ci# define DP_MST_CAP (1 << 0) 19262306a36Sopenharmony_ci# define DP_SINGLE_STREAM_SIDEBAND_MSG (1 << 1) /* 2.0 */ 19362306a36Sopenharmony_ci 19462306a36Sopenharmony_ci#define DP_NUMBER_OF_AUDIO_ENDPOINTS 0x022 /* 1.2 */ 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci/* AV_SYNC_DATA_BLOCK 1.2 */ 19762306a36Sopenharmony_ci#define DP_AV_GRANULARITY 0x023 19862306a36Sopenharmony_ci# define DP_AG_FACTOR_MASK (0xf << 0) 19962306a36Sopenharmony_ci# define DP_AG_FACTOR_3MS (0 << 0) 20062306a36Sopenharmony_ci# define DP_AG_FACTOR_2MS (1 << 0) 20162306a36Sopenharmony_ci# define DP_AG_FACTOR_1MS (2 << 0) 20262306a36Sopenharmony_ci# define DP_AG_FACTOR_500US (3 << 0) 20362306a36Sopenharmony_ci# define DP_AG_FACTOR_200US (4 << 0) 20462306a36Sopenharmony_ci# define DP_AG_FACTOR_100US (5 << 0) 20562306a36Sopenharmony_ci# define DP_AG_FACTOR_10US (6 << 0) 20662306a36Sopenharmony_ci# define DP_AG_FACTOR_1US (7 << 0) 20762306a36Sopenharmony_ci# define DP_VG_FACTOR_MASK (0xf << 4) 20862306a36Sopenharmony_ci# define DP_VG_FACTOR_3MS (0 << 4) 20962306a36Sopenharmony_ci# define DP_VG_FACTOR_2MS (1 << 4) 21062306a36Sopenharmony_ci# define DP_VG_FACTOR_1MS (2 << 4) 21162306a36Sopenharmony_ci# define DP_VG_FACTOR_500US (3 << 4) 21262306a36Sopenharmony_ci# define DP_VG_FACTOR_200US (4 << 4) 21362306a36Sopenharmony_ci# define DP_VG_FACTOR_100US (5 << 4) 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_ci#define DP_AUD_DEC_LAT0 0x024 21662306a36Sopenharmony_ci#define DP_AUD_DEC_LAT1 0x025 21762306a36Sopenharmony_ci 21862306a36Sopenharmony_ci#define DP_AUD_PP_LAT0 0x026 21962306a36Sopenharmony_ci#define DP_AUD_PP_LAT1 0x027 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ci#define DP_VID_INTER_LAT 0x028 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_ci#define DP_VID_PROG_LAT 0x029 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci#define DP_REP_LAT 0x02a 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci#define DP_AUD_DEL_INS0 0x02b 22862306a36Sopenharmony_ci#define DP_AUD_DEL_INS1 0x02c 22962306a36Sopenharmony_ci#define DP_AUD_DEL_INS2 0x02d 23062306a36Sopenharmony_ci/* End of AV_SYNC_DATA_BLOCK */ 23162306a36Sopenharmony_ci 23262306a36Sopenharmony_ci#define DP_RECEIVER_ALPM_CAP 0x02e /* eDP 1.4 */ 23362306a36Sopenharmony_ci# define DP_ALPM_CAP (1 << 0) 23462306a36Sopenharmony_ci 23562306a36Sopenharmony_ci#define DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP 0x02f /* eDP 1.4 */ 23662306a36Sopenharmony_ci# define DP_AUX_FRAME_SYNC_CAP (1 << 0) 23762306a36Sopenharmony_ci 23862306a36Sopenharmony_ci#define DP_GUID 0x030 /* 1.2 */ 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci#define DP_DSC_SUPPORT 0x060 /* DP 1.4 */ 24162306a36Sopenharmony_ci# define DP_DSC_DECOMPRESSION_IS_SUPPORTED (1 << 0) 24262306a36Sopenharmony_ci# define DP_DSC_PASSTHROUGH_IS_SUPPORTED (1 << 1) 24362306a36Sopenharmony_ci# define DP_DSC_DYNAMIC_PPS_UPDATE_SUPPORT_COMP_TO_COMP (1 << 2) 24462306a36Sopenharmony_ci# define DP_DSC_DYNAMIC_PPS_UPDATE_SUPPORT_UNCOMP_TO_COMP (1 << 3) 24562306a36Sopenharmony_ci 24662306a36Sopenharmony_ci#define DP_DSC_REV 0x061 24762306a36Sopenharmony_ci# define DP_DSC_MAJOR_MASK (0xf << 0) 24862306a36Sopenharmony_ci# define DP_DSC_MINOR_MASK (0xf << 4) 24962306a36Sopenharmony_ci# define DP_DSC_MAJOR_SHIFT 0 25062306a36Sopenharmony_ci# define DP_DSC_MINOR_SHIFT 4 25162306a36Sopenharmony_ci 25262306a36Sopenharmony_ci#define DP_DSC_RC_BUF_BLK_SIZE 0x062 25362306a36Sopenharmony_ci# define DP_DSC_RC_BUF_BLK_SIZE_1 0x0 25462306a36Sopenharmony_ci# define DP_DSC_RC_BUF_BLK_SIZE_4 0x1 25562306a36Sopenharmony_ci# define DP_DSC_RC_BUF_BLK_SIZE_16 0x2 25662306a36Sopenharmony_ci# define DP_DSC_RC_BUF_BLK_SIZE_64 0x3 25762306a36Sopenharmony_ci 25862306a36Sopenharmony_ci#define DP_DSC_RC_BUF_SIZE 0x063 25962306a36Sopenharmony_ci 26062306a36Sopenharmony_ci#define DP_DSC_SLICE_CAP_1 0x064 26162306a36Sopenharmony_ci# define DP_DSC_1_PER_DP_DSC_SINK (1 << 0) 26262306a36Sopenharmony_ci# define DP_DSC_2_PER_DP_DSC_SINK (1 << 1) 26362306a36Sopenharmony_ci# define DP_DSC_4_PER_DP_DSC_SINK (1 << 3) 26462306a36Sopenharmony_ci# define DP_DSC_6_PER_DP_DSC_SINK (1 << 4) 26562306a36Sopenharmony_ci# define DP_DSC_8_PER_DP_DSC_SINK (1 << 5) 26662306a36Sopenharmony_ci# define DP_DSC_10_PER_DP_DSC_SINK (1 << 6) 26762306a36Sopenharmony_ci# define DP_DSC_12_PER_DP_DSC_SINK (1 << 7) 26862306a36Sopenharmony_ci 26962306a36Sopenharmony_ci#define DP_DSC_LINE_BUF_BIT_DEPTH 0x065 27062306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_MASK (0xf << 0) 27162306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_9 0x0 27262306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_10 0x1 27362306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_11 0x2 27462306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_12 0x3 27562306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_13 0x4 27662306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_14 0x5 27762306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_15 0x6 27862306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_16 0x7 27962306a36Sopenharmony_ci# define DP_DSC_LINE_BUF_BIT_DEPTH_8 0x8 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_ci#define DP_DSC_BLK_PREDICTION_SUPPORT 0x066 28262306a36Sopenharmony_ci# define DP_DSC_BLK_PREDICTION_IS_SUPPORTED (1 << 0) 28362306a36Sopenharmony_ci# define DP_DSC_RGB_COLOR_CONV_BYPASS_SUPPORT (1 << 1) 28462306a36Sopenharmony_ci 28562306a36Sopenharmony_ci#define DP_DSC_MAX_BITS_PER_PIXEL_LOW 0x067 /* eDP 1.4 */ 28662306a36Sopenharmony_ci 28762306a36Sopenharmony_ci#define DP_DSC_MAX_BITS_PER_PIXEL_HI 0x068 /* eDP 1.4 */ 28862306a36Sopenharmony_ci# define DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK (0x3 << 0) 28962306a36Sopenharmony_ci# define DP_DSC_MAX_BPP_DELTA_VERSION_MASK (0x3 << 5) /* eDP 1.5 & DP 2.0 */ 29062306a36Sopenharmony_ci# define DP_DSC_MAX_BPP_DELTA_AVAILABILITY (1 << 7) /* eDP 1.5 & DP 2.0 */ 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_ci#define DP_DSC_DEC_COLOR_FORMAT_CAP 0x069 29362306a36Sopenharmony_ci# define DP_DSC_RGB (1 << 0) 29462306a36Sopenharmony_ci# define DP_DSC_YCbCr444 (1 << 1) 29562306a36Sopenharmony_ci# define DP_DSC_YCbCr422_Simple (1 << 2) 29662306a36Sopenharmony_ci# define DP_DSC_YCbCr422_Native (1 << 3) 29762306a36Sopenharmony_ci# define DP_DSC_YCbCr420_Native (1 << 4) 29862306a36Sopenharmony_ci 29962306a36Sopenharmony_ci#define DP_DSC_DEC_COLOR_DEPTH_CAP 0x06A 30062306a36Sopenharmony_ci# define DP_DSC_8_BPC (1 << 1) 30162306a36Sopenharmony_ci# define DP_DSC_10_BPC (1 << 2) 30262306a36Sopenharmony_ci# define DP_DSC_12_BPC (1 << 3) 30362306a36Sopenharmony_ci 30462306a36Sopenharmony_ci#define DP_DSC_PEAK_THROUGHPUT 0x06B 30562306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_MASK (0xf << 0) 30662306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_SHIFT 0 30762306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_UNSUPPORTED 0 30862306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_340 (1 << 0) 30962306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_400 (2 << 0) 31062306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_450 (3 << 0) 31162306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_500 (4 << 0) 31262306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_550 (5 << 0) 31362306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_600 (6 << 0) 31462306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_650 (7 << 0) 31562306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_700 (8 << 0) 31662306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_750 (9 << 0) 31762306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_800 (10 << 0) 31862306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_850 (11 << 0) 31962306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_900 (12 << 0) 32062306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_950 (13 << 0) 32162306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_1000 (14 << 0) 32262306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_0_170 (15 << 0) /* 1.4a */ 32362306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_MASK (0xf << 4) 32462306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_SHIFT 4 32562306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_UNSUPPORTED 0 32662306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_340 (1 << 4) 32762306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_400 (2 << 4) 32862306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_450 (3 << 4) 32962306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_500 (4 << 4) 33062306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_550 (5 << 4) 33162306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_600 (6 << 4) 33262306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_650 (7 << 4) 33362306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_700 (8 << 4) 33462306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_750 (9 << 4) 33562306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_800 (10 << 4) 33662306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_850 (11 << 4) 33762306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_900 (12 << 4) 33862306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_950 (13 << 4) 33962306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_1000 (14 << 4) 34062306a36Sopenharmony_ci# define DP_DSC_THROUGHPUT_MODE_1_170 (15 << 4) 34162306a36Sopenharmony_ci 34262306a36Sopenharmony_ci#define DP_DSC_MAX_SLICE_WIDTH 0x06C 34362306a36Sopenharmony_ci#define DP_DSC_MIN_SLICE_WIDTH_VALUE 2560 34462306a36Sopenharmony_ci#define DP_DSC_SLICE_WIDTH_MULTIPLIER 320 34562306a36Sopenharmony_ci 34662306a36Sopenharmony_ci#define DP_DSC_SLICE_CAP_2 0x06D 34762306a36Sopenharmony_ci# define DP_DSC_16_PER_DP_DSC_SINK (1 << 0) 34862306a36Sopenharmony_ci# define DP_DSC_20_PER_DP_DSC_SINK (1 << 1) 34962306a36Sopenharmony_ci# define DP_DSC_24_PER_DP_DSC_SINK (1 << 2) 35062306a36Sopenharmony_ci 35162306a36Sopenharmony_ci#define DP_DSC_BITS_PER_PIXEL_INC 0x06F 35262306a36Sopenharmony_ci# define DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK 0x1f 35362306a36Sopenharmony_ci# define DP_DSC_RGB_YCbCr420_MAX_BPP_DELTA_MASK 0xe0 35462306a36Sopenharmony_ci# define DP_DSC_BITS_PER_PIXEL_1_16 0x0 35562306a36Sopenharmony_ci# define DP_DSC_BITS_PER_PIXEL_1_8 0x1 35662306a36Sopenharmony_ci# define DP_DSC_BITS_PER_PIXEL_1_4 0x2 35762306a36Sopenharmony_ci# define DP_DSC_BITS_PER_PIXEL_1_2 0x3 35862306a36Sopenharmony_ci# define DP_DSC_BITS_PER_PIXEL_1_1 0x4 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_ci#define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */ 36162306a36Sopenharmony_ci# define DP_PSR_IS_SUPPORTED 1 36262306a36Sopenharmony_ci# define DP_PSR2_IS_SUPPORTED 2 /* eDP 1.4 */ 36362306a36Sopenharmony_ci# define DP_PSR2_WITH_Y_COORD_IS_SUPPORTED 3 /* eDP 1.4a */ 36462306a36Sopenharmony_ci# define DP_PSR2_WITH_Y_COORD_ET_SUPPORTED 4 /* eDP 1.5, adopted eDP 1.4b SCR */ 36562306a36Sopenharmony_ci 36662306a36Sopenharmony_ci#define DP_PSR_CAPS 0x071 /* XXX 1.2? */ 36762306a36Sopenharmony_ci# define DP_PSR_NO_TRAIN_ON_EXIT 1 36862306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_330 (0 << 1) 36962306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_275 (1 << 1) 37062306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_220 (2 << 1) 37162306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_165 (3 << 1) 37262306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_110 (4 << 1) 37362306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_55 (5 << 1) 37462306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_0 (6 << 1) 37562306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_MASK (7 << 1) 37662306a36Sopenharmony_ci# define DP_PSR_SETUP_TIME_SHIFT 1 37762306a36Sopenharmony_ci# define DP_PSR2_SU_Y_COORDINATE_REQUIRED (1 << 4) /* eDP 1.4a */ 37862306a36Sopenharmony_ci# define DP_PSR2_SU_GRANULARITY_REQUIRED (1 << 5) /* eDP 1.4b */ 37962306a36Sopenharmony_ci# define DP_PSR2_SU_AUX_FRAME_SYNC_NOT_NEEDED (1 << 6)/* eDP 1.5, adopted eDP 1.4b SCR */ 38062306a36Sopenharmony_ci 38162306a36Sopenharmony_ci#define DP_PSR2_SU_X_GRANULARITY 0x072 /* eDP 1.4b */ 38262306a36Sopenharmony_ci#define DP_PSR2_SU_Y_GRANULARITY 0x074 /* eDP 1.4b */ 38362306a36Sopenharmony_ci 38462306a36Sopenharmony_ci/* 38562306a36Sopenharmony_ci * 0x80-0x8f describe downstream port capabilities, but there are two layouts 38662306a36Sopenharmony_ci * based on whether DP_DETAILED_CAP_INFO_AVAILABLE was set. If it was not, 38762306a36Sopenharmony_ci * each port's descriptor is one byte wide. If it was set, each port's is 38862306a36Sopenharmony_ci * four bytes wide, starting with the one byte from the base info. As of 38962306a36Sopenharmony_ci * DP interop v1.1a only VGA defines additional detail. 39062306a36Sopenharmony_ci */ 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci/* offset 0 */ 39362306a36Sopenharmony_ci#define DP_DOWNSTREAM_PORT_0 0x80 39462306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_MASK (7 << 0) 39562306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_DP 0 39662306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_VGA 1 39762306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_DVI 2 39862306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_HDMI 3 39962306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_NON_EDID 4 40062306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_DP_DUALMODE 5 40162306a36Sopenharmony_ci# define DP_DS_PORT_TYPE_WIRELESS 6 40262306a36Sopenharmony_ci# define DP_DS_PORT_HPD (1 << 3) 40362306a36Sopenharmony_ci# define DP_DS_NON_EDID_MASK (0xf << 4) 40462306a36Sopenharmony_ci# define DP_DS_NON_EDID_720x480i_60 (1 << 4) 40562306a36Sopenharmony_ci# define DP_DS_NON_EDID_720x480i_50 (2 << 4) 40662306a36Sopenharmony_ci# define DP_DS_NON_EDID_1920x1080i_60 (3 << 4) 40762306a36Sopenharmony_ci# define DP_DS_NON_EDID_1920x1080i_50 (4 << 4) 40862306a36Sopenharmony_ci# define DP_DS_NON_EDID_1280x720_60 (5 << 4) 40962306a36Sopenharmony_ci# define DP_DS_NON_EDID_1280x720_50 (7 << 4) 41062306a36Sopenharmony_ci/* offset 1 for VGA is maximum megapixels per second / 8 */ 41162306a36Sopenharmony_ci/* offset 1 for DVI/HDMI is maximum TMDS clock in Mbps / 2.5 */ 41262306a36Sopenharmony_ci/* offset 2 for VGA/DVI/HDMI */ 41362306a36Sopenharmony_ci# define DP_DS_MAX_BPC_MASK (3 << 0) 41462306a36Sopenharmony_ci# define DP_DS_8BPC 0 41562306a36Sopenharmony_ci# define DP_DS_10BPC 1 41662306a36Sopenharmony_ci# define DP_DS_12BPC 2 41762306a36Sopenharmony_ci# define DP_DS_16BPC 3 41862306a36Sopenharmony_ci/* HDMI2.1 PCON FRL CONFIGURATION */ 41962306a36Sopenharmony_ci# define DP_PCON_MAX_FRL_BW (7 << 2) 42062306a36Sopenharmony_ci# define DP_PCON_MAX_0GBPS (0 << 2) 42162306a36Sopenharmony_ci# define DP_PCON_MAX_9GBPS (1 << 2) 42262306a36Sopenharmony_ci# define DP_PCON_MAX_18GBPS (2 << 2) 42362306a36Sopenharmony_ci# define DP_PCON_MAX_24GBPS (3 << 2) 42462306a36Sopenharmony_ci# define DP_PCON_MAX_32GBPS (4 << 2) 42562306a36Sopenharmony_ci# define DP_PCON_MAX_40GBPS (5 << 2) 42662306a36Sopenharmony_ci# define DP_PCON_MAX_48GBPS (6 << 2) 42762306a36Sopenharmony_ci# define DP_PCON_SOURCE_CTL_MODE (1 << 5) 42862306a36Sopenharmony_ci 42962306a36Sopenharmony_ci/* offset 3 for DVI */ 43062306a36Sopenharmony_ci# define DP_DS_DVI_DUAL_LINK (1 << 1) 43162306a36Sopenharmony_ci# define DP_DS_DVI_HIGH_COLOR_DEPTH (1 << 2) 43262306a36Sopenharmony_ci/* offset 3 for HDMI */ 43362306a36Sopenharmony_ci# define DP_DS_HDMI_FRAME_SEQ_TO_FRAME_PACK (1 << 0) 43462306a36Sopenharmony_ci# define DP_DS_HDMI_YCBCR422_PASS_THROUGH (1 << 1) 43562306a36Sopenharmony_ci# define DP_DS_HDMI_YCBCR420_PASS_THROUGH (1 << 2) 43662306a36Sopenharmony_ci# define DP_DS_HDMI_YCBCR444_TO_422_CONV (1 << 3) 43762306a36Sopenharmony_ci# define DP_DS_HDMI_YCBCR444_TO_420_CONV (1 << 4) 43862306a36Sopenharmony_ci 43962306a36Sopenharmony_ci/* 44062306a36Sopenharmony_ci * VESA DP-to-HDMI PCON Specification adds caps for colorspace 44162306a36Sopenharmony_ci * conversion in DFP cap DPCD 83h. Sec6.1 Table-3. 44262306a36Sopenharmony_ci * Based on the available support the source can enable 44362306a36Sopenharmony_ci * color conversion by writing into PROTOCOL_COVERTER_CONTROL_2 44462306a36Sopenharmony_ci * DPCD 3052h. 44562306a36Sopenharmony_ci */ 44662306a36Sopenharmony_ci# define DP_DS_HDMI_BT601_RGB_YCBCR_CONV (1 << 5) 44762306a36Sopenharmony_ci# define DP_DS_HDMI_BT709_RGB_YCBCR_CONV (1 << 6) 44862306a36Sopenharmony_ci# define DP_DS_HDMI_BT2020_RGB_YCBCR_CONV (1 << 7) 44962306a36Sopenharmony_ci 45062306a36Sopenharmony_ci#define DP_MAX_DOWNSTREAM_PORTS 0x10 45162306a36Sopenharmony_ci 45262306a36Sopenharmony_ci/* DP Forward error Correction Registers */ 45362306a36Sopenharmony_ci#define DP_FEC_CAPABILITY 0x090 /* 1.4 */ 45462306a36Sopenharmony_ci# define DP_FEC_CAPABLE (1 << 0) 45562306a36Sopenharmony_ci# define DP_FEC_UNCORR_BLK_ERROR_COUNT_CAP (1 << 1) 45662306a36Sopenharmony_ci# define DP_FEC_CORR_BLK_ERROR_COUNT_CAP (1 << 2) 45762306a36Sopenharmony_ci# define DP_FEC_BIT_ERROR_COUNT_CAP (1 << 3) 45862306a36Sopenharmony_ci#define DP_FEC_CAPABILITY_1 0x091 /* 2.0 */ 45962306a36Sopenharmony_ci 46062306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC ENCODER SUPPORT */ 46162306a36Sopenharmony_ci#define DP_PCON_DSC_ENCODER_CAP_SIZE 0xD /* 0x92 through 0x9E */ 46262306a36Sopenharmony_ci#define DP_PCON_DSC_ENCODER 0x092 46362306a36Sopenharmony_ci# define DP_PCON_DSC_ENCODER_SUPPORTED (1 << 0) 46462306a36Sopenharmony_ci# define DP_PCON_DSC_PPS_ENC_OVERRIDE (1 << 1) 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC Version */ 46762306a36Sopenharmony_ci#define DP_PCON_DSC_VERSION 0x093 46862306a36Sopenharmony_ci# define DP_PCON_DSC_MAJOR_MASK (0xF << 0) 46962306a36Sopenharmony_ci# define DP_PCON_DSC_MINOR_MASK (0xF << 4) 47062306a36Sopenharmony_ci# define DP_PCON_DSC_MAJOR_SHIFT 0 47162306a36Sopenharmony_ci# define DP_PCON_DSC_MINOR_SHIFT 4 47262306a36Sopenharmony_ci 47362306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC RC Buffer block size */ 47462306a36Sopenharmony_ci#define DP_PCON_DSC_RC_BUF_BLK_INFO 0x094 47562306a36Sopenharmony_ci# define DP_PCON_DSC_RC_BUF_BLK_SIZE (0x3 << 0) 47662306a36Sopenharmony_ci# define DP_PCON_DSC_RC_BUF_BLK_1KB 0 47762306a36Sopenharmony_ci# define DP_PCON_DSC_RC_BUF_BLK_4KB 1 47862306a36Sopenharmony_ci# define DP_PCON_DSC_RC_BUF_BLK_16KB 2 47962306a36Sopenharmony_ci# define DP_PCON_DSC_RC_BUF_BLK_64KB 3 48062306a36Sopenharmony_ci 48162306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC RC Buffer size */ 48262306a36Sopenharmony_ci#define DP_PCON_DSC_RC_BUF_SIZE 0x095 48362306a36Sopenharmony_ci 48462306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC Slice capabilities-1 */ 48562306a36Sopenharmony_ci#define DP_PCON_DSC_SLICE_CAP_1 0x096 48662306a36Sopenharmony_ci# define DP_PCON_DSC_1_PER_DSC_ENC (0x1 << 0) 48762306a36Sopenharmony_ci# define DP_PCON_DSC_2_PER_DSC_ENC (0x1 << 1) 48862306a36Sopenharmony_ci# define DP_PCON_DSC_4_PER_DSC_ENC (0x1 << 3) 48962306a36Sopenharmony_ci# define DP_PCON_DSC_6_PER_DSC_ENC (0x1 << 4) 49062306a36Sopenharmony_ci# define DP_PCON_DSC_8_PER_DSC_ENC (0x1 << 5) 49162306a36Sopenharmony_ci# define DP_PCON_DSC_10_PER_DSC_ENC (0x1 << 6) 49262306a36Sopenharmony_ci# define DP_PCON_DSC_12_PER_DSC_ENC (0x1 << 7) 49362306a36Sopenharmony_ci 49462306a36Sopenharmony_ci#define DP_PCON_DSC_BUF_BIT_DEPTH 0x097 49562306a36Sopenharmony_ci# define DP_PCON_DSC_BIT_DEPTH_MASK (0xF << 0) 49662306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_9_BITS 0 49762306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_10_BITS 1 49862306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_11_BITS 2 49962306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_12_BITS 3 50062306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_13_BITS 4 50162306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_14_BITS 5 50262306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_15_BITS 6 50362306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_16_BITS 7 50462306a36Sopenharmony_ci# define DP_PCON_DSC_DEPTH_8_BITS 8 50562306a36Sopenharmony_ci 50662306a36Sopenharmony_ci#define DP_PCON_DSC_BLOCK_PREDICTION 0x098 50762306a36Sopenharmony_ci# define DP_PCON_DSC_BLOCK_PRED_SUPPORT (0x1 << 0) 50862306a36Sopenharmony_ci 50962306a36Sopenharmony_ci#define DP_PCON_DSC_ENC_COLOR_FMT_CAP 0x099 51062306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_RGB (0x1 << 0) 51162306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_YUV444 (0x1 << 1) 51262306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_YUV422_S (0x1 << 2) 51362306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_YUV422_N (0x1 << 3) 51462306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_YUV420_N (0x1 << 4) 51562306a36Sopenharmony_ci 51662306a36Sopenharmony_ci#define DP_PCON_DSC_ENC_COLOR_DEPTH_CAP 0x09A 51762306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_8BPC (0x1 << 1) 51862306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_10BPC (0x1 << 2) 51962306a36Sopenharmony_ci# define DP_PCON_DSC_ENC_12BPC (0x1 << 3) 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_ci#define DP_PCON_DSC_MAX_SLICE_WIDTH 0x09B 52262306a36Sopenharmony_ci 52362306a36Sopenharmony_ci/* DP-HDMI2.1 PCON DSC Slice capabilities-2 */ 52462306a36Sopenharmony_ci#define DP_PCON_DSC_SLICE_CAP_2 0x09C 52562306a36Sopenharmony_ci# define DP_PCON_DSC_16_PER_DSC_ENC (0x1 << 0) 52662306a36Sopenharmony_ci# define DP_PCON_DSC_20_PER_DSC_ENC (0x1 << 1) 52762306a36Sopenharmony_ci# define DP_PCON_DSC_24_PER_DSC_ENC (0x1 << 2) 52862306a36Sopenharmony_ci 52962306a36Sopenharmony_ci/* DP-HDMI2.1 PCON HDMI TX Encoder Bits/pixel increment */ 53062306a36Sopenharmony_ci#define DP_PCON_DSC_BPP_INCR 0x09E 53162306a36Sopenharmony_ci# define DP_PCON_DSC_BPP_INCR_MASK (0x7 << 0) 53262306a36Sopenharmony_ci# define DP_PCON_DSC_ONE_16TH_BPP 0 53362306a36Sopenharmony_ci# define DP_PCON_DSC_ONE_8TH_BPP 1 53462306a36Sopenharmony_ci# define DP_PCON_DSC_ONE_4TH_BPP 2 53562306a36Sopenharmony_ci# define DP_PCON_DSC_ONE_HALF_BPP 3 53662306a36Sopenharmony_ci# define DP_PCON_DSC_ONE_BPP 4 53762306a36Sopenharmony_ci 53862306a36Sopenharmony_ci/* DP Extended DSC Capabilities */ 53962306a36Sopenharmony_ci#define DP_DSC_BRANCH_OVERALL_THROUGHPUT_0 0x0a0 /* DP 1.4a SCR */ 54062306a36Sopenharmony_ci#define DP_DSC_BRANCH_OVERALL_THROUGHPUT_1 0x0a1 54162306a36Sopenharmony_ci#define DP_DSC_BRANCH_MAX_LINE_WIDTH 0x0a2 54262306a36Sopenharmony_ci 54362306a36Sopenharmony_ci/* DFP Capability Extension */ 54462306a36Sopenharmony_ci#define DP_DFP_CAPABILITY_EXTENSION_SUPPORT 0x0a3 /* 2.0 */ 54562306a36Sopenharmony_ci 54662306a36Sopenharmony_ci/* Link Configuration */ 54762306a36Sopenharmony_ci#define DP_LINK_BW_SET 0x100 54862306a36Sopenharmony_ci# define DP_LINK_RATE_TABLE 0x00 /* eDP 1.4 */ 54962306a36Sopenharmony_ci# define DP_LINK_BW_1_62 0x06 55062306a36Sopenharmony_ci# define DP_LINK_BW_2_7 0x0a 55162306a36Sopenharmony_ci# define DP_LINK_BW_5_4 0x14 /* 1.2 */ 55262306a36Sopenharmony_ci# define DP_LINK_BW_8_1 0x1e /* 1.4 */ 55362306a36Sopenharmony_ci# define DP_LINK_BW_10 0x01 /* 2.0 128b/132b Link Layer */ 55462306a36Sopenharmony_ci# define DP_LINK_BW_13_5 0x04 /* 2.0 128b/132b Link Layer */ 55562306a36Sopenharmony_ci# define DP_LINK_BW_20 0x02 /* 2.0 128b/132b Link Layer */ 55662306a36Sopenharmony_ci 55762306a36Sopenharmony_ci#define DP_LANE_COUNT_SET 0x101 55862306a36Sopenharmony_ci# define DP_LANE_COUNT_MASK 0x0f 55962306a36Sopenharmony_ci# define DP_LANE_COUNT_ENHANCED_FRAME_EN (1 << 7) 56062306a36Sopenharmony_ci 56162306a36Sopenharmony_ci#define DP_TRAINING_PATTERN_SET 0x102 56262306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_DISABLE 0 56362306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_1 1 56462306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_2 2 56562306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_2_CDS 3 /* 2.0 E11 */ 56662306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_3 3 /* 1.2 */ 56762306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_4 7 /* 1.4 */ 56862306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_MASK 0x3 56962306a36Sopenharmony_ci# define DP_TRAINING_PATTERN_MASK_1_4 0xf 57062306a36Sopenharmony_ci 57162306a36Sopenharmony_ci/* DPCD 1.1 only. For DPCD >= 1.2 see per-lane DP_LINK_QUAL_LANEn_SET */ 57262306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_11_DISABLE (0 << 2) 57362306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_11_D10_2 (1 << 2) 57462306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_11_ERROR_RATE (2 << 2) 57562306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_11_PRBS7 (3 << 2) 57662306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_11_MASK (3 << 2) 57762306a36Sopenharmony_ci 57862306a36Sopenharmony_ci# define DP_RECOVERED_CLOCK_OUT_EN (1 << 4) 57962306a36Sopenharmony_ci# define DP_LINK_SCRAMBLING_DISABLE (1 << 5) 58062306a36Sopenharmony_ci 58162306a36Sopenharmony_ci# define DP_SYMBOL_ERROR_COUNT_BOTH (0 << 6) 58262306a36Sopenharmony_ci# define DP_SYMBOL_ERROR_COUNT_DISPARITY (1 << 6) 58362306a36Sopenharmony_ci# define DP_SYMBOL_ERROR_COUNT_SYMBOL (2 << 6) 58462306a36Sopenharmony_ci# define DP_SYMBOL_ERROR_COUNT_MASK (3 << 6) 58562306a36Sopenharmony_ci 58662306a36Sopenharmony_ci#define DP_TRAINING_LANE0_SET 0x103 58762306a36Sopenharmony_ci#define DP_TRAINING_LANE1_SET 0x104 58862306a36Sopenharmony_ci#define DP_TRAINING_LANE2_SET 0x105 58962306a36Sopenharmony_ci#define DP_TRAINING_LANE3_SET 0x106 59062306a36Sopenharmony_ci 59162306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_MASK 0x3 59262306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_SHIFT 0 59362306a36Sopenharmony_ci# define DP_TRAIN_MAX_SWING_REACHED (1 << 2) 59462306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0 (0 << 0) 59562306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1 (1 << 0) 59662306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2 (2 << 0) 59762306a36Sopenharmony_ci# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3 (3 << 0) 59862306a36Sopenharmony_ci 59962306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPHASIS_MASK (3 << 3) 60062306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPH_LEVEL_0 (0 << 3) 60162306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPH_LEVEL_1 (1 << 3) 60262306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPH_LEVEL_2 (2 << 3) 60362306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPH_LEVEL_3 (3 << 3) 60462306a36Sopenharmony_ci 60562306a36Sopenharmony_ci# define DP_TRAIN_PRE_EMPHASIS_SHIFT 3 60662306a36Sopenharmony_ci# define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED (1 << 5) 60762306a36Sopenharmony_ci 60862306a36Sopenharmony_ci# define DP_TX_FFE_PRESET_VALUE_MASK (0xf << 0) /* 2.0 128b/132b Link Layer */ 60962306a36Sopenharmony_ci 61062306a36Sopenharmony_ci#define DP_DOWNSPREAD_CTRL 0x107 61162306a36Sopenharmony_ci# define DP_SPREAD_AMP_0_5 (1 << 4) 61262306a36Sopenharmony_ci# define DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE (1 << 6) 61362306a36Sopenharmony_ci# define DP_MSA_TIMING_PAR_IGNORE_EN (1 << 7) /* eDP */ 61462306a36Sopenharmony_ci 61562306a36Sopenharmony_ci#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 61662306a36Sopenharmony_ci# define DP_SET_ANSI_8B10B (1 << 0) 61762306a36Sopenharmony_ci# define DP_SET_ANSI_128B132B (1 << 1) 61862306a36Sopenharmony_ci 61962306a36Sopenharmony_ci#define DP_I2C_SPEED_CONTROL_STATUS 0x109 /* DPI */ 62062306a36Sopenharmony_ci/* bitmask as for DP_I2C_SPEED_CAP */ 62162306a36Sopenharmony_ci 62262306a36Sopenharmony_ci#define DP_EDP_CONFIGURATION_SET 0x10a /* XXX 1.2? */ 62362306a36Sopenharmony_ci# define DP_ALTERNATE_SCRAMBLER_RESET_ENABLE (1 << 0) 62462306a36Sopenharmony_ci# define DP_FRAMING_CHANGE_ENABLE (1 << 1) 62562306a36Sopenharmony_ci# define DP_PANEL_SELF_TEST_ENABLE (1 << 7) 62662306a36Sopenharmony_ci 62762306a36Sopenharmony_ci#define DP_LINK_QUAL_LANE0_SET 0x10b /* DPCD >= 1.2 */ 62862306a36Sopenharmony_ci#define DP_LINK_QUAL_LANE1_SET 0x10c 62962306a36Sopenharmony_ci#define DP_LINK_QUAL_LANE2_SET 0x10d 63062306a36Sopenharmony_ci#define DP_LINK_QUAL_LANE3_SET 0x10e 63162306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_DISABLE 0 63262306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_D10_2 1 63362306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_ERROR_RATE 2 63462306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRBS7 3 63562306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_80BIT_CUSTOM 4 63662306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_CP2520_PAT_1 5 63762306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_CP2520_PAT_2 6 63862306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_CP2520_PAT_3 7 63962306a36Sopenharmony_ci/* DP 2.0 UHBR10, UHBR13.5, UHBR20 */ 64062306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_128B132B_TPS1 0x08 64162306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_128B132B_TPS2 0x10 64262306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRSBS9 0x18 64362306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRSBS11 0x20 64462306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRSBS15 0x28 64562306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRSBS23 0x30 64662306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_PRSBS31 0x38 64762306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_CUSTOM 0x40 64862306a36Sopenharmony_ci# define DP_LINK_QUAL_PATTERN_SQUARE 0x48 64962306a36Sopenharmony_ci 65062306a36Sopenharmony_ci#define DP_TRAINING_LANE0_1_SET2 0x10f 65162306a36Sopenharmony_ci#define DP_TRAINING_LANE2_3_SET2 0x110 65262306a36Sopenharmony_ci# define DP_LANE02_POST_CURSOR2_SET_MASK (3 << 0) 65362306a36Sopenharmony_ci# define DP_LANE02_MAX_POST_CURSOR2_REACHED (1 << 2) 65462306a36Sopenharmony_ci# define DP_LANE13_POST_CURSOR2_SET_MASK (3 << 4) 65562306a36Sopenharmony_ci# define DP_LANE13_MAX_POST_CURSOR2_REACHED (1 << 6) 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_ci#define DP_MSTM_CTRL 0x111 /* 1.2 */ 65862306a36Sopenharmony_ci# define DP_MST_EN (1 << 0) 65962306a36Sopenharmony_ci# define DP_UP_REQ_EN (1 << 1) 66062306a36Sopenharmony_ci# define DP_UPSTREAM_IS_SRC (1 << 2) 66162306a36Sopenharmony_ci 66262306a36Sopenharmony_ci#define DP_AUDIO_DELAY0 0x112 /* 1.2 */ 66362306a36Sopenharmony_ci#define DP_AUDIO_DELAY1 0x113 66462306a36Sopenharmony_ci#define DP_AUDIO_DELAY2 0x114 66562306a36Sopenharmony_ci 66662306a36Sopenharmony_ci#define DP_LINK_RATE_SET 0x115 /* eDP 1.4 */ 66762306a36Sopenharmony_ci# define DP_LINK_RATE_SET_SHIFT 0 66862306a36Sopenharmony_ci# define DP_LINK_RATE_SET_MASK (7 << 0) 66962306a36Sopenharmony_ci 67062306a36Sopenharmony_ci#define DP_RECEIVER_ALPM_CONFIG 0x116 /* eDP 1.4 */ 67162306a36Sopenharmony_ci# define DP_ALPM_ENABLE (1 << 0) 67262306a36Sopenharmony_ci# define DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE (1 << 1) 67362306a36Sopenharmony_ci 67462306a36Sopenharmony_ci#define DP_SINK_DEVICE_AUX_FRAME_SYNC_CONF 0x117 /* eDP 1.4 */ 67562306a36Sopenharmony_ci# define DP_AUX_FRAME_SYNC_ENABLE (1 << 0) 67662306a36Sopenharmony_ci# define DP_IRQ_HPD_ENABLE (1 << 1) 67762306a36Sopenharmony_ci 67862306a36Sopenharmony_ci#define DP_UPSTREAM_DEVICE_DP_PWR_NEED 0x118 /* 1.2 */ 67962306a36Sopenharmony_ci# define DP_PWR_NOT_NEEDED (1 << 0) 68062306a36Sopenharmony_ci 68162306a36Sopenharmony_ci#define DP_FEC_CONFIGURATION 0x120 /* 1.4 */ 68262306a36Sopenharmony_ci# define DP_FEC_READY (1 << 0) 68362306a36Sopenharmony_ci# define DP_FEC_ERR_COUNT_SEL_MASK (7 << 1) 68462306a36Sopenharmony_ci# define DP_FEC_ERR_COUNT_DIS (0 << 1) 68562306a36Sopenharmony_ci# define DP_FEC_UNCORR_BLK_ERROR_COUNT (1 << 1) 68662306a36Sopenharmony_ci# define DP_FEC_CORR_BLK_ERROR_COUNT (2 << 1) 68762306a36Sopenharmony_ci# define DP_FEC_BIT_ERROR_COUNT (3 << 1) 68862306a36Sopenharmony_ci# define DP_FEC_LANE_SELECT_MASK (3 << 4) 68962306a36Sopenharmony_ci# define DP_FEC_LANE_0_SELECT (0 << 4) 69062306a36Sopenharmony_ci# define DP_FEC_LANE_1_SELECT (1 << 4) 69162306a36Sopenharmony_ci# define DP_FEC_LANE_2_SELECT (2 << 4) 69262306a36Sopenharmony_ci# define DP_FEC_LANE_3_SELECT (3 << 4) 69362306a36Sopenharmony_ci 69462306a36Sopenharmony_ci#define DP_SDP_ERROR_DETECTION_CONFIGURATION 0x121 /* DP 2.0 E11 */ 69562306a36Sopenharmony_ci#define DP_SDP_CRC16_128B132B_EN BIT(0) 69662306a36Sopenharmony_ci 69762306a36Sopenharmony_ci#define DP_AUX_FRAME_SYNC_VALUE 0x15c /* eDP 1.4 */ 69862306a36Sopenharmony_ci# define DP_AUX_FRAME_SYNC_VALID (1 << 0) 69962306a36Sopenharmony_ci 70062306a36Sopenharmony_ci#define DP_DSC_ENABLE 0x160 /* DP 1.4 */ 70162306a36Sopenharmony_ci# define DP_DECOMPRESSION_EN (1 << 0) 70262306a36Sopenharmony_ci#define DP_DSC_CONFIGURATION 0x161 /* DP 2.0 */ 70362306a36Sopenharmony_ci 70462306a36Sopenharmony_ci#define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */ 70562306a36Sopenharmony_ci# define DP_PSR_ENABLE BIT(0) 70662306a36Sopenharmony_ci# define DP_PSR_MAIN_LINK_ACTIVE BIT(1) 70762306a36Sopenharmony_ci# define DP_PSR_CRC_VERIFICATION BIT(2) 70862306a36Sopenharmony_ci# define DP_PSR_FRAME_CAPTURE BIT(3) 70962306a36Sopenharmony_ci# define DP_PSR_SU_REGION_SCANLINE_CAPTURE BIT(4) /* eDP 1.4a */ 71062306a36Sopenharmony_ci# define DP_PSR_IRQ_HPD_WITH_CRC_ERRORS BIT(5) /* eDP 1.4a */ 71162306a36Sopenharmony_ci# define DP_PSR_ENABLE_PSR2 BIT(6) /* eDP 1.4a */ 71262306a36Sopenharmony_ci 71362306a36Sopenharmony_ci#define DP_ADAPTER_CTRL 0x1a0 71462306a36Sopenharmony_ci# define DP_ADAPTER_CTRL_FORCE_LOAD_SENSE (1 << 0) 71562306a36Sopenharmony_ci 71662306a36Sopenharmony_ci#define DP_BRANCH_DEVICE_CTRL 0x1a1 71762306a36Sopenharmony_ci# define DP_BRANCH_DEVICE_IRQ_HPD (1 << 0) 71862306a36Sopenharmony_ci 71962306a36Sopenharmony_ci#define DP_PAYLOAD_ALLOCATE_SET 0x1c0 72062306a36Sopenharmony_ci#define DP_PAYLOAD_ALLOCATE_START_TIME_SLOT 0x1c1 72162306a36Sopenharmony_ci#define DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT 0x1c2 72262306a36Sopenharmony_ci 72362306a36Sopenharmony_ci/* Link/Sink Device Status */ 72462306a36Sopenharmony_ci#define DP_SINK_COUNT 0x200 72562306a36Sopenharmony_ci/* prior to 1.2 bit 7 was reserved mbz */ 72662306a36Sopenharmony_ci# define DP_GET_SINK_COUNT(x) ((((x) & 0x80) >> 1) | ((x) & 0x3f)) 72762306a36Sopenharmony_ci# define DP_SINK_CP_READY (1 << 6) 72862306a36Sopenharmony_ci 72962306a36Sopenharmony_ci#define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201 73062306a36Sopenharmony_ci# define DP_REMOTE_CONTROL_COMMAND_PENDING (1 << 0) 73162306a36Sopenharmony_ci# define DP_AUTOMATED_TEST_REQUEST (1 << 1) 73262306a36Sopenharmony_ci# define DP_CP_IRQ (1 << 2) 73362306a36Sopenharmony_ci# define DP_MCCS_IRQ (1 << 3) 73462306a36Sopenharmony_ci# define DP_DOWN_REP_MSG_RDY (1 << 4) /* 1.2 MST */ 73562306a36Sopenharmony_ci# define DP_UP_REQ_MSG_RDY (1 << 5) /* 1.2 MST */ 73662306a36Sopenharmony_ci# define DP_SINK_SPECIFIC_IRQ (1 << 6) 73762306a36Sopenharmony_ci 73862306a36Sopenharmony_ci#define DP_LANE0_1_STATUS 0x202 73962306a36Sopenharmony_ci#define DP_LANE2_3_STATUS 0x203 74062306a36Sopenharmony_ci# define DP_LANE_CR_DONE (1 << 0) 74162306a36Sopenharmony_ci# define DP_LANE_CHANNEL_EQ_DONE (1 << 1) 74262306a36Sopenharmony_ci# define DP_LANE_SYMBOL_LOCKED (1 << 2) 74362306a36Sopenharmony_ci 74462306a36Sopenharmony_ci#define DP_CHANNEL_EQ_BITS (DP_LANE_CR_DONE | \ 74562306a36Sopenharmony_ci DP_LANE_CHANNEL_EQ_DONE | \ 74662306a36Sopenharmony_ci DP_LANE_SYMBOL_LOCKED) 74762306a36Sopenharmony_ci 74862306a36Sopenharmony_ci#define DP_LANE_ALIGN_STATUS_UPDATED 0x204 74962306a36Sopenharmony_ci#define DP_INTERLANE_ALIGN_DONE (1 << 0) 75062306a36Sopenharmony_ci#define DP_128B132B_DPRX_EQ_INTERLANE_ALIGN_DONE (1 << 2) /* 2.0 E11 */ 75162306a36Sopenharmony_ci#define DP_128B132B_DPRX_CDS_INTERLANE_ALIGN_DONE (1 << 3) /* 2.0 E11 */ 75262306a36Sopenharmony_ci#define DP_128B132B_LT_FAILED (1 << 4) /* 2.0 E11 */ 75362306a36Sopenharmony_ci#define DP_DOWNSTREAM_PORT_STATUS_CHANGED (1 << 6) 75462306a36Sopenharmony_ci#define DP_LINK_STATUS_UPDATED (1 << 7) 75562306a36Sopenharmony_ci 75662306a36Sopenharmony_ci#define DP_SINK_STATUS 0x205 75762306a36Sopenharmony_ci# define DP_RECEIVE_PORT_0_STATUS (1 << 0) 75862306a36Sopenharmony_ci# define DP_RECEIVE_PORT_1_STATUS (1 << 1) 75962306a36Sopenharmony_ci# define DP_STREAM_REGENERATION_STATUS (1 << 2) /* 2.0 */ 76062306a36Sopenharmony_ci# define DP_INTRA_HOP_AUX_REPLY_INDICATION (1 << 3) /* 2.0 */ 76162306a36Sopenharmony_ci 76262306a36Sopenharmony_ci#define DP_ADJUST_REQUEST_LANE0_1 0x206 76362306a36Sopenharmony_ci#define DP_ADJUST_REQUEST_LANE2_3 0x207 76462306a36Sopenharmony_ci# define DP_ADJUST_VOLTAGE_SWING_LANE0_MASK 0x03 76562306a36Sopenharmony_ci# define DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT 0 76662306a36Sopenharmony_ci# define DP_ADJUST_PRE_EMPHASIS_LANE0_MASK 0x0c 76762306a36Sopenharmony_ci# define DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT 2 76862306a36Sopenharmony_ci# define DP_ADJUST_VOLTAGE_SWING_LANE1_MASK 0x30 76962306a36Sopenharmony_ci# define DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT 4 77062306a36Sopenharmony_ci# define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 77162306a36Sopenharmony_ci# define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 77262306a36Sopenharmony_ci 77362306a36Sopenharmony_ci/* DP 2.0 128b/132b Link Layer */ 77462306a36Sopenharmony_ci# define DP_ADJUST_TX_FFE_PRESET_LANE0_MASK (0xf << 0) 77562306a36Sopenharmony_ci# define DP_ADJUST_TX_FFE_PRESET_LANE0_SHIFT 0 77662306a36Sopenharmony_ci# define DP_ADJUST_TX_FFE_PRESET_LANE1_MASK (0xf << 4) 77762306a36Sopenharmony_ci# define DP_ADJUST_TX_FFE_PRESET_LANE1_SHIFT 4 77862306a36Sopenharmony_ci 77962306a36Sopenharmony_ci#define DP_ADJUST_REQUEST_POST_CURSOR2 0x20c 78062306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE0_MASK 0x03 78162306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE0_SHIFT 0 78262306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE1_MASK 0x0c 78362306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE1_SHIFT 2 78462306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE2_MASK 0x30 78562306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE2_SHIFT 4 78662306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE3_MASK 0xc0 78762306a36Sopenharmony_ci# define DP_ADJUST_POST_CURSOR2_LANE3_SHIFT 6 78862306a36Sopenharmony_ci 78962306a36Sopenharmony_ci#define DP_TEST_REQUEST 0x218 79062306a36Sopenharmony_ci# define DP_TEST_LINK_TRAINING (1 << 0) 79162306a36Sopenharmony_ci# define DP_TEST_LINK_VIDEO_PATTERN (1 << 1) 79262306a36Sopenharmony_ci# define DP_TEST_LINK_EDID_READ (1 << 2) 79362306a36Sopenharmony_ci# define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */ 79462306a36Sopenharmony_ci# define DP_TEST_LINK_FAUX_PATTERN (1 << 4) /* DPCD >= 1.2 */ 79562306a36Sopenharmony_ci# define DP_TEST_LINK_AUDIO_PATTERN (1 << 5) /* DPCD >= 1.2 */ 79662306a36Sopenharmony_ci# define DP_TEST_LINK_AUDIO_DISABLED_VIDEO (1 << 6) /* DPCD >= 1.2 */ 79762306a36Sopenharmony_ci 79862306a36Sopenharmony_ci#define DP_TEST_LINK_RATE 0x219 79962306a36Sopenharmony_ci# define DP_LINK_RATE_162 (0x6) 80062306a36Sopenharmony_ci# define DP_LINK_RATE_27 (0xa) 80162306a36Sopenharmony_ci 80262306a36Sopenharmony_ci#define DP_TEST_LANE_COUNT 0x220 80362306a36Sopenharmony_ci 80462306a36Sopenharmony_ci#define DP_TEST_PATTERN 0x221 80562306a36Sopenharmony_ci# define DP_NO_TEST_PATTERN 0x0 80662306a36Sopenharmony_ci# define DP_COLOR_RAMP 0x1 80762306a36Sopenharmony_ci# define DP_BLACK_AND_WHITE_VERTICAL_LINES 0x2 80862306a36Sopenharmony_ci# define DP_COLOR_SQUARE 0x3 80962306a36Sopenharmony_ci 81062306a36Sopenharmony_ci#define DP_TEST_H_TOTAL_HI 0x222 81162306a36Sopenharmony_ci#define DP_TEST_H_TOTAL_LO 0x223 81262306a36Sopenharmony_ci 81362306a36Sopenharmony_ci#define DP_TEST_V_TOTAL_HI 0x224 81462306a36Sopenharmony_ci#define DP_TEST_V_TOTAL_LO 0x225 81562306a36Sopenharmony_ci 81662306a36Sopenharmony_ci#define DP_TEST_H_START_HI 0x226 81762306a36Sopenharmony_ci#define DP_TEST_H_START_LO 0x227 81862306a36Sopenharmony_ci 81962306a36Sopenharmony_ci#define DP_TEST_V_START_HI 0x228 82062306a36Sopenharmony_ci#define DP_TEST_V_START_LO 0x229 82162306a36Sopenharmony_ci 82262306a36Sopenharmony_ci#define DP_TEST_HSYNC_HI 0x22A 82362306a36Sopenharmony_ci# define DP_TEST_HSYNC_POLARITY (1 << 7) 82462306a36Sopenharmony_ci# define DP_TEST_HSYNC_WIDTH_HI_MASK (127 << 0) 82562306a36Sopenharmony_ci#define DP_TEST_HSYNC_WIDTH_LO 0x22B 82662306a36Sopenharmony_ci 82762306a36Sopenharmony_ci#define DP_TEST_VSYNC_HI 0x22C 82862306a36Sopenharmony_ci# define DP_TEST_VSYNC_POLARITY (1 << 7) 82962306a36Sopenharmony_ci# define DP_TEST_VSYNC_WIDTH_HI_MASK (127 << 0) 83062306a36Sopenharmony_ci#define DP_TEST_VSYNC_WIDTH_LO 0x22D 83162306a36Sopenharmony_ci 83262306a36Sopenharmony_ci#define DP_TEST_H_WIDTH_HI 0x22E 83362306a36Sopenharmony_ci#define DP_TEST_H_WIDTH_LO 0x22F 83462306a36Sopenharmony_ci 83562306a36Sopenharmony_ci#define DP_TEST_V_HEIGHT_HI 0x230 83662306a36Sopenharmony_ci#define DP_TEST_V_HEIGHT_LO 0x231 83762306a36Sopenharmony_ci 83862306a36Sopenharmony_ci#define DP_TEST_MISC0 0x232 83962306a36Sopenharmony_ci# define DP_TEST_SYNC_CLOCK (1 << 0) 84062306a36Sopenharmony_ci# define DP_TEST_COLOR_FORMAT_MASK (3 << 1) 84162306a36Sopenharmony_ci# define DP_TEST_COLOR_FORMAT_SHIFT 1 84262306a36Sopenharmony_ci# define DP_COLOR_FORMAT_RGB (0 << 1) 84362306a36Sopenharmony_ci# define DP_COLOR_FORMAT_YCbCr422 (1 << 1) 84462306a36Sopenharmony_ci# define DP_COLOR_FORMAT_YCbCr444 (2 << 1) 84562306a36Sopenharmony_ci# define DP_TEST_DYNAMIC_RANGE_VESA (0 << 3) 84662306a36Sopenharmony_ci# define DP_TEST_DYNAMIC_RANGE_CEA (1 << 3) 84762306a36Sopenharmony_ci# define DP_TEST_YCBCR_COEFFICIENTS (1 << 4) 84862306a36Sopenharmony_ci# define DP_YCBCR_COEFFICIENTS_ITU601 (0 << 4) 84962306a36Sopenharmony_ci# define DP_YCBCR_COEFFICIENTS_ITU709 (1 << 4) 85062306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_MASK (7 << 5) 85162306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_SHIFT 5 85262306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_6 (0 << 5) 85362306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_8 (1 << 5) 85462306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_10 (2 << 5) 85562306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_12 (3 << 5) 85662306a36Sopenharmony_ci# define DP_TEST_BIT_DEPTH_16 (4 << 5) 85762306a36Sopenharmony_ci 85862306a36Sopenharmony_ci#define DP_TEST_MISC1 0x233 85962306a36Sopenharmony_ci# define DP_TEST_REFRESH_DENOMINATOR (1 << 0) 86062306a36Sopenharmony_ci# define DP_TEST_INTERLACED (1 << 1) 86162306a36Sopenharmony_ci 86262306a36Sopenharmony_ci#define DP_TEST_REFRESH_RATE_NUMERATOR 0x234 86362306a36Sopenharmony_ci 86462306a36Sopenharmony_ci#define DP_TEST_MISC0 0x232 86562306a36Sopenharmony_ci 86662306a36Sopenharmony_ci#define DP_TEST_CRC_R_CR 0x240 86762306a36Sopenharmony_ci#define DP_TEST_CRC_G_Y 0x242 86862306a36Sopenharmony_ci#define DP_TEST_CRC_B_CB 0x244 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci#define DP_TEST_SINK_MISC 0x246 87162306a36Sopenharmony_ci# define DP_TEST_CRC_SUPPORTED (1 << 5) 87262306a36Sopenharmony_ci# define DP_TEST_COUNT_MASK 0xf 87362306a36Sopenharmony_ci 87462306a36Sopenharmony_ci#define DP_PHY_TEST_PATTERN 0x248 87562306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_SEL_MASK 0x7 87662306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_NONE 0x0 87762306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_D10_2 0x1 87862306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_ERROR_COUNT 0x2 87962306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_PRBS7 0x3 88062306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_80BIT_CUSTOM 0x4 88162306a36Sopenharmony_ci# define DP_PHY_TEST_PATTERN_CP2520 0x5 88262306a36Sopenharmony_ci 88362306a36Sopenharmony_ci#define DP_PHY_SQUARE_PATTERN 0x249 88462306a36Sopenharmony_ci 88562306a36Sopenharmony_ci#define DP_TEST_HBR2_SCRAMBLER_RESET 0x24A 88662306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_7_0 0x250 88762306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_15_8 0x251 88862306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_23_16 0x252 88962306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_31_24 0x253 89062306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_39_32 0x254 89162306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_47_40 0x255 89262306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_55_48 0x256 89362306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_63_56 0x257 89462306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_71_64 0x258 89562306a36Sopenharmony_ci#define DP_TEST_80BIT_CUSTOM_PATTERN_79_72 0x259 89662306a36Sopenharmony_ci 89762306a36Sopenharmony_ci#define DP_TEST_RESPONSE 0x260 89862306a36Sopenharmony_ci# define DP_TEST_ACK (1 << 0) 89962306a36Sopenharmony_ci# define DP_TEST_NAK (1 << 1) 90062306a36Sopenharmony_ci# define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) 90162306a36Sopenharmony_ci 90262306a36Sopenharmony_ci#define DP_TEST_EDID_CHECKSUM 0x261 90362306a36Sopenharmony_ci 90462306a36Sopenharmony_ci#define DP_TEST_SINK 0x270 90562306a36Sopenharmony_ci# define DP_TEST_SINK_START (1 << 0) 90662306a36Sopenharmony_ci#define DP_TEST_AUDIO_MODE 0x271 90762306a36Sopenharmony_ci#define DP_TEST_AUDIO_PATTERN_TYPE 0x272 90862306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH1 0x273 90962306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH2 0x274 91062306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH3 0x275 91162306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH4 0x276 91262306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH5 0x277 91362306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH6 0x278 91462306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH7 0x279 91562306a36Sopenharmony_ci#define DP_TEST_AUDIO_PERIOD_CH8 0x27A 91662306a36Sopenharmony_ci 91762306a36Sopenharmony_ci#define DP_FEC_STATUS 0x280 /* 1.4 */ 91862306a36Sopenharmony_ci# define DP_FEC_DECODE_EN_DETECTED (1 << 0) 91962306a36Sopenharmony_ci# define DP_FEC_DECODE_DIS_DETECTED (1 << 1) 92062306a36Sopenharmony_ci 92162306a36Sopenharmony_ci#define DP_FEC_ERROR_COUNT_LSB 0x0281 /* 1.4 */ 92262306a36Sopenharmony_ci 92362306a36Sopenharmony_ci#define DP_FEC_ERROR_COUNT_MSB 0x0282 /* 1.4 */ 92462306a36Sopenharmony_ci# define DP_FEC_ERROR_COUNT_MASK 0x7F 92562306a36Sopenharmony_ci# define DP_FEC_ERR_COUNT_VALID (1 << 7) 92662306a36Sopenharmony_ci 92762306a36Sopenharmony_ci#define DP_PAYLOAD_TABLE_UPDATE_STATUS 0x2c0 /* 1.2 MST */ 92862306a36Sopenharmony_ci# define DP_PAYLOAD_TABLE_UPDATED (1 << 0) 92962306a36Sopenharmony_ci# define DP_PAYLOAD_ACT_HANDLED (1 << 1) 93062306a36Sopenharmony_ci 93162306a36Sopenharmony_ci#define DP_VC_PAYLOAD_ID_SLOT_1 0x2c1 /* 1.2 MST */ 93262306a36Sopenharmony_ci/* up to ID_SLOT_63 at 0x2ff */ 93362306a36Sopenharmony_ci 93462306a36Sopenharmony_ci/* Source Device-specific */ 93562306a36Sopenharmony_ci#define DP_SOURCE_OUI 0x300 93662306a36Sopenharmony_ci 93762306a36Sopenharmony_ci/* Sink Device-specific */ 93862306a36Sopenharmony_ci#define DP_SINK_OUI 0x400 93962306a36Sopenharmony_ci 94062306a36Sopenharmony_ci/* Branch Device-specific */ 94162306a36Sopenharmony_ci#define DP_BRANCH_OUI 0x500 94262306a36Sopenharmony_ci#define DP_BRANCH_ID 0x503 94362306a36Sopenharmony_ci#define DP_BRANCH_REVISION_START 0x509 94462306a36Sopenharmony_ci#define DP_BRANCH_HW_REV 0x509 94562306a36Sopenharmony_ci#define DP_BRANCH_SW_REV 0x50A 94662306a36Sopenharmony_ci 94762306a36Sopenharmony_ci/* Link/Sink Device Power Control */ 94862306a36Sopenharmony_ci#define DP_SET_POWER 0x600 94962306a36Sopenharmony_ci# define DP_SET_POWER_D0 0x1 95062306a36Sopenharmony_ci# define DP_SET_POWER_D3 0x2 95162306a36Sopenharmony_ci# define DP_SET_POWER_MASK 0x3 95262306a36Sopenharmony_ci# define DP_SET_POWER_D3_AUX_ON 0x5 95362306a36Sopenharmony_ci 95462306a36Sopenharmony_ci/* eDP-specific */ 95562306a36Sopenharmony_ci#define DP_EDP_DPCD_REV 0x700 /* eDP 1.2 */ 95662306a36Sopenharmony_ci# define DP_EDP_11 0x00 95762306a36Sopenharmony_ci# define DP_EDP_12 0x01 95862306a36Sopenharmony_ci# define DP_EDP_13 0x02 95962306a36Sopenharmony_ci# define DP_EDP_14 0x03 96062306a36Sopenharmony_ci# define DP_EDP_14a 0x04 /* eDP 1.4a */ 96162306a36Sopenharmony_ci# define DP_EDP_14b 0x05 /* eDP 1.4b */ 96262306a36Sopenharmony_ci 96362306a36Sopenharmony_ci#define DP_EDP_GENERAL_CAP_1 0x701 96462306a36Sopenharmony_ci# define DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP (1 << 0) 96562306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_PIN_ENABLE_CAP (1 << 1) 96662306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_AUX_ENABLE_CAP (1 << 2) 96762306a36Sopenharmony_ci# define DP_EDP_PANEL_SELF_TEST_PIN_ENABLE_CAP (1 << 3) 96862306a36Sopenharmony_ci# define DP_EDP_PANEL_SELF_TEST_AUX_ENABLE_CAP (1 << 4) 96962306a36Sopenharmony_ci# define DP_EDP_FRC_ENABLE_CAP (1 << 5) 97062306a36Sopenharmony_ci# define DP_EDP_COLOR_ENGINE_CAP (1 << 6) 97162306a36Sopenharmony_ci# define DP_EDP_SET_POWER_CAP (1 << 7) 97262306a36Sopenharmony_ci 97362306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_ADJUSTMENT_CAP 0x702 97462306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP (1 << 0) 97562306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP (1 << 1) 97662306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT (1 << 2) 97762306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_AUX_PWM_PRODUCT_CAP (1 << 3) 97862306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_FREQ_PWM_PIN_PASSTHRU_CAP (1 << 4) 97962306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP (1 << 5) 98062306a36Sopenharmony_ci# define DP_EDP_DYNAMIC_BACKLIGHT_CAP (1 << 6) 98162306a36Sopenharmony_ci# define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP (1 << 7) 98262306a36Sopenharmony_ci 98362306a36Sopenharmony_ci#define DP_EDP_GENERAL_CAP_2 0x703 98462306a36Sopenharmony_ci# define DP_EDP_OVERDRIVE_ENGINE_ENABLED (1 << 0) 98562306a36Sopenharmony_ci# define DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE (1 << 4) 98662306a36Sopenharmony_ci 98762306a36Sopenharmony_ci#define DP_EDP_GENERAL_CAP_3 0x704 /* eDP 1.4 */ 98862306a36Sopenharmony_ci# define DP_EDP_X_REGION_CAP_MASK (0xf << 0) 98962306a36Sopenharmony_ci# define DP_EDP_X_REGION_CAP_SHIFT 0 99062306a36Sopenharmony_ci# define DP_EDP_Y_REGION_CAP_MASK (0xf << 4) 99162306a36Sopenharmony_ci# define DP_EDP_Y_REGION_CAP_SHIFT 4 99262306a36Sopenharmony_ci 99362306a36Sopenharmony_ci#define DP_EDP_DISPLAY_CONTROL_REGISTER 0x720 99462306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_ENABLE (1 << 0) 99562306a36Sopenharmony_ci# define DP_EDP_BLACK_VIDEO_ENABLE (1 << 1) 99662306a36Sopenharmony_ci# define DP_EDP_FRC_ENABLE (1 << 2) 99762306a36Sopenharmony_ci# define DP_EDP_COLOR_ENGINE_ENABLE (1 << 3) 99862306a36Sopenharmony_ci# define DP_EDP_VBLANK_BACKLIGHT_UPDATE_ENABLE (1 << 7) 99962306a36Sopenharmony_ci 100062306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_MODE_SET_REGISTER 0x721 100162306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_CONTROL_MODE_MASK (3 << 0) 100262306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_CONTROL_MODE_PWM (0 << 0) 100362306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET (1 << 0) 100462306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD (2 << 0) 100562306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_CONTROL_MODE_PRODUCT (3 << 0) 100662306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_FREQ_PWM_PIN_PASSTHRU_ENABLE (1 << 2) 100762306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE (1 << 3) 100862306a36Sopenharmony_ci# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE (1 << 4) 100962306a36Sopenharmony_ci# define DP_EDP_REGIONAL_BACKLIGHT_ENABLE (1 << 5) 101062306a36Sopenharmony_ci# define DP_EDP_UPDATE_REGION_BRIGHTNESS (1 << 6) /* eDP 1.4 */ 101162306a36Sopenharmony_ci# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1 << 7) 101262306a36Sopenharmony_ci 101362306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB 0x722 101462306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_BRIGHTNESS_LSB 0x723 101562306a36Sopenharmony_ci 101662306a36Sopenharmony_ci#define DP_EDP_PWMGEN_BIT_COUNT 0x724 101762306a36Sopenharmony_ci#define DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN 0x725 101862306a36Sopenharmony_ci#define DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX 0x726 101962306a36Sopenharmony_ci# define DP_EDP_PWMGEN_BIT_COUNT_MASK (0x1f << 0) 102062306a36Sopenharmony_ci 102162306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_CONTROL_STATUS 0x727 102262306a36Sopenharmony_ci 102362306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_SET 0x728 102462306a36Sopenharmony_ci# define DP_EDP_BACKLIGHT_FREQ_BASE_KHZ 27000 102562306a36Sopenharmony_ci 102662306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_MSB 0x72a 102762306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_MID 0x72b 102862306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_LSB 0x72c 102962306a36Sopenharmony_ci 103062306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_MSB 0x72d 103162306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_MID 0x72e 103262306a36Sopenharmony_ci#define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_LSB 0x72f 103362306a36Sopenharmony_ci 103462306a36Sopenharmony_ci#define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET 0x732 103562306a36Sopenharmony_ci#define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET 0x733 103662306a36Sopenharmony_ci#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734 103762306a36Sopenharmony_ci 103862306a36Sopenharmony_ci#define DP_EDP_REGIONAL_BACKLIGHT_BASE 0x740 /* eDP 1.4 */ 103962306a36Sopenharmony_ci#define DP_EDP_REGIONAL_BACKLIGHT_0 0x741 /* eDP 1.4 */ 104062306a36Sopenharmony_ci 104162306a36Sopenharmony_ci#define DP_EDP_MSO_LINK_CAPABILITIES 0x7a4 /* eDP 1.4 */ 104262306a36Sopenharmony_ci# define DP_EDP_MSO_NUMBER_OF_LINKS_MASK (7 << 0) 104362306a36Sopenharmony_ci# define DP_EDP_MSO_NUMBER_OF_LINKS_SHIFT 0 104462306a36Sopenharmony_ci# define DP_EDP_MSO_INDEPENDENT_LINK_BIT (1 << 3) 104562306a36Sopenharmony_ci 104662306a36Sopenharmony_ci/* Sideband MSG Buffers */ 104762306a36Sopenharmony_ci#define DP_SIDEBAND_MSG_DOWN_REQ_BASE 0x1000 /* 1.2 MST */ 104862306a36Sopenharmony_ci#define DP_SIDEBAND_MSG_UP_REP_BASE 0x1200 /* 1.2 MST */ 104962306a36Sopenharmony_ci#define DP_SIDEBAND_MSG_DOWN_REP_BASE 0x1400 /* 1.2 MST */ 105062306a36Sopenharmony_ci#define DP_SIDEBAND_MSG_UP_REQ_BASE 0x1600 /* 1.2 MST */ 105162306a36Sopenharmony_ci 105262306a36Sopenharmony_ci/* DPRX Event Status Indicator */ 105362306a36Sopenharmony_ci#define DP_SINK_COUNT_ESI 0x2002 /* same as 0x200 */ 105462306a36Sopenharmony_ci#define DP_DEVICE_SERVICE_IRQ_VECTOR_ESI0 0x2003 /* same as 0x201 */ 105562306a36Sopenharmony_ci 105662306a36Sopenharmony_ci#define DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1 0x2004 /* 1.2 */ 105762306a36Sopenharmony_ci# define DP_RX_GTC_MSTR_REQ_STATUS_CHANGE (1 << 0) 105862306a36Sopenharmony_ci# define DP_LOCK_ACQUISITION_REQUEST (1 << 1) 105962306a36Sopenharmony_ci# define DP_CEC_IRQ (1 << 2) 106062306a36Sopenharmony_ci 106162306a36Sopenharmony_ci#define DP_LINK_SERVICE_IRQ_VECTOR_ESI0 0x2005 /* 1.2 */ 106262306a36Sopenharmony_ci# define RX_CAP_CHANGED (1 << 0) 106362306a36Sopenharmony_ci# define LINK_STATUS_CHANGED (1 << 1) 106462306a36Sopenharmony_ci# define STREAM_STATUS_CHANGED (1 << 2) 106562306a36Sopenharmony_ci# define HDMI_LINK_STATUS_CHANGED (1 << 3) 106662306a36Sopenharmony_ci# define CONNECTED_OFF_ENTRY_REQUESTED (1 << 4) 106762306a36Sopenharmony_ci 106862306a36Sopenharmony_ci#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */ 106962306a36Sopenharmony_ci# define DP_PSR_LINK_CRC_ERROR (1 << 0) 107062306a36Sopenharmony_ci# define DP_PSR_RFB_STORAGE_ERROR (1 << 1) 107162306a36Sopenharmony_ci# define DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR (1 << 2) /* eDP 1.4 */ 107262306a36Sopenharmony_ci 107362306a36Sopenharmony_ci#define DP_PSR_ESI 0x2007 /* XXX 1.2? */ 107462306a36Sopenharmony_ci# define DP_PSR_CAPS_CHANGE (1 << 0) 107562306a36Sopenharmony_ci 107662306a36Sopenharmony_ci#define DP_PSR_STATUS 0x2008 /* XXX 1.2? */ 107762306a36Sopenharmony_ci# define DP_PSR_SINK_INACTIVE 0 107862306a36Sopenharmony_ci# define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1 107962306a36Sopenharmony_ci# define DP_PSR_SINK_ACTIVE_RFB 2 108062306a36Sopenharmony_ci# define DP_PSR_SINK_ACTIVE_SINK_SYNCED 3 108162306a36Sopenharmony_ci# define DP_PSR_SINK_ACTIVE_RESYNC 4 108262306a36Sopenharmony_ci# define DP_PSR_SINK_INTERNAL_ERROR 7 108362306a36Sopenharmony_ci# define DP_PSR_SINK_STATE_MASK 0x07 108462306a36Sopenharmony_ci 108562306a36Sopenharmony_ci#define DP_SYNCHRONIZATION_LATENCY_IN_SINK 0x2009 /* edp 1.4 */ 108662306a36Sopenharmony_ci# define DP_MAX_RESYNC_FRAME_COUNT_MASK (0xf << 0) 108762306a36Sopenharmony_ci# define DP_MAX_RESYNC_FRAME_COUNT_SHIFT 0 108862306a36Sopenharmony_ci# define DP_LAST_ACTUAL_SYNCHRONIZATION_LATENCY_MASK (0xf << 4) 108962306a36Sopenharmony_ci# define DP_LAST_ACTUAL_SYNCHRONIZATION_LATENCY_SHIFT 4 109062306a36Sopenharmony_ci 109162306a36Sopenharmony_ci#define DP_LAST_RECEIVED_PSR_SDP 0x200a /* eDP 1.2 */ 109262306a36Sopenharmony_ci# define DP_PSR_STATE_BIT (1 << 0) /* eDP 1.2 */ 109362306a36Sopenharmony_ci# define DP_UPDATE_RFB_BIT (1 << 1) /* eDP 1.2 */ 109462306a36Sopenharmony_ci# define DP_CRC_VALID_BIT (1 << 2) /* eDP 1.2 */ 109562306a36Sopenharmony_ci# define DP_SU_VALID (1 << 3) /* eDP 1.4 */ 109662306a36Sopenharmony_ci# define DP_FIRST_SCAN_LINE_SU_REGION (1 << 4) /* eDP 1.4 */ 109762306a36Sopenharmony_ci# define DP_LAST_SCAN_LINE_SU_REGION (1 << 5) /* eDP 1.4 */ 109862306a36Sopenharmony_ci# define DP_Y_COORDINATE_VALID (1 << 6) /* eDP 1.4a */ 109962306a36Sopenharmony_ci 110062306a36Sopenharmony_ci#define DP_RECEIVER_ALPM_STATUS 0x200b /* eDP 1.4 */ 110162306a36Sopenharmony_ci# define DP_ALPM_LOCK_TIMEOUT_ERROR (1 << 0) 110262306a36Sopenharmony_ci 110362306a36Sopenharmony_ci#define DP_LANE0_1_STATUS_ESI 0x200c /* status same as 0x202 */ 110462306a36Sopenharmony_ci#define DP_LANE2_3_STATUS_ESI 0x200d /* status same as 0x203 */ 110562306a36Sopenharmony_ci#define DP_LANE_ALIGN_STATUS_UPDATED_ESI 0x200e /* status same as 0x204 */ 110662306a36Sopenharmony_ci#define DP_SINK_STATUS_ESI 0x200f /* status same as 0x205 */ 110762306a36Sopenharmony_ci 110862306a36Sopenharmony_ci/* Extended Receiver Capability: See DP_DPCD_REV for definitions */ 110962306a36Sopenharmony_ci#define DP_DP13_DPCD_REV 0x2200 111062306a36Sopenharmony_ci 111162306a36Sopenharmony_ci#define DP_DPRX_FEATURE_ENUMERATION_LIST 0x2210 /* DP 1.3 */ 111262306a36Sopenharmony_ci# define DP_GTC_CAP (1 << 0) /* DP 1.3 */ 111362306a36Sopenharmony_ci# define DP_SST_SPLIT_SDP_CAP (1 << 1) /* DP 1.4 */ 111462306a36Sopenharmony_ci# define DP_AV_SYNC_CAP (1 << 2) /* DP 1.3 */ 111562306a36Sopenharmony_ci# define DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED (1 << 3) /* DP 1.3 */ 111662306a36Sopenharmony_ci# define DP_VSC_EXT_VESA_SDP_SUPPORTED (1 << 4) /* DP 1.4 */ 111762306a36Sopenharmony_ci# define DP_VSC_EXT_VESA_SDP_CHAINING_SUPPORTED (1 << 5) /* DP 1.4 */ 111862306a36Sopenharmony_ci# define DP_VSC_EXT_CEA_SDP_SUPPORTED (1 << 6) /* DP 1.4 */ 111962306a36Sopenharmony_ci# define DP_VSC_EXT_CEA_SDP_CHAINING_SUPPORTED (1 << 7) /* DP 1.4 */ 112062306a36Sopenharmony_ci 112162306a36Sopenharmony_ci#define DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1 0x2214 /* 2.0 E11 */ 112262306a36Sopenharmony_ci# define DP_ADAPTIVE_SYNC_SDP_SUPPORTED (1 << 0) 112362306a36Sopenharmony_ci# define DP_AS_SDP_FIRST_HALF_LINE_OR_3840_PIXEL_CYCLE_WINDOW_NOT_SUPPORTED (1 << 1) 112462306a36Sopenharmony_ci# define DP_VSC_EXT_SDP_FRAMEWORK_VERSION_1_SUPPORTED (1 << 4) 112562306a36Sopenharmony_ci 112662306a36Sopenharmony_ci#define DP_128B132B_SUPPORTED_LINK_RATES 0x2215 /* 2.0 */ 112762306a36Sopenharmony_ci# define DP_UHBR10 (1 << 0) 112862306a36Sopenharmony_ci# define DP_UHBR20 (1 << 1) 112962306a36Sopenharmony_ci# define DP_UHBR13_5 (1 << 2) 113062306a36Sopenharmony_ci 113162306a36Sopenharmony_ci#define DP_128B132B_TRAINING_AUX_RD_INTERVAL 0x2216 /* 2.0 */ 113262306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_1MS_UNIT (1 << 7) 113362306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_MASK 0x7f 113462306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_400_US 0x00 113562306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_4_MS 0x01 113662306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_8_MS 0x02 113762306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_12_MS 0x03 113862306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_16_MS 0x04 113962306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_32_MS 0x05 114062306a36Sopenharmony_ci# define DP_128B132B_TRAINING_AUX_RD_INTERVAL_64_MS 0x06 114162306a36Sopenharmony_ci 114262306a36Sopenharmony_ci#define DP_TEST_264BIT_CUSTOM_PATTERN_7_0 0x2230 114362306a36Sopenharmony_ci#define DP_TEST_264BIT_CUSTOM_PATTERN_263_256 0x2250 114462306a36Sopenharmony_ci 114562306a36Sopenharmony_ci/* DSC Extended Capability Branch Total DSC Resources */ 114662306a36Sopenharmony_ci#define DP_DSC_SUPPORT_AND_DSC_DECODER_COUNT 0x2260 /* 2.0 */ 114762306a36Sopenharmony_ci# define DP_DSC_DECODER_COUNT_MASK (0b111 << 5) 114862306a36Sopenharmony_ci# define DP_DSC_DECODER_COUNT_SHIFT 5 114962306a36Sopenharmony_ci#define DP_DSC_MAX_SLICE_COUNT_AND_AGGREGATION_0 0x2270 /* 2.0 */ 115062306a36Sopenharmony_ci# define DP_DSC_DECODER_0_MAXIMUM_SLICE_COUNT_MASK (1 << 0) 115162306a36Sopenharmony_ci# define DP_DSC_DECODER_0_AGGREGATION_SUPPORT_MASK (0b111 << 1) 115262306a36Sopenharmony_ci# define DP_DSC_DECODER_0_AGGREGATION_SUPPORT_SHIFT 1 115362306a36Sopenharmony_ci 115462306a36Sopenharmony_ci/* Protocol Converter Extension */ 115562306a36Sopenharmony_ci/* HDMI CEC tunneling over AUX DP 1.3 section 5.3.3.3.1 DPCD 1.4+ */ 115662306a36Sopenharmony_ci#define DP_CEC_TUNNELING_CAPABILITY 0x3000 115762306a36Sopenharmony_ci# define DP_CEC_TUNNELING_CAPABLE (1 << 0) 115862306a36Sopenharmony_ci# define DP_CEC_SNOOPING_CAPABLE (1 << 1) 115962306a36Sopenharmony_ci# define DP_CEC_MULTIPLE_LA_CAPABLE (1 << 2) 116062306a36Sopenharmony_ci 116162306a36Sopenharmony_ci#define DP_CEC_TUNNELING_CONTROL 0x3001 116262306a36Sopenharmony_ci# define DP_CEC_TUNNELING_ENABLE (1 << 0) 116362306a36Sopenharmony_ci# define DP_CEC_SNOOPING_ENABLE (1 << 1) 116462306a36Sopenharmony_ci 116562306a36Sopenharmony_ci#define DP_CEC_RX_MESSAGE_INFO 0x3002 116662306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_LEN_MASK (0xf << 0) 116762306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_LEN_SHIFT 0 116862306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_HPD_STATE (1 << 4) 116962306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_HPD_LOST (1 << 5) 117062306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_ACKED (1 << 6) 117162306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_ENDED (1 << 7) 117262306a36Sopenharmony_ci 117362306a36Sopenharmony_ci#define DP_CEC_TX_MESSAGE_INFO 0x3003 117462306a36Sopenharmony_ci# define DP_CEC_TX_MESSAGE_LEN_MASK (0xf << 0) 117562306a36Sopenharmony_ci# define DP_CEC_TX_MESSAGE_LEN_SHIFT 0 117662306a36Sopenharmony_ci# define DP_CEC_TX_RETRY_COUNT_MASK (0x7 << 4) 117762306a36Sopenharmony_ci# define DP_CEC_TX_RETRY_COUNT_SHIFT 4 117862306a36Sopenharmony_ci# define DP_CEC_TX_MESSAGE_SEND (1 << 7) 117962306a36Sopenharmony_ci 118062306a36Sopenharmony_ci#define DP_CEC_TUNNELING_IRQ_FLAGS 0x3004 118162306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_INFO_VALID (1 << 0) 118262306a36Sopenharmony_ci# define DP_CEC_RX_MESSAGE_OVERFLOW (1 << 1) 118362306a36Sopenharmony_ci# define DP_CEC_TX_MESSAGE_SENT (1 << 4) 118462306a36Sopenharmony_ci# define DP_CEC_TX_LINE_ERROR (1 << 5) 118562306a36Sopenharmony_ci# define DP_CEC_TX_ADDRESS_NACK_ERROR (1 << 6) 118662306a36Sopenharmony_ci# define DP_CEC_TX_DATA_NACK_ERROR (1 << 7) 118762306a36Sopenharmony_ci 118862306a36Sopenharmony_ci#define DP_CEC_LOGICAL_ADDRESS_MASK 0x300E /* 0x300F word */ 118962306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_0 (1 << 0) 119062306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_1 (1 << 1) 119162306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_2 (1 << 2) 119262306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_3 (1 << 3) 119362306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_4 (1 << 4) 119462306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_5 (1 << 5) 119562306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_6 (1 << 6) 119662306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_7 (1 << 7) 119762306a36Sopenharmony_ci#define DP_CEC_LOGICAL_ADDRESS_MASK_2 0x300F /* 0x300E word */ 119862306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_8 (1 << 0) 119962306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_9 (1 << 1) 120062306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_10 (1 << 2) 120162306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_11 (1 << 3) 120262306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_12 (1 << 4) 120362306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_13 (1 << 5) 120462306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_14 (1 << 6) 120562306a36Sopenharmony_ci# define DP_CEC_LOGICAL_ADDRESS_15 (1 << 7) 120662306a36Sopenharmony_ci 120762306a36Sopenharmony_ci#define DP_CEC_RX_MESSAGE_BUFFER 0x3010 120862306a36Sopenharmony_ci#define DP_CEC_TX_MESSAGE_BUFFER 0x3020 120962306a36Sopenharmony_ci#define DP_CEC_MESSAGE_BUFFER_LENGTH 0x10 121062306a36Sopenharmony_ci 121162306a36Sopenharmony_ci/* PCON CONFIGURE-1 FRL FOR HDMI SINK */ 121262306a36Sopenharmony_ci#define DP_PCON_HDMI_LINK_CONFIG_1 0x305A 121362306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_FRL_BW (7 << 0) 121462306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_0GBPS 0 121562306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_9GBPS 1 121662306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_18GBPS 2 121762306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_24GBPS 3 121862306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_32GBPS 4 121962306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_40GBPS 5 122062306a36Sopenharmony_ci# define DP_PCON_ENABLE_MAX_BW_48GBPS 6 122162306a36Sopenharmony_ci# define DP_PCON_ENABLE_SOURCE_CTL_MODE (1 << 3) 122262306a36Sopenharmony_ci# define DP_PCON_ENABLE_CONCURRENT_LINK (1 << 4) 122362306a36Sopenharmony_ci# define DP_PCON_ENABLE_SEQUENTIAL_LINK (0 << 4) 122462306a36Sopenharmony_ci# define DP_PCON_ENABLE_LINK_FRL_MODE (1 << 5) 122562306a36Sopenharmony_ci# define DP_PCON_ENABLE_HPD_READY (1 << 6) 122662306a36Sopenharmony_ci# define DP_PCON_ENABLE_HDMI_LINK (1 << 7) 122762306a36Sopenharmony_ci 122862306a36Sopenharmony_ci/* PCON CONFIGURE-2 FRL FOR HDMI SINK */ 122962306a36Sopenharmony_ci#define DP_PCON_HDMI_LINK_CONFIG_2 0x305B 123062306a36Sopenharmony_ci# define DP_PCON_MAX_LINK_BW_MASK (0x3F << 0) 123162306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_9GBPS (1 << 0) 123262306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_18GBPS (1 << 1) 123362306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_24GBPS (1 << 2) 123462306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_32GBPS (1 << 3) 123562306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_40GBPS (1 << 4) 123662306a36Sopenharmony_ci# define DP_PCON_FRL_BW_MASK_48GBPS (1 << 5) 123762306a36Sopenharmony_ci# define DP_PCON_FRL_LINK_TRAIN_EXTENDED (1 << 6) 123862306a36Sopenharmony_ci# define DP_PCON_FRL_LINK_TRAIN_NORMAL (0 << 6) 123962306a36Sopenharmony_ci 124062306a36Sopenharmony_ci/* PCON HDMI LINK STATUS */ 124162306a36Sopenharmony_ci#define DP_PCON_HDMI_TX_LINK_STATUS 0x303B 124262306a36Sopenharmony_ci# define DP_PCON_HDMI_TX_LINK_ACTIVE (1 << 0) 124362306a36Sopenharmony_ci# define DP_PCON_FRL_READY (1 << 1) 124462306a36Sopenharmony_ci 124562306a36Sopenharmony_ci/* PCON HDMI POST FRL STATUS */ 124662306a36Sopenharmony_ci#define DP_PCON_HDMI_POST_FRL_STATUS 0x3036 124762306a36Sopenharmony_ci# define DP_PCON_HDMI_LINK_MODE (1 << 0) 124862306a36Sopenharmony_ci# define DP_PCON_HDMI_MODE_TMDS 0 124962306a36Sopenharmony_ci# define DP_PCON_HDMI_MODE_FRL 1 125062306a36Sopenharmony_ci# define DP_PCON_HDMI_FRL_TRAINED_BW (0x3F << 1) 125162306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_9GBPS (1 << 1) 125262306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_18GBPS (1 << 2) 125362306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_24GBPS (1 << 3) 125462306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_32GBPS (1 << 4) 125562306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_40GBPS (1 << 5) 125662306a36Sopenharmony_ci# define DP_PCON_FRL_TRAINED_BW_48GBPS (1 << 6) 125762306a36Sopenharmony_ci 125862306a36Sopenharmony_ci#define DP_PROTOCOL_CONVERTER_CONTROL_0 0x3050 /* DP 1.3 */ 125962306a36Sopenharmony_ci# define DP_HDMI_DVI_OUTPUT_CONFIG (1 << 0) /* DP 1.3 */ 126062306a36Sopenharmony_ci#define DP_PROTOCOL_CONVERTER_CONTROL_1 0x3051 /* DP 1.3 */ 126162306a36Sopenharmony_ci# define DP_CONVERSION_TO_YCBCR420_ENABLE (1 << 0) /* DP 1.3 */ 126262306a36Sopenharmony_ci# define DP_HDMI_EDID_PROCESSING_DISABLE (1 << 1) /* DP 1.4 */ 126362306a36Sopenharmony_ci# define DP_HDMI_AUTONOMOUS_SCRAMBLING_DISABLE (1 << 2) /* DP 1.4 */ 126462306a36Sopenharmony_ci# define DP_HDMI_FORCE_SCRAMBLING (1 << 3) /* DP 1.4 */ 126562306a36Sopenharmony_ci#define DP_PROTOCOL_CONVERTER_CONTROL_2 0x3052 /* DP 1.3 */ 126662306a36Sopenharmony_ci# define DP_CONVERSION_TO_YCBCR422_ENABLE (1 << 0) /* DP 1.3 */ 126762306a36Sopenharmony_ci# define DP_PCON_ENABLE_DSC_ENCODER (1 << 1) 126862306a36Sopenharmony_ci# define DP_PCON_ENCODER_PPS_OVERRIDE_MASK (0x3 << 2) 126962306a36Sopenharmony_ci# define DP_PCON_ENC_PPS_OVERRIDE_DISABLED 0 127062306a36Sopenharmony_ci# define DP_PCON_ENC_PPS_OVERRIDE_EN_PARAMS 1 127162306a36Sopenharmony_ci# define DP_PCON_ENC_PPS_OVERRIDE_EN_BUFFER 2 127262306a36Sopenharmony_ci# define DP_CONVERSION_RGB_YCBCR_MASK (7 << 4) 127362306a36Sopenharmony_ci# define DP_CONVERSION_BT601_RGB_YCBCR_ENABLE (1 << 4) 127462306a36Sopenharmony_ci# define DP_CONVERSION_BT709_RGB_YCBCR_ENABLE (1 << 5) 127562306a36Sopenharmony_ci# define DP_CONVERSION_BT2020_RGB_YCBCR_ENABLE (1 << 6) 127662306a36Sopenharmony_ci 127762306a36Sopenharmony_ci/* PCON Downstream HDMI ERROR Status per Lane */ 127862306a36Sopenharmony_ci#define DP_PCON_HDMI_ERROR_STATUS_LN0 0x3037 127962306a36Sopenharmony_ci#define DP_PCON_HDMI_ERROR_STATUS_LN1 0x3038 128062306a36Sopenharmony_ci#define DP_PCON_HDMI_ERROR_STATUS_LN2 0x3039 128162306a36Sopenharmony_ci#define DP_PCON_HDMI_ERROR_STATUS_LN3 0x303A 128262306a36Sopenharmony_ci# define DP_PCON_HDMI_ERROR_COUNT_MASK (0x7 << 0) 128362306a36Sopenharmony_ci# define DP_PCON_HDMI_ERROR_COUNT_THREE_PLUS (1 << 0) 128462306a36Sopenharmony_ci# define DP_PCON_HDMI_ERROR_COUNT_TEN_PLUS (1 << 1) 128562306a36Sopenharmony_ci# define DP_PCON_HDMI_ERROR_COUNT_HUNDRED_PLUS (1 << 2) 128662306a36Sopenharmony_ci 128762306a36Sopenharmony_ci/* PCON HDMI CONFIG PPS Override Buffer 128862306a36Sopenharmony_ci * Valid Offsets to be added to Base : 0-127 128962306a36Sopenharmony_ci */ 129062306a36Sopenharmony_ci#define DP_PCON_HDMI_PPS_OVERRIDE_BASE 0x3100 129162306a36Sopenharmony_ci 129262306a36Sopenharmony_ci/* PCON HDMI CONFIG PPS Override Parameter: Slice height 129362306a36Sopenharmony_ci * Offset-0 8LSBs of the Slice height. 129462306a36Sopenharmony_ci * Offset-1 8MSBs of the Slice height. 129562306a36Sopenharmony_ci */ 129662306a36Sopenharmony_ci#define DP_PCON_HDMI_PPS_OVRD_SLICE_HEIGHT 0x3180 129762306a36Sopenharmony_ci 129862306a36Sopenharmony_ci/* PCON HDMI CONFIG PPS Override Parameter: Slice width 129962306a36Sopenharmony_ci * Offset-0 8LSBs of the Slice width. 130062306a36Sopenharmony_ci * Offset-1 8MSBs of the Slice width. 130162306a36Sopenharmony_ci */ 130262306a36Sopenharmony_ci#define DP_PCON_HDMI_PPS_OVRD_SLICE_WIDTH 0x3182 130362306a36Sopenharmony_ci 130462306a36Sopenharmony_ci/* PCON HDMI CONFIG PPS Override Parameter: bits_per_pixel 130562306a36Sopenharmony_ci * Offset-0 8LSBs of the bits_per_pixel. 130662306a36Sopenharmony_ci * Offset-1 2MSBs of the bits_per_pixel. 130762306a36Sopenharmony_ci */ 130862306a36Sopenharmony_ci#define DP_PCON_HDMI_PPS_OVRD_BPP 0x3184 130962306a36Sopenharmony_ci 131062306a36Sopenharmony_ci/* HDCP 1.3 and HDCP 2.2 */ 131162306a36Sopenharmony_ci#define DP_AUX_HDCP_BKSV 0x68000 131262306a36Sopenharmony_ci#define DP_AUX_HDCP_RI_PRIME 0x68005 131362306a36Sopenharmony_ci#define DP_AUX_HDCP_AKSV 0x68007 131462306a36Sopenharmony_ci#define DP_AUX_HDCP_AN 0x6800C 131562306a36Sopenharmony_ci#define DP_AUX_HDCP_V_PRIME(h) (0x68014 + h * 4) 131662306a36Sopenharmony_ci#define DP_AUX_HDCP_BCAPS 0x68028 131762306a36Sopenharmony_ci# define DP_BCAPS_REPEATER_PRESENT BIT(1) 131862306a36Sopenharmony_ci# define DP_BCAPS_HDCP_CAPABLE BIT(0) 131962306a36Sopenharmony_ci#define DP_AUX_HDCP_BSTATUS 0x68029 132062306a36Sopenharmony_ci# define DP_BSTATUS_REAUTH_REQ BIT(3) 132162306a36Sopenharmony_ci# define DP_BSTATUS_LINK_FAILURE BIT(2) 132262306a36Sopenharmony_ci# define DP_BSTATUS_R0_PRIME_READY BIT(1) 132362306a36Sopenharmony_ci# define DP_BSTATUS_READY BIT(0) 132462306a36Sopenharmony_ci#define DP_AUX_HDCP_BINFO 0x6802A 132562306a36Sopenharmony_ci#define DP_AUX_HDCP_KSV_FIFO 0x6802C 132662306a36Sopenharmony_ci#define DP_AUX_HDCP_AINFO 0x6803B 132762306a36Sopenharmony_ci 132862306a36Sopenharmony_ci/* DP HDCP2.2 parameter offsets in DPCD address space */ 132962306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RTX_OFFSET 0x69000 133062306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_TXCAPS_OFFSET 0x69008 133162306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_CERT_RX_OFFSET 0x6900B 133262306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RRX_OFFSET 0x69215 133362306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RX_CAPS_OFFSET 0x6921D 133462306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_EKPUB_KM_OFFSET 0x69220 133562306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_EKH_KM_WR_OFFSET 0x692A0 133662306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_M_OFFSET 0x692B0 133762306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_HPRIME_OFFSET 0x692C0 133862306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_EKH_KM_RD_OFFSET 0x692E0 133962306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RN_OFFSET 0x692F0 134062306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_LPRIME_OFFSET 0x692F8 134162306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_EDKEY_KS_OFFSET 0x69318 134262306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RIV_OFFSET 0x69328 134362306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RXINFO_OFFSET 0x69330 134462306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_SEQ_NUM_V_OFFSET 0x69332 134562306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_VPRIME_OFFSET 0x69335 134662306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RECV_ID_LIST_OFFSET 0x69345 134762306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_V_OFFSET 0x693E0 134862306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET 0x693F0 134962306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_K_OFFSET 0x693F3 135062306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_STREAM_ID_TYPE_OFFSET 0x693F5 135162306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_MPRIME_OFFSET 0x69473 135262306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_RXSTATUS_OFFSET 0x69493 135362306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_STREAM_TYPE_OFFSET 0x69494 135462306a36Sopenharmony_ci#define DP_HDCP_2_2_REG_DBG_OFFSET 0x69518 135562306a36Sopenharmony_ci 135662306a36Sopenharmony_ci/* LTTPR: Link Training (LT)-tunable PHY Repeaters */ 135762306a36Sopenharmony_ci#define DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV 0xf0000 /* 1.3 */ 135862306a36Sopenharmony_ci#define DP_MAX_LINK_RATE_PHY_REPEATER 0xf0001 /* 1.4a */ 135962306a36Sopenharmony_ci#define DP_PHY_REPEATER_CNT 0xf0002 /* 1.3 */ 136062306a36Sopenharmony_ci#define DP_PHY_REPEATER_MODE 0xf0003 /* 1.3 */ 136162306a36Sopenharmony_ci#define DP_MAX_LANE_COUNT_PHY_REPEATER 0xf0004 /* 1.4a */ 136262306a36Sopenharmony_ci#define DP_Repeater_FEC_CAPABILITY 0xf0004 /* 1.4 */ 136362306a36Sopenharmony_ci#define DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT 0xf0005 /* 1.4a */ 136462306a36Sopenharmony_ci#define DP_MAIN_LINK_CHANNEL_CODING_PHY_REPEATER 0xf0006 /* 2.0 */ 136562306a36Sopenharmony_ci# define DP_PHY_REPEATER_128B132B_SUPPORTED (1 << 0) 136662306a36Sopenharmony_ci/* See DP_128B132B_SUPPORTED_LINK_RATES for values */ 136762306a36Sopenharmony_ci#define DP_PHY_REPEATER_128B132B_RATES 0xf0007 /* 2.0 */ 136862306a36Sopenharmony_ci#define DP_PHY_REPEATER_EQ_DONE 0xf0008 /* 2.0 E11 */ 136962306a36Sopenharmony_ci 137062306a36Sopenharmony_cienum drm_dp_phy { 137162306a36Sopenharmony_ci DP_PHY_DPRX, 137262306a36Sopenharmony_ci 137362306a36Sopenharmony_ci DP_PHY_LTTPR1, 137462306a36Sopenharmony_ci DP_PHY_LTTPR2, 137562306a36Sopenharmony_ci DP_PHY_LTTPR3, 137662306a36Sopenharmony_ci DP_PHY_LTTPR4, 137762306a36Sopenharmony_ci DP_PHY_LTTPR5, 137862306a36Sopenharmony_ci DP_PHY_LTTPR6, 137962306a36Sopenharmony_ci DP_PHY_LTTPR7, 138062306a36Sopenharmony_ci DP_PHY_LTTPR8, 138162306a36Sopenharmony_ci 138262306a36Sopenharmony_ci DP_MAX_LTTPR_COUNT = DP_PHY_LTTPR8, 138362306a36Sopenharmony_ci}; 138462306a36Sopenharmony_ci 138562306a36Sopenharmony_ci#define DP_PHY_LTTPR(i) (DP_PHY_LTTPR1 + (i)) 138662306a36Sopenharmony_ci 138762306a36Sopenharmony_ci#define __DP_LTTPR1_BASE 0xf0010 /* 1.3 */ 138862306a36Sopenharmony_ci#define __DP_LTTPR2_BASE 0xf0060 /* 1.3 */ 138962306a36Sopenharmony_ci#define DP_LTTPR_BASE(dp_phy) \ 139062306a36Sopenharmony_ci (__DP_LTTPR1_BASE + (__DP_LTTPR2_BASE - __DP_LTTPR1_BASE) * \ 139162306a36Sopenharmony_ci ((dp_phy) - DP_PHY_LTTPR1)) 139262306a36Sopenharmony_ci 139362306a36Sopenharmony_ci#define DP_LTTPR_REG(dp_phy, lttpr1_reg) \ 139462306a36Sopenharmony_ci (DP_LTTPR_BASE(dp_phy) - DP_LTTPR_BASE(DP_PHY_LTTPR1) + (lttpr1_reg)) 139562306a36Sopenharmony_ci 139662306a36Sopenharmony_ci#define DP_TRAINING_PATTERN_SET_PHY_REPEATER1 0xf0010 /* 1.3 */ 139762306a36Sopenharmony_ci#define DP_TRAINING_PATTERN_SET_PHY_REPEATER(dp_phy) \ 139862306a36Sopenharmony_ci DP_LTTPR_REG(dp_phy, DP_TRAINING_PATTERN_SET_PHY_REPEATER1) 139962306a36Sopenharmony_ci 140062306a36Sopenharmony_ci#define DP_TRAINING_LANE0_SET_PHY_REPEATER1 0xf0011 /* 1.3 */ 140162306a36Sopenharmony_ci#define DP_TRAINING_LANE0_SET_PHY_REPEATER(dp_phy) \ 140262306a36Sopenharmony_ci DP_LTTPR_REG(dp_phy, DP_TRAINING_LANE0_SET_PHY_REPEATER1) 140362306a36Sopenharmony_ci 140462306a36Sopenharmony_ci#define DP_TRAINING_LANE1_SET_PHY_REPEATER1 0xf0012 /* 1.3 */ 140562306a36Sopenharmony_ci#define DP_TRAINING_LANE2_SET_PHY_REPEATER1 0xf0013 /* 1.3 */ 140662306a36Sopenharmony_ci#define DP_TRAINING_LANE3_SET_PHY_REPEATER1 0xf0014 /* 1.3 */ 140762306a36Sopenharmony_ci#define DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1 0xf0020 /* 1.4a */ 140862306a36Sopenharmony_ci#define DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER(dp_phy) \ 140962306a36Sopenharmony_ci DP_LTTPR_REG(dp_phy, DP_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1) 141062306a36Sopenharmony_ci 141162306a36Sopenharmony_ci#define DP_TRANSMITTER_CAPABILITY_PHY_REPEATER1 0xf0021 /* 1.4a */ 141262306a36Sopenharmony_ci# define DP_VOLTAGE_SWING_LEVEL_3_SUPPORTED BIT(0) 141362306a36Sopenharmony_ci# define DP_PRE_EMPHASIS_LEVEL_3_SUPPORTED BIT(1) 141462306a36Sopenharmony_ci 141562306a36Sopenharmony_ci#define DP_128B132B_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1 0xf0022 /* 2.0 */ 141662306a36Sopenharmony_ci#define DP_128B132B_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER(dp_phy) \ 141762306a36Sopenharmony_ci DP_LTTPR_REG(dp_phy, DP_128B132B_TRAINING_AUX_RD_INTERVAL_PHY_REPEATER1) 141862306a36Sopenharmony_ci/* see DP_128B132B_TRAINING_AUX_RD_INTERVAL for values */ 141962306a36Sopenharmony_ci 142062306a36Sopenharmony_ci#define DP_LANE0_1_STATUS_PHY_REPEATER1 0xf0030 /* 1.3 */ 142162306a36Sopenharmony_ci#define DP_LANE0_1_STATUS_PHY_REPEATER(dp_phy) \ 142262306a36Sopenharmony_ci DP_LTTPR_REG(dp_phy, DP_LANE0_1_STATUS_PHY_REPEATER1) 142362306a36Sopenharmony_ci 142462306a36Sopenharmony_ci#define DP_LANE2_3_STATUS_PHY_REPEATER1 0xf0031 /* 1.3 */ 142562306a36Sopenharmony_ci 142662306a36Sopenharmony_ci#define DP_LANE_ALIGN_STATUS_UPDATED_PHY_REPEATER1 0xf0032 /* 1.3 */ 142762306a36Sopenharmony_ci#define DP_ADJUST_REQUEST_LANE0_1_PHY_REPEATER1 0xf0033 /* 1.3 */ 142862306a36Sopenharmony_ci#define DP_ADJUST_REQUEST_LANE2_3_PHY_REPEATER1 0xf0034 /* 1.3 */ 142962306a36Sopenharmony_ci#define DP_SYMBOL_ERROR_COUNT_LANE0_PHY_REPEATER1 0xf0035 /* 1.3 */ 143062306a36Sopenharmony_ci#define DP_SYMBOL_ERROR_COUNT_LANE1_PHY_REPEATER1 0xf0037 /* 1.3 */ 143162306a36Sopenharmony_ci#define DP_SYMBOL_ERROR_COUNT_LANE2_PHY_REPEATER1 0xf0039 /* 1.3 */ 143262306a36Sopenharmony_ci#define DP_SYMBOL_ERROR_COUNT_LANE3_PHY_REPEATER1 0xf003b /* 1.3 */ 143362306a36Sopenharmony_ci 143462306a36Sopenharmony_ci#define __DP_FEC1_BASE 0xf0290 /* 1.4 */ 143562306a36Sopenharmony_ci#define __DP_FEC2_BASE 0xf0298 /* 1.4 */ 143662306a36Sopenharmony_ci#define DP_FEC_BASE(dp_phy) \ 143762306a36Sopenharmony_ci (__DP_FEC1_BASE + ((__DP_FEC2_BASE - __DP_FEC1_BASE) * \ 143862306a36Sopenharmony_ci ((dp_phy) - DP_PHY_LTTPR1))) 143962306a36Sopenharmony_ci 144062306a36Sopenharmony_ci#define DP_FEC_REG(dp_phy, fec1_reg) \ 144162306a36Sopenharmony_ci (DP_FEC_BASE(dp_phy) - DP_FEC_BASE(DP_PHY_LTTPR1) + fec1_reg) 144262306a36Sopenharmony_ci 144362306a36Sopenharmony_ci#define DP_FEC_STATUS_PHY_REPEATER1 0xf0290 /* 1.4 */ 144462306a36Sopenharmony_ci#define DP_FEC_STATUS_PHY_REPEATER(dp_phy) \ 144562306a36Sopenharmony_ci DP_FEC_REG(dp_phy, DP_FEC_STATUS_PHY_REPEATER1) 144662306a36Sopenharmony_ci 144762306a36Sopenharmony_ci#define DP_FEC_ERROR_COUNT_PHY_REPEATER1 0xf0291 /* 1.4 */ 144862306a36Sopenharmony_ci#define DP_FEC_CAPABILITY_PHY_REPEATER1 0xf0294 /* 1.4a */ 144962306a36Sopenharmony_ci 145062306a36Sopenharmony_ci#define DP_LTTPR_MAX_ADD 0xf02ff /* 1.4 */ 145162306a36Sopenharmony_ci 145262306a36Sopenharmony_ci#define DP_DPCD_MAX_ADD 0xfffff /* 1.4 */ 145362306a36Sopenharmony_ci 145462306a36Sopenharmony_ci/* Repeater modes */ 145562306a36Sopenharmony_ci#define DP_PHY_REPEATER_MODE_TRANSPARENT 0x55 /* 1.3 */ 145662306a36Sopenharmony_ci#define DP_PHY_REPEATER_MODE_NON_TRANSPARENT 0xaa /* 1.3 */ 145762306a36Sopenharmony_ci 145862306a36Sopenharmony_ci/* DP HDCP message start offsets in DPCD address space */ 145962306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_INIT_OFFSET DP_HDCP_2_2_REG_RTX_OFFSET 146062306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_SEND_CERT_OFFSET DP_HDCP_2_2_REG_CERT_RX_OFFSET 146162306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_NO_STORED_KM_OFFSET DP_HDCP_2_2_REG_EKPUB_KM_OFFSET 146262306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_STORED_KM_OFFSET DP_HDCP_2_2_REG_EKH_KM_WR_OFFSET 146362306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_SEND_HPRIME_OFFSET DP_HDCP_2_2_REG_HPRIME_OFFSET 146462306a36Sopenharmony_ci#define DP_HDCP_2_2_AKE_SEND_PAIRING_INFO_OFFSET \ 146562306a36Sopenharmony_ci DP_HDCP_2_2_REG_EKH_KM_RD_OFFSET 146662306a36Sopenharmony_ci#define DP_HDCP_2_2_LC_INIT_OFFSET DP_HDCP_2_2_REG_RN_OFFSET 146762306a36Sopenharmony_ci#define DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET DP_HDCP_2_2_REG_LPRIME_OFFSET 146862306a36Sopenharmony_ci#define DP_HDCP_2_2_SKE_SEND_EKS_OFFSET DP_HDCP_2_2_REG_EDKEY_KS_OFFSET 146962306a36Sopenharmony_ci#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET DP_HDCP_2_2_REG_RXINFO_OFFSET 147062306a36Sopenharmony_ci#define DP_HDCP_2_2_REP_SEND_ACK_OFFSET DP_HDCP_2_2_REG_V_OFFSET 147162306a36Sopenharmony_ci#define DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET 147262306a36Sopenharmony_ci#define DP_HDCP_2_2_REP_STREAM_READY_OFFSET DP_HDCP_2_2_REG_MPRIME_OFFSET 147362306a36Sopenharmony_ci 147462306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_LEN 1 147562306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_READY(x) ((x) & BIT(0)) 147662306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_H_PRIME(x) ((x) & BIT(1)) 147762306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_PAIRING(x) ((x) & BIT(2)) 147862306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_REAUTH_REQ(x) ((x) & BIT(3)) 147962306a36Sopenharmony_ci#define HDCP_2_2_DP_RXSTATUS_LINK_FAILED(x) ((x) & BIT(4)) 148062306a36Sopenharmony_ci 148162306a36Sopenharmony_ci/* DP 1.2 Sideband message defines */ 148262306a36Sopenharmony_ci/* peer device type - DP 1.2a Table 2-92 */ 148362306a36Sopenharmony_ci#define DP_PEER_DEVICE_NONE 0x0 148462306a36Sopenharmony_ci#define DP_PEER_DEVICE_SOURCE_OR_SST 0x1 148562306a36Sopenharmony_ci#define DP_PEER_DEVICE_MST_BRANCHING 0x2 148662306a36Sopenharmony_ci#define DP_PEER_DEVICE_SST_SINK 0x3 148762306a36Sopenharmony_ci#define DP_PEER_DEVICE_DP_LEGACY_CONV 0x4 148862306a36Sopenharmony_ci 148962306a36Sopenharmony_ci/* DP 1.2 MST sideband request names DP 1.2a Table 2-80 */ 149062306a36Sopenharmony_ci#define DP_GET_MSG_TRANSACTION_VERSION 0x00 /* DP 1.3 */ 149162306a36Sopenharmony_ci#define DP_LINK_ADDRESS 0x01 149262306a36Sopenharmony_ci#define DP_CONNECTION_STATUS_NOTIFY 0x02 149362306a36Sopenharmony_ci#define DP_ENUM_PATH_RESOURCES 0x10 149462306a36Sopenharmony_ci#define DP_ALLOCATE_PAYLOAD 0x11 149562306a36Sopenharmony_ci#define DP_QUERY_PAYLOAD 0x12 149662306a36Sopenharmony_ci#define DP_RESOURCE_STATUS_NOTIFY 0x13 149762306a36Sopenharmony_ci#define DP_CLEAR_PAYLOAD_ID_TABLE 0x14 149862306a36Sopenharmony_ci#define DP_REMOTE_DPCD_READ 0x20 149962306a36Sopenharmony_ci#define DP_REMOTE_DPCD_WRITE 0x21 150062306a36Sopenharmony_ci#define DP_REMOTE_I2C_READ 0x22 150162306a36Sopenharmony_ci#define DP_REMOTE_I2C_WRITE 0x23 150262306a36Sopenharmony_ci#define DP_POWER_UP_PHY 0x24 150362306a36Sopenharmony_ci#define DP_POWER_DOWN_PHY 0x25 150462306a36Sopenharmony_ci#define DP_SINK_EVENT_NOTIFY 0x30 150562306a36Sopenharmony_ci#define DP_QUERY_STREAM_ENC_STATUS 0x38 150662306a36Sopenharmony_ci#define DP_QUERY_STREAM_ENC_STATUS_STATE_NO_EXIST 0 150762306a36Sopenharmony_ci#define DP_QUERY_STREAM_ENC_STATUS_STATE_INACTIVE 1 150862306a36Sopenharmony_ci#define DP_QUERY_STREAM_ENC_STATUS_STATE_ACTIVE 2 150962306a36Sopenharmony_ci 151062306a36Sopenharmony_ci/* DP 1.2 MST sideband reply types */ 151162306a36Sopenharmony_ci#define DP_SIDEBAND_REPLY_ACK 0x00 151262306a36Sopenharmony_ci#define DP_SIDEBAND_REPLY_NAK 0x01 151362306a36Sopenharmony_ci 151462306a36Sopenharmony_ci/* DP 1.2 MST sideband nak reasons - table 2.84 */ 151562306a36Sopenharmony_ci#define DP_NAK_WRITE_FAILURE 0x01 151662306a36Sopenharmony_ci#define DP_NAK_INVALID_READ 0x02 151762306a36Sopenharmony_ci#define DP_NAK_CRC_FAILURE 0x03 151862306a36Sopenharmony_ci#define DP_NAK_BAD_PARAM 0x04 151962306a36Sopenharmony_ci#define DP_NAK_DEFER 0x05 152062306a36Sopenharmony_ci#define DP_NAK_LINK_FAILURE 0x06 152162306a36Sopenharmony_ci#define DP_NAK_NO_RESOURCES 0x07 152262306a36Sopenharmony_ci#define DP_NAK_DPCD_FAIL 0x08 152362306a36Sopenharmony_ci#define DP_NAK_I2C_NAK 0x09 152462306a36Sopenharmony_ci#define DP_NAK_ALLOCATE_FAIL 0x0a 152562306a36Sopenharmony_ci 152662306a36Sopenharmony_ci#define MODE_I2C_START 1 152762306a36Sopenharmony_ci#define MODE_I2C_WRITE 2 152862306a36Sopenharmony_ci#define MODE_I2C_READ 4 152962306a36Sopenharmony_ci#define MODE_I2C_STOP 8 153062306a36Sopenharmony_ci 153162306a36Sopenharmony_ci/* DP 1.2 MST PORTs - Section 2.5.1 v1.2a spec */ 153262306a36Sopenharmony_ci#define DP_MST_PHYSICAL_PORT_0 0 153362306a36Sopenharmony_ci#define DP_MST_LOGICAL_PORT_0 8 153462306a36Sopenharmony_ci 153562306a36Sopenharmony_ci#define DP_LINK_CONSTANT_N_VALUE 0x8000 153662306a36Sopenharmony_ci#define DP_LINK_STATUS_SIZE 6 153762306a36Sopenharmony_ci 153862306a36Sopenharmony_ci#define DP_BRANCH_OUI_HEADER_SIZE 0xc 153962306a36Sopenharmony_ci#define DP_RECEIVER_CAP_SIZE 0xf 154062306a36Sopenharmony_ci#define DP_DSC_RECEIVER_CAP_SIZE 0x10 /* DSC Capabilities 0x60 through 0x6F */ 154162306a36Sopenharmony_ci#define EDP_PSR_RECEIVER_CAP_SIZE 2 154262306a36Sopenharmony_ci#define EDP_DISPLAY_CTL_CAP_SIZE 3 154362306a36Sopenharmony_ci#define DP_LTTPR_COMMON_CAP_SIZE 8 154462306a36Sopenharmony_ci#define DP_LTTPR_PHY_CAP_SIZE 3 154562306a36Sopenharmony_ci 154662306a36Sopenharmony_ci#define DP_SDP_AUDIO_TIMESTAMP 0x01 154762306a36Sopenharmony_ci#define DP_SDP_AUDIO_STREAM 0x02 154862306a36Sopenharmony_ci#define DP_SDP_EXTENSION 0x04 /* DP 1.1 */ 154962306a36Sopenharmony_ci#define DP_SDP_AUDIO_COPYMANAGEMENT 0x05 /* DP 1.2 */ 155062306a36Sopenharmony_ci#define DP_SDP_ISRC 0x06 /* DP 1.2 */ 155162306a36Sopenharmony_ci#define DP_SDP_VSC 0x07 /* DP 1.2 */ 155262306a36Sopenharmony_ci#define DP_SDP_CAMERA_GENERIC(i) (0x08 + (i)) /* 0-7, DP 1.3 */ 155362306a36Sopenharmony_ci#define DP_SDP_PPS 0x10 /* DP 1.4 */ 155462306a36Sopenharmony_ci#define DP_SDP_VSC_EXT_VESA 0x20 /* DP 1.4 */ 155562306a36Sopenharmony_ci#define DP_SDP_VSC_EXT_CEA 0x21 /* DP 1.4 */ 155662306a36Sopenharmony_ci/* 0x80+ CEA-861 infoframe types */ 155762306a36Sopenharmony_ci 155862306a36Sopenharmony_ci#define DP_SDP_AUDIO_INFOFRAME_HB2 0x1b 155962306a36Sopenharmony_ci 156062306a36Sopenharmony_ci/** 156162306a36Sopenharmony_ci * struct dp_sdp_header - DP secondary data packet header 156262306a36Sopenharmony_ci * @HB0: Secondary Data Packet ID 156362306a36Sopenharmony_ci * @HB1: Secondary Data Packet Type 156462306a36Sopenharmony_ci * @HB2: Secondary Data Packet Specific header, Byte 0 156562306a36Sopenharmony_ci * @HB3: Secondary Data packet Specific header, Byte 1 156662306a36Sopenharmony_ci */ 156762306a36Sopenharmony_cistruct dp_sdp_header { 156862306a36Sopenharmony_ci u8 HB0; 156962306a36Sopenharmony_ci u8 HB1; 157062306a36Sopenharmony_ci u8 HB2; 157162306a36Sopenharmony_ci u8 HB3; 157262306a36Sopenharmony_ci} __packed; 157362306a36Sopenharmony_ci 157462306a36Sopenharmony_ci#define EDP_SDP_HEADER_REVISION_MASK 0x1F 157562306a36Sopenharmony_ci#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES 0x1F 157662306a36Sopenharmony_ci#define DP_SDP_PPS_HEADER_PAYLOAD_BYTES_MINUS_1 0x7F 157762306a36Sopenharmony_ci 157862306a36Sopenharmony_ci/** 157962306a36Sopenharmony_ci * struct dp_sdp - DP secondary data packet 158062306a36Sopenharmony_ci * @sdp_header: DP secondary data packet header 158162306a36Sopenharmony_ci * @db: DP secondaray data packet data blocks 158262306a36Sopenharmony_ci * VSC SDP Payload for PSR 158362306a36Sopenharmony_ci * db[0]: Stereo Interface 158462306a36Sopenharmony_ci * db[1]: 0 - PSR State; 1 - Update RFB; 2 - CRC Valid 158562306a36Sopenharmony_ci * db[2]: CRC value bits 7:0 of the R or Cr component 158662306a36Sopenharmony_ci * db[3]: CRC value bits 15:8 of the R or Cr component 158762306a36Sopenharmony_ci * db[4]: CRC value bits 7:0 of the G or Y component 158862306a36Sopenharmony_ci * db[5]: CRC value bits 15:8 of the G or Y component 158962306a36Sopenharmony_ci * db[6]: CRC value bits 7:0 of the B or Cb component 159062306a36Sopenharmony_ci * db[7]: CRC value bits 15:8 of the B or Cb component 159162306a36Sopenharmony_ci * db[8] - db[31]: Reserved 159262306a36Sopenharmony_ci * VSC SDP Payload for Pixel Encoding/Colorimetry Format 159362306a36Sopenharmony_ci * db[0] - db[15]: Reserved 159462306a36Sopenharmony_ci * db[16]: Pixel Encoding and Colorimetry Formats 159562306a36Sopenharmony_ci * db[17]: Dynamic Range and Component Bit Depth 159662306a36Sopenharmony_ci * db[18]: Content Type 159762306a36Sopenharmony_ci * db[19] - db[31]: Reserved 159862306a36Sopenharmony_ci */ 159962306a36Sopenharmony_cistruct dp_sdp { 160062306a36Sopenharmony_ci struct dp_sdp_header sdp_header; 160162306a36Sopenharmony_ci u8 db[32]; 160262306a36Sopenharmony_ci} __packed; 160362306a36Sopenharmony_ci 160462306a36Sopenharmony_ci#define EDP_VSC_PSR_STATE_ACTIVE (1<<0) 160562306a36Sopenharmony_ci#define EDP_VSC_PSR_UPDATE_RFB (1<<1) 160662306a36Sopenharmony_ci#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2) 160762306a36Sopenharmony_ci 160862306a36Sopenharmony_ci/** 160962306a36Sopenharmony_ci * enum dp_pixelformat - drm DP Pixel encoding formats 161062306a36Sopenharmony_ci * 161162306a36Sopenharmony_ci * This enum is used to indicate DP VSC SDP Pixel encoding formats. 161262306a36Sopenharmony_ci * It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through 161362306a36Sopenharmony_ci * DB18] 161462306a36Sopenharmony_ci * 161562306a36Sopenharmony_ci * @DP_PIXELFORMAT_RGB: RGB pixel encoding format 161662306a36Sopenharmony_ci * @DP_PIXELFORMAT_YUV444: YCbCr 4:4:4 pixel encoding format 161762306a36Sopenharmony_ci * @DP_PIXELFORMAT_YUV422: YCbCr 4:2:2 pixel encoding format 161862306a36Sopenharmony_ci * @DP_PIXELFORMAT_YUV420: YCbCr 4:2:0 pixel encoding format 161962306a36Sopenharmony_ci * @DP_PIXELFORMAT_Y_ONLY: Y Only pixel encoding format 162062306a36Sopenharmony_ci * @DP_PIXELFORMAT_RAW: RAW pixel encoding format 162162306a36Sopenharmony_ci * @DP_PIXELFORMAT_RESERVED: Reserved pixel encoding format 162262306a36Sopenharmony_ci */ 162362306a36Sopenharmony_cienum dp_pixelformat { 162462306a36Sopenharmony_ci DP_PIXELFORMAT_RGB = 0, 162562306a36Sopenharmony_ci DP_PIXELFORMAT_YUV444 = 0x1, 162662306a36Sopenharmony_ci DP_PIXELFORMAT_YUV422 = 0x2, 162762306a36Sopenharmony_ci DP_PIXELFORMAT_YUV420 = 0x3, 162862306a36Sopenharmony_ci DP_PIXELFORMAT_Y_ONLY = 0x4, 162962306a36Sopenharmony_ci DP_PIXELFORMAT_RAW = 0x5, 163062306a36Sopenharmony_ci DP_PIXELFORMAT_RESERVED = 0x6, 163162306a36Sopenharmony_ci}; 163262306a36Sopenharmony_ci 163362306a36Sopenharmony_ci/** 163462306a36Sopenharmony_ci * enum dp_colorimetry - drm DP Colorimetry formats 163562306a36Sopenharmony_ci * 163662306a36Sopenharmony_ci * This enum is used to indicate DP VSC SDP Colorimetry formats. 163762306a36Sopenharmony_ci * It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through 163862306a36Sopenharmony_ci * DB18] and a name of enum member follows enum drm_colorimetry definition. 163962306a36Sopenharmony_ci * 164062306a36Sopenharmony_ci * @DP_COLORIMETRY_DEFAULT: sRGB (IEC 61966-2-1) or 164162306a36Sopenharmony_ci * ITU-R BT.601 colorimetry format 164262306a36Sopenharmony_ci * @DP_COLORIMETRY_RGB_WIDE_FIXED: RGB wide gamut fixed point colorimetry format 164362306a36Sopenharmony_ci * @DP_COLORIMETRY_BT709_YCC: ITU-R BT.709 colorimetry format 164462306a36Sopenharmony_ci * @DP_COLORIMETRY_RGB_WIDE_FLOAT: RGB wide gamut floating point 164562306a36Sopenharmony_ci * (scRGB (IEC 61966-2-2)) colorimetry format 164662306a36Sopenharmony_ci * @DP_COLORIMETRY_XVYCC_601: xvYCC601 colorimetry format 164762306a36Sopenharmony_ci * @DP_COLORIMETRY_OPRGB: OpRGB colorimetry format 164862306a36Sopenharmony_ci * @DP_COLORIMETRY_XVYCC_709: xvYCC709 colorimetry format 164962306a36Sopenharmony_ci * @DP_COLORIMETRY_DCI_P3_RGB: DCI-P3 (SMPTE RP 431-2) colorimetry format 165062306a36Sopenharmony_ci * @DP_COLORIMETRY_SYCC_601: sYCC601 colorimetry format 165162306a36Sopenharmony_ci * @DP_COLORIMETRY_RGB_CUSTOM: RGB Custom Color Profile colorimetry format 165262306a36Sopenharmony_ci * @DP_COLORIMETRY_OPYCC_601: opYCC601 colorimetry format 165362306a36Sopenharmony_ci * @DP_COLORIMETRY_BT2020_RGB: ITU-R BT.2020 R' G' B' colorimetry format 165462306a36Sopenharmony_ci * @DP_COLORIMETRY_BT2020_CYCC: ITU-R BT.2020 Y'c C'bc C'rc colorimetry format 165562306a36Sopenharmony_ci * @DP_COLORIMETRY_BT2020_YCC: ITU-R BT.2020 Y' C'b C'r colorimetry format 165662306a36Sopenharmony_ci */ 165762306a36Sopenharmony_cienum dp_colorimetry { 165862306a36Sopenharmony_ci DP_COLORIMETRY_DEFAULT = 0, 165962306a36Sopenharmony_ci DP_COLORIMETRY_RGB_WIDE_FIXED = 0x1, 166062306a36Sopenharmony_ci DP_COLORIMETRY_BT709_YCC = 0x1, 166162306a36Sopenharmony_ci DP_COLORIMETRY_RGB_WIDE_FLOAT = 0x2, 166262306a36Sopenharmony_ci DP_COLORIMETRY_XVYCC_601 = 0x2, 166362306a36Sopenharmony_ci DP_COLORIMETRY_OPRGB = 0x3, 166462306a36Sopenharmony_ci DP_COLORIMETRY_XVYCC_709 = 0x3, 166562306a36Sopenharmony_ci DP_COLORIMETRY_DCI_P3_RGB = 0x4, 166662306a36Sopenharmony_ci DP_COLORIMETRY_SYCC_601 = 0x4, 166762306a36Sopenharmony_ci DP_COLORIMETRY_RGB_CUSTOM = 0x5, 166862306a36Sopenharmony_ci DP_COLORIMETRY_OPYCC_601 = 0x5, 166962306a36Sopenharmony_ci DP_COLORIMETRY_BT2020_RGB = 0x6, 167062306a36Sopenharmony_ci DP_COLORIMETRY_BT2020_CYCC = 0x6, 167162306a36Sopenharmony_ci DP_COLORIMETRY_BT2020_YCC = 0x7, 167262306a36Sopenharmony_ci}; 167362306a36Sopenharmony_ci 167462306a36Sopenharmony_ci/** 167562306a36Sopenharmony_ci * enum dp_dynamic_range - drm DP Dynamic Range 167662306a36Sopenharmony_ci * 167762306a36Sopenharmony_ci * This enum is used to indicate DP VSC SDP Dynamic Range. 167862306a36Sopenharmony_ci * It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through 167962306a36Sopenharmony_ci * DB18] 168062306a36Sopenharmony_ci * 168162306a36Sopenharmony_ci * @DP_DYNAMIC_RANGE_VESA: VESA range 168262306a36Sopenharmony_ci * @DP_DYNAMIC_RANGE_CTA: CTA range 168362306a36Sopenharmony_ci */ 168462306a36Sopenharmony_cienum dp_dynamic_range { 168562306a36Sopenharmony_ci DP_DYNAMIC_RANGE_VESA = 0, 168662306a36Sopenharmony_ci DP_DYNAMIC_RANGE_CTA = 1, 168762306a36Sopenharmony_ci}; 168862306a36Sopenharmony_ci 168962306a36Sopenharmony_ci/** 169062306a36Sopenharmony_ci * enum dp_content_type - drm DP Content Type 169162306a36Sopenharmony_ci * 169262306a36Sopenharmony_ci * This enum is used to indicate DP VSC SDP Content Types. 169362306a36Sopenharmony_ci * It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through 169462306a36Sopenharmony_ci * DB18] 169562306a36Sopenharmony_ci * CTA-861-G defines content types and expected processing by a sink device 169662306a36Sopenharmony_ci * 169762306a36Sopenharmony_ci * @DP_CONTENT_TYPE_NOT_DEFINED: Not defined type 169862306a36Sopenharmony_ci * @DP_CONTENT_TYPE_GRAPHICS: Graphics type 169962306a36Sopenharmony_ci * @DP_CONTENT_TYPE_PHOTO: Photo type 170062306a36Sopenharmony_ci * @DP_CONTENT_TYPE_VIDEO: Video type 170162306a36Sopenharmony_ci * @DP_CONTENT_TYPE_GAME: Game type 170262306a36Sopenharmony_ci */ 170362306a36Sopenharmony_cienum dp_content_type { 170462306a36Sopenharmony_ci DP_CONTENT_TYPE_NOT_DEFINED = 0x00, 170562306a36Sopenharmony_ci DP_CONTENT_TYPE_GRAPHICS = 0x01, 170662306a36Sopenharmony_ci DP_CONTENT_TYPE_PHOTO = 0x02, 170762306a36Sopenharmony_ci DP_CONTENT_TYPE_VIDEO = 0x03, 170862306a36Sopenharmony_ci DP_CONTENT_TYPE_GAME = 0x04, 170962306a36Sopenharmony_ci}; 171062306a36Sopenharmony_ci 171162306a36Sopenharmony_ci#endif /* _DRM_DP_H_ */ 1712