summaryrefslogtreecommitdiff
path: root/board/cr50/build.mk
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2016-12-13 10:20:54 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-12-13 23:49:39 -0800
commitc7ea2c9125b9d6be9a52c6358e2892ff67e404c7 (patch)
tree9d5c7cfd87257346cc042bae57a32c18ae2cc3f3 /board/cr50/build.mk
parentd3e662bf77234755c0483643dac5a6a74beda3ea (diff)
downloadchrome-ec-c7ea2c9125b9d6be9a52c6358e2892ff67e404c7.tar.gz
CR50: make SHA512 a config option
Turn SHA512 support into a config option so that boards may individually enable SHA512 support. BRANCH=none BUG=chromium:673778 CQ-DEPEND=CL:419578 TEST=make buildall succeeds Change-Id: Ib857a3e97f1c2ec7066ae23ac725c7bf3d194e01 Signed-off-by: nagendra modadugu <ngm@google.com> Reviewed-on: https://chromium-review.googlesource.com/419327 Commit-Ready: Nagendra Modadugu <ngm@google.com> Tested-by: Nagendra Modadugu <ngm@google.com> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50/build.mk')
-rw-r--r--board/cr50/build.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/board/cr50/build.mk b/board/cr50/build.mk
index d2194c39e4..9aeaf391b7 100644
--- a/board/cr50/build.mk
+++ b/board/cr50/build.mk
@@ -63,14 +63,21 @@ CPPFLAGS += -I$(abspath ./chip/$(CHIP))
CPPFLAGS += -I$(abspath .)
CPPFLAGS += -I$(abspath $(BDIR))
CPPFLAGS += -I$(abspath ./test)
+ifeq ($(CONFIG_UPTO_SHA512),y)
+CPPFLAGS += -DSHA512_SUPPORT
+endif
# Make sure the context of the software sha512 implementation fits. If it ever
# increases, a compile time assert will fire in tpm2/hash.c.
+ifeq ($(CONFIG_UPTO_SHA512),y)
CFLAGS += -DUSER_MIN_HASH_STATE_SIZE=208
+else
+CFLAGS += -DUSER_MIN_HASH_STATE_SIZE=112
+endif
# Configure TPM2 headers accordingly.
CFLAGS += -DEMBEDDED_MODE=1
# Configure cryptoc headers to handle unaligned accesses.
-CFLAGS += -DSUPPORT_UNALIGNED=1 -DSHA512_SUPPORT=1
+CFLAGS += -DSUPPORT_UNALIGNED=1
# Add dependencies on that library
$(out)/RW/ec.RW.elf $(out)/RW/ec.RW_B.elf: LDFLAGS_EXTRA += -L$(out)/tpm2 -ltpm2