Skip to content

Commit 472b044

Browse files
DeclanIntelherbertx
authored andcommitted
crypto: keembay - Add Keem Bay OCS HCU driver
Add support for the Hashing Control Unit (HCU) included in the Offload Crypto Subsystem (OCS) of the Intel Keem Bay SoC, thus enabling hardware-accelerated hashing on the Keem Bay SoC for the following algorithms: - sha256 - sha384 - sha512 - sm3 The driver is composed of two files: - 'ocs-hcu.c' which interacts with the hardware and abstracts it by providing an API following the usual paradigm used in hashing drivers / libraries (e.g., hash_init(), hash_update(), hash_final(), etc.). NOTE: this API can block and sleep, since completions are used to wait for the HW to complete the hashing. - 'keembay-ocs-hcu-core.c' which exports the functionality provided by 'ocs-hcu.c' as a ahash crypto driver. The crypto engine is used to provide asynchronous behavior. 'keembay-ocs-hcu-core.c' also takes care of the DMA mapping of the input sg list. The driver passes crypto manager self-tests, including the extra tests (CRYPTO_MANAGER_EXTRA_TESTS=y). Signed-off-by: Declan Murphy <declan.murphy@intel.com> Co-developed-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> Acked-by: Mark Gross <mgross@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 33ff648 commit 472b044

File tree

5 files changed

+1632
-0
lines changed

5 files changed

+1632
-0
lines changed

drivers/crypto/keembay/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,20 @@ config CRYPTO_DEV_KEEMBAY_OCS_AES_SM4_CTS
3838
Provides OCS version of cts(cbc(aes)) and cts(cbc(sm4)).
3939

4040
Intel does not recommend use of CTS mode with AES/SM4.
41+
42+
config CRYPTO_DEV_KEEMBAY_OCS_HCU
43+
tristate "Support for Intel Keem Bay OCS HCU HW acceleration"
44+
select CRYPTO_HASH
45+
select CRYPTO_ENGINE
46+
depends on OF || COMPILE_TEST
47+
help
48+
Support for Intel Keem Bay Offload and Crypto Subsystem (OCS) Hash
49+
Control Unit (HCU) hardware acceleration for use with Crypto API.
50+
51+
Provides OCS HCU hardware acceleration of sha256, sha384, sha512, and
52+
sm3.
53+
54+
Say Y or M if you're building for the Intel Keem Bay SoC. If compiled
55+
as a module, the module will be called keembay-ocs-hcu.
56+
57+
If unsure, say N.

drivers/crypto/keembay/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
#
44
obj-$(CONFIG_CRYPTO_DEV_KEEMBAY_OCS_AES_SM4) += keembay-ocs-aes.o
55
keembay-ocs-aes-objs := keembay-ocs-aes-core.o ocs-aes.o
6+
7+
obj-$(CONFIG_CRYPTO_DEV_KEEMBAY_OCS_HCU) += keembay-ocs-hcu.o
8+
keembay-ocs-hcu-objs := keembay-ocs-hcu-core.o ocs-hcu.o

0 commit comments

Comments
 (0)