xref: /openbmc/linux/drivers/crypto/caam/Kconfig (revision 565485b8)
1# SPDX-License-Identifier: GPL-2.0
2config CRYPTO_DEV_FSL_CAAM_COMMON
3	tristate
4
5config CRYPTO_DEV_FSL_CAAM
6	tristate "Freescale CAAM-Multicore platform driver backend"
7	depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE
8	select SOC_BUS
9	select CRYPTO_DEV_FSL_CAAM_COMMON
10	help
11	  Enables the driver module for Freescale's Cryptographic Accelerator
12	  and Assurance Module (CAAM), also known as the SEC version 4 (SEC4).
13	  This module creates job ring devices, and configures h/w
14	  to operate as a DPAA component automatically, depending
15	  on h/w feature availability.
16
17	  To compile this driver as a module, choose M here: the module
18	  will be called caam.
19
20if CRYPTO_DEV_FSL_CAAM
21
22config CRYPTO_DEV_FSL_CAAM_DEBUG
23	bool "Enable debug output in CAAM driver"
24	help
25	  Selecting this will enable printing of various debug
26	  information in the CAAM driver.
27
28config CRYPTO_DEV_FSL_CAAM_JR
29	tristate "Freescale CAAM Job Ring driver backend"
30	default y
31	help
32	  Enables the driver module for Job Rings which are part of
33	  Freescale's Cryptographic Accelerator
34	  and Assurance Module (CAAM). This module adds a job ring operation
35	  interface.
36
37	  To compile this driver as a module, choose M here: the module
38	  will be called caam_jr.
39
40if CRYPTO_DEV_FSL_CAAM_JR
41
42config CRYPTO_DEV_FSL_CAAM_RINGSIZE
43	int "Job Ring size"
44	range 2 9
45	default "9"
46	help
47	  Select size of Job Rings as a power of 2, within the
48	  range 2-9 (ring size 4-512).
49	  Examples:
50		2 => 4
51		3 => 8
52		4 => 16
53		5 => 32
54		6 => 64
55		7 => 128
56		8 => 256
57		9 => 512
58
59config CRYPTO_DEV_FSL_CAAM_INTC
60	bool "Job Ring interrupt coalescing"
61	help
62	  Enable the Job Ring's interrupt coalescing feature.
63
64	  Note: the driver already provides adequate
65	  interrupt coalescing in software.
66
67config CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD
68	int "Job Ring interrupt coalescing count threshold"
69	depends on CRYPTO_DEV_FSL_CAAM_INTC
70	range 1 255
71	default 255
72	help
73	  Select number of descriptor completions to queue before
74	  raising an interrupt, in the range 1-255. Note that a selection
75	  of 1 functionally defeats the coalescing feature, and a selection
76	  equal or greater than the job ring size will force timeouts.
77
78config CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD
79	int "Job Ring interrupt coalescing timer threshold"
80	depends on CRYPTO_DEV_FSL_CAAM_INTC
81	range 1 65535
82	default 2048
83	help
84	  Select number of bus clocks/64 to timeout in the case that one or
85	  more descriptor completions are queued without reaching the count
86	  threshold. Range is 1-65535.
87
88config CRYPTO_DEV_FSL_CAAM_CRYPTO_API
89	tristate "Register algorithm implementations with the Crypto API"
90	default y
91	select CRYPTO_AEAD
92	select CRYPTO_AUTHENC
93	select CRYPTO_BLKCIPHER
94	help
95	  Selecting this will offload crypto for users of the
96	  scatterlist crypto API (such as the linux native IPSec
97	  stack) to the SEC4 via job ring.
98
99	  To compile this as a module, choose M here: the module
100	  will be called caamalg.
101
102config CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
103	tristate "Queue Interface as Crypto API backend"
104	depends on FSL_DPAA && NET
105	default y
106	select CRYPTO_AUTHENC
107	select CRYPTO_BLKCIPHER
108	help
109	  Selecting this will use CAAM Queue Interface (QI) for sending
110	  & receiving crypto jobs to/from CAAM. This gives better performance
111	  than job ring interface when the number of cores are more than the
112	  number of job rings assigned to the kernel. The number of portals
113	  assigned to the kernel should also be more than the number of
114	  job rings.
115
116	  To compile this as a module, choose M here: the module
117	  will be called caamalg_qi.
118
119config CRYPTO_DEV_FSL_CAAM_AHASH_API
120	tristate "Register hash algorithm implementations with Crypto API"
121	default y
122	select CRYPTO_HASH
123	help
124	  Selecting this will offload ahash for users of the
125	  scatterlist crypto API to the SEC4 via job ring.
126
127	  To compile this as a module, choose M here: the module
128	  will be called caamhash.
129
130config CRYPTO_DEV_FSL_CAAM_PKC_API
131        tristate "Register public key cryptography implementations with Crypto API"
132        default y
133        select CRYPTO_RSA
134        help
135          Selecting this will allow SEC Public key support for RSA.
136          Supported cryptographic primitives: encryption, decryption,
137          signature and verification.
138          To compile this as a module, choose M here: the module
139          will be called caam_pkc.
140
141config CRYPTO_DEV_FSL_CAAM_RNG_API
142	tristate "Register caam device for hwrng API"
143	default y
144	select CRYPTO_RNG
145	select HW_RANDOM
146	help
147	  Selecting this will register the SEC4 hardware rng to
148	  the hw_random API for suppying the kernel entropy pool.
149
150	  To compile this as a module, choose M here: the module
151	  will be called caamrng.
152
153endif # CRYPTO_DEV_FSL_CAAM_JR
154
155endif # CRYPTO_DEV_FSL_CAAM
156
157config CRYPTO_DEV_FSL_DPAA2_CAAM
158	tristate "QorIQ DPAA2 CAAM (DPSECI) driver"
159	depends on FSL_MC_DPIO
160	depends on NETDEVICES
161	select CRYPTO_DEV_FSL_CAAM_COMMON
162	select CRYPTO_BLKCIPHER
163	select CRYPTO_AUTHENC
164	select CRYPTO_AEAD
165	select CRYPTO_HASH
166	help
167	  CAAM driver for QorIQ Data Path Acceleration Architecture 2.
168	  It handles DPSECI DPAA2 objects that sit on the Management Complex
169	  (MC) fsl-mc bus.
170
171	  To compile this as a module, choose M here: the module
172	  will be called dpaa2_caam.
173
174config CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC
175	def_tristate (CRYPTO_DEV_FSL_CAAM_CRYPTO_API || \
176		      CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI || \
177		      CRYPTO_DEV_FSL_DPAA2_CAAM)
178
179config CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC
180	def_tristate (CRYPTO_DEV_FSL_CAAM_AHASH_API || \
181		      CRYPTO_DEV_FSL_DPAA2_CAAM)
182