Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10850
-gerrit
commit cefb7744c63ee95e42e15d76de079dcb46aa155a Author: Daisuke Nojiri dnojiri@chromium.org Date: Wed Jul 1 10:37:04 2015 -0700
cbfs: make size for CBFS_HEADER_OFFSET explicit
It's currently not visible in memlayout.ld how much space is allocated for CBFS_HEADER_OFFSET, thus, it cannot be validated whether the field following it has the right address and size. This change makes CBFS_HEADER_OFFSET macro take size argument explicitly, which also makes it consistent with other fields with a fixed size.
BUG=none BRANCH=tot TEST=built storm
Change-Id: Ifedc21abf4c41038a6021f221d924400d9ef41d6 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Commit-Id: f30577fc8f8cb24ec83868ecbbea1fe9b2ff4a71 Original-Change-Id: I61bfb53b5604661504bbe8af3f8bb8310b543d14 Original-Signed-off-by: Daisuke Nojiri dnojiri@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/283062 Original-Reviewed-by: Aaron Durbin adurbin@chromium.org --- src/include/memlayout.h | 6 +++++- src/soc/broadcom/cygnus/include/soc/memlayout.ld | 2 +- src/soc/qualcomm/ipq806x/include/soc/memlayout.ld | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/include/memlayout.h b/src/include/memlayout.h index caae25a..0eab785 100644 --- a/src/include/memlayout.h +++ b/src/include/memlayout.h @@ -105,6 +105,10 @@ . += sz; #endif
-#define CBFS_HEADER_OFFSET(addr) REGION(cbfs_header_offset, addr, 4, 4) +/* space used to store cbfs header offset, which is 4 bytes */ +#define CBFS_HEADER_OFFSET(addr, sz) \ + REGION(cbfs_header_offset, addr, sz, 4) \ + _ = ASSERT(sz == 4, \ + STR(cbfs_header_offset must be exactly 4 bytes (sz)));
#endif /* __MEMLAYOUT_H */ diff --git a/src/soc/broadcom/cygnus/include/soc/memlayout.ld b/src/soc/broadcom/cygnus/include/soc/memlayout.ld index bd3621a..e1d30e8 100644 --- a/src/soc/broadcom/cygnus/include/soc/memlayout.ld +++ b/src/soc/broadcom/cygnus/include/soc/memlayout.ld @@ -35,7 +35,7 @@ SECTIONS OVERLAP_VERSTAGE_ROMSTAGE(0x02014000, 120K) PRERAM_CBFS_CACHE(0x02032000, 1K) TIMESTAMP(0x02032400, 1K) - CBFS_HEADER_OFFSET(0x02032800) + CBFS_HEADER_OFFSET(0x02032800, 4) STACK(0x02033000, 12K) REGION(reserved_for_secure_service_api, 0x0203F000, 4K, 4) SRAM_END(0x02040000) diff --git a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld b/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld index c66d0c8..c74d580 100644 --- a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld +++ b/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld @@ -35,7 +35,7 @@ SECTIONS VBOOT2_WORK(0x2A022000, 16K) PRERAM_CBMEM_CONSOLE(0x2A026000, 32K) TIMESTAMP(0x2A02E000, 1K) - CBFS_HEADER_OFFSET(0x2A02E400) + CBFS_HEADER_OFFSET(0x2A02E400, 4)
/* 0x2e404..0x3F000 4 bytes shy of 67KB free */