MLK-22105-1 Revert "MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA"
authorYe Li <ye.li@nxp.com>
Tue, 25 Jun 2019 09:14:00 +0000 (02:14 -0700)
committerYe Li <ye.li@nxp.com>
Wed, 26 Jun 2019 05:59:35 +0000 (22:59 -0700)
This reverts commit b12e170792c918efc7c371f86989d34fc397fe06.
The original patch has issue due to the early malloc pool is not ready
at this phase. So malloc always return NULL.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 35a24430c2da7c687bc729fa7f0b4b45749aba34)

drivers/crypto/fsl_caam.c

index 53e4e1c..a513ba1 100644 (file)
@@ -602,22 +602,15 @@ static int do_cfg_jrqueue(void)
                g_jrdata.status = RING_RELOC_INIT;
        } else {
                u32 align_idx = 0;
-               u32 *addr;
 
-#if defined(CONFIG_SPL_BUILD) && CONFIG_VAL(SYS_MALLOC_F_LEN)
-               ulong maddr = (ulong)malloc(DESC_MAX_SIZE * 2 + 8);
-               addr = (u32*)ALIGN(maddr, 8);
-#else
-               addr = g_jrdata.raw_addr;
-#endif
                /* Ensure 64bits buffers addresses alignment */
-               if ((uintptr_t)addr & 0x7)
+               if ((uintptr_t)g_jrdata.raw_addr & 0x7)
                        align_idx = 1;
                g_jrdata.inrings  = (struct inring_entry *)
-                                   (&addr[align_idx]);
+                                   (&g_jrdata.raw_addr[align_idx]);
                g_jrdata.outrings = (struct outring_entry *)
-                                   (&addr[align_idx + 2]);
-               g_jrdata.desc = (u32 *)(&addr[align_idx + 4]);
+                                   (&g_jrdata.raw_addr[align_idx + 2]);
+               g_jrdata.desc = (u32 *)(&g_jrdata.raw_addr[align_idx + 4]);
                g_jrdata.status = RING_EARLY_INIT;
        }