summaryrefslogtreecommitdiff
path: root/chip/npcx/build.mk
diff options
context:
space:
mode:
authorCHLin <CHLin56@nuvoton.com>2020-09-29 14:23:59 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-13 11:29:46 +0000
commit0f12014ad53ddfd0063a733a1357f81478136dc8 (patch)
treeb8a4e3b500ed7b9d28ae67588b8ceba42879503c /chip/npcx/build.mk
parent44435d3b9c447ad25edaa8aece42f1cff0dd6df9 (diff)
downloadchrome-ec-0f12014ad53ddfd0063a733a1357f81478136dc8.tar.gz
npcx9: support SHA256 hardware accelerator
There is the hardware accelerator for SHA computation inside npcx9. This CL wraps the Nuvoton SHA library APIs (which are in the ROM) to Chromium EC's SHA256_* APIs to speed up the SHA256 computation. With the help of the hardware accelerator, the hash computation runs several times faster than the software method (see b:155771688 for more detailed evaluation data.) Also, we can gain ~840 bytes of code size. BRANCH=none BUG=b:165777478 BUG=b:155771688 TEST=pass "make buildall" TEST=flash the same RW image; #define/#undef CONFIG_SHA256_HW_ACCELERATE ; verify the RW hash value is the same in the console message. TEST=with the following test CL, move test patterns in test/sha256.c to board/npcx9_evb/test_sha256.c; pass all test patterns. Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: I45ca609889bd73573d67d15f3e561614201e60f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2455021 Tested-by: CH Lin <chlin56@nuvoton.com> Auto-Submit: CH Lin <chlin56@nuvoton.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'chip/npcx/build.mk')
-rw-r--r--chip/npcx/build.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/npcx/build.mk b/chip/npcx/build.mk
index 4409c33c5d..a013ef5ef5 100644
--- a/chip/npcx/build.mk
+++ b/chip/npcx/build.mk
@@ -48,6 +48,8 @@ ifneq ($(CHIP_FAMILY),$(filter $(CHIP_FAMILY),npcx5 npcx7))
chip-y+=lct.o
endif
+chip-$(CONFIG_SHA256_HW_ACCELERATE)+=sha256_chip.o
+
# spi monitor program fw for openocd and UUT(UART Update Tool)
npcx-monitor-fw=chip/npcx/spiflashfw/npcx_monitor
npcx-monitor-fw-bin=${out}/$(npcx-monitor-fw).bin