mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
arch/arm/imxrt: finish the CAAM job ring reset
A JRCR reset only flushes and halts the job ring; a second reset, once JRINT reports the halt done, completes it, as Linux's caam_reset_hw_jr() does. With the single write the ring stayed halted, so the RNG instantiate job never completed and every boot logged "job ring did not answer" before the settle loop's second ring init finished the reset. Signed-off-by: Royyan Zahir <royzah@gmail.com>
This commit is contained in:
parent
2ef6153047
commit
e9bafae796
2 changed files with 19 additions and 0 deletions
|
|
@ -115,6 +115,7 @@
|
|||
#define CAAM_JRCR_RESET (1 << 0)
|
||||
#define CAAM_JRINT_ERR_HALT_MASK (3 << 2)
|
||||
#define CAAM_JRINT_ERR_HALT_INPROG (1 << 2)
|
||||
#define CAAM_JRINT_ERR_HALT_DONE (2 << 2)
|
||||
#define CAAM_JRCFG1_IMSK (1 << 0) /* Mask the ring interrupt */
|
||||
|
||||
/* RTMCTL, RTSDCTL, RDSTA */
|
||||
|
|
|
|||
|
|
@ -302,6 +302,24 @@ static int imxrt_caam_ring_init(void)
|
|||
|
||||
putreg32(CAAM_JRCR_RESET, IMXRT_CAAM_JRCR);
|
||||
|
||||
for (timeout = CAAM_TIMEOUT; timeout > 0; timeout--)
|
||||
{
|
||||
if ((getreg32(IMXRT_CAAM_JRINT) & CAAM_JRINT_ERR_HALT_MASK) !=
|
||||
CAAM_JRINT_ERR_HALT_INPROG)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((getreg32(IMXRT_CAAM_JRINT) & CAAM_JRINT_ERR_HALT_MASK) !=
|
||||
CAAM_JRINT_ERR_HALT_DONE)
|
||||
{
|
||||
_err("ERROR: job ring would not halt\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
putreg32(CAAM_JRCR_RESET, IMXRT_CAAM_JRCR);
|
||||
|
||||
for (timeout = CAAM_TIMEOUT; timeout > 0; timeout--)
|
||||
{
|
||||
if ((getreg32(IMXRT_CAAM_JRCR) & CAAM_JRCR_RESET) == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue