diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2017-08-15 15:53:30 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-09-15 03:08:26 -0700 |
commit | 94279fc38fae533e86425102082e0c681d98d259 (patch) | |
tree | 2012cd0153497e193fa417d2ce71941b0264a408 /Makefile.rules | |
parent | e18d9dd5300d5e1693ec3d4c72dd105efcff4393 (diff) | |
download | chrome-ec-94279fc38fae533e86425102082e0c681d98d259.tar.gz |
Makefile: Generate hashes for the touchpad FW
Based on the passed TOUCHPAD_FW parameter to the make command, the
build system generates hashes for the touchpad FW.
To generate the hashes, gen_touchpad_hash splits the touchpad FW
in blocks of CONFIG_UPDATE_PDU_SIZE, that are hashed individually
(SHA-256), and then stored in the EC image.
This will allow the USB updater code to verify the integrity of
the touchpad firmware being flashed.
When no FW is provided, zeros are output, which do not match
any valid data.
BRANCH=none
BUG=b:63993173
TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \
BOARD=hammer -j
TEST=Using variations of
make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \
BOARD=hammer -j
make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_4.0.bin \
BOARD=hammer -j
make BOARD=hammer -j
Check that TPHASH touchpad_fw_hash.h is only regenerated when
the parameter changes.
Change-Id: Ie347270aa9c00342de13489c9422e45e681b94c2
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/615321
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r-- | Makefile.rules | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules index d589556558..0544d29d07 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -100,6 +100,9 @@ cmd_c_to_taskinfo = $(BUILDCC) \ cmd_link_taskinfo = $(BUILDCC) $(BUILD_CFLAGS) --shared -fPIC $^ \ $(BUILD_LDFLAGS) -flto -o $@ +cmd_tp_hash = $(out)/util/gen_touchpad_hash \ + $(if $(TOUCHPAD_FW),-f $(TOUCHPAD_FW)) -o $@ + # commands for RSA signature: rwsig does not need to sign the whole image # (it signs the RW part separately). usbpd1 type needs to sign the final image. ifeq ($(CONFIG_RWSIG_TYPE_RWSIG),) |