1 /* SPDX-License-Identifier: (GPL-2.0+) */
3 * Copyright © 2017-2019 Intel Corporation
6 * Ramalingam C <ramalingam.c@intel.com>
9 #ifndef _I915_MEI_HDCP_INTERFACE_H_
10 #define _I915_MEI_HDCP_INTERFACE_H_
12 #include <linux/mutex.h>
13 #include <linux/device.h>
14 #include <drm/drm_hdcp.h>
15 #include <drm/i915_drm.h>
18 * enum hdcp_port_type - HDCP port implementation type defined by ME FW
19 * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
20 * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
21 * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON
23 * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP (DP 1.3)
27 HDCP_PORT_TYPE_INVALID
,
28 HDCP_PORT_TYPE_INTEGRATED
,
29 HDCP_PORT_TYPE_LSPCON
,
34 * enum hdcp_wired_protocol - HDCP adaptation used on the port
35 * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
36 * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
37 * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port
39 enum hdcp_wired_protocol
{
40 HDCP_PROTOCOL_INVALID
,
46 MEI_DDI_INVALID_PORT
= 0x0,
54 MEI_DDI_RANGE_END
= MEI_DDI_A
,
58 * enum mei_fw_tc - ME Firmware defined index for transcoders
59 * @MEI_INVALID_TRANSCODER: Index for Invalid transcoder
60 * @MEI_TRANSCODER_EDP: Index for EDP Transcoder
61 * @MEI_TRANSCODER_DSI0: Index for DSI0 Transcoder
62 * @MEI_TRANSCODER_DSI1: Index for DSI1 Transcoder
63 * @MEI_TRANSCODER_A: Index for Transcoder A
64 * @MEI_TRANSCODER_B: Index for Transcoder B
65 * @MEI_TRANSCODER_C: Index for Transcoder C
66 * @MEI_TRANSCODER_D: Index for Transcoder D
69 MEI_INVALID_TRANSCODER
= 0x00,
73 MEI_TRANSCODER_A
= 0x10,
80 * struct hdcp_port_data - intel specific HDCP port data
81 * @fw_ddi: ddi index as per ME FW
82 * @fw_tc: transcoder index as per ME FW
83 * @port_type: HDCP port type as per ME FW classification
84 * @protocol: HDCP adaptation as per ME FW
85 * @k: No of streams transmitted on a port. Only on DP MST this is != 1
86 * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.
87 * Initialized to 0 on AKE_INIT. Incremented after every successful
88 * transmission of RepeaterAuth_Stream_Manage message. When it rolls
89 * over re-Auth has to be triggered.
90 * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the
93 struct hdcp_port_data
{
94 enum mei_fw_ddi fw_ddi
;
100 struct hdcp2_streamid_type
*streams
;
104 * struct i915_hdcp_component_ops- ops for HDCP2.2 services.
105 * @owner: Module providing the ops
106 * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
107 * And Prepare AKE_Init.
108 * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
109 * AKE_Send_Cert and prepare
110 AKE_Stored_Km/AKE_No_Stored_Km
111 * @verify_hprime: Verify AKE_Send_H_prime
112 * @store_pairing_info: Store pairing info received
113 * @initiate_locality_check: Prepare LC_Init
114 * @verify_lprime: Verify lprime
115 * @get_session_key: Prepare SKE_Send_Eks
116 * @repeater_check_flow_prepare_ack: Validate the Downstream topology
117 * and prepare rep_ack
118 * @verify_mprime: Verify mprime
119 * @enable_hdcp_authentication: Mark a port as authenticated.
120 * @close_hdcp_session: Close the Wired HDCP Tx session per port.
121 * This also disables the authenticated state of the port.
123 struct i915_hdcp_component_ops
{
125 * @owner: mei_hdcp module
127 struct module
*owner
;
129 int (*initiate_hdcp2_session
)(struct device
*dev
,
130 struct hdcp_port_data
*data
,
131 struct hdcp2_ake_init
*ake_data
);
132 int (*verify_receiver_cert_prepare_km
)(struct device
*dev
,
133 struct hdcp_port_data
*data
,
134 struct hdcp2_ake_send_cert
137 struct hdcp2_ake_no_stored_km
140 int (*verify_hprime
)(struct device
*dev
,
141 struct hdcp_port_data
*data
,
142 struct hdcp2_ake_send_hprime
*rx_hprime
);
143 int (*store_pairing_info
)(struct device
*dev
,
144 struct hdcp_port_data
*data
,
145 struct hdcp2_ake_send_pairing_info
147 int (*initiate_locality_check
)(struct device
*dev
,
148 struct hdcp_port_data
*data
,
149 struct hdcp2_lc_init
*lc_init_data
);
150 int (*verify_lprime
)(struct device
*dev
,
151 struct hdcp_port_data
*data
,
152 struct hdcp2_lc_send_lprime
*rx_lprime
);
153 int (*get_session_key
)(struct device
*dev
,
154 struct hdcp_port_data
*data
,
155 struct hdcp2_ske_send_eks
*ske_data
);
156 int (*repeater_check_flow_prepare_ack
)(struct device
*dev
,
157 struct hdcp_port_data
*data
,
158 struct hdcp2_rep_send_receiverid_list
160 struct hdcp2_rep_send_ack
162 int (*verify_mprime
)(struct device
*dev
,
163 struct hdcp_port_data
*data
,
164 struct hdcp2_rep_stream_ready
*stream_ready
);
165 int (*enable_hdcp_authentication
)(struct device
*dev
,
166 struct hdcp_port_data
*data
);
167 int (*close_hdcp_session
)(struct device
*dev
,
168 struct hdcp_port_data
*data
);
172 * struct i915_hdcp_component_master - Used for communication between i915
173 * and mei_hdcp drivers for the HDCP2.2 services
174 * @mei_dev: device that provide the HDCP2.2 service from MEI Bus.
175 * @hdcp_ops: Ops implemented by mei_hdcp driver, used by i915 driver.
177 struct i915_hdcp_comp_master
{
178 struct device
*mei_dev
;
179 const struct i915_hdcp_component_ops
*ops
;
181 /* To protect the above members. */
185 #endif /* _I915_MEI_HDCP_INTERFACE_H_ */