mtk_dp_hdcp2.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Copyright (c) 2020 MediaTek Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef HDCP_TX_H
  14. #define HDCP_TX_H
  15. #include "mtk_dp_common.h"
  16. #ifdef DPTX_HDCP_ENABLE
  17. #define HDCP2_RXSTATUS_SIZE 1
  18. #define HDCP2_RTX_SIZE 8
  19. #define HDCP2_RRX_SIZE 8
  20. #define HDCP2_TXCAPS_SIZE 3
  21. #define HDCP2_RXCAPS_SIZE 3
  22. #define HDCP2_M_SIZE 16
  23. #define HDCP2_KD_SIZE 32
  24. #define HDCP2_CERTRX_SIZE 522
  25. #define HDCP2_EKPUBKM_SIZE 128
  26. #define HDCP2_EKHKM_SIZE 16
  27. #define HDCP2_KM_SIZE 16
  28. #define HDCP2_KH_SIZE 16
  29. #define HDCP2_RN_SIZE 8
  30. #define HDCP2_LPRIME_SIZE 32
  31. #define HDCP2_EDKEYKS_SIZE 16
  32. #define HDCP2_KS_SIZE 16
  33. #define HDCP2_RIV_SIZE 8
  34. #define HDCP2_RXINFO_SIZE 2
  35. #define HDCP2_SEQ_NUM_V_SIZE 3
  36. #define HDCP2_RECVID_SIZE 5
  37. #define HDCP2_VPRIME_SIZE 16
  38. #define HDCP2_RECV_ID_LIST_SIZE 155
  39. #define HDCP2_SEQ_NUM_M_SIZE 3
  40. #define HDCP2_STREAMID_TYPE_SIZE 2
  41. #define HDCP2_K_SIZE 2
  42. #define HDCP2_REP_MPRIME_SIZE 32
  43. #define HDCP2_HPRIME_SIZE 32
  44. #define HDCP2_RX_ENCKEY_SIZE 104
  45. #define HDCP2_TX_ENCKEY_SIZE 448
  46. #define HDCP2_LC128_SIZE 16
  47. #define HDCP2_KPUBRX_MODULUS_SIZE 128
  48. #define HDCP2_KPUBRX_EXPONENT_SIZE 3
  49. #define HDCP2_KPUBRX_RESERVED_SIZE 2
  50. #define HDCP2_MAX_DEVICE_COUNT 31
  51. #define HDCP2_MAX_DEPTH_LEVEL 4
  52. #define HDCP2_KPUB_SIZE 384
  53. //timeout relative
  54. #define HDCP2_AKESENDCERT_WDT 100 // 100ms
  55. #define HDCP2_AKESENDHPRIME_NO_STORED_WDT 1000 // 1sec
  56. #define HDCP2_AKESENDHPRIME_STORED_WDT 200 // 200ms
  57. #define HDCP2_AKESENDPAIRINGINFO_WDT 200 // 200ms
  58. #define HDCP2_LCSENDLPRIME_WDT 7 // 7ms
  59. #define HDCP2_ENC_EN_TIMER 200 // 200 ms
  60. #define HDCP2_REPAUTHSENDRECVID_WDT 3000 // 3 sec
  61. #define HDCP2_REP_SEND_ACK 2000 // 2 Sec
  62. #define HDCP2_REPAUTHSTREAMRDY_WDT 100 // 100 ms
  63. //Patch for QD980 LLCTS
  64. #define HDCP2_TX_RETRY_CNT 1
  65. #define HDCP2_TX_LC_RETRY_CNT 1023
  66. #define HDCP2_STREAM_MANAGE_RETRY_CNT 8
  67. enum ENUM_HDCP2TX_MAIN_STATE {
  68. HDCP2_MS_H1P1 = 0,
  69. HDCP2_MS_A0F0 = 1,
  70. HDCP2_MS_A1F1 = 2,
  71. HDCP2_MS_A2F2 = 3,
  72. HDCP2_MS_A3F3 = 4,
  73. HDCP2_MS_A4F4 = 5,
  74. HDCP2_MS_A5F5 = 6,
  75. HDCP2_MS_A6F6 = 7,
  76. HDCP2_MS_A7F7 = 8,
  77. HDCP2_MS_A8F8 = 9,
  78. HDCP2_MS_A9F9 = 10
  79. };
  80. enum ENUM_HDCP2_MSG_LIST {
  81. HDCP2_MSG_ZERO = 0,
  82. HDCP2_MSG_AKE_INIT = 1,
  83. HDCP2_MSG_AKE_SEND_CERT = 2,
  84. HDCP2_MSG_AKE_NO_STORED_KM = 3,
  85. HDCP2_MSG_AKE_STORED_KM = 4,
  86. HDCP2_MSG_AKE_SEND_H_PRIME = 5,
  87. HDCP2_MSG_AKE_SEND_PAIRING_INFO = 6,
  88. HDCP2_MSG_LC_INIT = 7,
  89. HDCP2_MSG_LC_SEND_L_PRIME = 8,
  90. HDCP2_MSG_SKE_SEND_EKS = 9,
  91. HDCP2_MSG_REPAUTH_SEND_RECVID_LIST = 10,
  92. HDCP2_MSG_REPAUTH_VERIFY_RECVID_LIST = 11,
  93. HDCP2_MSG_REPAUTH_SEND_ACK = 12,
  94. HDCP2_MSG_REPAUTH_STREAM_MANAGE = 13,
  95. HDCP2_MSG_REPAUTH_STREAM_READY = 14,
  96. HDCP2_MSG_AUTH_FAIL = 15,
  97. HDCP2_MSG_AUTH_DONE = 16,
  98. };
  99. struct HDCP2_PAIRING_INFO {
  100. BYTE u8M[HDCP2_M_SIZE];
  101. BYTE u8EkhKM[HDCP2_EKHKM_SIZE];
  102. };
  103. enum ENUM_HDCP_ERR_CODE {
  104. HDCP_ERR_NONE = 0,
  105. HDCP_ERR_UNKNOWN_STATE,
  106. HDCP_ERR_SEND_MSG_FAIL,
  107. HDCP_ERR_RESPONSE_TIMEROUT,
  108. HDCP_ERR_PROCESS_FAIL
  109. };
  110. int HDCPTx_Hdcp2FSM(struct mtk_dp *mtk_dp);
  111. void mdrv_DPTx_HDCP2_SetStartAuth(struct mtk_dp *mtk_dp, bool bEnable);
  112. bool mdrv_DPTx_HDCP2_Support(struct mtk_dp *mtk_dp);
  113. bool mdrv_DPTx_HDCP2_irq(struct mtk_dp *mtk_dp);
  114. #endif
  115. #endif //#ifndef HDCP_TX_H