summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-09-28 14:45:14 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-09-29 20:16:24 -0700
commitaca2692f3224836eea5c2e5f1474e1d454af7062 (patch)
tree8a44697f83c069ce05ed63d5a71e9712565532bc
parent6f7d764e50accbe51114d46b56c31651c7b80a72 (diff)
downloadchrome-ec-aca2692f3224836eea5c2e5f1474e1d454af7062.tar.gz
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 <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/690993 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--board/mn50/board.h4
-rw-r--r--chip/g/build.mk2
-rw-r--r--chip/g/dcrypto/dcrypto.h2
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