2 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
15 ".pushsection .text.hdcp_handler, \"ax\", %progbits\n"
16 ".global hdcp_handler\n"
19 ".incbin \"" __XSTRING(HDCPFW
) "\"\n"
20 ".type hdcp_handler, %function\n"
21 ".size hdcp_handler, .- hdcp_handler\n"
25 static uint64_t *hdcp_key_pdata
;
26 static struct cdn_dp_hdcp_key_1x key
;
28 int hdcp_handler(struct cdn_dp_hdcp_key_1x
*key
);
30 uint64_t dp_hdcp_ctrl(uint64_t type
)
33 case HDCP_KEY_DATA_START_TRANSFER
:
34 memset(&key
, 0x00, sizeof(key
));
35 hdcp_key_pdata
= (uint64_t *)&key
;
37 case HDCP_KEY_DATA_START_DECRYPT
:
38 if (hdcp_key_pdata
== (uint64_t *)(&key
+ 1))
39 return hdcp_handler(&key
);
41 return PSCI_E_INVALID_PARAMS
;
42 assert(0); /* Unreachable */
48 uint64_t dp_hdcp_store_key(uint64_t x1
,
55 if (hdcp_key_pdata
< (uint64_t *)&key
||
56 hdcp_key_pdata
+ 6 > (uint64_t *)(&key
+ 1))
57 return PSCI_E_INVALID_PARAMS
;
59 hdcp_key_pdata
[0] = x1
;
60 hdcp_key_pdata
[1] = x2
;
61 hdcp_key_pdata
[2] = x3
;
62 hdcp_key_pdata
[3] = x4
;
63 hdcp_key_pdata
[4] = x5
;
64 hdcp_key_pdata
[5] = x6
;