Hello,
On the i.MX8MP platform, considering the Kernel 6.6.52 and CAAM RNG Self-test stuck issues you provided, this is typically related to a chain reaction caused by residual RNG initialization state, Job Ring permission lockout, or SDMA firmware loading timeout. The following are analysis suggestions and configuration solutions for this issue:
1. Core Cause Analysis CAAM State Machine Not Reset: Warm reboot does not reset all SoC registers. If CAAM was busy before reboot (e.g., caam_jr ... Device is busy in the log), the RNG's hardware state machine may be in an indeterminate intermediate state after reboot. Job Ring Permission Issue: If High Assurance Boot (HAB) or OP-TEE is used, the BootROM or ATF may lock certain Job Rings (JRs). During warm reboot, if the JR registers are not properly released, the Linux kernel will wait indefinitely during the Executing RNG SELF-TEST with wait phase because it cannot obtain a hardware response.
2. Suggested Optimizations and Solutions
A. Kernel Configuration and Driver Adjustment Disable Synchronous Self-Check: Try disabling the forced wait mechanism in CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API, or pre-initialize the RNG in U-Boot.
Integrate SDMA Firmware: Compile the SDMA firmware into the kernel (CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx7d.bin") to avoid the 60-second wait time caused by the file system not being mounted in the early stages of startup. This can significantly reduce timing risks during the startup process.
B. Modify U-Boot/ATF Reset Behavior (Workaround) Warm Reset often has this kind of residual problem on the i.MX8M series.
C. DTS Device Tree Check the attributes of the caam_jr node. In some versions, it is necessary to ensure that the Job Ring allocation is consistent with the security mode:
&crypto {
status = "okay";
};
&sec_jr0 {
status = "okay";
};
Regards