Merge changes from topic "assert_boolean_set" into integration

* changes:
  build!: check boolean flags are not empty
  fix(build): add a default value for INVERTED_MEMMAP
  fix(a5ds): add default value for ARM_DISABLE_TRUSTED_WDOG
  fix(st-crypto): move flag control into source code
  fix(stm32mp1): always define PKA algos flags
  fix(stm32mp1): remove boolean check on PLAT_TBBR_IMG_DEF
This commit is contained in:
Manish Pandey 2023-05-09 11:26:11 +02:00 committed by TrustedFirmware Code Review
commit 3e2923199d
6 changed files with 15 additions and 17 deletions

View file

@ -1062,6 +1062,7 @@ PYTHON ?= python3
# Variables for use with PRINT_MEMORY_MAP # Variables for use with PRINT_MEMORY_MAP
PRINT_MEMORY_MAP_PATH ?= tools/memory PRINT_MEMORY_MAP_PATH ?= tools/memory
PRINT_MEMORY_MAP ?= ${PRINT_MEMORY_MAP_PATH}/print_memory_map.py PRINT_MEMORY_MAP ?= ${PRINT_MEMORY_MAP_PATH}/print_memory_map.py
INVERTED_MEMMAP ?= 0
# Variables for use with documentation build using Sphinx tool # Variables for use with documentation build using Sphinx tool
DOCS_PATH ?= docs DOCS_PATH ?= docs

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022, STMicroelectronics - All Rights Reserved * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -19,6 +19,11 @@
#include <platform_def.h> #include <platform_def.h>
#if !PKA_USE_NIST_P256 && !PKA_USE_BRAINPOOL_P256R1 && !PKA_USE_BRAINPOOL_P256T1 && \
!PKA_USE_NIST_P521
#error "At least one ECDSA curve needs to be selected"
#endif
/* /*
* For our comprehension in this file * For our comprehension in this file
* _len are in BITs * _len are in BITs

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022, STMicroelectronics - All Rights Reserved * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -9,24 +9,11 @@
#include <stdint.h> #include <stdint.h>
#if !PKA_USE_NIST_P256 && !PKA_USE_BRAINPOOL_P256R1 && !PKA_USE_BRAINPOOL_P256T1 && \
!PKA_USE_NIST_P521
#error "At least one ECDSA curve needs to be selected"
#endif
enum stm32_pka_ecdsa_curve_id { enum stm32_pka_ecdsa_curve_id {
#if PKA_USE_NIST_P256
PKA_NIST_P256, PKA_NIST_P256,
#endif
#if PKA_USE_BRAINPOOL_P256R1
PKA_BRAINPOOL_P256R1, PKA_BRAINPOOL_P256R1,
#endif
#if PKA_USE_BRAINPOOL_P256T1
PKA_BRAINPOOL_P256T1, PKA_BRAINPOOL_P256T1,
#endif
#if PKA_USE_NIST_P521
PKA_NIST_P521, PKA_NIST_P521,
#endif
}; };
struct stm32_pka_platdata { struct stm32_pka_platdata {

View file

@ -73,6 +73,7 @@ endef
# Convenience function for verifying option has a boolean value # Convenience function for verifying option has a boolean value
# $(eval $(call assert_boolean,FOO)) will assert FOO is 0 or 1 # $(eval $(call assert_boolean,FOO)) will assert FOO is 0 or 1
define assert_boolean define assert_boolean
$(if $($(1)),,$(error $(1) must not be empty))
$(if $(filter-out 0 1,$($1)),$(error $1 must be boolean)) $(if $(filter-out 0 1,$($1)),$(error $1 must be boolean))
endef endef

View file

@ -100,6 +100,8 @@ NEED_BL32 := yes
MULTI_CONSOLE_API := 1 MULTI_CONSOLE_API := 1
ARM_DISABLE_TRUSTED_WDOG := 1
PLAT_BL_COMMON_SOURCES += lib/xlat_tables/aarch32/nonlpae_tables.c PLAT_BL_COMMON_SOURCES += lib/xlat_tables/aarch32/nonlpae_tables.c
# Use translation tables library v1 when using Cortex-A5 # Use translation tables library v1 when using Cortex-A5

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015-2023, ARM Limited and Contributors. All rights reserved. # Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -73,6 +73,9 @@ $(error "DECRYPTION_SUPPORT not supported on STM32MP15")
endif endif
endif endif
PKA_USE_NIST_P256 ?= 0
PKA_USE_BRAINPOOL_P256T1 ?= 0
ifeq ($(AARCH32_SP),sp_min) ifeq ($(AARCH32_SP),sp_min)
# Disable Neon support: sp_min runtime may conflict with non-secure world # Disable Neon support: sp_min runtime may conflict with non-secure world
TF_CFLAGS += -mfloat-abi=soft TF_CFLAGS += -mfloat-abi=soft
@ -158,7 +161,6 @@ $(eval $(call assert_booleans,\
$(sort \ $(sort \
PKA_USE_BRAINPOOL_P256T1 \ PKA_USE_BRAINPOOL_P256T1 \
PKA_USE_NIST_P256 \ PKA_USE_NIST_P256 \
PLAT_TBBR_IMG_DEF \
STM32MP_CRYPTO_ROM_LIB \ STM32MP_CRYPTO_ROM_LIB \
STM32MP_DDR_32BIT_INTERFACE \ STM32MP_DDR_32BIT_INTERFACE \
STM32MP_DDR_DUAL_AXI_PORT \ STM32MP_DDR_DUAL_AXI_PORT \