From 6bfabce33b698571be73a47f62fe733f18e69f66 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 25 Dec 2014 15:07:22 -0800 Subject: cbfs: look for CBFS header in a predefined place This patch introduces a new option (CONFIG_MULTIPLE_CBFS_INSTANCES) to allow multiple CBFS instances in the bootrom. When the new option is enabled, the code running on the target controls which CBFS instance is used. Since all other then header CBFS structures use relative addressing, the only value which needs explicit setting is the offset of the CBFS header in the bootrom. This patch adds a facility to set the CBFS header offset. The offset value of zero means default. i.e. the CBFS initialization code still discovers the offset through the value saved at the top of the ROM. BRANCH=storm BUG=chrome-os-partner:34161, chromium:445938 TEST=with the rest patches in, storm target successfully boots from RW section A. Change-Id: Id8333c9373e61597f0c653c727dcee4ef6a58cd2 Signed-off-by: Patrick Georgi Original-Commit-Id: e57a3a15bba7cdcca4a5d684ed78f8ac6dbbc95e Original-Change-Id: I4c026389ec4fbaa19bd11b2160202282d2f9283c Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/237569 Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/9747 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Edward O'Callaghan --- src/include/cbfs.h | 5 +++++ src/include/memlayout.h | 2 ++ src/include/symbols.h | 1 + 3 files changed, 8 insertions(+) (limited to 'src/include') diff --git a/src/include/cbfs.h b/src/include/cbfs.h index c46d2a0be3..086fa19eb6 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -84,5 +84,10 @@ void *cbfs_simple_buffer_unmap(struct cbfs_simple_buffer *buffer, */ int init_default_cbfs_media(struct cbfs_media *media); +#if (IS_ENABLED(CONFIG_MULTIPLE_CBFS_INSTANCES)) +void cbfs_set_header_offset(size_t offset); +#else +static inline void cbfs_set_header_offset(size_t offset) {} +#endif #endif diff --git a/src/include/memlayout.h b/src/include/memlayout.h index a80e03ef85..263dc5ceda 100644 --- a/src/include/memlayout.h +++ b/src/include/memlayout.h @@ -102,4 +102,6 @@ . += sz; #endif +#define CBFS_HEADER_OFFSET(addr) REGION(cbfs_header_offset, addr, 4, 4) + #endif /* __MEMLAYOUT_H */ diff --git a/src/include/symbols.h b/src/include/symbols.h index c3ced87d3f..279c5a214a 100644 --- a/src/include/symbols.h +++ b/src/include/symbols.h @@ -27,6 +27,7 @@ extern u8 _esram[]; #define _sram_size (_esram - _sram) extern u8 _dram[]; +extern u32 _cbfs_header_offset[]; extern u8 _preram_cbmem_console[]; extern u8 _epreram_cbmem_console[]; -- cgit v1.2.3