From aca2692f3224836eea5c2e5f1474e1d454af7062 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 28 Sep 2017 14:45:14 -0700 Subject: g: limit compiling in crypto tests to cases where CR50DEV > 1 To aid with severe flash space shortage, let's enable CRYPTO_TEST_SETUP only if CR50_DEV is set to a value exceeding 1. board/mn50/board.h used to define CR50_DEV without any value assigned to it, correct this so that the check in dcrypto.h works when mn50 is built. BRANCH=cr50 BUG=b:65253310 TEST=compiling with CR50-DEV=1 vs CR50_DEV=2 saves more than 17.5 Kbytes per RW image. Change-Id: Ic77fa45b1a8f7631efa91c08e63438d412196eed Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/690993 Reviewed-by: Randall Spangler --- board/mn50/board.h | 4 +++- chip/g/build.mk | 2 +- chip/g/dcrypto/dcrypto.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/board/mn50/board.h b/board/mn50/board.h index 2037fd8e5b..486d39a53f 100644 --- a/board/mn50/board.h +++ b/board/mn50/board.h @@ -13,7 +13,9 @@ #undef CONFIG_WATCHDOG_PERIOD_MS #define CONFIG_WATCHDOG_PERIOD_MS 5000 -#define CR50_DEV +#ifndef CR50_DEV +#define CR50_DEV 1 +#endif /* Features that we don't want */ #undef CONFIG_CMD_LID_ANGLE diff --git a/chip/g/build.mk b/chip/g/build.mk index cedba7d95b..2b41ca42c6 100644 --- a/chip/g/build.mk +++ b/chip/g/build.mk @@ -124,7 +124,7 @@ $(out)/RW/ec.RW_B.flat: $(out)/util/signer endif ifneq ($(CR50_DEV),) -CPPFLAGS += -DCR50_DEV=1 +CPPFLAGS += -DCR50_DEV=$(CR50_DEV) endif MANIFEST := util/signer/ec_RW-manifest-dev.json diff --git a/chip/g/dcrypto/dcrypto.h b/chip/g/dcrypto/dcrypto.h index ba058fea5f..5c643382c6 100644 --- a/chip/g/dcrypto/dcrypto.h +++ b/chip/g/dcrypto/dcrypto.h @@ -9,7 +9,7 @@ #ifndef __EC_CHIP_G_DCRYPTO_DCRYPTO_H #define __EC_CHIP_G_DCRYPTO_DCRYPTO_H -#ifdef CR50_DEV +#if defined(CR50_DEV) && (CR50_DEV) > 1 #define CRYPTO_TEST_SETUP #endif -- cgit v1.2.1