From 5c924c0c2175d176d34ceccc64deeec8c4d4c92a Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Wed, 23 May 2018 16:01:18 +0800 Subject: hammer: Increase PDU size to 4k Saves another ~1300 bytes of flash size, as the touchpad hashes can now be computed in blocks of 4K, instead of 1K. This costs 3K of SRAM, which we would not otherwise need on hammer. wand can only fit 2k PDU, so let's stick to that. Also, make sure that util/gen_touchpad_fw is regenerated when the configuration option changes (touchpad FW size, PDU size). Sadly, this will still break bisection from commit after this CL, to before this CL. BRANCH=poppy BUG=b:80167548 TEST=make buildall -j TEST=make BOARD=hammer/staff/wand/whiskers all tests -j TEST=Copy new staff image with old touchpad FW to DUT, verify that FW can be updated. Change-Id: Ic1763684da730dc986bbbcb3312088c8208c84b5 Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/1070953 Reviewed-by: Vincent Palatin --- board/hammer/board.h | 8 ++++++++ util/build.mk | 2 ++ 2 files changed, 10 insertions(+) diff --git a/board/hammer/board.h b/board/hammer/board.h index 013dd4bc68..0f84c53d39 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -99,6 +99,14 @@ #define CONFIG_STREAM_USB #define CONFIG_USB_UPDATE +#undef CONFIG_UPDATE_PDU_SIZE +#ifdef BOARD_WAND +/* Wand does not have enough space to fit 4k PDU. */ +#define CONFIG_UPDATE_PDU_SIZE 2048 +#else +#define CONFIG_UPDATE_PDU_SIZE 4096 +#endif + #undef CONFIG_USB_MAXPOWER_MA #define CONFIG_USB_MAXPOWER_MA 100 diff --git a/util/build.mk b/util/build.mk index be130c728c..065528a681 100644 --- a/util/build.mk +++ b/util/build.mk @@ -69,6 +69,8 @@ OPENSSL_LDFLAGS := $(shell $(PKG_CONFIG) --libs openssl) $(out)/util/gen_touchpad_hash: BUILD_CFLAGS += $(OPENSSL_CFLAGS) $(out)/util/gen_touchpad_hash: BUILD_LDFLAGS += $(OPENSSL_LDFLAGS) + +deps-y += $(out)/util/gen_touchpad_hash.d endif # CONFIG_TOUCHPAD_VIRTUAL_OFF cbi-util-objs=../common/crc8.o ../common/cbi.o -- cgit v1.2.1