MLK-19449: crypto: caam - Add Power Management
authorFranck LENORMAND <franck.lenormand@nxp.com>
Tue, 19 Mar 2019 15:05:30 +0000 (16:05 +0100)
committerLeonard Crestez <leonard.crestez@nxp.com>
Thu, 18 Apr 2019 00:00:38 +0000 (03:00 +0300)
commitc151af80cfda82eae533a80fb2bb0158dffe556d
tree791c758b0a4430b0402cfb235e3ba125acdac778
parent2d8dab735757dae8efb35bb0371970a7d27e98be
MLK-19449: crypto: caam - Add Power Management

Add support for suspend and resume operation for PM in CAAM driver.

When the CAAM goes in suspend, the hardware is considered to do nothing.

On some platforms, the power of the CAAM is not turned off so it keeps
its configuration.

On other platforms, it doesn't so it is necessary to save the state of
the CAAM:
 - JRs MID
 - Address of input and output rings

Limitation:
When the CAAM is powered OFF, it is resetted so the JDKEK and TDKEK
changes. This impacts crypto transforms using MDHA split-keys
which are kept over suspend as they are encrypted with the JDKEK:
 - hmac(*) from caamhash.c
 - authenc(hmac(*),*) from caamalg.c
 - echainiv(authenc(hmac(*),*)) from caamalg.c
The issue was already present in current code so this patch does not
add a regression in this regard.

Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/inst_rng.c
drivers/crypto/caam/intern.h
drivers/crypto/caam/jr.c