| 1 | /* SPDX-License-Identifier: (GPL-2.0+) */ | 
|---|
| 2 | /* | 
|---|
| 3 | * Copyright © 2017-2019 Intel Corporation | 
|---|
| 4 | * | 
|---|
| 5 | * Authors: | 
|---|
| 6 | * Ramalingam C <ramalingam.c@intel.com> | 
|---|
| 7 | */ | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef _I915_HDCP_INTERFACE_H_ | 
|---|
| 10 | #define _I915_HDCP_INTERFACE_H_ | 
|---|
| 11 |  | 
|---|
| 12 | #include <linux/mutex.h> | 
|---|
| 13 | #include <linux/device.h> | 
|---|
| 14 | #include <drm/display/drm_hdcp.h> | 
|---|
| 15 |  | 
|---|
| 16 | /** | 
|---|
| 17 | * enum hdcp_port_type - HDCP port implementation type defined by ME/GSC FW | 
|---|
| 18 | * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type | 
|---|
| 19 | * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port | 
|---|
| 20 | * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON | 
|---|
| 21 | *			   (HDMI 2.0) solution | 
|---|
| 22 | * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP (DP 1.3) | 
|---|
| 23 | *			 solution | 
|---|
| 24 | */ | 
|---|
| 25 | enum hdcp_port_type { | 
|---|
| 26 | HDCP_PORT_TYPE_INVALID, | 
|---|
| 27 | HDCP_PORT_TYPE_INTEGRATED, | 
|---|
| 28 | HDCP_PORT_TYPE_LSPCON, | 
|---|
| 29 | HDCP_PORT_TYPE_CPDP | 
|---|
| 30 | }; | 
|---|
| 31 |  | 
|---|
| 32 | /** | 
|---|
| 33 | * enum hdcp_wired_protocol - HDCP adaptation used on the port | 
|---|
| 34 | * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol | 
|---|
| 35 | * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port | 
|---|
| 36 | * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port | 
|---|
| 37 | */ | 
|---|
| 38 | enum hdcp_wired_protocol { | 
|---|
| 39 | HDCP_PROTOCOL_INVALID, | 
|---|
| 40 | HDCP_PROTOCOL_HDMI, | 
|---|
| 41 | HDCP_PROTOCOL_DP | 
|---|
| 42 | }; | 
|---|
| 43 |  | 
|---|
| 44 | enum hdcp_ddi { | 
|---|
| 45 | HDCP_DDI_INVALID_PORT = 0x0, | 
|---|
| 46 |  | 
|---|
| 47 | HDCP_DDI_B = 1, | 
|---|
| 48 | HDCP_DDI_C, | 
|---|
| 49 | HDCP_DDI_D, | 
|---|
| 50 | HDCP_DDI_E, | 
|---|
| 51 | HDCP_DDI_F, | 
|---|
| 52 | HDCP_DDI_A = 7, | 
|---|
| 53 | HDCP_DDI_RANGE_END = HDCP_DDI_A, | 
|---|
| 54 | }; | 
|---|
| 55 |  | 
|---|
| 56 | /** | 
|---|
| 57 | * enum hdcp_transcoder - ME/GSC Firmware defined index for transcoders | 
|---|
| 58 | * @HDCP_INVALID_TRANSCODER: Index for Invalid transcoder | 
|---|
| 59 | * @HDCP_TRANSCODER_EDP: Index for EDP Transcoder | 
|---|
| 60 | * @HDCP_TRANSCODER_DSI0: Index for DSI0 Transcoder | 
|---|
| 61 | * @HDCP_TRANSCODER_DSI1: Index for DSI1 Transcoder | 
|---|
| 62 | * @HDCP_TRANSCODER_A: Index for Transcoder A | 
|---|
| 63 | * @HDCP_TRANSCODER_B: Index for Transcoder B | 
|---|
| 64 | * @HDCP_TRANSCODER_C: Index for Transcoder C | 
|---|
| 65 | * @HDCP_TRANSCODER_D: Index for Transcoder D | 
|---|
| 66 | */ | 
|---|
| 67 | enum hdcp_transcoder { | 
|---|
| 68 | HDCP_INVALID_TRANSCODER = 0x00, | 
|---|
| 69 | HDCP_TRANSCODER_EDP, | 
|---|
| 70 | HDCP_TRANSCODER_DSI0, | 
|---|
| 71 | HDCP_TRANSCODER_DSI1, | 
|---|
| 72 | HDCP_TRANSCODER_A = 0x10, | 
|---|
| 73 | HDCP_TRANSCODER_B, | 
|---|
| 74 | HDCP_TRANSCODER_C, | 
|---|
| 75 | HDCP_TRANSCODER_D | 
|---|
| 76 | }; | 
|---|
| 77 |  | 
|---|
| 78 | /** | 
|---|
| 79 | * struct hdcp_port_data - intel specific HDCP port data | 
|---|
| 80 | * @hdcp_ddi: ddi index as per ME/GSC FW | 
|---|
| 81 | * @hdcp_transcoder: transcoder index as per ME/GSC FW | 
|---|
| 82 | * @port_type: HDCP port type as per ME/GSC FW classification | 
|---|
| 83 | * @protocol: HDCP adaptation as per ME/GSC FW | 
|---|
| 84 | * @k: No of streams transmitted on a port. Only on DP MST this is != 1 | 
|---|
| 85 | * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated. | 
|---|
| 86 | *	       Initialized to 0 on AKE_INIT. Incremented after every successful | 
|---|
| 87 | *	       transmission of RepeaterAuth_Stream_Manage message. When it rolls | 
|---|
| 88 | *	       over re-Auth has to be triggered. | 
|---|
| 89 | * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the | 
|---|
| 90 | *	     streams | 
|---|
| 91 | */ | 
|---|
| 92 | struct hdcp_port_data { | 
|---|
| 93 | enum hdcp_ddi hdcp_ddi; | 
|---|
| 94 | enum hdcp_transcoder hdcp_transcoder; | 
|---|
| 95 | u8 port_type; | 
|---|
| 96 | u8 protocol; | 
|---|
| 97 | u16 k; | 
|---|
| 98 | u32 seq_num_m; | 
|---|
| 99 | struct hdcp2_streamid_type *streams; | 
|---|
| 100 | }; | 
|---|
| 101 |  | 
|---|
| 102 | /** | 
|---|
| 103 | * struct i915_hdcp_ops- ops for HDCP2.2 services. | 
|---|
| 104 | * @owner: Module providing the ops | 
|---|
| 105 | * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session. | 
|---|
| 106 | *			    And Prepare AKE_Init. | 
|---|
| 107 | * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate | 
|---|
| 108 | *				     AKE_Send_Cert and prepare | 
|---|
| 109 | *				     AKE_Stored_Km/AKE_No_Stored_Km | 
|---|
| 110 | * @verify_hprime: Verify AKE_Send_H_prime | 
|---|
| 111 | * @store_pairing_info: Store pairing info received | 
|---|
| 112 | * @initiate_locality_check: Prepare LC_Init | 
|---|
| 113 | * @verify_lprime: Verify lprime | 
|---|
| 114 | * @get_session_key: Prepare SKE_Send_Eks | 
|---|
| 115 | * @repeater_check_flow_prepare_ack: Validate the Downstream topology | 
|---|
| 116 | *				     and prepare rep_ack | 
|---|
| 117 | * @verify_mprime: Verify mprime | 
|---|
| 118 | * @enable_hdcp_authentication:  Mark a port as authenticated. | 
|---|
| 119 | * @close_hdcp_session: Close the Wired HDCP Tx session per port. | 
|---|
| 120 | *			This also disables the authenticated state of the port. | 
|---|
| 121 | */ | 
|---|
| 122 | struct i915_hdcp_ops { | 
|---|
| 123 | /** | 
|---|
| 124 | * @owner: hdcp module | 
|---|
| 125 | */ | 
|---|
| 126 | struct module *owner; | 
|---|
| 127 |  | 
|---|
| 128 | int (*initiate_hdcp2_session)(struct device *dev, | 
|---|
| 129 | struct hdcp_port_data *data, | 
|---|
| 130 | struct hdcp2_ake_init *ake_data); | 
|---|
| 131 | int (*verify_receiver_cert_prepare_km)(struct device *dev, | 
|---|
| 132 | struct hdcp_port_data *data, | 
|---|
| 133 | struct hdcp2_ake_send_cert | 
|---|
| 134 | *rx_cert, | 
|---|
| 135 | bool *km_stored, | 
|---|
| 136 | struct hdcp2_ake_no_stored_km | 
|---|
| 137 | *ek_pub_km, | 
|---|
| 138 | size_t *msg_sz); | 
|---|
| 139 | int (*verify_hprime)(struct device *dev, | 
|---|
| 140 | struct hdcp_port_data *data, | 
|---|
| 141 | struct hdcp2_ake_send_hprime *rx_hprime); | 
|---|
| 142 | int (*store_pairing_info)(struct device *dev, | 
|---|
| 143 | struct hdcp_port_data *data, | 
|---|
| 144 | struct hdcp2_ake_send_pairing_info | 
|---|
| 145 | *pairing_info); | 
|---|
| 146 | int (*initiate_locality_check)(struct device *dev, | 
|---|
| 147 | struct hdcp_port_data *data, | 
|---|
| 148 | struct hdcp2_lc_init *lc_init_data); | 
|---|
| 149 | int (*verify_lprime)(struct device *dev, | 
|---|
| 150 | struct hdcp_port_data *data, | 
|---|
| 151 | struct hdcp2_lc_send_lprime *rx_lprime); | 
|---|
| 152 | int (*get_session_key)(struct device *dev, | 
|---|
| 153 | struct hdcp_port_data *data, | 
|---|
| 154 | struct hdcp2_ske_send_eks *ske_data); | 
|---|
| 155 | int (*repeater_check_flow_prepare_ack)(struct device *dev, | 
|---|
| 156 | struct hdcp_port_data *data, | 
|---|
| 157 | struct hdcp2_rep_send_receiverid_list | 
|---|
| 158 | *rep_topology, | 
|---|
| 159 | struct hdcp2_rep_send_ack | 
|---|
| 160 | *rep_send_ack); | 
|---|
| 161 | int (*verify_mprime)(struct device *dev, | 
|---|
| 162 | struct hdcp_port_data *data, | 
|---|
| 163 | struct hdcp2_rep_stream_ready *stream_ready); | 
|---|
| 164 | int (*enable_hdcp_authentication)(struct device *dev, | 
|---|
| 165 | struct hdcp_port_data *data); | 
|---|
| 166 | int (*close_hdcp_session)(struct device *dev, | 
|---|
| 167 | struct hdcp_port_data *data); | 
|---|
| 168 | }; | 
|---|
| 169 |  | 
|---|
| 170 | /** | 
|---|
| 171 | * struct i915_hdcp_arbiter - Used for communication between i915 | 
|---|
| 172 | * and hdcp drivers for the HDCP2.2 services | 
|---|
| 173 | */ | 
|---|
| 174 | struct i915_hdcp_arbiter { | 
|---|
| 175 | /** | 
|---|
| 176 | * @hdcp_dev: device that provides the HDCP2.2 service from MEI Bus. | 
|---|
| 177 | */ | 
|---|
| 178 | struct device *hdcp_dev; | 
|---|
| 179 |  | 
|---|
| 180 | /** | 
|---|
| 181 | * @ops: Ops implemented by hdcp driver or intel_hdcp_gsc, used by i915 | 
|---|
| 182 | * driver. | 
|---|
| 183 | */ | 
|---|
| 184 | const struct i915_hdcp_ops *ops; | 
|---|
| 185 |  | 
|---|
| 186 | /** | 
|---|
| 187 | * @mutex: To protect the above members. | 
|---|
| 188 | */ | 
|---|
| 189 | struct mutex mutex; | 
|---|
| 190 | }; | 
|---|
| 191 |  | 
|---|
| 192 | /* fw_hdcp_status: Enumeration of all HDCP Status Codes */ | 
|---|
| 193 | enum fw_hdcp_status { | 
|---|
| 194 | FW_HDCP_STATUS_SUCCESS			= 0x0000, | 
|---|
| 195 |  | 
|---|
| 196 | /* WiDi Generic Status Codes */ | 
|---|
| 197 | FW_HDCP_STATUS_INTERNAL_ERROR		= 0x1000, | 
|---|
| 198 | FW_HDCP_STATUS_UNKNOWN_ERROR		= 0x1001, | 
|---|
| 199 | FW_HDCP_STATUS_INCORRECT_API_VERSION	= 0x1002, | 
|---|
| 200 | FW_HDCP_STATUS_INVALID_FUNCTION		= 0x1003, | 
|---|
| 201 | FW_HDCP_STATUS_INVALID_BUFFER_LENGTH	= 0x1004, | 
|---|
| 202 | FW_HDCP_STATUS_INVALID_PARAMS		= 0x1005, | 
|---|
| 203 | FW_HDCP_STATUS_AUTHENTICATION_FAILED	= 0x1006, | 
|---|
| 204 |  | 
|---|
| 205 | /* WiDi Status Codes */ | 
|---|
| 206 | FW_HDCP_INVALID_SESSION_STATE		= 0x6000, | 
|---|
| 207 | FW_HDCP_SRM_FRAGMENT_UNEXPECTED		= 0x6001, | 
|---|
| 208 | FW_HDCP_SRM_INVALID_LENGTH		= 0x6002, | 
|---|
| 209 | FW_HDCP_SRM_FRAGMENT_OFFSET_INVALID	= 0x6003, | 
|---|
| 210 | FW_HDCP_SRM_VERIFICATION_FAILED		= 0x6004, | 
|---|
| 211 | FW_HDCP_SRM_VERSION_TOO_OLD		= 0x6005, | 
|---|
| 212 | FW_HDCP_RX_CERT_VERIFICATION_FAILED	= 0x6006, | 
|---|
| 213 | FW_HDCP_RX_REVOKED			= 0x6007, | 
|---|
| 214 | FW_HDCP_H_VERIFICATION_FAILED		= 0x6008, | 
|---|
| 215 | FW_HDCP_REPEATER_CHECK_UNEXPECTED	= 0x6009, | 
|---|
| 216 | FW_HDCP_TOPOLOGY_MAX_EXCEEDED		= 0x600A, | 
|---|
| 217 | FW_HDCP_V_VERIFICATION_FAILED		= 0x600B, | 
|---|
| 218 | FW_HDCP_L_VERIFICATION_FAILED		= 0x600C, | 
|---|
| 219 | FW_HDCP_STREAM_KEY_ALLOC_FAILED		= 0x600D, | 
|---|
| 220 | FW_HDCP_BASE_KEY_RESET_FAILED		= 0x600E, | 
|---|
| 221 | FW_HDCP_NONCE_GENERATION_FAILED		= 0x600F, | 
|---|
| 222 | FW_HDCP_STATUS_INVALID_E_KEY_STATE	= 0x6010, | 
|---|
| 223 | FW_HDCP_STATUS_INVALID_CS_ICV		= 0x6011, | 
|---|
| 224 | FW_HDCP_STATUS_INVALID_KB_KEY_STATE	= 0x6012, | 
|---|
| 225 | FW_HDCP_STATUS_INVALID_PAVP_MODE_ICV	= 0x6013, | 
|---|
| 226 | FW_HDCP_STATUS_INVALID_PAVP_MODE	= 0x6014, | 
|---|
| 227 | FW_HDCP_STATUS_LC_MAX_ATTEMPTS		= 0x6015, | 
|---|
| 228 |  | 
|---|
| 229 | /* New status for HDCP 2.1 */ | 
|---|
| 230 | FW_HDCP_STATUS_MISMATCH_IN_M		= 0x6016, | 
|---|
| 231 |  | 
|---|
| 232 | /* New status code for HDCP 2.2 Rx */ | 
|---|
| 233 | FW_HDCP_STATUS_RX_PROV_NOT_ALLOWED	= 0x6017, | 
|---|
| 234 | FW_HDCP_STATUS_RX_PROV_WRONG_SUBJECT	= 0x6018, | 
|---|
| 235 | FW_HDCP_RX_NEEDS_PROVISIONING		= 0x6019, | 
|---|
| 236 | FW_HDCP_BKSV_ICV_AUTH_FAILED		= 0x6020, | 
|---|
| 237 | FW_HDCP_STATUS_INVALID_STREAM_ID	= 0x6021, | 
|---|
| 238 | FW_HDCP_STATUS_CHAIN_NOT_INITIALIZED	= 0x6022, | 
|---|
| 239 | FW_HDCP_FAIL_NOT_EXPECTED		= 0x6023, | 
|---|
| 240 | FW_HDCP_FAIL_HDCP_OFF			= 0x6024, | 
|---|
| 241 | FW_HDCP_FAIL_INVALID_PAVP_MEMORY_MODE	= 0x6025, | 
|---|
| 242 | FW_HDCP_FAIL_AES_ECB_FAILURE		= 0x6026, | 
|---|
| 243 | FW_HDCP_FEATURE_NOT_SUPPORTED		= 0x6027, | 
|---|
| 244 | FW_HDCP_DMA_READ_ERROR			= 0x6028, | 
|---|
| 245 | FW_HDCP_DMA_WRITE_ERROR			= 0x6029, | 
|---|
| 246 | FW_HDCP_FAIL_INVALID_PACKET_SIZE	= 0x6030, | 
|---|
| 247 | FW_HDCP_H264_PARSING_ERROR		= 0x6031, | 
|---|
| 248 | FW_HDCP_HDCP2_ERRATA_VIDEO_VIOLATION	= 0x6032, | 
|---|
| 249 | FW_HDCP_HDCP2_ERRATA_AUDIO_VIOLATION	= 0x6033, | 
|---|
| 250 | FW_HDCP_TX_ACTIVE_ERROR			= 0x6034, | 
|---|
| 251 | FW_HDCP_MODE_CHANGE_ERROR		= 0x6035, | 
|---|
| 252 | FW_HDCP_STREAM_TYPE_ERROR		= 0x6036, | 
|---|
| 253 | FW_HDCP_STREAM_MANAGE_NOT_POSSIBLE	= 0x6037, | 
|---|
| 254 |  | 
|---|
| 255 | FW_HDCP_STATUS_PORT_INVALID_COMMAND	= 0x6038, | 
|---|
| 256 | FW_HDCP_STATUS_UNSUPPORTED_PROTOCOL	= 0x6039, | 
|---|
| 257 | FW_HDCP_STATUS_INVALID_PORT_INDEX	= 0x603a, | 
|---|
| 258 | FW_HDCP_STATUS_TX_AUTH_NEEDED		= 0x603b, | 
|---|
| 259 | FW_HDCP_STATUS_NOT_INTEGRATED_PORT	= 0x603c, | 
|---|
| 260 | FW_HDCP_STATUS_SESSION_MAX_REACHED	= 0x603d, | 
|---|
| 261 |  | 
|---|
| 262 | /* hdcp capable bit is not set in rx_caps(error is unique to DP) */ | 
|---|
| 263 | FW_HDCP_STATUS_NOT_HDCP_CAPABLE		= 0x6041, | 
|---|
| 264 |  | 
|---|
| 265 | FW_HDCP_STATUS_INVALID_STREAM_COUNT	= 0x6042, | 
|---|
| 266 | }; | 
|---|
| 267 |  | 
|---|
| 268 | #define HDCP_API_VERSION				0x00010000 | 
|---|
| 269 |  | 
|---|
| 270 | #define HDCP_M_LEN					16 | 
|---|
| 271 | #define HDCP_KH_LEN					16 | 
|---|
| 272 |  | 
|---|
| 273 | /* Payload Buffer size(Excluding Header) for CMDs and corresponding response */ | 
|---|
| 274 | /* Wired_Tx_AKE  */ | 
|---|
| 275 | #define	WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN	(4 + 1) | 
|---|
| 276 | #define	WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_OUT	(4 + 8 + 3) | 
|---|
| 277 |  | 
|---|
| 278 | #define	WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN	(4 + 522 + 8 + 3) | 
|---|
| 279 | #define	WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MIN_OUT	(4 + 1 + 3 + 16 + 16) | 
|---|
| 280 | #define	WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MAX_OUT	(4 + 1 + 3 + 128) | 
|---|
| 281 |  | 
|---|
| 282 | #define	WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN		(4 + 32) | 
|---|
| 283 | #define	WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_OUT		(4) | 
|---|
| 284 |  | 
|---|
| 285 | #define	WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN		(4 + 16) | 
|---|
| 286 | #define	WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_OUT		(4) | 
|---|
| 287 |  | 
|---|
| 288 | #define	WIRED_CMD_BUF_LEN_CLOSE_SESSION_IN		(4) | 
|---|
| 289 | #define	WIRED_CMD_BUF_LEN_CLOSE_SESSION_OUT		(4) | 
|---|
| 290 |  | 
|---|
| 291 | /* Wired_Tx_LC */ | 
|---|
| 292 | #define	WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN	(4) | 
|---|
| 293 | #define	WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_OUT	(4 + 8) | 
|---|
| 294 |  | 
|---|
| 295 | #define	WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_IN		(4 + 32) | 
|---|
| 296 | #define	WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_OUT		(4) | 
|---|
| 297 |  | 
|---|
| 298 | /* Wired_Tx_SKE */ | 
|---|
| 299 | #define	WIRED_CMD_BUF_LEN_GET_SESSION_KEY_IN		(4) | 
|---|
| 300 | #define	WIRED_CMD_BUF_LEN_GET_SESSION_KEY_OUT		(4 + 16 + 8) | 
|---|
| 301 |  | 
|---|
| 302 | /* Wired_Tx_SKE */ | 
|---|
| 303 | #define	WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN		(4 + 1) | 
|---|
| 304 | #define	WIRED_CMD_BUF_LEN_ENABLE_AUTH_OUT		(4) | 
|---|
| 305 |  | 
|---|
| 306 | /* Wired_Tx_Repeater */ | 
|---|
| 307 | #define	WIRED_CMD_BUF_LEN_VERIFY_REPEATER_IN		(4 + 2 + 3 + 16 + 155) | 
|---|
| 308 | #define	WIRED_CMD_BUF_LEN_VERIFY_REPEATER_OUT		(4 + 1 + 16) | 
|---|
| 309 |  | 
|---|
| 310 | #define	WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_MIN_IN	(4 + 3 + \ | 
|---|
| 311 | 32 + 2 + 2) | 
|---|
| 312 |  | 
|---|
| 313 | #define	WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_OUT		(4) | 
|---|
| 314 |  | 
|---|
| 315 | /* hdcp_command_id: Enumeration of all WIRED HDCP Command IDs */ | 
|---|
| 316 | enum hdcp_command_id { | 
|---|
| 317 | _WIDI_COMMAND_BASE		= 0x00030000, | 
|---|
| 318 | WIDI_INITIATE_HDCP2_SESSION	= _WIDI_COMMAND_BASE, | 
|---|
| 319 | HDCP_GET_SRM_STATUS, | 
|---|
| 320 | HDCP_SEND_SRM_FRAGMENT, | 
|---|
| 321 |  | 
|---|
| 322 | /* The wired HDCP Tx commands */ | 
|---|
| 323 | _WIRED_COMMAND_BASE		= 0x00031000, | 
|---|
| 324 | WIRED_INITIATE_HDCP2_SESSION	= _WIRED_COMMAND_BASE, | 
|---|
| 325 | WIRED_VERIFY_RECEIVER_CERT, | 
|---|
| 326 | WIRED_AKE_SEND_HPRIME, | 
|---|
| 327 | WIRED_AKE_SEND_PAIRING_INFO, | 
|---|
| 328 | WIRED_INIT_LOCALITY_CHECK, | 
|---|
| 329 | WIRED_VALIDATE_LOCALITY, | 
|---|
| 330 | WIRED_GET_SESSION_KEY, | 
|---|
| 331 | WIRED_ENABLE_AUTH, | 
|---|
| 332 | WIRED_VERIFY_REPEATER, | 
|---|
| 333 | WIRED_REPEATER_AUTH_STREAM_REQ, | 
|---|
| 334 | WIRED_CLOSE_SESSION, | 
|---|
| 335 |  | 
|---|
| 336 | _WIRED_COMMANDS_COUNT, | 
|---|
| 337 | }; | 
|---|
| 338 |  | 
|---|
| 339 | union encrypted_buff { | 
|---|
| 340 | u8		e_kpub_km[HDCP_2_2_E_KPUB_KM_LEN]; | 
|---|
| 341 | u8		e_kh_km_m[HDCP_2_2_E_KH_KM_M_LEN]; | 
|---|
| 342 | struct { | 
|---|
| 343 | u8	e_kh_km[HDCP_KH_LEN]; | 
|---|
| 344 | u8	m[HDCP_M_LEN]; | 
|---|
| 345 | } __packed; | 
|---|
| 346 | }; | 
|---|
| 347 |  | 
|---|
| 348 | /* HDCP HECI message header. All header values are little endian. */ | 
|---|
| 349 | struct  { | 
|---|
| 350 | u32			; | 
|---|
| 351 | u32			command_id; | 
|---|
| 352 | enum fw_hdcp_status	; | 
|---|
| 353 | /* Length of the HECI message (excluding the header) */ | 
|---|
| 354 | u32			; | 
|---|
| 355 | } __packed; | 
|---|
| 356 |  | 
|---|
| 357 | /* Empty command request or response. No data follows the header. */ | 
|---|
| 358 | struct hdcp_cmd_no_data { | 
|---|
| 359 | struct hdcp_cmd_header ; | 
|---|
| 360 | } __packed; | 
|---|
| 361 |  | 
|---|
| 362 | /* Uniquely identifies the hdcp port being addressed for a given command. */ | 
|---|
| 363 | struct hdcp_port_id { | 
|---|
| 364 | u8	integrated_port_type; | 
|---|
| 365 | /* physical_port is used until Gen11.5. Must be zero for Gen11.5+ */ | 
|---|
| 366 | u8	physical_port; | 
|---|
| 367 | /* attached_transcoder is for Gen11.5+. Set to zero for <Gen11.5 */ | 
|---|
| 368 | u8	attached_transcoder; | 
|---|
| 369 | u8	reserved; | 
|---|
| 370 | } __packed; | 
|---|
| 371 |  | 
|---|
| 372 | /* | 
|---|
| 373 | * Data structures for integrated wired HDCP2 Tx in | 
|---|
| 374 | * support of the AKE protocol | 
|---|
| 375 | */ | 
|---|
| 376 | /* HECI struct for integrated wired HDCP Tx session initiation. */ | 
|---|
| 377 | struct wired_cmd_initiate_hdcp2_session_in { | 
|---|
| 378 | struct hdcp_cmd_header	; | 
|---|
| 379 | struct hdcp_port_id	port; | 
|---|
| 380 | u8			protocol; /* for HDMI vs DP */ | 
|---|
| 381 | } __packed; | 
|---|
| 382 |  | 
|---|
| 383 | struct wired_cmd_initiate_hdcp2_session_out { | 
|---|
| 384 | struct hdcp_cmd_header	; | 
|---|
| 385 | struct hdcp_port_id	port; | 
|---|
| 386 | u8			r_tx[HDCP_2_2_RTX_LEN]; | 
|---|
| 387 | struct hdcp2_tx_caps	tx_caps; | 
|---|
| 388 | } __packed; | 
|---|
| 389 |  | 
|---|
| 390 | /* HECI struct for ending an integrated wired HDCP Tx session. */ | 
|---|
| 391 | struct wired_cmd_close_session_in { | 
|---|
| 392 | struct hdcp_cmd_header	; | 
|---|
| 393 | struct hdcp_port_id	port; | 
|---|
| 394 | } __packed; | 
|---|
| 395 |  | 
|---|
| 396 | struct wired_cmd_close_session_out { | 
|---|
| 397 | struct hdcp_cmd_header	; | 
|---|
| 398 | struct hdcp_port_id	port; | 
|---|
| 399 | } __packed; | 
|---|
| 400 |  | 
|---|
| 401 | /* HECI struct for integrated wired HDCP Tx Rx Cert verification. */ | 
|---|
| 402 | struct wired_cmd_verify_receiver_cert_in { | 
|---|
| 403 | struct hdcp_cmd_header	; | 
|---|
| 404 | struct hdcp_port_id	port; | 
|---|
| 405 | struct hdcp2_cert_rx	cert_rx; | 
|---|
| 406 | u8			r_rx[HDCP_2_2_RRX_LEN]; | 
|---|
| 407 | u8			rx_caps[HDCP_2_2_RXCAPS_LEN]; | 
|---|
| 408 | } __packed; | 
|---|
| 409 |  | 
|---|
| 410 | struct wired_cmd_verify_receiver_cert_out { | 
|---|
| 411 | struct hdcp_cmd_header	; | 
|---|
| 412 | struct hdcp_port_id	port; | 
|---|
| 413 | u8			km_stored; | 
|---|
| 414 | u8			reserved[3]; | 
|---|
| 415 | union encrypted_buff	ekm_buff; | 
|---|
| 416 | } __packed; | 
|---|
| 417 |  | 
|---|
| 418 | /* HECI struct for verification of Rx's Hprime in a HDCP Tx session */ | 
|---|
| 419 | struct wired_cmd_ake_send_hprime_in { | 
|---|
| 420 | struct hdcp_cmd_header	; | 
|---|
| 421 | struct hdcp_port_id	port; | 
|---|
| 422 | u8			h_prime[HDCP_2_2_H_PRIME_LEN]; | 
|---|
| 423 | } __packed; | 
|---|
| 424 |  | 
|---|
| 425 | struct wired_cmd_ake_send_hprime_out { | 
|---|
| 426 | struct hdcp_cmd_header	; | 
|---|
| 427 | struct hdcp_port_id	port; | 
|---|
| 428 | } __packed; | 
|---|
| 429 |  | 
|---|
| 430 | /* | 
|---|
| 431 | * HECI struct for sending in AKE pairing data generated by the Rx in an | 
|---|
| 432 | * integrated wired HDCP Tx session. | 
|---|
| 433 | */ | 
|---|
| 434 | struct wired_cmd_ake_send_pairing_info_in { | 
|---|
| 435 | struct hdcp_cmd_header	; | 
|---|
| 436 | struct hdcp_port_id	port; | 
|---|
| 437 | u8			e_kh_km[HDCP_2_2_E_KH_KM_LEN]; | 
|---|
| 438 | } __packed; | 
|---|
| 439 |  | 
|---|
| 440 | struct wired_cmd_ake_send_pairing_info_out { | 
|---|
| 441 | struct hdcp_cmd_header	; | 
|---|
| 442 | struct hdcp_port_id	port; | 
|---|
| 443 | } __packed; | 
|---|
| 444 |  | 
|---|
| 445 | /* Data structures for integrated wired HDCP2 Tx in support of the LC protocol*/ | 
|---|
| 446 | /* | 
|---|
| 447 | * HECI struct for initiating locality check with an | 
|---|
| 448 | * integrated wired HDCP Tx session. | 
|---|
| 449 | */ | 
|---|
| 450 | struct wired_cmd_init_locality_check_in { | 
|---|
| 451 | struct hdcp_cmd_header	; | 
|---|
| 452 | struct hdcp_port_id	port; | 
|---|
| 453 | } __packed; | 
|---|
| 454 |  | 
|---|
| 455 | struct wired_cmd_init_locality_check_out { | 
|---|
| 456 | struct hdcp_cmd_header	; | 
|---|
| 457 | struct hdcp_port_id	port; | 
|---|
| 458 | u8			r_n[HDCP_2_2_RN_LEN]; | 
|---|
| 459 | } __packed; | 
|---|
| 460 |  | 
|---|
| 461 | /* | 
|---|
| 462 | * HECI struct for validating an Rx's LPrime value in an | 
|---|
| 463 | * integrated wired HDCP Tx session. | 
|---|
| 464 | */ | 
|---|
| 465 | struct wired_cmd_validate_locality_in { | 
|---|
| 466 | struct hdcp_cmd_header	; | 
|---|
| 467 | struct hdcp_port_id	port; | 
|---|
| 468 | u8			l_prime[HDCP_2_2_L_PRIME_LEN]; | 
|---|
| 469 | } __packed; | 
|---|
| 470 |  | 
|---|
| 471 | struct wired_cmd_validate_locality_out { | 
|---|
| 472 | struct hdcp_cmd_header	; | 
|---|
| 473 | struct hdcp_port_id	port; | 
|---|
| 474 | } __packed; | 
|---|
| 475 |  | 
|---|
| 476 | /* | 
|---|
| 477 | * Data structures for integrated wired HDCP2 Tx in support of the | 
|---|
| 478 | * SKE protocol | 
|---|
| 479 | */ | 
|---|
| 480 | /* HECI struct for creating session key */ | 
|---|
| 481 | struct wired_cmd_get_session_key_in { | 
|---|
| 482 | struct hdcp_cmd_header	; | 
|---|
| 483 | struct hdcp_port_id	port; | 
|---|
| 484 | } __packed; | 
|---|
| 485 |  | 
|---|
| 486 | struct wired_cmd_get_session_key_out { | 
|---|
| 487 | struct hdcp_cmd_header	; | 
|---|
| 488 | struct hdcp_port_id	port; | 
|---|
| 489 | u8			e_dkey_ks[HDCP_2_2_E_DKEY_KS_LEN]; | 
|---|
| 490 | u8			r_iv[HDCP_2_2_RIV_LEN]; | 
|---|
| 491 | } __packed; | 
|---|
| 492 |  | 
|---|
| 493 | /* HECI struct for the Tx enable authentication command */ | 
|---|
| 494 | struct wired_cmd_enable_auth_in { | 
|---|
| 495 | struct hdcp_cmd_header	; | 
|---|
| 496 | struct hdcp_port_id	port; | 
|---|
| 497 | u8			stream_type; | 
|---|
| 498 | } __packed; | 
|---|
| 499 |  | 
|---|
| 500 | struct wired_cmd_enable_auth_out { | 
|---|
| 501 | struct hdcp_cmd_header	; | 
|---|
| 502 | struct hdcp_port_id	port; | 
|---|
| 503 | } __packed; | 
|---|
| 504 |  | 
|---|
| 505 | /* | 
|---|
| 506 | * Data structures for integrated wired HDCP2 Tx in support of | 
|---|
| 507 | * the repeater protocols | 
|---|
| 508 | */ | 
|---|
| 509 | /* | 
|---|
| 510 | * HECI struct for verifying the downstream repeater's HDCP topology in an | 
|---|
| 511 | * integrated wired HDCP Tx session. | 
|---|
| 512 | */ | 
|---|
| 513 | struct wired_cmd_verify_repeater_in { | 
|---|
| 514 | struct hdcp_cmd_header	; | 
|---|
| 515 | struct hdcp_port_id	port; | 
|---|
| 516 | u8			rx_info[HDCP_2_2_RXINFO_LEN]; | 
|---|
| 517 | u8			seq_num_v[HDCP_2_2_SEQ_NUM_LEN]; | 
|---|
| 518 | u8			v_prime[HDCP_2_2_V_PRIME_HALF_LEN]; | 
|---|
| 519 | u8			receiver_ids[HDCP_2_2_RECEIVER_IDS_MAX_LEN]; | 
|---|
| 520 | } __packed; | 
|---|
| 521 |  | 
|---|
| 522 | struct wired_cmd_verify_repeater_out { | 
|---|
| 523 | struct hdcp_cmd_header	; | 
|---|
| 524 | struct hdcp_port_id	port; | 
|---|
| 525 | u8			content_type_supported; | 
|---|
| 526 | u8			v[HDCP_2_2_V_PRIME_HALF_LEN]; | 
|---|
| 527 | } __packed; | 
|---|
| 528 |  | 
|---|
| 529 | /* | 
|---|
| 530 | * HECI struct in support of stream management in an | 
|---|
| 531 | * integrated wired HDCP Tx session. | 
|---|
| 532 | */ | 
|---|
| 533 | struct wired_cmd_repeater_auth_stream_req_in { | 
|---|
| 534 | struct hdcp_cmd_header		; | 
|---|
| 535 | struct hdcp_port_id		port; | 
|---|
| 536 | u8				seq_num_m[HDCP_2_2_SEQ_NUM_LEN]; | 
|---|
| 537 | u8				m_prime[HDCP_2_2_MPRIME_LEN]; | 
|---|
| 538 | __be16				k; | 
|---|
| 539 | struct hdcp2_streamid_type	streams[]; | 
|---|
| 540 | } __packed; | 
|---|
| 541 |  | 
|---|
| 542 | struct wired_cmd_repeater_auth_stream_req_out { | 
|---|
| 543 | struct hdcp_cmd_header	; | 
|---|
| 544 | struct hdcp_port_id	port; | 
|---|
| 545 | } __packed; | 
|---|
| 546 |  | 
|---|
| 547 | #endif /* _I915_HDCP_INTERFACE_H_ */ | 
|---|
| 548 |  | 
|---|