From ded7c748e05c6effda9bc1cc55c6146835b772a5 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 31 May 2016 18:11:10 -0700 Subject: [PATCH] UPSTREAM: chromeec: Move EC image hash to separate file in CBFS The Chrome OS bootloader is changing its EC software sync mechanism to look for the hash of an EC image in a separate CBFS file, rather than using the CBFS hash attribute of the image itself (see http://crosreview.com/348061). This patch makes coreboot generate appropriate hash files for the new format when it builds and bundles a Chrome EC image. This also allows us to compress the EC image itself. Change-Id: I9aee6b8d24cdf41cb540db86a7569038fc7d9937 Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://review.coreboot.org/15039 Original-Reviewed-by: Aaron Durbin (cherry-picked from commit 8e97d00755867a41913156ecb08c74aab7398cb2) Signed-off-by: Martin Roth Reviewed-on: https://chromium-review.googlesource.com/350070 Reviewed-by: Furquan Shaikh --- src/ec/google/chromeec/Makefile.inc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ec/google/chromeec/Makefile.inc b/src/ec/google/chromeec/Makefile.inc index 9f5f0c1572..044aef3c2f 100644 --- a/src/ec/google/chromeec/Makefile.inc +++ b/src/ec/google/chromeec/Makefile.inc @@ -38,13 +38,21 @@ cbfs-files-$(if $(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME),y) += ecrw ecrw-file := $(obj)/mainboard/$(MAINBOARDDIR)/ecrw ecrw-name := ecrw ecrw-type := raw -ecrw-options := -A sha256 +ecrw-compression := $(CBFS_COMPRESS_FLAG) +cbfs-files-$(if $(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME),y) += ecrw.hash +ecrw.hash-file := $(obj)/mainboard/$(MAINBOARDDIR)/ecrw.hash +ecrw.hash-name := ecrw.hash +ecrw.hash-type := raw cbfs-files-$(if $(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME),y) += pdrw pdrw-file := $(obj)/mainboard/$(MAINBOARDDIR)/pdrw pdrw-name := pdrw pdrw-type := raw -pdrw-options := -A sha256 +pdrw-compression := $(CBFS_COMPRESS_FLAG) +cbfs-files-$(if $(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME),y) += pdrw.hash +pdrw.hash-file := $(obj)/mainboard/$(MAINBOARDDIR)/pdrw.hash +pdrw.hash-name := pdrw.hash +pdrw.hash-type := raw $(obj)/mainboard/$(MAINBOARDDIR)/ecrw: $(MAKE) -C $(top)/3rdparty/chromeec \ @@ -64,6 +72,9 @@ $(obj)/mainboard/$(MAINBOARDDIR)/pdrw: rw cp $(obj)/external/chromeec/$(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME)/RW/ec.RW.flat $@ +$(obj)/mainboard/$(MAINBOARDDIR)/%.hash: $(obj)/mainboard/$(MAINBOARDDIR)/% + openssl dgst -sha256 -binary $< > $@ + .PHONY: $(obj)/mainboard/$(MAINBOARDDIR)/ecrw $(obj)/mainboard/$(MAINBOARDDIR)/pdrw endif