From e7d2f636cb9c80e0c391b0eb4dddd5f15cd15d21 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Tue, 16 Jul 2019 10:54:27 -0700 Subject: cr50: provide separate environment variable to enable crypto tests Presently the CR50_DEV environment variable is overloaded, if its value is a number exceeding 1, it enables inclusion in the image of the dcrypto tests. To make things cleaner let's use a separate environment variable to add dcrypto tests to the image. Note that the tests still can not be enabled, as they do not fit into the flash code space. BRANCH=cr50, cr50-mp BUG=b:137659935 TEST=verified that image building with CRYPTO_TEST=1 fails due to exceeded code size. Change-Id: I550c219c1eefe01fbe035b85a1d5aae88ea439de Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704607 Reviewed-by: Mary Ruthven --- board/cr50/build.mk | 7 ++++++- chip/g/dcrypto/dcrypto.h | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/cr50/build.mk b/board/cr50/build.mk index 4f3b513683..5b0d788401 100644 --- a/board/cr50/build.mk +++ b/board/cr50/build.mk @@ -18,7 +18,12 @@ ifeq ($(BOARD_MK_INCLUDED_ONCE),) # List of variables which can be defined in the environment or set in the make # command line. -ENV_VARS := CR50_DEV CR50_SQA H1_RED_BOARD +ENV_VARS := CR50_DEV CR50_SQA CRYPTO_TEST H1_RED_BOARD + +ifneq ($(CRYPTO_TEST),) +CPPFLAGS += -DCRYPTO_TEST_SETUP +endif + BOARD_MK_INCLUDED_ONCE=1 SIG_EXTRA = --cros diff --git a/chip/g/dcrypto/dcrypto.h b/chip/g/dcrypto/dcrypto.h index bf3333e883..7a186e790e 100644 --- a/chip/g/dcrypto/dcrypto.h +++ b/chip/g/dcrypto/dcrypto.h @@ -9,10 +9,6 @@ #ifndef __EC_CHIP_G_DCRYPTO_DCRYPTO_H #define __EC_CHIP_G_DCRYPTO_DCRYPTO_H -#if defined(CR50_DEV) && (CR50_DEV) > 1 -#define CRYPTO_TEST_SETUP -#endif - #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.1