imx: Ensure CAAM clock is enabled prior getting out_jr_size
[platform/kernel/u-boot.git] / arch / arm / mach-imx / cmd_dek.c
index 5bf92cb..9a96557 100644 (file)
@@ -28,12 +28,12 @@ static int blob_encap_dek(const u8 *src, u8 *dst, u32 len)
        int ret = 0;
        u32 jr_size = 4;
 
+       hab_caam_clock_enable(1);
+
        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);
+       if (out_jr_size != jr_size)
                sec_init();
-       }
 
        if (!((len == 128) | (len == 192) | (len == 256))) {
                debug("Invalid DEK size. Valid sizes are 128, 192 and 256b\n");