arm: mach-k3: security: Clean image out of cache before authentication
authorAndrew F. Davis <afd@ti.com>
Tue, 7 Jan 2020 23:22:29 +0000 (18:22 -0500)
committerLokesh Vutla <lokeshvutla@ti.com>
Mon, 20 Jan 2020 04:40:28 +0000 (10:10 +0530)
commit95b256ec3ff71d026f6b9750ae3c610d13bf8b32
treee0593dd214373c9aa7b9f2809bed410c8627c4ad
parent28b90a46565adc0ff6c426f4ea84def2d38ef0f6
arm: mach-k3: security: Clean image out of cache before authentication

On K3 systems U-Boot runs on both an R5 and a large ARM cores (usually
A53 or A72). The large ARMs are coherent with the DMA controllers and
the SYSFW that perform authentication. And previously the R5 core did
not enable caches. Now that R5 does enable caching we need to be sure
to clean out any of the image that may still only be in cache before we
read it using external DMA for authentication.

Although not expected to happen, it may be possible that the data was
read back into cache after the flush but before the external operation,
in this case we must invalidate our stale local cached version.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
arch/arm/mach-k3/security.c