Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 1 | # |
laurenw-arm | d344978 | 2022-04-21 16:50:49 -0500 | [diff] [blame] | 2 | # Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved. |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 5 | # |
| 6 | |
Antonio Nino Diaz | d7da2f8 | 2018-10-10 11:14:44 +0100 | [diff] [blame] | 7 | PLAT_BL_COMMON_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \ |
Yatharth Kochar | f528faf | 2016-06-28 16:58:26 +0100 | [diff] [blame] | 8 | plat/arm/board/common/${ARCH}/board_arm_helpers.S |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 9 | |
Antonio Nino Diaz | d7da2f8 | 2018-10-10 11:14:44 +0100 | [diff] [blame] | 10 | BL1_SOURCES += drivers/cfi/v2m/v2m_flash.c |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 11 | |
Antonio Nino Diaz | d7da2f8 | 2018-10-10 11:14:44 +0100 | [diff] [blame] | 12 | BL2_SOURCES += drivers/cfi/v2m/v2m_flash.c |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 13 | |
| 14 | ifneq (${TRUSTED_BOARD_BOOT},0) |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 15 | ifneq (${ARM_CRYPTOCELL_INTEG}, 1) |
| 16 | # ROTPK hash location |
| 17 | ifeq (${ARM_ROTPK_LOCATION}, regs) |
| 18 | ARM_ROTPK_LOCATION_ID = ARM_ROTPK_REGS_ID |
| 19 | else ifeq (${ARM_ROTPK_LOCATION}, devel_rsa) |
Max Shvetsov | 7b753d9 | 2020-02-11 12:41:08 +0000 | [diff] [blame] | 20 | CRYPTO_ALG=rsa |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 21 | ARM_ROTPK_LOCATION_ID = ARM_ROTPK_DEVEL_RSA_ID |
| 22 | ARM_ROTPK_HASH = plat/arm/board/common/rotpk/arm_rotpk_rsa_sha256.bin |
| 23 | $(eval $(call add_define_val,ARM_ROTPK_HASH,'"$(ARM_ROTPK_HASH)"')) |
| 24 | $(BUILD_PLAT)/bl2/arm_dev_rotpk.o : $(ARM_ROTPK_HASH) |
| 25 | $(warning Development keys support for FVP is deprecated. Use `regs` \ |
| 26 | option instead) |
| 27 | else ifeq (${ARM_ROTPK_LOCATION}, devel_ecdsa) |
Max Shvetsov | 7b753d9 | 2020-02-11 12:41:08 +0000 | [diff] [blame] | 28 | CRYPTO_ALG=ec |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 29 | ARM_ROTPK_LOCATION_ID = ARM_ROTPK_DEVEL_ECDSA_ID |
| 30 | ARM_ROTPK_HASH = plat/arm/board/common/rotpk/arm_rotpk_ecdsa_sha256.bin |
| 31 | $(eval $(call add_define_val,ARM_ROTPK_HASH,'"$(ARM_ROTPK_HASH)"')) |
| 32 | $(BUILD_PLAT)/bl2/arm_dev_rotpk.o : $(ARM_ROTPK_HASH) |
| 33 | $(warning Development keys support for FVP is deprecated. Use `regs` \ |
| 34 | option instead) |
| 35 | else |
Sandrine Bailleux | 3e183f9 | 2021-04-16 16:08:46 +0200 | [diff] [blame] | 36 | $(error "Unsupported ARM_ROTPK_LOCATION value") |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 37 | endif |
| 38 | |
| 39 | $(eval $(call add_define,ARM_ROTPK_LOCATION_ID)) |
| 40 | |
laurenw-arm | d344978 | 2022-04-21 16:50:49 -0500 | [diff] [blame] | 41 | ifeq (${ENABLE_RME}, 1) |
| 42 | COT := cca |
| 43 | endif |
| 44 | |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 45 | # Force generation of the new hash if ROT_KEY is specified |
| 46 | ifdef ROT_KEY |
| 47 | HASH_PREREQUISITES = $(ROT_KEY) FORCE |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 48 | else |
| 49 | HASH_PREREQUISITES = $(ROT_KEY) |
| 50 | endif |
| 51 | |
| 52 | $(ARM_ROTPK_HASH) : $(HASH_PREREQUISITES) |
| 53 | ifndef ROT_KEY |
| 54 | $(error Cannot generate hash: no ROT_KEY defined) |
| 55 | endif |
Max Shvetsov | 7b753d9 | 2020-02-11 12:41:08 +0000 | [diff] [blame] | 56 | openssl ${CRYPTO_ALG} -in $< -pubout -outform DER | openssl dgst \ |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 57 | -sha256 -binary > $@ |
| 58 | |
| 59 | # Certificate NV-Counters. Use values corresponding to tied off values in |
| 60 | # ARM development platforms |
| 61 | TFW_NVCTR_VAL ?= 31 |
| 62 | NTFW_NVCTR_VAL ?= 223 |
| 63 | else |
| 64 | # Certificate NV-Counters when CryptoCell is integrated. For development |
| 65 | # platforms we set the counter to first valid value. |
| 66 | TFW_NVCTR_VAL ?= 0 |
| 67 | NTFW_NVCTR_VAL ?= 0 |
| 68 | endif |
| 69 | BL1_SOURCES += plat/arm/board/common/board_arm_trusted_boot.c \ |
| 70 | plat/arm/board/common/rotpk/arm_dev_rotpk.S |
| 71 | BL2_SOURCES += plat/arm/board/common/board_arm_trusted_boot.c \ |
| 72 | plat/arm/board/common/rotpk/arm_dev_rotpk.S |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 73 | |
Sandrine Bailleux | 012f871 | 2020-02-06 14:59:33 +0100 | [diff] [blame] | 74 | # Allows platform code to provide implementation variants depending on the |
| 75 | # selected chain of trust. |
| 76 | $(eval $(call add_define,ARM_COT_${COT})) |
| 77 | |
| 78 | ifeq (${COT},dualroot) |
| 79 | # Platform Root of Trust key files. |
| 80 | ARM_PROT_KEY := plat/arm/board/common/protpk/arm_protprivk_rsa.pem |
| 81 | ARM_PROTPK_HASH := plat/arm/board/common/protpk/arm_protpk_rsa_sha256.bin |
| 82 | |
| 83 | # Provide the private key to cert_create tool. It needs it to sign the images. |
| 84 | PROT_KEY := ${ARM_PROT_KEY} |
| 85 | |
| 86 | $(eval $(call add_define_val,ARM_PROTPK_HASH,'"$(ARM_PROTPK_HASH)"')) |
| 87 | |
| 88 | BL1_SOURCES += plat/arm/board/common/protpk/arm_dev_protpk.S |
| 89 | BL2_SOURCES += plat/arm/board/common/protpk/arm_dev_protpk.S |
| 90 | |
| 91 | $(BUILD_PLAT)/bl1/arm_dev_protpk.o: $(ARM_PROTPK_HASH) |
laurenw-arm | d344978 | 2022-04-21 16:50:49 -0500 | [diff] [blame] | 92 | $(BUILD_PLAT)/bl2/arm_dev_protpk.o: $(ARM_PROTPK_HASH) |
| 93 | endif |
| 94 | |
| 95 | ifeq (${COT},cca) |
| 96 | # Platform and Secure World Root of Trust key files. |
| 97 | ARM_PROT_KEY := plat/arm/board/common/protpk/arm_protprivk_rsa.pem |
| 98 | ARM_PROTPK_HASH := plat/arm/board/common/protpk/arm_protpk_rsa_sha256.bin |
| 99 | ARM_SWD_ROT_KEY := plat/arm/board/common/swd_rotpk/arm_swd_rotprivk_rsa.pem |
| 100 | ARM_SWD_ROTPK_HASH := plat/arm/board/common/swd_rotpk/arm_swd_rotpk_rsa_sha256.bin |
| 101 | |
| 102 | # Provide the private keys to cert_create tool. It needs them to sign the images. |
| 103 | PROT_KEY := ${ARM_PROT_KEY} |
| 104 | SWD_ROT_KEY := ${ARM_SWD_ROT_KEY} |
| 105 | |
| 106 | $(eval $(call add_define_val,ARM_PROTPK_HASH,'"$(ARM_PROTPK_HASH)"')) |
| 107 | $(eval $(call add_define_val,ARM_SWD_ROTPK_HASH,'"$(ARM_SWD_ROTPK_HASH)"')) |
| 108 | |
| 109 | BL1_SOURCES += plat/arm/board/common/protpk/arm_dev_protpk.S \ |
| 110 | plat/arm/board/common/swd_rotpk/arm_dev_swd_rotpk.S |
| 111 | BL2_SOURCES += plat/arm/board/common/protpk/arm_dev_protpk.S \ |
| 112 | plat/arm/board/common/swd_rotpk/arm_dev_swd_rotpk.S |
| 113 | |
| 114 | $(BUILD_PLAT)/bl1/arm_dev_protpk.o: $(ARM_PROTPK_HASH) |
| 115 | $(BUILD_PLAT)/bl1/arm_dev_swd_rotpk.o: $(ARM_SWD_ROTPK_HASH) |
Sandrine Bailleux | 012f871 | 2020-02-06 14:59:33 +0100 | [diff] [blame] | 116 | $(BUILD_PLAT)/bl2/arm_dev_protpk.o: $(ARM_PROTPK_HASH) |
laurenw-arm | d344978 | 2022-04-21 16:50:49 -0500 | [diff] [blame] | 117 | $(BUILD_PLAT)/bl2/arm_dev_swd_rotpk.o: $(ARM_SWD_ROTPK_HASH) |
Sandrine Bailleux | 012f871 | 2020-02-06 14:59:33 +0100 | [diff] [blame] | 118 | endif |
| 119 | |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 120 | endif |