caam: Fix CAAM error on startup
authorOlaf Baehring <olaf.baehring@draeger.com>
Wed, 21 May 2025 11:03:40 +0000 (08:03 -0300)
committerFabio Estevam <festevam@gmail.com>
Thu, 22 May 2025 12:01:51 +0000 (09:01 -0300)
commit159b6f0e119962ce5da645f548cefe9196c8778e
tree50ecf449a82f80cf3d70cf7d7375407b7aec99bf
parentb7b301c9061401eaea34e19e65cb1862269c9001
caam: Fix CAAM error on startup

In rare cases U-Boot returns an error message when intantiating the RNG
of the CAAM device:
“SEC0:  RNG4 SH0 instantiation failed with error 0xffffffff”
This  means, that even when the CAAM device reports a finished
descriptor, none is found in the output ring.
This might be caused by a missing cache invalidation before
reading the memory of the output ring
This patch moves the cache invalidation of the output ring from start of
the job to immediately after the notification from hardware where the
output ring will be read.

Signed-off-by: Olaf Baehring <olaf.baehring@draeger.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
drivers/crypto/fsl/jr.c
drivers/crypto/fsl/jr.h