From 0ff68d9716bc046573615b886545ef6dc3e71626 Mon Sep 17 00:00:00 2001 From: Johnny Sorocil Date: Sat, 14 Aug 2021 12:47:33 +0200 Subject: [PATCH] Remove binary files: src part Remove code which is not usable without hdcp.bin file https://github.com/ARM-software/tf-issues/issues/651 It is only needed for HDCP support (a DRM feature for video streaming), if you don't care about that the rest of the firmware should work perfectly fine without it. Just change rk3399/plat_sip_calls.c to not handle the RK_SIP_HDCP* SMCs when this option is set, and then exclude rk3399/drivers/dp/cdn_dp.c and the blob from rk3399/platform.mk. --- plat/rockchip/rk3399/plat_sip_calls.c | 15 --------------- plat/rockchip/rk3399/platform.mk | 10 ---------- 2 files changed, 25 deletions(-) diff --git a/plat/rockchip/rk3399/plat_sip_calls.c b/plat/rockchip/rk3399/plat_sip_calls.c index ce8476c9a6..16c37f5867 100644 --- a/plat/rockchip/rk3399/plat_sip_calls.c +++ b/plat/rockchip/rk3399/plat_sip_calls.c @@ -24,9 +24,6 @@ #define DRAM_SET_PARAM 0x07 #define DRAM_SET_ODT_PD 0x08 -#define RK_SIP_HDCP_CONTROL 0x82000009 -#define RK_SIP_HDCP_KEY_DATA64 0xC200000A - uint32_t ddr_smc_handler(uint64_t arg0, uint64_t arg1, uint64_t id, uint64_t arg2) { @@ -56,21 +53,9 @@ uintptr_t rockchip_plat_sip_handler(uint32_t smc_fid, void *handle, u_register_t flags) { -#ifdef PLAT_RK_DP_HDCP - uint64_t x5, x6; -#endif - switch (smc_fid) { case RK_SIP_DDR_CFG: SMC_RET1(handle, ddr_smc_handler(x1, x2, x3, x4)); -#ifdef PLAT_RK_DP_HDCP - case RK_SIP_HDCP_CONTROL: - SMC_RET1(handle, dp_hdcp_ctrl(x1)); - case RK_SIP_HDCP_KEY_DATA64: - x5 = read_ctx_reg(get_gpregs_ctx(handle), CTX_GPREG_X5); - x6 = read_ctx_reg(get_gpregs_ctx(handle), CTX_GPREG_X6); - SMC_RET1(handle, dp_hdcp_store_key(x1, x2, x3, x4, x5, x6)); -#endif default: ERROR("%s: unhandled SMC (0x%x)\n", __func__, smc_fid); SMC_RET1(handle, SMC_UNK); diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk index aba67c2fe3..31c5e7290b 100644 --- a/plat/rockchip/rk3399/platform.mk +++ b/plat/rockchip/rk3399/platform.mk @@ -89,16 +89,6 @@ $(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\")) RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin $(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\")) -ifdef PLAT_RK_DP_HDCP -BL31_SOURCES += ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c - -HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin -$(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\")) - -${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW) -${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW) -endif - # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin export CCACHE_EXTRAFILES ${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW):$(RK3399M0PMUFW)