MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA
authorYe Li <ye.li@nxp.com>
Mon, 22 Oct 2018 07:45:09 +0000 (00:45 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:39:09 +0000 (02:39 -0700)
commit1e48d07ea18ed0e6a6539c2b10613472bec11174
treecb9e922e963d84a3027367d2f254aa281b323aa6
parent9e0ec51fc5a95cb197c9579414343ab3e1d0419a
MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA

Found the imx8mq Rev A chip (B0 and B1 chips are ok) boot hang at CAAM RNG init.
The jobring 0 can't complete instantiation descriptor and spins on checking ORSFR_JR0.

In current implementation, the descriptor and jobring input and output base address locate
on TCM, because the driver uses raw_data array in jr_data_st structure as the buffer.
This seems cause the issue. If switched from TCM to OCRAM, the issue will go.

Since accessing TCM by CAAM is not very reliable. Add this patch to use OCRAM for SPL case.
The early malloc is ready on SPL before calling board_init_f. So we can use malloc to allocate
memory instead of the raw_data array.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b12e170792c918efc7c371f86989d34fc397fe06)
drivers/crypto/fsl_caam.c