summaryrefslogtreecommitdiff
path: root/chip/mchp
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2019-04-28 16:50:15 +0800
committerNicolas Boichat <drinkcat@chromium.org>2019-04-29 05:51:06 +0000
commit7e392e80e65c1b80cda4b585a2adc841905b17f1 (patch)
tree092454b90d2cf8b053c7d55a0414db85d99c5d48 /chip/mchp
parentc7ff23fb5e7057dfda351de004e70b862127a1d0 (diff)
downloadchrome-ec-7e392e80e65c1b80cda4b585a2adc841905b17f1.tar.gz
chip/(mec1322|mchp): Drop math expressions in MEMORY ORIGIN/LENGTH
binutils/ld 2.32 does not allow expressions in MEMORY regions (for some reason 2.31.1 was fine with that). Replace the expression with a constant, and add 2 assertions to check that the values are sane. BRANCH=none BUG=chromium:957361 TEST=make buildall -j with latest coreboot-sdk, no error Change-Id: I679f1a0ff24e96f215a52cdd6f2cde8540901b8e Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1587256 Reviewed-by: Sean Abraham <seanabraham@chromium.org>
Diffstat (limited to 'chip/mchp')
-rw-r--r--chip/mchp/lfw/ec_lfw.ld11
1 files changed, 9 insertions, 2 deletions
diff --git a/chip/mchp/lfw/ec_lfw.ld b/chip/mchp/lfw/ec_lfw.ld
index 315ad1bcfd..8e8601a5ee 100644
--- a/chip/mchp/lfw/ec_lfw.ld
+++ b/chip/mchp/lfw/ec_lfw.ld
@@ -14,11 +14,18 @@
*/
MEMORY
{
- VECTOR(r ) : ORIGIN = 0x0E0000, LENGTH = 24
- SRAM (xrw) : ORIGIN = 0x0E0018, LENGTH = 0x1000 - LENGTH(VECTOR)
+ VECTOR(r ) : ORIGIN = 0x0E0000, LENGTH = 0x18
+ SRAM (xrw) : ORIGIN = 0x0E0018, LENGTH = 0xFE8
}
/*
+ * ld does not allow mathematical expressions in ORIGIN/LENGTH, so check the
+ * values here.
+ */
+ASSERT(ORIGIN(VECTOR) + LENGTH(VECTOR) == ORIGIN(SRAM), "Invalid SRAM origin.")
+ASSERT(LENGTH(VECTOR) + LENGTH(SRAM) == 0x1000, "Invalid VECTOR+SRAM length.")
+
+/*
* The entry point is informative, for debuggers and simulators,
* since the Cortex-M vector points to it anyway.
*/