diff --git a/soc/ambiq/apollo3x/CMakeLists.txt b/soc/ambiq/apollo3x/CMakeLists.txt index 2003b1a8df5..4d73e4ed2fe 100644 --- a/soc/ambiq/apollo3x/CMakeLists.txt +++ b/soc/ambiq/apollo3x/CMakeLists.txt @@ -6,4 +6,6 @@ zephyr_sources(soc.c) zephyr_include_directories(.) +zephyr_linker_sources(SECTIONS shared_ram.ld) + set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") diff --git a/soc/ambiq/apollo3x/shared_ram.ld b/soc/ambiq/apollo3x/shared_ram.ld new file mode 100644 index 00000000000..1904029e01c --- /dev/null +++ b/soc/ambiq/apollo3x/shared_ram.ld @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Ambiq Micro Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#if CONFIG_DT_HAS_AMBIQ_MSPI_CONTROLLER_ENABLED + SECTION_PROLOGUE (mspi_buff, CONFIG_SRAM_BASE_ADDRESS + CONFIG_MSPI_AMBIQ_BUFF_RAM_LOCATION (NOLOAD),) + { + __mspi_buff_start = .; + KEEP(*(SORT_BY_NAME(".mspi_buff*"))) + . = ALIGN(CONFIG_MSPI_AMBIQ_BUFF_ALIGNMENT); + __mspi_buff_end = .; + } GROUP_LINK_IN(RAMABLE_REGION) +#endif