From 4c434db787f3e65b2ac25fac8c2d65f250a45994 Mon Sep 17 00:00:00 2001 From: "Brian J. Nemec" Date: Thu, 19 Jan 2023 14:44:10 -0800 Subject: Zephyr: Remove binman.dtsi requirements Starfish uses the EC build environment but does not use the CrOSEC stubs and does not use the EC partition. This leads to linker errors when building due to CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE dependencies which is undefined on Zephyr only targets. Adds defined() guards to checks in the linker to avoid build failures. BUG=b:243700103 BRANCH=None TEST=None Change-Id: I98b207f25edd4f6306fa9ed3a0c1a0ce91f46856 Signed-off-by: Brian Nemec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4182530 Reviewed-by: Keith Short Reviewed-by: Abe Levkoy --- zephyr/linker/end-of-ram.ld | 2 +- zephyr/linker/image_size.ld | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/zephyr/linker/end-of-ram.ld b/zephyr/linker/end-of-ram.ld index e03de7481d..91e8385950 100644 --- a/zephyr/linker/end-of-ram.ld +++ b/zephyr/linker/end-of-ram.ld @@ -12,7 +12,7 @@ SECTION_PROLOGUE(.end_of_ram_info, 0, ) { ASSERT(DEFINED(_image_ram_end) && _image_ram_end > 0, "Error: _image_ram_end is not defined"); -#if defined(RAM_ADDR) && defined(RAM_SIZE) +#if defined(RAM_ADDR) && defined(RAM_SIZE) && defined(CONFIG_PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE) PROVIDE(__unused_ram_start = _image_ram_end); PROVIDE(__unused_ram_end = RAM_ADDR + RAM_SIZE); PROVIDE(__unused_ram_size = __unused_ram_end - __unused_ram_start); diff --git a/zephyr/linker/image_size.ld b/zephyr/linker/image_size.ld index 170daf141d..efeeafa3d4 100644 --- a/zephyr/linker/image_size.ld +++ b/zephyr/linker/image_size.ld @@ -3,8 +3,7 @@ * found in the LICENSE file. */ -#if defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) || \ - defined(CONFIG_CPU_CORTEX_A) || defined (CONFIG_RISCV) +#if defined(CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE) __image_size = CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE; #else /* -- cgit v1.2.1