xref: /optee_os/core/drivers/crypto/se050/crypto.mk (revision 2f4d97e7664270c92f4fd9d35fcddcfa4fd5f667)
1ifeq ($(CFG_NXP_SE05X),y)
2# Enable the crypto driver
3$(call force,CFG_CRYPTO_DRIVER,y)
4CFG_CRYPTO_DRIVER_DEBUG ?= 0
5
6# SE050 initialization
7# Enables the SCP03 key rotation
8CFG_CORE_SE05X_SCP03_PROVISION ?= n
9# Displays the SE050 device information on the console at boot (i.e. OEFID)
10CFG_CORE_SE05X_DISPLAY_INFO ?= y
11# Enables the SCP03 before the REE: notice that if SCP03_PROVISION is enabled,
12# it will also attempt to rotate the keys
13CFG_CORE_SE05X_SCP03_EARLY ?= y
14# Deletes all persistent storage from the SE050 at boot
15CFG_CORE_SE05X_INIT_NVM ?= n
16
17# I2C bus baudrate (depends on SoC)
18CFG_CORE_SE05X_BAUDRATE ?= 3400000
19# I2C bus [0..2] (depends on board)
20CFG_CORE_SE05X_I2C_BUS ?= 2
21# I2C access via REE after TEE boot
22CFG_CORE_SE05X_I2C_TRAMPOLINE ?= y
23
24# Extra stacks required to support the Plug and Trust external library
25ifeq ($(shell test $(CFG_STACK_THREAD_EXTRA) -lt 8192; echo $$?), 0)
26$(error Error: SE050 requires CFG_STACK_THREAD_EXTRA at least 8192)
27endif
28ifeq ($(shell test $(CFG_STACK_TMP_EXTRA) -lt 8192; echo $$?), 0)
29$(error Error: SE050 requires CFG_STACK_TMP_EXTRA at least 8192)
30endif
31
32# SE05X Die Identifier
33CFG_NXP_SE05X_DIEID_DRV ?= y
34
35# Allow a secure client to enable the SCP03 session
36CFG_NXP_SE05X_SCP03_DRV ?= y
37ifeq ($(CFG_NXP_SE05X_SCP03_DRV),y)
38$(call force,CFG_SCP03_PTA,y,Mandated by CFG_NXP_SE05X_SCP03)
39endif
40
41# Allow a secure client to send APDU raw frames
42CFG_NXP_SE05X_APDU_DRV ?= y
43ifeq ($(CFG_NXP_SE05X_APDU_DRV),y)
44$(call force,CFG_APDU_PTA,y,Mandated by CFG_NXP_SE05X_APDU)
45endif
46
47# Random Number Generator
48CFG_NXP_SE05X_RNG_DRV ?= y
49ifeq ($(CFG_NXP_SE05X_RNG_DRV),y)
50$(call force,CFG_WITH_SOFTWARE_PRNG,n)
51endif
52
53se050-one-enabled = $(call cfg-one-enabled, \
54                        $(foreach v,$(1), CFG_NXP_SE05X_$(v)_DRV))
55# Asymmetric ciphers
56CFG_NXP_SE05X_RSA_DRV ?= y
57CFG_NXP_SE05X_ECC_DRV ?= y
58$(call force,CFG_NXP_SE05X_ACIPHER_DRV,$(call se050-one-enabled,RSA ECC))
59
60# Asymmetric driver
61ifeq ($(CFG_NXP_SE05X_ACIPHER_DRV),y)
62$(call force,CFG_CRYPTO_DRV_ACIPHER,y,Mandated by CFG_NXP_SE05X_ACIPHER_DRV)
63endif
64
65# Asymmetric ciphers configuration
66# - RSA
67ifeq ($(CFG_NXP_SE05X_RSA_DRV),y)
68$(call force,CFG_CRYPTO_DRV_RSA,y)
69CFG_CRYPTO_RSASSA_NA1 ?= y
70_CFG_CORE_LTC_RSA = n
71endif
72# - ECC
73ifeq ($(CFG_NXP_SE05X_ECC_DRV),y)
74$(call force,CFG_CRYPTO_DRV_ECC,y)
75endif
76
77# Symmetric ciphers
78CFG_NXP_SE05X_CTR_DRV ?= y
79$(call force,CFG_NXP_SE05X_CIPHER_DRV,$(call se050-one-enabled,CTR))
80
81# Symmetric driver
82ifeq ($(CFG_NXP_SE05X_CIPHER_DRV),y)
83$(call force,CFG_CRYPTO_DRV_CIPHER,y,Mandated by CFG_NXP_SE05X_CIPHER_DRV)
84endif
85
86endif  # CFG_NXP_SE05X
87