summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-08-21 13:27:56 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-22 01:37:31 +0000
commit6f8637a6dfc3588367df7d211f26ea5b67ebbea1 (patch)
tree74f8f04c6f4f7125c724769445088ece1334cd3f
parent65d683a7e50f919669ff2e127c0e881642857fee (diff)
downloadchrome-ec-6f8637a6dfc3588367df7d211f26ea5b67ebbea1.tar.gz
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>
-rw-r--r--core/cortex-m/ec.lds.S3
-rw-r--r--include/config.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index dc9e829fa1..d0b90e5ada 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -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 = .;
diff --git a/include/config.h b/include/config.h
index a527c67fed..b718941a12 100644
--- a/include/config.h
+++ b/include/config.h
@@ -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