diff --git a/boards/xtensa/esp32s2/common/scripts/esp32s2_memory.ld b/boards/xtensa/esp32s2/common/scripts/flat_memory.ld similarity index 96% rename from boards/xtensa/esp32s2/common/scripts/esp32s2_memory.ld rename to boards/xtensa/esp32s2/common/scripts/flat_memory.ld index 9c30cba1ff..4dc6efecf2 100644 --- a/boards/xtensa/esp32s2/common/scripts/esp32s2_memory.ld +++ b/boards/xtensa/esp32s2/common/scripts/flat_memory.ld @@ -1,12 +1,12 @@ /**************************************************************************** - * boards/xtensa/esp32s2/common/scripts/esp32s2_memory.ld + * boards/xtensa/esp32s2/common/scripts/flat_memory.ld * ESP32-S2 Linker Script Memory Layout * * This file describes the memory layout (memory blocks) as virtual * memory addresses. * - * esp32s2_sections.ld contains output sections to link compiler output - * into these memory blocks. + * _sections.ld contains output sections to link compiler + * output into these memory blocks. * ****************************************************************************/ diff --git a/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld b/boards/xtensa/esp32s2/common/scripts/legacy_sections.ld similarity index 98% rename from boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld rename to boards/xtensa/esp32s2/common/scripts/legacy_sections.ld index d466cddee9..22b084b104 100644 --- a/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld +++ b/boards/xtensa/esp32s2/common/scripts/legacy_sections.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld + * boards/xtensa/esp32s2/common/scripts/legacy_sections.ld ****************************************************************************/ /* Default entry point: */ diff --git a/boards/xtensa/esp32s2/common/scripts/esp32s2_mcuboot.ld b/boards/xtensa/esp32s2/common/scripts/mcuboot_sections.ld similarity index 99% rename from boards/xtensa/esp32s2/common/scripts/esp32s2_mcuboot.ld rename to boards/xtensa/esp32s2/common/scripts/mcuboot_sections.ld index 2abdcfaf51..0af713f173 100644 --- a/boards/xtensa/esp32s2/common/scripts/esp32s2_mcuboot.ld +++ b/boards/xtensa/esp32s2/common/scripts/mcuboot_sections.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/xtensa/esp32s2/common/scripts/esp32s2_mcuboot.ld + * boards/xtensa/esp32s2/common/scripts/mcuboot_sections.ld * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/xtensa/esp32s2/esp32s2-kaluga-1/scripts/Make.defs b/boards/xtensa/esp32s2/esp32s2-kaluga-1/scripts/Make.defs index 1e0d63c65c..d91a4b141d 100644 --- a/boards/xtensa/esp32s2/esp32s2-kaluga-1/scripts/Make.defs +++ b/boards/xtensa/esp32s2/esp32s2-kaluga-1/scripts/Make.defs @@ -23,30 +23,18 @@ include $(TOPDIR)/tools/Config.mk include $(TOPDIR)/tools/esp32s2/Config.mk include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs -# Pick the linker scripts from the board level if they exist, if not -# pick the common linker scripts. - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_rom.ld ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_peripherals.ld -ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld -else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld -endif +# Pick the linker scripts from the board level if they exist, if not +# pick the common linker scripts. + +ARCHSCRIPT += $(call FINDSCRIPT,flat_memory.ld) ifeq ($(CONFIG_ESP32S2_APP_FORMAT_MCUBOOT),y) - ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld - else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld - endif + ARCHSCRIPT += $(call FINDSCRIPT,mcuboot_sections.ld) else - ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld - else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld - endif + ARCHSCRIPT += $(call FINDSCRIPT,legacy_sections.ld) endif ARCHPICFLAGS = -fpic diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs index 7056fb64f5..dbcc0add21 100644 --- a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs +++ b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs @@ -23,30 +23,18 @@ include $(TOPDIR)/tools/Config.mk include $(TOPDIR)/tools/esp32s2/Config.mk include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs -# Pick the linker scripts from the board level if they exist, if not -# pick the common linker scripts. - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_rom.ld ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_peripherals.ld -ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld -else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_memory.ld -endif +# Pick the linker scripts from the board level if they exist, if not +# pick the common linker scripts. + +ARCHSCRIPT += $(call FINDSCRIPT,flat_memory.ld) ifeq ($(CONFIG_ESP32S2_APP_FORMAT_MCUBOOT),y) - ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld - else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_mcuboot.ld - endif + ARCHSCRIPT += $(call FINDSCRIPT,mcuboot_sections.ld) else - ifneq ($(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld),) - ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld - else - ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s2_sections.ld - endif + ARCHSCRIPT += $(call FINDSCRIPT,legacy_sections.ld) endif ARCHPICFLAGS = -fpic