2 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
12 #include <lib/smccc.h>
17 ".pushsection .text.hdcp_handler, \"ax\", %progbits\n"
18 ".global hdcp_handler\n"
21 ".incbin \"" __XSTRING(HDCPFW
) "\"\n"
22 ".type hdcp_handler, %function\n"
23 ".size hdcp_handler, .- hdcp_handler\n"
27 static uint64_t *hdcp_key_pdata
;
28 static struct cdn_dp_hdcp_key_1x key
;
30 int hdcp_handler(struct cdn_dp_hdcp_key_1x
*key
);
32 uint64_t dp_hdcp_ctrl(uint64_t type
)
35 case HDCP_KEY_DATA_START_TRANSFER
:
36 memset(&key
, 0x00, sizeof(key
));
37 hdcp_key_pdata
= (uint64_t *)&key
;
39 case HDCP_KEY_DATA_START_DECRYPT
:
40 if (hdcp_key_pdata
== (uint64_t *)(&key
+ 1))
41 return hdcp_handler(&key
);
43 return PSCI_E_INVALID_PARAMS
;
44 assert(0); /* Unreachable */
50 uint64_t dp_hdcp_store_key(uint64_t x1
,
57 if (hdcp_key_pdata
< (uint64_t *)&key
||
58 hdcp_key_pdata
+ 6 > (uint64_t *)(&key
+ 1))
59 return PSCI_E_INVALID_PARAMS
;
61 hdcp_key_pdata
[0] = x1
;
62 hdcp_key_pdata
[1] = x2
;
63 hdcp_key_pdata
[2] = x3
;
64 hdcp_key_pdata
[3] = x4
;
65 hdcp_key_pdata
[4] = x5
;
66 hdcp_key_pdata
[5] = x6
;