From e262b961d0b2fe96bbe47fbbb6d37c97280cbf02 Mon Sep 17 00:00:00 2001 From: Breno Lima Date: Fri, 23 Mar 2018 17:17:04 -0300 Subject: [PATCH] MLK-17917: imx-common: Avoid hardcoded output ring size register offset (ORSR) The CAAM output ring size register offset is currently defined in fsl_sec.h as FSL_CAAM_ORSR_JRa_OFFSET, use this definition to avoid hardcoded value in i.MX common code. Signed-off-by: Breno Lima Reviewed-by: Ye Li (cherry picked from commit 9d381708210270a1cf9bf25924c8932c436967e8) --- arch/arm/imx-common/cmd_dek.c | 3 ++- arch/arm/imx-common/cmd_mfgprot.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/imx-common/cmd_dek.c b/arch/arm/imx-common/cmd_dek.c index ada8adf2f4..2e5b21e640 100644 --- a/arch/arm/imx-common/cmd_dek.c +++ b/arch/arm/imx-common/cmd_dek.c @@ -31,7 +31,8 @@ static int blob_encap_dek(const u8 *src, u8 *dst, u32 len) int ret = 0; u32 jr_size = 4; - u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + 0x102c); + u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + + FSL_CAAM_ORSR_JRa_OFFSET); if (out_jr_size != jr_size) { hab_caam_clock_enable(1); sec_init(); diff --git a/arch/arm/imx-common/cmd_mfgprot.c b/arch/arm/imx-common/cmd_mfgprot.c index 41fea52f02..0e7f1faab5 100644 --- a/arch/arm/imx-common/cmd_mfgprot.c +++ b/arch/arm/imx-common/cmd_mfgprot.c @@ -43,7 +43,8 @@ static int do_mfgprot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) /* Enable HAB clock */ u32 jr_size = 4; - u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + 0x102c); + u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + + FSL_CAAM_ORSR_JRa_OFFSET); if (out_jr_size != jr_size) { hab_caam_clock_enable(1); -- 2.17.1