MLK-17917: imx: Avoid hardcoded output ring size register offset (ORSR)
authorBreno Lima <breno.lima@nxp.com>
Fri, 23 Mar 2018 20:17:04 +0000 (17:17 -0300)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:27:18 +0000 (02:27 -0700)
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 <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9d381708210270a1cf9bf25924c8932c436967e8)
(cherry picked from commit 42db685ace092bedc569cd2c846b51b393630759)

arch/arm/mach-imx/cmd_dek.c
arch/arm/mach-imx/cmd_mfgprot.c

index 463b869..a49f720 100644 (file)
@@ -28,7 +28,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();
index 41fea52..0e7f1fa 100644 (file)
@@ -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);