I'm am trying to reset/initialize the SEC Job Rings. Here is the pseudo-code of what I am doing to reset a SEC Job Ring Controller:
writeReg32(JRCFGR_JRx_LS[IMSK], 1) // Mask interrupts
writeReg32(JRCR_JRx, RESET, 1) // Initiate a flush
while( readReg32(JRINTR_JRx, HALT) == 1 ) // While halt in progress
return Error if (readReg32(JRINTR_JRx, HALT) != 2) // Return error if halt not complete
writeReg32(JRCR_JRx, RESET, 1) // Initiate a reset (after flush)
while( readReg32(JRCR_JRx, RESET) != 0 ) // Wait for reset to complete
writeReg32(JRCFGR_JRx_LS[IMSK], 0) // Unmask interrupts
return Success
However the "halt in progress" (on the third line) is never deasserted. And if I skip over the above initialization then the BSY bit is stuck set in the SSTA register and if I enable interrupts on Job Ring 1 then the interrupt is always asserted with a I keep getting interrupts on Job Ring 1 with a value 0x03030000 in interrupt status register JRINTR_JR0 (i.e. no status asserted).
I have two questions:
1) Is the above pseudo-code showing the correct method for resetting the Job Ring Controller?
2) Is there anything else I should be doing to reset or initialize the Job Ring Controllers?
Please ask customer refer to reference code in u-boot
uboot/drivers/crypto/fsl/jobdesc.c, jr_hw_reset()
Discussing with the SE team.