]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - add Derived Key Protocol (DKP) support
authorHoria Geantă <horia.geanta@nxp.com>
Tue, 19 Dec 2017 10:16:07 +0000 (12:16 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 Dec 2017 06:56:48 +0000 (17:56 +1100)
commita08f4763ce93c0d94ff3707554bfd5d199a0afc1
treec07ae03fe84c7a3b584691a8addef389c09e3e44
parent4f05fe4e8a8d8969e42a9385cd2ec7e3077ab42f
crypto: caam - add Derived Key Protocol (DKP) support

Offload split key generation in CAAM engine, using DKP.
DKP is supported starting with Era 6.

Note that the way assoclen is transmitted from the job descriptor
to the shared descriptor changes - DPOVRD register is used instead
of MATH3 (where available), since DKP protocol thrashes the MATH
registers.

The replacement of MDHA split key generation with DKP has the side
effect of the crypto engine writing the authentication key, and thus
the DMA mapping direction for the buffer holding the key has to change
from DMA_TO_DEVICE to DMA_BIDIRECTIONAL.
There are two cases:
-key is inlined in descriptor - descriptor buffer mapping changes
-key is referenced - key buffer mapping changes

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_desc.c
drivers/crypto/caam/caamalg_desc.h
drivers/crypto/caam/caamalg_qi.c
drivers/crypto/caam/caamhash.c
drivers/crypto/caam/desc.h
drivers/crypto/caam/desc_constr.h
drivers/crypto/caam/key_gen.c
drivers/crypto/caam/key_gen.h