summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-09-28 14:45:14 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-12-16 01:12:24 +0000
commit8a278ae0ff2b4961c76d0841f1c19dd6b59d259e (patch)
tree7b54a930d37075aefb92954d8e785289d04dc3aa
parent0fc8f0bb15108689120162d14d2cb737c289ccdc (diff)
downloadchrome-ec-8a278ae0ff2b4961c76d0841f1c19dd6b59d259e.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. Conflicts: board/mn50/board.h 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> (cherry picked from commit aca2692f3224836eea5c2e5f1474e1d454af7062) Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/828419
-rw-r--r--chip/g/build.mk2
-rw-r--r--chip/g/dcrypto/dcrypto.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/chip/g/build.mk b/chip/g/build.mk
index e9c3a219a6..7b6392fcd5 100644
--- a/chip/g/build.mk
+++ b/chip/g/build.mk
@@ -123,7 +123,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