Soby Mathew | 5d70800 | 2017-05-10 11:49:58 +0100 | [diff] [blame] | 1 | # |
Gilad Ben-Yossef | 033327a | 2019-05-15 09:24:04 +0300 | [diff] [blame] | 2 | # Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. |
Soby Mathew | 5d70800 | 2017-05-10 11:49:58 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | include drivers/auth/mbedtls/mbedtls_common.mk |
| 8 | |
| 9 | # The algorithm is RSA when using Cryptocell crypto driver |
| 10 | TF_MBEDTLS_KEY_ALG_ID := TF_MBEDTLS_RSA |
| 11 | |
| 12 | # Needs to be set to drive mbed TLS configuration correctly |
| 13 | $(eval $(call add_define,TF_MBEDTLS_KEY_ALG_ID)) |
| 14 | |
Gilad Ben-Yossef | a6e5342 | 2019-09-15 13:29:29 +0300 | [diff] [blame] | 15 | $(eval $(call add_define,KEY_SIZE)) |
| 16 | |
Soby Mathew | 5d70800 | 2017-05-10 11:49:58 +0100 | [diff] [blame] | 17 | # CCSBROM_LIB_PATH must be set to the Cryptocell SBROM library path |
| 18 | ifeq (${CCSBROM_LIB_PATH},) |
| 19 | $(error Error: CCSBROM_LIB_PATH not set) |
| 20 | endif |
| 21 | |
Gilad Ben-Yossef | 6fbe0fc | 2019-05-14 14:47:36 +0300 | [diff] [blame] | 22 | CRYPTOCELL_VERSION ?= 712 |
| 23 | ifeq (${CRYPTOCELL_VERSION},712) |
| 24 | CCSBROM_LIB_FILENAME := cc_712sbromx509 |
Gilad Ben-Yossef | 033327a | 2019-05-15 09:24:04 +0300 | [diff] [blame] | 25 | else ifeq (${CRYPTOCELL_VERSION},713) |
| 26 | CCSBROM_LIB_FILENAME := cc_713bsv |
Gilad Ben-Yossef | 6fbe0fc | 2019-05-14 14:47:36 +0300 | [diff] [blame] | 27 | else |
| 28 | $(error Error: CRYPTOCELL_VERSION set to invalid version) |
| 29 | endif |
| 30 | |
| 31 | CRYPTOCELL_SRC_DIR := drivers/auth/cryptocell/${CRYPTOCELL_VERSION}/ |
Soby Mathew | 5d70800 | 2017-05-10 11:49:58 +0100 | [diff] [blame] | 32 | |
Gilad Ben-Yossef | 6fbe0fc | 2019-05-14 14:47:36 +0300 | [diff] [blame] | 33 | CRYPTOCELL_SOURCES := ${CRYPTOCELL_SRC_DIR}/cryptocell_crypto.c \ |
| 34 | ${CRYPTOCELL_SRC_DIR}/cryptocell_plat_helpers.c |
| 35 | |
| 36 | TF_LDFLAGS += -L$(CCSBROM_LIB_PATH) |
| 37 | LDLIBS += -l$(CCSBROM_LIB_FILENAME) |
Soby Mathew | 5d70800 | 2017-05-10 11:49:58 +0100 | [diff] [blame] | 38 | |
Gilad Ben-Yossef | fbb88a3 | 2019-05-14 10:48:18 +0300 | [diff] [blame] | 39 | BL1_SOURCES += ${CRYPTOCELL_SOURCES} |
| 40 | BL2_SOURCES += ${CRYPTOCELL_SOURCES} |