162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_COMMON
362306a36Sopenharmony_ci	tristate
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC
662306a36Sopenharmony_ci	tristate
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC
962306a36Sopenharmony_ci	tristate
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM
1262306a36Sopenharmony_ci	tristate "Freescale CAAM-Multicore platform driver backend"
1362306a36Sopenharmony_ci	depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE
1462306a36Sopenharmony_ci	select SOC_BUS
1562306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_COMMON
1662306a36Sopenharmony_ci	imply FSL_MC_BUS
1762306a36Sopenharmony_ci	help
1862306a36Sopenharmony_ci	  Enables the driver module for Freescale's Cryptographic Accelerator
1962306a36Sopenharmony_ci	  and Assurance Module (CAAM), also known as the SEC version 4 (SEC4).
2062306a36Sopenharmony_ci	  This module creates job ring devices, and configures h/w
2162306a36Sopenharmony_ci	  to operate as a DPAA component automatically, depending
2262306a36Sopenharmony_ci	  on h/w feature availability.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module
2562306a36Sopenharmony_ci	  will be called caam.
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciif CRYPTO_DEV_FSL_CAAM
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_DEBUG
3062306a36Sopenharmony_ci	bool "Enable debug output in CAAM driver"
3162306a36Sopenharmony_ci	help
3262306a36Sopenharmony_ci	  Selecting this will enable printing of various debug
3362306a36Sopenharmony_ci	  information in the CAAM driver.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_cimenuconfig CRYPTO_DEV_FSL_CAAM_JR
3662306a36Sopenharmony_ci	tristate "Freescale CAAM Job Ring driver backend"
3762306a36Sopenharmony_ci	select CRYPTO_ENGINE
3862306a36Sopenharmony_ci	default y
3962306a36Sopenharmony_ci	help
4062306a36Sopenharmony_ci	  Enables the driver module for Job Rings which are part of
4162306a36Sopenharmony_ci	  Freescale's Cryptographic Accelerator
4262306a36Sopenharmony_ci	  and Assurance Module (CAAM). This module adds a job ring operation
4362306a36Sopenharmony_ci	  interface.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module
4662306a36Sopenharmony_ci	  will be called caam_jr.
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciif CRYPTO_DEV_FSL_CAAM_JR
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_RINGSIZE
5162306a36Sopenharmony_ci	int "Job Ring size"
5262306a36Sopenharmony_ci	range 2 9
5362306a36Sopenharmony_ci	default "9"
5462306a36Sopenharmony_ci	help
5562306a36Sopenharmony_ci	  Select size of Job Rings as a power of 2, within the
5662306a36Sopenharmony_ci	  range 2-9 (ring size 4-512).
5762306a36Sopenharmony_ci	  Examples:
5862306a36Sopenharmony_ci		2 => 4
5962306a36Sopenharmony_ci		3 => 8
6062306a36Sopenharmony_ci		4 => 16
6162306a36Sopenharmony_ci		5 => 32
6262306a36Sopenharmony_ci		6 => 64
6362306a36Sopenharmony_ci		7 => 128
6462306a36Sopenharmony_ci		8 => 256
6562306a36Sopenharmony_ci		9 => 512
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_INTC
6862306a36Sopenharmony_ci	bool "Job Ring interrupt coalescing"
6962306a36Sopenharmony_ci	help
7062306a36Sopenharmony_ci	  Enable the Job Ring's interrupt coalescing feature.
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci	  Note: the driver already provides adequate
7362306a36Sopenharmony_ci	  interrupt coalescing in software.
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD
7662306a36Sopenharmony_ci	int "Job Ring interrupt coalescing count threshold"
7762306a36Sopenharmony_ci	depends on CRYPTO_DEV_FSL_CAAM_INTC
7862306a36Sopenharmony_ci	range 1 255
7962306a36Sopenharmony_ci	default 255
8062306a36Sopenharmony_ci	help
8162306a36Sopenharmony_ci	  Select number of descriptor completions to queue before
8262306a36Sopenharmony_ci	  raising an interrupt, in the range 1-255. Note that a selection
8362306a36Sopenharmony_ci	  of 1 functionally defeats the coalescing feature, and a selection
8462306a36Sopenharmony_ci	  equal or greater than the job ring size will force timeouts.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD
8762306a36Sopenharmony_ci	int "Job Ring interrupt coalescing timer threshold"
8862306a36Sopenharmony_ci	depends on CRYPTO_DEV_FSL_CAAM_INTC
8962306a36Sopenharmony_ci	range 1 65535
9062306a36Sopenharmony_ci	default 2048
9162306a36Sopenharmony_ci	help
9262306a36Sopenharmony_ci	  Select number of bus clocks/64 to timeout in the case that one or
9362306a36Sopenharmony_ci	  more descriptor completions are queued without reaching the count
9462306a36Sopenharmony_ci	  threshold. Range is 1-65535.
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_CRYPTO_API
9762306a36Sopenharmony_ci	bool "Register algorithm implementations with the Crypto API"
9862306a36Sopenharmony_ci	default y
9962306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC
10062306a36Sopenharmony_ci	select CRYPTO_AEAD
10162306a36Sopenharmony_ci	select CRYPTO_AUTHENC
10262306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
10362306a36Sopenharmony_ci	select CRYPTO_LIB_DES
10462306a36Sopenharmony_ci	select CRYPTO_XTS
10562306a36Sopenharmony_ci	help
10662306a36Sopenharmony_ci	  Selecting this will offload crypto for users of the
10762306a36Sopenharmony_ci	  scatterlist crypto API (such as the linux native IPSec
10862306a36Sopenharmony_ci	  stack) to the SEC4 via job ring.
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
11162306a36Sopenharmony_ci	bool "Queue Interface as Crypto API backend"
11262306a36Sopenharmony_ci	depends on FSL_DPAA && NET
11362306a36Sopenharmony_ci	default y
11462306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC
11562306a36Sopenharmony_ci	select CRYPTO_AUTHENC
11662306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
11762306a36Sopenharmony_ci	select CRYPTO_DES
11862306a36Sopenharmony_ci	select CRYPTO_XTS
11962306a36Sopenharmony_ci	help
12062306a36Sopenharmony_ci	  Selecting this will use CAAM Queue Interface (QI) for sending
12162306a36Sopenharmony_ci	  & receiving crypto jobs to/from CAAM. This gives better performance
12262306a36Sopenharmony_ci	  than job ring interface when the number of cores are more than the
12362306a36Sopenharmony_ci	  number of job rings assigned to the kernel. The number of portals
12462306a36Sopenharmony_ci	  assigned to the kernel should also be more than the number of
12562306a36Sopenharmony_ci	  job rings.
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_AHASH_API
12862306a36Sopenharmony_ci	bool "Register hash algorithm implementations with Crypto API"
12962306a36Sopenharmony_ci	default y
13062306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC
13162306a36Sopenharmony_ci	select CRYPTO_HASH
13262306a36Sopenharmony_ci	help
13362306a36Sopenharmony_ci	  Selecting this will offload ahash for users of the
13462306a36Sopenharmony_ci	  scatterlist crypto API to the SEC4 via job ring.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_PKC_API
13762306a36Sopenharmony_ci	bool "Register public key cryptography implementations with Crypto API"
13862306a36Sopenharmony_ci	default y
13962306a36Sopenharmony_ci	select CRYPTO_RSA
14062306a36Sopenharmony_ci	help
14162306a36Sopenharmony_ci	  Selecting this will allow SEC Public key support for RSA.
14262306a36Sopenharmony_ci	  Supported cryptographic primitives: encryption, decryption,
14362306a36Sopenharmony_ci	  signature and verification.
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_RNG_API
14662306a36Sopenharmony_ci	bool "Register caam device for hwrng API"
14762306a36Sopenharmony_ci	default y
14862306a36Sopenharmony_ci	select CRYPTO_RNG
14962306a36Sopenharmony_ci	select HW_RANDOM
15062306a36Sopenharmony_ci	help
15162306a36Sopenharmony_ci	  Selecting this will register the SEC4 hardware rng to
15262306a36Sopenharmony_ci	  the hw_random API for supplying the kernel entropy pool.
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_PRNG_API
15562306a36Sopenharmony_ci	bool "Register Pseudo random number generation implementation with Crypto API"
15662306a36Sopenharmony_ci	default y
15762306a36Sopenharmony_ci	select CRYPTO_RNG
15862306a36Sopenharmony_ci	help
15962306a36Sopenharmony_ci	  Selecting this will register the SEC hardware prng to
16062306a36Sopenharmony_ci	  the Crypto API.
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_BLOB_GEN
16362306a36Sopenharmony_ci	bool
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_CAAM_RNG_TEST
16662306a36Sopenharmony_ci	bool "Test caam rng"
16762306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_RNG_API
16862306a36Sopenharmony_ci	help
16962306a36Sopenharmony_ci	  Selecting this will enable a self-test to run for the
17062306a36Sopenharmony_ci	  caam RNG.
17162306a36Sopenharmony_ci	  This test is several minutes long and executes
17262306a36Sopenharmony_ci	  just before the RNG is registered with the hw_random API.
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ciendif # CRYPTO_DEV_FSL_CAAM_JR
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ciendif # CRYPTO_DEV_FSL_CAAM
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ciconfig CRYPTO_DEV_FSL_DPAA2_CAAM
17962306a36Sopenharmony_ci	tristate "QorIQ DPAA2 CAAM (DPSECI) driver"
18062306a36Sopenharmony_ci	depends on FSL_MC_DPIO
18162306a36Sopenharmony_ci	depends on NETDEVICES
18262306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_COMMON
18362306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC
18462306a36Sopenharmony_ci	select CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC
18562306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
18662306a36Sopenharmony_ci	select CRYPTO_AUTHENC
18762306a36Sopenharmony_ci	select CRYPTO_AEAD
18862306a36Sopenharmony_ci	select CRYPTO_HASH
18962306a36Sopenharmony_ci	select CRYPTO_DES
19062306a36Sopenharmony_ci	select CRYPTO_XTS
19162306a36Sopenharmony_ci	help
19262306a36Sopenharmony_ci	  CAAM driver for QorIQ Data Path Acceleration Architecture 2.
19362306a36Sopenharmony_ci	  It handles DPSECI DPAA2 objects that sit on the Management Complex
19462306a36Sopenharmony_ci	  (MC) fsl-mc bus.
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci	  To compile this as a module, choose M here: the module
19762306a36Sopenharmony_ci	  will be called dpaa2_caam.
198