diff options
| author | Daniel Fu <danifu@nvidia.com> | 2018-01-24 02:42:41 -0500 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-27 02:46:35 -0500 |
| commit | 05c7451400f36bcca05ee1c7ce69fbf3849f2cbf (patch) | |
| tree | 0f5a8d27fcb7da122da2c0b97c360c9d4e22e623 | |
| parent | 033935acd9b1be2f71b2dd980e38d00e13ad29b2 (diff) | |
hdcp: fix tlk build failure
hdcp is a common driver for different chips or kernel versions.
When only enable tlk on t21x but not on t18x, there will be build
fallures as follow:
drivers/built-in.o: In function `get_srm_signature':
kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:824: undefined
reference to `te_is_secos_dev_enabled'
/kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:825: undefined
reference to `te_launch_trusted_oper_tlk'
drivers/built-in.o: In function `tsec_hdcp_authentication':
kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:1217: undefined
reference to `te_is_secos_dev_enabled'
kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:1218: undefined
reference to `te_open_trusted_session_tlk'
kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:1398: undefined
reference to `te_is_secos_dev_enabled'
kernel/nvidia/drivers/video/tegra/dc/hdmihdcp.c:1400: undefined
reference to `te_close_trusted_session_tlk'
make[2]: *** [vmlinux] Error 1
make[2]: Leaving directory
`out/target/product/t186_int/obj/KERNEL/kernel-4.4'
make[1]: *** [sub-make] Error 2
Fix the build failure above.
Bug 200381472
Change-Id: Ic892a1331ded47320e6c8fab8ab2186539dc68ce
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1645119
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/video/tegra/dc/hdmihdcp.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/hdmihdcp.c b/drivers/video/tegra/dc/hdmihdcp.c index e90ee640f..4138e45db 100644 --- a/drivers/video/tegra/dc/hdmihdcp.c +++ b/drivers/video/tegra/dc/hdmihdcp.c | |||
| @@ -124,8 +124,10 @@ static u8 g_seq_num_m_retries; | |||
| 124 | static u8 g_fallback; | 124 | static u8 g_fallback; |
| 125 | void __iomem *g_misc_base; | 125 | void __iomem *g_misc_base; |
| 126 | 126 | ||
| 127 | #ifdef CONFIG_TRUSTED_LITTLE_KERNEL | ||
| 127 | uint32_t hdcp_uuid[4] = HDCP_SERVICE_UUID; | 128 | uint32_t hdcp_uuid[4] = HDCP_SERVICE_UUID; |
| 128 | static uint32_t session_id; | 129 | static uint32_t session_id; |
| 130 | #endif | ||
| 129 | 131 | ||
| 130 | static struct tegra_dc *tegra_dc_hdmi_get_dc(struct tegra_hdmi *hdmi) | 132 | static struct tegra_dc *tegra_dc_hdmi_get_dc(struct tegra_hdmi *hdmi) |
| 131 | { | 133 | { |
| @@ -822,12 +824,18 @@ static int get_srm_signature(struct hdcp_context_t *hdcp_context, | |||
| 822 | 824 | ||
| 823 | /* pass the nonce to hdcp TA and get the signature back */ | 825 | /* pass the nonce to hdcp TA and get the signature back */ |
| 824 | memcpy(pkt, nonce, HDCP_NONCE_SIZE); | 826 | memcpy(pkt, nonce, HDCP_NONCE_SIZE); |
| 827 | |||
| 828 | #ifdef CONFIG_TRUSTED_LITTLE_KERNEL | ||
| 825 | if (te_is_secos_dev_enabled()) | 829 | if (te_is_secos_dev_enabled()) |
| 826 | err = te_launch_trusted_oper_tlk(pkt, PKT_SIZE, session_id, | 830 | err = te_launch_trusted_oper_tlk(pkt, PKT_SIZE, session_id, |
| 827 | hdcp_uuid, HDCP_CMD_GEN_CMAC, sizeof(hdcp_uuid)); | 831 | hdcp_uuid, HDCP_CMD_GEN_CMAC, sizeof(hdcp_uuid)); |
| 828 | else | 832 | else |
| 829 | err = te_launch_trusted_oper(pkt, PKT_SIZE, | 833 | err = te_launch_trusted_oper(pkt, PKT_SIZE, |
| 830 | HDCP_CMD_GEN_CMAC, ta_ctx); | 834 | HDCP_CMD_GEN_CMAC, ta_ctx); |
| 835 | #else | ||
| 836 | err = te_launch_trusted_oper(pkt, PKT_SIZE, HDCP_CMD_GEN_CMAC, ta_ctx); | ||
| 837 | #endif | ||
| 838 | |||
| 831 | if (err) | 839 | if (err) |
| 832 | nvhdcp_err("te launch operation failed with error %d\n", err); | 840 | nvhdcp_err("te launch operation failed with error %d\n", err); |
| 833 | return err; | 841 | return err; |
| @@ -1214,6 +1222,8 @@ static int tsec_hdcp_authentication(struct tegra_nvhdcp *nvhdcp, | |||
| 1214 | &hdcp_context->msg.rxcaps_capmask); | 1222 | &hdcp_context->msg.rxcaps_capmask); |
| 1215 | if (err) | 1223 | if (err) |
| 1216 | goto exit; | 1224 | goto exit; |
| 1225 | |||
| 1226 | #ifdef CONFIG_TRUSTED_LITTLE_KERNEL | ||
| 1217 | /* differentiate between TLK and trusty */ | 1227 | /* differentiate between TLK and trusty */ |
| 1218 | if (te_is_secos_dev_enabled()) { | 1228 | if (te_is_secos_dev_enabled()) { |
| 1219 | err = te_open_trusted_session_tlk(hdcp_uuid, sizeof(hdcp_uuid), | 1229 | err = te_open_trusted_session_tlk(hdcp_uuid, sizeof(hdcp_uuid), |
| @@ -1223,6 +1233,12 @@ static int tsec_hdcp_authentication(struct tegra_nvhdcp *nvhdcp, | |||
| 1223 | /* Open a trusted sesion with HDCP TA */ | 1233 | /* Open a trusted sesion with HDCP TA */ |
| 1224 | err = te_open_trusted_session(HDCP_PORT_NAME, &nvhdcp->ta_ctx); | 1234 | err = te_open_trusted_session(HDCP_PORT_NAME, &nvhdcp->ta_ctx); |
| 1225 | } | 1235 | } |
| 1236 | #else | ||
| 1237 | nvhdcp->ta_ctx = NULL; | ||
| 1238 | /* Open a trusted sesion with HDCP TA */ | ||
| 1239 | err = te_open_trusted_session(HDCP_PORT_NAME, &nvhdcp->ta_ctx); | ||
| 1240 | #endif | ||
| 1241 | |||
| 1226 | if (err) { | 1242 | if (err) { |
| 1227 | nvhdcp_err("Error opening trusted session\n"); | 1243 | nvhdcp_err("Error opening trusted session\n"); |
| 1228 | goto exit; | 1244 | goto exit; |
| @@ -1396,6 +1412,8 @@ exit: | |||
| 1396 | if (err) | 1412 | if (err) |
| 1397 | nvhdcp_err("HDCP authentication failed with err %d\n", err); | 1413 | nvhdcp_err("HDCP authentication failed with err %d\n", err); |
| 1398 | kfree(pkt); | 1414 | kfree(pkt); |
| 1415 | |||
| 1416 | #ifdef CONFIG_TRUSTED_LITTLE_KERNEL | ||
| 1399 | if (te_is_secos_dev_enabled()) { | 1417 | if (te_is_secos_dev_enabled()) { |
| 1400 | if (session_id) { | 1418 | if (session_id) { |
| 1401 | te_close_trusted_session_tlk(session_id, hdcp_uuid, | 1419 | te_close_trusted_session_tlk(session_id, hdcp_uuid, |
| @@ -1408,6 +1426,13 @@ exit: | |||
| 1408 | nvhdcp->ta_ctx = NULL; | 1426 | nvhdcp->ta_ctx = NULL; |
| 1409 | } | 1427 | } |
| 1410 | } | 1428 | } |
| 1429 | #else | ||
| 1430 | if (nvhdcp->ta_ctx) { | ||
| 1431 | te_close_trusted_session(nvhdcp->ta_ctx); | ||
| 1432 | nvhdcp->ta_ctx = NULL; | ||
| 1433 | } | ||
| 1434 | #endif | ||
| 1435 | |||
| 1411 | return err; | 1436 | return err; |
| 1412 | } | 1437 | } |
| 1413 | 1438 | ||
