Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 1 | # |
Max Shvetsov | 06dba29 | 2019-12-06 11:50:12 +0000 | [diff] [blame] | 2 | # Copyright (c) 2015-2020, 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) |
| 20 | KEY_ALG := rsa |
| 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) |
| 28 | KEY_ALG := ecdsa |
| 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 |
| 36 | $(error "Unsupported ARM_ROTPK_LOCATION value") |
| 37 | endif |
| 38 | |
| 39 | $(eval $(call add_define,ARM_ROTPK_LOCATION_ID)) |
| 40 | |
| 41 | # Force generation of the new hash if ROT_KEY is specified |
| 42 | ifdef ROT_KEY |
| 43 | HASH_PREREQUISITES = $(ROT_KEY) FORCE |
| 44 | FORCE: |
| 45 | else |
| 46 | HASH_PREREQUISITES = $(ROT_KEY) |
| 47 | endif |
| 48 | |
| 49 | $(ARM_ROTPK_HASH) : $(HASH_PREREQUISITES) |
| 50 | ifndef ROT_KEY |
| 51 | $(error Cannot generate hash: no ROT_KEY defined) |
| 52 | endif |
| 53 | openssl rsa -in $< -pubout -outform DER | openssl dgst \ |
| 54 | -sha256 -binary > $@ |
| 55 | |
| 56 | # Certificate NV-Counters. Use values corresponding to tied off values in |
| 57 | # ARM development platforms |
| 58 | TFW_NVCTR_VAL ?= 31 |
| 59 | NTFW_NVCTR_VAL ?= 223 |
| 60 | else |
| 61 | # Certificate NV-Counters when CryptoCell is integrated. For development |
| 62 | # platforms we set the counter to first valid value. |
| 63 | TFW_NVCTR_VAL ?= 0 |
| 64 | NTFW_NVCTR_VAL ?= 0 |
| 65 | endif |
| 66 | BL1_SOURCES += plat/arm/board/common/board_arm_trusted_boot.c \ |
| 67 | plat/arm/board/common/rotpk/arm_dev_rotpk.S |
| 68 | BL2_SOURCES += plat/arm/board/common/board_arm_trusted_boot.c \ |
| 69 | plat/arm/board/common/rotpk/arm_dev_rotpk.S |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 70 | |
Juan Castillo | 31a68f0 | 2015-04-14 12:49:03 +0100 | [diff] [blame] | 71 | endif |