Skip to content

Commit 0b496ef

Browse files
linuswherbertx
authored andcommitted
crypto: stm32/cryp - enable for use with Ux500
This adds a few small quirks to handle the differences between the STM32 and Ux500 cryp blocks. The following differences are handled with special bool switch bits in the capabilities: - The main difference is that some registers are removed, so we add register offsets for all registers in the per-variant data. Then we assign the right offsets for Ux500 vs the STM32 variants. - The Ux500 does not support the aeads algorithms; gcm(aes) and ccm(aes). Avoid registering them when running on Ux500. - The Ux500 has a special "linear" key format and does some elaborare bit swizzling of the key bits before writing them into the key registers. This is written as an "application note" inside the DB8500 design specification, and seems to be the result of some mishap when assigning the data lines to register bits. (STM32 has clearly fixed this.) - The Ux500 does not have the KP "key prepare" bit in the CR register. Instead, we need to set the KSE bit, "key schedule encryption" bit which does the same thing but is in bit 11 rather than being a special "algorithm type" as on STM32. The algorithm must however be specified as AES ECB while doing this. - The Ux500 cannot just read out IV registers, we need to set the KEYRDEN "key read enable" bit, as this protects not just the key but also the IV from being read out. Enable this bit before reading out the IV and disable it afterwards. Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Acked by: Lionel Debieve <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent fe86753 commit 0b496ef

File tree

1 file changed

+322
-91
lines changed

1 file changed

+322
-91
lines changed

0 commit comments

Comments
 (0)