cortex-m: provide ability to insert free space into RO image base

Some platforms might expect the header of the image to be a certain
platform specific blob. This patch adds an ability to insert an
arbitrary size header in the binary blob, if so desired, the intention
is to have the platform specific tools to postprocess the image and
replace the header with sensible data.

Ideally we should be able to produce an image which is mapped to start
at an offset to the FLASH_BASE, but the macros in ec.S.lds files are
way too smart for this.

BRANCH=none
BUG=chrome-os-partner:43025
TEST=with this and other changes the latest cr50 image gets signed and
     booted properly.

Change-Id: Icabf00c6b90657b0ae3370ddad3567ccedf3ff49
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295200
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Vadim Bendebury
2015-08-21 13:27:56 -07:00
committed by ChromeOS Commit Bot
parent 65d683a7e5
commit 6f8637a6df
2 changed files with 9 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ SECTIONS
} > SHARED_LIB
#endif
.text : {
#if defined(CONFIG_RO_HEAD_ROOM)
. = . + CONFIG_RO_HEAD_ROOM;
#endif
OUTDIR/core/CORE/init.o (.text.vecttable)
. = ALIGN(4);
__version_struct_offset = .;

View File

@@ -1820,6 +1820,12 @@
*/
#undef CONFIG_WP_ALWAYS
/*
* If needed to allocate some free space in the base of the RO section of the
* image, define this to be equal the required size of the free space.
*/
#undef CONFIG_RO_HEAD_ROOM
/*****************************************************************************/
/*
* Include board and core configs, since those hold the CONFIG_ constants for a