1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Cadence MHDP8546 DP bridge driver.
5 * Copyright (C) 2020 Cadence Design Systems, Inc.
9 #ifndef CDNS_MHDP8546_HDCP_H
10 #define CDNS_MHDP8546_HDCP_H
12 #include "cdns-mhdp8546-core.h"
14 #define HDCP_MAX_RECEIVERS 32
15 #define HDCP_RECEIVER_ID_SIZE_BYTES 5
16 #define HDCP_STATUS_SIZE 0x5
17 #define HDCP_PORT_STS_AUTH 0x1
18 #define HDCP_PORT_STS_LAST_ERR_SHIFT 0x5
19 #define HDCP_PORT_STS_LAST_ERR_MASK (0x0F << 5)
20 #define GET_HDCP_PORT_STS_LAST_ERR(__sts__) \
21 (((__sts__) & HDCP_PORT_STS_LAST_ERR_MASK) >> \
22 HDCP_PORT_STS_LAST_ERR_SHIFT)
24 #define HDCP_CONFIG_1_4 BIT(0) /* use HDCP 1.4 only */
25 #define HDCP_CONFIG_2_2 BIT(1) /* use HDCP 2.2 only */
26 /* use All HDCP versions */
27 #define HDCP_CONFIG_ALL (BIT(0) | BIT(1))
28 #define HDCP_CONFIG_NONE 0
31 HDCP_GENERAL_SET_LC_128,
36 HDCP_TRAN_CONFIGURATION,
37 HDCP2X_TX_SET_PUBLIC_KEY_PARAMS,
38 HDCP2X_TX_SET_DEBUG_RANDOM_NUMBERS,
41 HDCP1_TX_SEND_RANDOM_AN,
42 HDCP_TRAN_STATUS_CHANGE,
43 HDCP2X_TX_IS_KM_STORED,
45 HDCP_TRAN_IS_REC_ID_VALID,
46 HDCP_TRAN_RESPOND_RECEIVER_ID_VALID,
48 HDCP2X_TX_SET_KM_KEY_PARAMS,
49 HDCP_NUM_OF_SUPPORTED_MESSAGES
57 #define DRM_HDCP_CHECK_PERIOD_MS (128 * 16)
59 #define HDCP_PAIRING_R_ID 5
60 #define HDCP_PAIRING_M_LEN 16
61 #define HDCP_KM_LEN 16
62 #define HDCP_PAIRING_M_EKH 16
64 struct cdns_hdcp_pairing_data {
65 u8 receiver_id[HDCP_PAIRING_R_ID];
66 u8 m[HDCP_PAIRING_M_LEN];
68 u8 ekh[HDCP_PAIRING_M_EKH];
77 #define DLP_MODULUS_N 384
80 struct cdns_hdcp_tx_public_key_param {
85 int cdns_mhdp_hdcp_set_public_key_param(struct cdns_mhdp_device *mhdp,
86 struct cdns_hdcp_tx_public_key_param *val);
87 int cdns_mhdp_hdcp_set_lc(struct cdns_mhdp_device *mhdp, u8 *val);
88 int cdns_mhdp_hdcp_enable(struct cdns_mhdp_device *mhdp, u8 content_type);
89 int cdns_mhdp_hdcp_disable(struct cdns_mhdp_device *mhdp);
90 void cdns_mhdp_hdcp_init(struct cdns_mhdp_device *mhdp);