Skip to content

Commit d750618

Browse files
committed
Arm backend: Share runner linker script setup
Move Ethos-U system validation, linker script preprocessing, and target configuration into ArmRunnerUtils so bare-metal runners can reuse the same setup. This commit was authored with Codex. Signed-off-by: Per Held <per.held@arm.com> Change-Id: I73b6fd9fddbbb2923d6757f6496bdbb0e94ec524
1 parent 660e854 commit d750618

15 files changed

Lines changed: 630 additions & 374 deletions

File tree

‎backends/arm/cmake/ArmRunnerUtils.cmake‎

Lines changed: 507 additions & 2 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

‎backends/arm/scripts/corstone_utils.cmake‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ function(set_ethosu_dedicated_sram_fast_scratch_size OUT_VAR MEMORY_MODE)
109109
)
110110
endfunction()
111111

112+
#[[
113+
Return the linker script used by the Corstone FVP for SYSTEM_CONFIG.
114+
]]
115+
function(get_corstone_linker_script OUT_VAR SYSTEM_CONFIG)
116+
if(SYSTEM_CONFIG MATCHES "Ethos_U55" OR SYSTEM_CONFIG MATCHES "Ethos_U65")
117+
set(_linker_script "Corstone-300.ld")
118+
elseif(SYSTEM_CONFIG MATCHES "Ethos_U85")
119+
set(_linker_script "Corstone-320.ld")
120+
else()
121+
message(FATAL_ERROR "Unsupported SYSTEM_CONFIG ${SYSTEM_CONFIG}.")
122+
endif()
123+
set(${OUT_VAR}
124+
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../cmake/linker_scripts/${_linker_script}"
125+
PARENT_SCOPE
126+
)
127+
endfunction()
128+
112129
function(add_corstone_subdirectory SYSTEM_CONFIG ETHOS_SDK_PATH)
113130
if(MEMORY_MODE MATCHES "^Dedicated_Sram($|_)")
114131
# Both model and scratch in DRAM.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)