summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-06-11 11:59:07 -0700
committerFurquan Shaikh <furquan@google.com>2020-06-13 06:49:23 +0000
commit46514c2b877c29c2d7c2061a9785736e270c0c62 (patch)
tree2f78550192bce548139ef49fdac6623dad578703
parent00148bba7146318e2e815d8c13e33278f63814c9 (diff)
downloadcoreboot-46514c2b877c29c2d7c2061a9785736e270c0c62.tar.xz
treewide: Add Kconfig variable MEMLAYOUT_LD_FILE
This change defines a Kconfig variable MEMLAYOUT_LD_FILE which allows SoC/mainboard to provide a linker file for the platform. x86 already provides a default memlayout.ld under src/arch/x86. With this new Kconfig variable, it is possible for the SoC/mainboard code for x86 to provide a custom linker file as well. Makefile.inc is updated for all architectures to use this new Kconfig variable instead of assuming memlayout.ld files under a certain path. All non-x86 boards used memlayout.ld under mainboard directory. However, a lot of these boards were simply including the memlayout from SoC. So, this change also updates these mainboards and SoCs to define the Kconfig as required. BUG=b:155322763 TEST=Verified that abuild with --timeless option results in the same coreboot.rom image for all boards. Change-Id: I6a7f96643ed0519c93967ea2c3bcd881a5d6a4d6 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42292 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--Makefile.inc8
-rw-r--r--src/Kconfig9
-rw-r--r--src/arch/arm/Makefile.inc10
-rw-r--r--src/arch/arm64/Makefile.inc10
-rw-r--r--src/arch/ppc64/Makefile.inc6
-rw-r--r--src/arch/riscv/Makefile.inc6
-rw-r--r--src/arch/x86/Kconfig4
-rw-r--r--src/arch/x86/Makefile.inc11
-rw-r--r--src/cpu/ti/am335x/Kconfig8
-rw-r--r--src/cpu/ti/am335x/Makefile.inc5
-rw-r--r--src/mainboard/cavium/cn8100_sff_evb/Makefile.inc5
-rw-r--r--src/mainboard/cavium/cn8100_sff_evb/memlayout.ld1
-rw-r--r--src/mainboard/emulation/qemu-aarch64/Kconfig4
-rw-r--r--src/mainboard/emulation/qemu-aarch64/Makefile.inc4
-rw-r--r--src/mainboard/emulation/qemu-armv7/Kconfig4
-rw-r--r--src/mainboard/emulation/qemu-armv7/Makefile.inc4
-rw-r--r--src/mainboard/emulation/qemu-power8/Kconfig4
-rw-r--r--src/mainboard/emulation/qemu-power8/Makefile.inc4
-rw-r--r--src/mainboard/emulation/qemu-riscv/Kconfig4
-rw-r--r--src/mainboard/emulation/qemu-riscv/Makefile.inc4
-rw-r--r--src/mainboard/emulation/spike-riscv/Kconfig4
-rw-r--r--src/mainboard/emulation/spike-riscv/Makefile.inc4
-rw-r--r--src/mainboard/google/cheza/Makefile.inc4
-rw-r--r--src/mainboard/google/cheza/memlayout.ld3
-rw-r--r--src/mainboard/google/daisy/Makefile.inc4
-rw-r--r--src/mainboard/google/daisy/memlayout.ld3
-rw-r--r--src/mainboard/google/foster/Makefile.inc5
-rw-r--r--src/mainboard/google/foster/memlayout.ld3
-rw-r--r--src/mainboard/google/gale/Makefile.inc5
-rw-r--r--src/mainboard/google/gale/memlayout.ld3
-rw-r--r--src/mainboard/google/gru/Makefile.inc6
-rw-r--r--src/mainboard/google/gru/memlayout.ld3
-rw-r--r--src/mainboard/google/kukui/Makefile.inc5
-rw-r--r--src/mainboard/google/kukui/memlayout.ld3
-rw-r--r--src/mainboard/google/mistral/Makefile.inc4
-rw-r--r--src/mainboard/google/mistral/memlayout.ld3
-rw-r--r--src/mainboard/google/nyan/Makefile.inc5
-rw-r--r--src/mainboard/google/nyan/memlayout.ld3
-rw-r--r--src/mainboard/google/nyan_big/Makefile.inc5
-rw-r--r--src/mainboard/google/nyan_big/memlayout.ld3
-rw-r--r--src/mainboard/google/nyan_blaze/Makefile.inc5
-rw-r--r--src/mainboard/google/nyan_blaze/memlayout.ld3
-rw-r--r--src/mainboard/google/oak/Makefile.inc4
-rw-r--r--src/mainboard/google/oak/memlayout.ld3
-rw-r--r--src/mainboard/google/peach_pit/Makefile.inc4
-rw-r--r--src/mainboard/google/peach_pit/memlayout.ld3
-rw-r--r--src/mainboard/google/smaug/Makefile.inc5
-rw-r--r--src/mainboard/google/smaug/memlayout.ld3
-rw-r--r--src/mainboard/google/storm/Makefile.inc5
-rw-r--r--src/mainboard/google/storm/memlayout.ld3
-rw-r--r--src/mainboard/google/trogdor/Makefile.inc4
-rw-r--r--src/mainboard/google/trogdor/memlayout.ld3
-rw-r--r--src/mainboard/google/veyron/Makefile.inc5
-rw-r--r--src/mainboard/google/veyron/memlayout.ld3
-rw-r--r--src/mainboard/google/veyron_mickey/Makefile.inc5
-rw-r--r--src/mainboard/google/veyron_mickey/memlayout.ld3
-rw-r--r--src/mainboard/google/veyron_rialto/Makefile.inc5
-rw-r--r--src/mainboard/google/veyron_rialto/memlayout.ld3
-rw-r--r--src/mainboard/google/zork/Makefile.inc1
-rw-r--r--src/mainboard/opencellular/elgon/Makefile.inc4
-rw-r--r--src/mainboard/opencellular/elgon/memlayout.ld1
-rw-r--r--src/mainboard/sifive/hifive-unleashed/Makefile.inc4
-rw-r--r--src/mainboard/sifive/hifive-unleashed/memlayout.ld3
-rw-r--r--src/mainboard/ti/beaglebone/Makefile.inc4
-rw-r--r--src/mainboard/ti/beaglebone/memlayout.ld1
-rw-r--r--src/soc/cavium/cn81xx/Kconfig4
-rw-r--r--src/soc/cavium/cn81xx/memlayout.ld (renamed from src/soc/cavium/cn81xx/include/soc/memlayout.ld)0
-rw-r--r--src/soc/mediatek/mt8173/Kconfig4
-rw-r--r--src/soc/mediatek/mt8173/memlayout.ld (renamed from src/soc/mediatek/mt8173/include/soc/memlayout.ld)0
-rw-r--r--src/soc/mediatek/mt8183/Kconfig4
-rw-r--r--src/soc/mediatek/mt8183/memlayout.ld (renamed from src/soc/mediatek/mt8183/include/soc/memlayout.ld)0
-rw-r--r--src/soc/nvidia/tegra124/Kconfig4
-rw-r--r--src/soc/nvidia/tegra124/memlayout.ld (renamed from src/soc/nvidia/tegra124/include/soc/memlayout.ld)0
-rw-r--r--src/soc/nvidia/tegra210/Kconfig4
-rw-r--r--src/soc/nvidia/tegra210/memlayout.ld (renamed from src/soc/nvidia/tegra210/include/soc/memlayout.ld)0
-rw-r--r--src/soc/qualcomm/ipq40xx/Kconfig4
-rw-r--r--src/soc/qualcomm/ipq40xx/memlayout.ld (renamed from src/soc/qualcomm/ipq40xx/include/soc/memlayout.ld)0
-rw-r--r--src/soc/qualcomm/ipq806x/Kconfig4
-rw-r--r--src/soc/qualcomm/ipq806x/memlayout.ld (renamed from src/soc/qualcomm/ipq806x/include/soc/memlayout.ld)0
-rw-r--r--src/soc/qualcomm/qcs405/Kconfig4
-rw-r--r--src/soc/qualcomm/qcs405/memlayout.ld (renamed from src/soc/qualcomm/qcs405/include/soc/memlayout.ld)0
-rw-r--r--src/soc/qualcomm/sc7180/Kconfig4
-rw-r--r--src/soc/qualcomm/sc7180/memlayout.ld (renamed from src/soc/qualcomm/sc7180/include/soc/memlayout.ld)0
-rw-r--r--src/soc/qualcomm/sdm845/Kconfig4
-rw-r--r--src/soc/qualcomm/sdm845/memlayout.ld (renamed from src/soc/qualcomm/sdm845/include/soc/memlayout.ld)0
-rw-r--r--src/soc/rockchip/rk3288/Kconfig4
-rw-r--r--src/soc/rockchip/rk3288/memlayout.ld (renamed from src/soc/rockchip/rk3288/include/soc/memlayout.ld)0
-rw-r--r--src/soc/rockchip/rk3399/Kconfig4
-rw-r--r--src/soc/rockchip/rk3399/memlayout.ld (renamed from src/soc/rockchip/rk3399/include/soc/memlayout.ld)0
-rw-r--r--src/soc/samsung/exynos5250/Kconfig4
-rw-r--r--src/soc/samsung/exynos5250/memlayout.ld (renamed from src/soc/samsung/exynos5250/include/soc/memlayout.ld)0
-rw-r--r--src/soc/samsung/exynos5420/Kconfig4
-rw-r--r--src/soc/samsung/exynos5420/memlayout.ld (renamed from src/soc/samsung/exynos5420/include/soc/memlayout.ld)0
-rw-r--r--src/soc/sifive/fu540/Kconfig4
-rw-r--r--src/soc/sifive/fu540/memlayout.ld (renamed from src/soc/sifive/fu540/include/soc/memlayout.ld)0
95 files changed, 130 insertions, 210 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 86467a66a8..fca7ebdedd 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -13,6 +13,7 @@ CONFIG_CBFS_PREFIX:=$(call strip_quotes,$(CONFIG_CBFS_PREFIX))
CONFIG_FMDFILE:=$(call strip_quotes,$(CONFIG_FMDFILE))
CONFIG_DEVICETREE:=$(call strip_quotes, $(CONFIG_DEVICETREE))
CONFIG_OVERRIDE_DEVICETREE:=$(call strip_quotes, $(CONFIG_OVERRIDE_DEVICETREE))
+CONFIG_MEMLAYOUT_LD_FILE:=$(call strip_quotes, $(CONFIG_MEMLAYOUT_LD_FILE))
#######################################################################
# misleadingly named, this is the coreboot version
@@ -609,6 +610,13 @@ smm-c-deps+=$(DEVICETREE_STATIC_C)
.PHONY: devicetree
devicetree: $(DEVICETREE_STATIC_C)
+ramstage-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+romstage-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+bootblock-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+verstage-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+postcar-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+decompressor-y += $(CONFIG_MEMLAYOUT_LD_FILE)
+
#######################################################################
# Clean up rules
clean-abuild:
diff --git a/src/Kconfig b/src/Kconfig
index f3d86f2b6d..eef7a96f71 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -1182,6 +1182,15 @@ config BOOTBLOCK_CUSTOM
# src/lib/bootblock.c#main() C entry point.
bool
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/memlayout.ld"
+ help
+ This variable allows SoC/mainboard to supply in a custom linker file
+ if required. This determines the linker file used for all the stages
+ (bootblock, romstage, verstage, ramstage, postcar) in
+ src/arch/${ARCH}/Makefile.inc.
+
###############################################################################
# Set default values for symbols created before mainboards. This allows the
# option to be displayed in the general menu, but the default to be loaded in
diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc
index 66bf9c4f31..eef2650685 100644
--- a/src/arch/arm/Makefile.inc
+++ b/src/arch/arm/Makefile.inc
@@ -50,11 +50,11 @@ bootblock-y += stages.c
$(objcbfs)/bootblock.debug: $$(bootblock-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group
+ $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group
$(objcbfs)/decompressor.debug: $$(decompressor-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,decompressor,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group
+ $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,decompressor,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group
endif # CONFIG_ARCH_BOOTBLOCK_ARM
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_ARCH_VERSTAGE_ARM),y)
$(objcbfs)/verstage.debug: $$(verstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) -T $(call src-to-obj,verstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group
+ $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) -T $(call src-to-obj,verstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group
verstage-y += boot.c
verstage-y += div0.c
@@ -99,7 +99,7 @@ rmodules_arm-y += eabi_compat.c
$(objcbfs)/romstage.debug: $$(romstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group
+ $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group
endif # CONFIG_ARCH_ROMSTAGE_ARM
@@ -128,6 +128,6 @@ ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
$(objcbfs)/ramstage.debug: $$(ramstage-objs)
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group
+ $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group
endif # CONFIG_ARCH_RAMSTAGE_ARM
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index 5fd316aa7b..920ff5db51 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -45,11 +45,11 @@ bootblock-y += memmove.S
$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld)
+ $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE))
$(objcbfs)/decompressor.debug: $$(decompressor-objs) $(obj)/config.h
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group -T $(call src-to-obj,decompressor,src/mainboard/$(MAINBOARDDIR)/memlayout.ld)
+ $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group -T $(call src-to-obj,decompressor,$(CONFIG_MEMLAYOUT_LD_FILE))
endif # CONFIG_ARCH_BOOTBLOCK_ARM64
@@ -61,7 +61,7 @@ ifeq ($(CONFIG_ARCH_VERSTAGE_ARM64),y)
$(objcbfs)/verstage.debug: $$(verstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group -T $(call src-to-obj,verstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld)
+ $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group -T $(call src-to-obj,verstage,$(CONFIG_MEMLAYOUT_LD_FILE))
verstage-y += boot.c
verstage-y += div0.c
@@ -99,7 +99,7 @@ rmodules_arm64-y += eabi_compat.c
$(objcbfs)/romstage.debug: $$(romstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group -T $(call src-to-obj,romstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld)
+ $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE))
endif # CONFIG_ARCH_ROMSTAGE_ARM64
@@ -134,7 +134,7 @@ ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
$(objcbfs)/ramstage.debug: $$(ramstage-objs)
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group -T $(call src-to-obj,ramstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld)
+ $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE))
# Build ARM Trusted Firmware (BL31)
diff --git a/src/arch/ppc64/Makefile.inc b/src/arch/ppc64/Makefile.inc
index f1a2487a57..d1774a1d15 100644
--- a/src/arch/ppc64/Makefile.inc
+++ b/src/arch/ppc64/Makefile.inc
@@ -24,7 +24,7 @@ bootblock-generic-ccopts += $(ppc64_flags)
$(objcbfs)/bootblock.debug: $$(bootblock-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
$(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
- -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
+ -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
$(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock)
endif
@@ -50,7 +50,7 @@ romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
$(objcbfs)/romstage.debug: $$(romstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group $(COMPILER_RT_romstage)
+ $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group $(COMPILER_RT_romstage)
romstage-c-ccopts += $(ppc64_flags)
romstage-S-ccopts += $(ppc64_asm_flags)
@@ -83,7 +83,7 @@ ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
$(objcbfs)/ramstage.debug: $$(ramstage-objs)
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group $(COMPILER_RT_ramstage)
+ $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group $(COMPILER_RT_ramstage)
ramstage-c-ccopts += $(ppc64_flags)
ramstage-S-ccopts += $(ppc64_asm_flags)
diff --git a/src/arch/riscv/Makefile.inc b/src/arch/riscv/Makefile.inc
index 632e220410..cd94692c02 100644
--- a/src/arch/riscv/Makefile.inc
+++ b/src/arch/riscv/Makefile.inc
@@ -64,7 +64,7 @@ bootblock-$(CONFIG_RISCV_USE_ARCH_TIMER) += arch_timer.c
$(objcbfs)/bootblock.debug: $$(bootblock-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
$(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
- -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
+ -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
$(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock)
bootblock-c-ccopts += $(riscv_flags)
@@ -99,7 +99,7 @@ romstage-$(CONFIG_RISCV_USE_ARCH_TIMER) += arch_timer.c
$(objcbfs)/romstage.debug: $$(romstage-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group $(COMPILER_RT_romstage)
+ $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group $(COMPILER_RT_romstage)
romstage-c-ccopts += $(riscv_flags)
romstage-S-ccopts += $(riscv_asm_flags)
@@ -148,7 +148,7 @@ ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
$(objcbfs)/ramstage.debug: $$(ramstage-objs)
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group $(COMPILER_RT_ramstage)
+ $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group $(COMPILER_RT_ramstage)
ramstage-c-ccopts += $(riscv_flags)
ramstage-S-ccopts += $(riscv_asm_flags)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 0a207e19b0..18c1ed3d9f 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -316,4 +316,8 @@ config MAX_ACPI_TABLE_SIZE_KB
help
Set the maximum size of all ACPI tables in KiB.
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/arch/x86/memlayout.ld"
+
endif
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 8d4c45714d..1b70fec582 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -67,14 +67,13 @@ endef
define early_x86_stage
# $1 stage name
# $2 oformat
-$(1)-y += memlayout.ld
# The '.' include path is needed for the generated assembly.inc file.
$(1)-S-ccopts += -I.
$$(objcbfs)/$(1).debug: $$$$($(1)-libs) $$$$($(1)-objs)
@printf " LINK $$(subst $$(obj)/,,$$(@))\n"
- $$(LD_$(1)) $$(LDFLAGS_$(1)) -o $$@ -L$$(obj) $$(COMPILER_RT_FLAGS_$(1)) --whole-archive --start-group $$(filter-out %.ld,$$($(1)-objs)) $$($(1)-libs) --no-whole-archive $$(COMPILER_RT_$(1)) --end-group -T $(call src-to-obj,$(1),$(dir)/memlayout.ld) --oformat $(2)
+ $$(LD_$(1)) $$(LDFLAGS_$(1)) -o $$@ -L$$(obj) $$(COMPILER_RT_FLAGS_$(1)) --whole-archive --start-group $$(filter-out %.ld,$$($(1)-objs)) $$($(1)-libs) --no-whole-archive $$(COMPILER_RT_$(1)) --end-group -T $(call src-to-obj,$(1),$(CONFIG_MEMLAYOUT_LD_FILE)) --oformat $(2)
-LANG=C LC_ALL= $$(OBJCOPY_$(1)) --only-section .illegal_globals $$(@) $$(objcbfs)/$(1)_null.offenders >/dev/null 2>&1
if [ -z "$$$$($$(NM_$(1)) $$(objcbfs)/$(1)_null.offenders 2>&1 | grep 'no symbols')" ];then \
echo "Forbidden global variables in $(1):"; \
@@ -201,7 +200,6 @@ postcar-$(CONFIG_IDT_IN_EVERY_STAGE) += exception.c
postcar-$(CONFIG_IDT_IN_EVERY_STAGE) += idt.S
postcar-y += exit_car.S
postcar-y += memmove.c
-postcar-y += memlayout.ld
postcar-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
postcar-y += postcar.c
postcar-$(CONFIG_COLLECT_TIMESTAMPS_TSC) += timestamp.c
@@ -210,7 +208,7 @@ LDFLAGS_postcar += -Map $(objcbfs)/postcar.map
$(objcbfs)/postcar.debug: $$(postcar-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
- $(LD_postcar) $(LDFLAGS_postcar) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_postcar) --whole-archive --start-group $(filter-out %.ld,$^) --no-whole-archive $(COMPILER_RT_postcar) --end-group -T $(call src-to-obj,postcar,src/arch/x86/memlayout.ld)
+ $(LD_postcar) $(LDFLAGS_postcar) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_postcar) --whole-archive --start-group $(filter-out %.ld,$^) --no-whole-archive $(COMPILER_RT_postcar) --end-group -T $(call src-to-obj,postcar,$(CONFIG_MEMLAYOUT_LD_FILE))
$(objcbfs)/postcar.elf: $(objcbfs)/postcar.debug.rmod
cp $< $@
@@ -236,7 +234,6 @@ ramstage-y += exception.c
ramstage-y += idt.S
ramstage-y += gdt.c
ramstage-$(CONFIG_IOAPIC) += ioapic.c
-ramstage-y += memlayout.ld
ramstage-y += memmove.c
ramstage-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
ramstage-$(CONFIG_GENERATE_MP_TABLE) += mpspec.c
@@ -289,9 +286,9 @@ $(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod
endif
-$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld)
+$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE))
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld)
+ $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE))
$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs)
@printf " CC $(subst $(obj)/,,$(@))\n"
diff --git a/src/cpu/ti/am335x/Kconfig b/src/cpu/ti/am335x/Kconfig
index 6de5eb4df3..3684480929 100644
--- a/src/cpu/ti/am335x/Kconfig
+++ b/src/cpu/ti/am335x/Kconfig
@@ -8,3 +8,11 @@ config CPU_TI_AM335X
select BOOT_DEVICE_NOT_SPI_FLASH
bool
default n
+
+if CPU_TI_AM335X
+
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/cpu/ti/am335x/memlayout.ld"
+
+endif
diff --git a/src/cpu/ti/am335x/Makefile.inc b/src/cpu/ti/am335x/Makefile.inc
index e1a3b9c7b9..6f414bcf79 100644
--- a/src/cpu/ti/am335x/Makefile.inc
+++ b/src/cpu/ti/am335x/Makefile.inc
@@ -49,8 +49,5 @@ $(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin
omap-header-y += header.c
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
-omap-header-y += memlayout.ld
+omap-header-srcs += $(CONFIG_MEMLAYOUT_LD_FILE)
omap-header-y += header.ld
diff --git a/src/mainboard/cavium/cn8100_sff_evb/Makefile.inc b/src/mainboard/cavium/cn8100_sff_evb/Makefile.inc
index c73bc334c4..bd2ea797d7 100644
--- a/src/mainboard/cavium/cn8100_sff_evb/Makefile.inc
+++ b/src/mainboard/cavium/cn8100_sff_evb/Makefile.inc
@@ -1,18 +1,13 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
romstage-y += romstage.c
romstage-y += bdk_devicetree.c
ramstage-y += mainboard.c
-ramstage-y += memlayout.ld
ramstage-y += bdk_devicetree.c
-verstage-y += memlayout.ld
-
MB_DIR = src/mainboard/$(MAINBOARDDIR)
LINUX_DTB = sff8104-linux.dtb
diff --git a/src/mainboard/cavium/cn8100_sff_evb/memlayout.ld b/src/mainboard/cavium/cn8100_sff_evb/memlayout.ld
deleted file mode 100644
index 9349362cfa..0000000000
--- a/src/mainboard/cavium/cn8100_sff_evb/memlayout.ld
+++ /dev/null
@@ -1 +0,0 @@
- #include <soc/memlayout.ld>
diff --git a/src/mainboard/emulation/qemu-aarch64/Kconfig b/src/mainboard/emulation/qemu-aarch64/Kconfig
index b8896d28d1..368f7f3a69 100644
--- a/src/mainboard/emulation/qemu-aarch64/Kconfig
+++ b/src/mainboard/emulation/qemu-aarch64/Kconfig
@@ -24,6 +24,10 @@ config BOARD_SPECIFIC_OPTIONS
select MISSING_BOARD_RESET
select ARM64_USE_ARM_TRUSTED_FIRMWARE
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/emulation/qemu-aarch64/memlayout.ld"
+
config MAINBOARD_DIR
string
default "emulation/qemu-aarch64"
diff --git a/src/mainboard/emulation/qemu-aarch64/Makefile.inc b/src/mainboard/emulation/qemu-aarch64/Makefile.inc
index 754656ffa2..15572ca9bc 100644
--- a/src/mainboard/emulation/qemu-aarch64/Makefile.inc
+++ b/src/mainboard/emulation/qemu-aarch64/Makefile.inc
@@ -12,10 +12,6 @@ bootblock-y += mmio.c
romstage-y += mmio.c
ramstage-y += mmio.c
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
-
bootblock-y += bootblock_custom.S
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
diff --git a/src/mainboard/emulation/qemu-armv7/Kconfig b/src/mainboard/emulation/qemu-armv7/Kconfig
index 4af58434bc..64e5bb7168 100644
--- a/src/mainboard/emulation/qemu-armv7/Kconfig
+++ b/src/mainboard/emulation/qemu-armv7/Kconfig
@@ -25,6 +25,10 @@ config BOARD_SPECIFIC_OPTIONS
select MISSING_BOARD_RESET
select NO_MONOTONIC_TIMER
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/emulation/qemu-armv7/memlayout.ld"
+
config MAINBOARD_DIR
string
default "emulation/qemu-armv7"
diff --git a/src/mainboard/emulation/qemu-armv7/Makefile.inc b/src/mainboard/emulation/qemu-armv7/Makefile.inc
index 1b9e997ce1..65fdfe131e 100644
--- a/src/mainboard/emulation/qemu-armv7/Makefile.inc
+++ b/src/mainboard/emulation/qemu-armv7/Makefile.inc
@@ -15,7 +15,3 @@ ramstage-y += timer.c
bootblock-y += mmio.c
romstage-y += mmio.c
ramstage-y += mmio.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/emulation/qemu-power8/Kconfig b/src/mainboard/emulation/qemu-power8/Kconfig
index aa3aceb367..5dbea721d1 100644
--- a/src/mainboard/emulation/qemu-power8/Kconfig
+++ b/src/mainboard/emulation/qemu-power8/Kconfig
@@ -17,6 +17,10 @@ config BOARD_SPECIFIC_OPTIONS
select BOOT_DEVICE_NOT_SPI_FLASH
select MISSING_BOARD_RESET
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/emulation/qemu-power8/memlayout.ld"
+
config MAINBOARD_DIR
string
default "emulation/qemu-power8"
diff --git a/src/mainboard/emulation/qemu-power8/Makefile.inc b/src/mainboard/emulation/qemu-power8/Makefile.inc
index b713df71c9..4011983923 100644
--- a/src/mainboard/emulation/qemu-power8/Makefile.inc
+++ b/src/mainboard/emulation/qemu-power8/Makefile.inc
@@ -7,7 +7,3 @@ romstage-y += romstage.c
ramstage-y += timer.c
romstage-y += uart.c
ramstage-y += uart.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/emulation/qemu-riscv/Kconfig b/src/mainboard/emulation/qemu-riscv/Kconfig
index 66aa599864..5b556fc190 100644
--- a/src/mainboard/emulation/qemu-riscv/Kconfig
+++ b/src/mainboard/emulation/qemu-riscv/Kconfig
@@ -30,6 +30,10 @@ config BOARD_SPECIFIC_OPTIONS
select DRIVERS_UART_8250MEM
select RISCV_HAS_OPENSBI
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/emulation/qemu-riscv/memlayout.ld"
+
config MAINBOARD_DIR
string
default "emulation/qemu-riscv"
diff --git a/src/mainboard/emulation/qemu-riscv/Makefile.inc b/src/mainboard/emulation/qemu-riscv/Makefile.inc
index 7ca7e5930c..1a8342d2ca 100644
--- a/src/mainboard/emulation/qemu-riscv/Makefile.inc
+++ b/src/mainboard/emulation/qemu-riscv/Makefile.inc
@@ -13,8 +13,4 @@ ramstage-y += uart.c
ramstage-y += rom_media.c
ramstage-y += clint.c
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
-
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
diff --git a/src/mainboard/emulation/spike-riscv/Kconfig b/src/mainboard/emulation/spike-riscv/Kconfig
index c46a04781c..3c1ae122e0 100644
--- a/src/mainboard/emulation/spike-riscv/Kconfig
+++ b/src/mainboard/emulation/spike-riscv/Kconfig
@@ -11,6 +11,10 @@ config BOARD_SPECIFIC_OPTIONS
select BOOT_DEVICE_NOT_SPI_FLASH
select MISSING_BOARD_RESET
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/mainboard/emulation/spike-riscv/memlayout.ld"
+
config MAINBOARD_DIR
string
default "emulation/spike-riscv"
diff --git a/src/mainboard/emulation/spike-riscv/Makefile.inc b/src/mainboard/emulation/spike-riscv/Makefile.inc
index 6d2911662d..fc5a7b32d0 100644
--- a/src/mainboard/emulation/spike-riscv/Makefile.inc
+++ b/src/mainboard/emulation/spike-riscv/Makefile.inc
@@ -10,7 +10,3 @@ romstage-y += clint.c
ramstage-y += uart.c
ramstage-y += rom_media.c
ramstage-y += clint.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/cheza/Makefile.inc b/src/mainboard/google/cheza/Makefile.inc
index e54aefb0e1..949d775624 100644
--- a/src/mainboard/google/cheza/Makefile.inc
+++ b/src/mainboard/google/cheza/Makefile.inc
@@ -1,24 +1,20 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += boardid.c
-bootblock-y += memlayout.ld
bootblock-y += chromeos.c
bootblock-y += bootblock.c
bootblock-y += reset.c
verstage-y += boardid.c
-verstage-y += memlayout.ld
verstage-y += chromeos.c
verstage-y += reset.c
romstage-y += boardid.c
-romstage-y += memlayout.ld
romstage-y += chromeos.c
romstage-y += romstage.c
romstage-y += reset.c
ramstage-y += boardid.c
-ramstage-y += memlayout.ld
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += reset.c
diff --git a/src/mainboard/google/cheza/memlayout.ld b/src/mainboard/google/cheza/memlayout.ld
deleted file mode 100644
index 936c1a3e0a..0000000000
--- a/src/mainboard/google/cheza/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
- #include <soc/memlayout.ld>
diff --git a/src/mainboard/google/daisy/Makefile.inc b/src/mainboard/google/daisy/Makefile.inc
index 9faa2e09ef..4f5f87be89 100644
--- a/src/mainboard/google/daisy/Makefile.inc
+++ b/src/mainboard/google/daisy/Makefile.inc
@@ -9,7 +9,3 @@ romstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += chromeos.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/daisy/memlayout.ld b/src/mainboard/google/daisy/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/daisy/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/foster/Makefile.inc b/src/mainboard/google/foster/Makefile.inc
index 1b576a9512..7deae3e009 100644
--- a/src/mainboard/google/foster/Makefile.inc
+++ b/src/mainboard/google/foster/Makefile.inc
@@ -27,8 +27,3 @@ ramstage-y += mainboard.c
ramstage-y += reset.c
ramstage-y += chromeos.c
ramstage-y += sdram_configs.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
-verstage-y += memlayout.ld
diff --git a/src/mainboard/google/foster/memlayout.ld b/src/mainboard/google/foster/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/foster/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/gale/Makefile.inc b/src/mainboard/google/gale/Makefile.inc
index 84b41e6ebf..f23f804de5 100644
--- a/src/mainboard/google/gale/Makefile.inc
+++ b/src/mainboard/google/gale/Makefile.inc
@@ -9,7 +9,6 @@ verstage-y += boardid.c
verstage-y += cdp.c
verstage-y += chromeos.c
verstage-y += blsp.c
-verstage-y += memlayout.ld
verstage-y += reset.c
verstage-y += verstage.c
@@ -28,7 +27,3 @@ ramstage-y += mainboard.c
ramstage-y += mmu.c
ramstage-y += reset.c
ramstage-y += blsp.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/gale/memlayout.ld b/src/mainboard/google/gale/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/gale/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/gru/Makefile.inc b/src/mainboard/google/gru/Makefile.inc
index 8849162ce0..b800945466 100644
--- a/src/mainboard/google/gru/Makefile.inc
+++ b/src/mainboard/google/gru/Makefile.inc
@@ -2,22 +2,17 @@
subdirs-y += sdram_params/
-decompressor-y += memlayout.ld
-
bootblock-y += bootblock.c
bootblock-y += chromeos.c
-bootblock-y += memlayout.ld
bootblock-y += pwm_regulator.c
bootblock-y += boardid.c
bootblock-y += reset.c
verstage-y += chromeos.c
-verstage-y += memlayout.ld
verstage-y += reset.c
romstage-y += boardid.c
romstage-y += chromeos.c
-romstage-y += memlayout.ld
romstage-y += pwm_regulator.c
romstage-y += romstage.c
romstage-y += reset.c
@@ -26,6 +21,5 @@ romstage-y += sdram_configs.c
ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
-ramstage-y += memlayout.ld
ramstage-y += reset.c
ramstage-y += sdram_configs.c # Needed for ram_code()
diff --git a/src/mainboard/google/gru/memlayout.ld b/src/mainboard/google/gru/memlayout.ld
deleted file mode 100644
index 936c1a3e0a..0000000000
--- a/src/mainboard/google/gru/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
- #include <soc/memlayout.ld>
diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc
index a2a147c399..532712a6c1 100644
--- a/src/mainboard/google/kukui/Makefile.inc
+++ b/src/mainboard/google/kukui/Makefile.inc
@@ -3,20 +3,16 @@ subdirs-y += panel_params/
bootblock-y += boardid.c
bootblock-y += bootblock.c
-bootblock-y += memlayout.ld
bootblock-y += reset.c
-decompressor-y += memlayout.ld
verstage-y += chromeos.c
verstage-y += early_init.c
verstage-y += reset.c
verstage-y += verstage.c
-verstage-y += memlayout.ld
romstage-y += boardid.c
romstage-y += chromeos.c
romstage-y += early_init.c
-romstage-y += memlayout.ld
romstage-y += reset.c
romstage-y += romstage.c
romstage-y += sdram_configs.c
@@ -24,7 +20,6 @@ romstage-y += sdram_configs.c
ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
-ramstage-y += memlayout.ld
ramstage-$(CONFIG_BOARD_GOOGLE_FLAPJACK) += panel_flapjack.c
ramstage-$(CONFIG_BOARD_GOOGLE_KAKADU) += panel_kakadu.c
ramstage-$(CONFIG_BOARD_GOOGLE_KODAMA) += panel_kodama.c
diff --git a/src/mainboard/google/kukui/memlayout.ld b/src/mainboard/google/kukui/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/kukui/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/mistral/Makefile.inc b/src/mainboard/google/mistral/Makefile.inc
index ca191d147e..48faadf2e8 100644
--- a/src/mainboard/google/mistral/Makefile.inc
+++ b/src/mainboard/google/mistral/Makefile.inc
@@ -1,20 +1,16 @@
-bootblock-y += memlayout.ld
bootblock-y += chromeos.c
bootblock-y += reset.c
bootblock-y += bootblock.c
-verstage-y += memlayout.ld
verstage-y += chromeos.c
verstage-y += reset.c
verstage-y += verstage.c
-romstage-y += memlayout.ld
romstage-y += chromeos.c
romstage-y += reset.c
romstage-y += romstage.c
-ramstage-y += memlayout.ld
ramstage-y += chromeos.c
ramstage-y += reset.c
ramstage-y += mainboard.c
diff --git a/src/mainboard/google/mistral/memlayout.ld b/src/mainboard/google/mistral/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/mistral/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/nyan/Makefile.inc b/src/mainboard/google/nyan/Makefile.inc
index 124d4121d7..190cfc5127 100644
--- a/src/mainboard/google/nyan/Makefile.inc
+++ b/src/mainboard/google/nyan/Makefile.inc
@@ -29,8 +29,3 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c
verstage-y += reset.c
verstage-$(CONFIG_CHROMEOS) += chromeos.c
verstage-y += early_configs.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/nyan/memlayout.ld b/src/mainboard/google/nyan/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/nyan/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/nyan_big/Makefile.inc b/src/mainboard/google/nyan_big/Makefile.inc
index 5cf7356ec1..b734b5ba19 100644
--- a/src/mainboard/google/nyan_big/Makefile.inc
+++ b/src/mainboard/google/nyan_big/Makefile.inc
@@ -28,8 +28,3 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c
verstage-y += reset.c
verstage-$(CONFIG_CHROMEOS) += chromeos.c
verstage-y += early_configs.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/nyan_big/memlayout.ld b/src/mainboard/google/nyan_big/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/nyan_big/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/nyan_blaze/Makefile.inc b/src/mainboard/google/nyan_blaze/Makefile.inc
index de582badda..54410f0812 100644
--- a/src/mainboard/google/nyan_blaze/Makefile.inc
+++ b/src/mainboard/google/nyan_blaze/Makefile.inc
@@ -28,8 +28,3 @@ ramstage-y += reset.c
ramstage-y += boardid.c
ramstage-y += mainboard.c
ramstage-$(CONFIG_CHROMEOS) += chromeos.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/nyan_blaze/memlayout.ld b/src/mainboard/google/nyan_blaze/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/nyan_blaze/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/oak/Makefile.inc b/src/mainboard/google/oak/Makefile.inc
index 63ccc1e335..79a80ee6c1 100644
--- a/src/mainboard/google/oak/Makefile.inc
+++ b/src/mainboard/google/oak/Makefile.inc
@@ -1,23 +1,19 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
-bootblock-y += memlayout.ld
bootblock-y += chromeos.c
bootblock-y += boardid.c
bootblock-$(CONFIG_OAK_HAS_TPM2) += tpm_tis.c
verstage-y += chromeos.c
-verstage-y += memlayout.ld
verstage-$(CONFIG_OAK_HAS_TPM2) += tpm_tis.c
romstage-y += chromeos.c
romstage-y += romstage.c sdram_configs.c
-romstage-y += memlayout.ld
romstage-y += boardid.c
romstage-$(CONFIG_OAK_HAS_TPM2) += tpm_tis.c
ramstage-y += mainboard.c
ramstage-y += chromeos.c
-ramstage-y += memlayout.ld
ramstage-y += boardid.c
ramstage-$(CONFIG_OAK_HAS_TPM2) += tpm_tis.c
diff --git a/src/mainboard/google/oak/memlayout.ld b/src/mainboard/google/oak/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/oak/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/peach_pit/Makefile.inc b/src/mainboard/google/peach_pit/Makefile.inc
index 9faa2e09ef..4f5f87be89 100644
--- a/src/mainboard/google/peach_pit/Makefile.inc
+++ b/src/mainboard/google/peach_pit/Makefile.inc
@@ -9,7 +9,3 @@ romstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += chromeos.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/peach_pit/memlayout.ld b/src/mainboard/google/peach_pit/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/peach_pit/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/smaug/Makefile.inc b/src/mainboard/google/smaug/Makefile.inc
index 342e0dd35f..32c66b9fca 100644
--- a/src/mainboard/google/smaug/Makefile.inc
+++ b/src/mainboard/google/smaug/Makefile.inc
@@ -29,8 +29,3 @@ ramstage-y += mainboard.c
ramstage-y += reset.c
ramstage-y += pmic.c
ramstage-y += sdram_configs.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
-verstage-y += memlayout.ld
diff --git a/src/mainboard/google/smaug/memlayout.ld b/src/mainboard/google/smaug/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/smaug/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/storm/Makefile.inc b/src/mainboard/google/storm/Makefile.inc
index 272c49b602..b1bcacd5b5 100644
--- a/src/mainboard/google/storm/Makefile.inc
+++ b/src/mainboard/google/storm/Makefile.inc
@@ -9,7 +9,6 @@ verstage-y += boardid.c
verstage-y += cdp.c
verstage-y += chromeos.c
verstage-y += gsbi.c
-verstage-y += memlayout.ld
verstage-y += reset.c
romstage-y += romstage.c
@@ -26,7 +25,3 @@ ramstage-y += mainboard.c
ramstage-y += mmu.c
ramstage-y += reset.c
ramstage-y += gsbi.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/storm/memlayout.ld b/src/mainboard/google/storm/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/storm/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/trogdor/Makefile.inc b/src/mainboard/google/trogdor/Makefile.inc
index 4a2b5d47c6..9a71ea5197 100644
--- a/src/mainboard/google/trogdor/Makefile.inc
+++ b/src/mainboard/google/trogdor/Makefile.inc
@@ -1,23 +1,19 @@
## SPDX-License-Identifier: GPL-2.0-only
-bootblock-y += memlayout.ld
bootblock-y += boardid.c
bootblock-y += chromeos.c
bootblock-y += bootblock.c
-verstage-y += memlayout.ld
ifneq ($(CONFIG_BOARD_GOOGLE_BUBS),y)
verstage-y += reset.c
endif
verstage-y += boardid.c
verstage-y += chromeos.c
-romstage-y += memlayout.ld
romstage-y += romstage.c
romstage-y += boardid.c
romstage-y += chromeos.c
-ramstage-y += memlayout.ld
ramstage-y += mainboard.c
ifneq ($(CONFIG_BOARD_GOOGLE_BUBS),y)
ramstage-y += reset.c
diff --git a/src/mainboard/google/trogdor/memlayout.ld b/src/mainboard/google/trogdor/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/trogdor/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/veyron/Makefile.inc b/src/mainboard/google/veyron/Makefile.inc
index 76d141fa27..6c3b7f4c51 100644
--- a/src/mainboard/google/veyron/Makefile.inc
+++ b/src/mainboard/google/veyron/Makefile.inc
@@ -19,8 +19,3 @@ ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += reset.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/veyron/memlayout.ld b/src/mainboard/google/veyron/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/veyron/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/veyron_mickey/Makefile.inc b/src/mainboard/google/veyron_mickey/Makefile.inc
index 76d141fa27..6c3b7f4c51 100644
--- a/src/mainboard/google/veyron_mickey/Makefile.inc
+++ b/src/mainboard/google/veyron_mickey/Makefile.inc
@@ -19,8 +19,3 @@ ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += reset.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/veyron_mickey/memlayout.ld b/src/mainboard/google/veyron_mickey/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/veyron_mickey/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/veyron_rialto/Makefile.inc b/src/mainboard/google/veyron_rialto/Makefile.inc
index 76d141fa27..6c3b7f4c51 100644
--- a/src/mainboard/google/veyron_rialto/Makefile.inc
+++ b/src/mainboard/google/veyron_rialto/Makefile.inc
@@ -19,8 +19,3 @@ ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += reset.c
-
-bootblock-y += memlayout.ld
-verstage-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/veyron_rialto/memlayout.ld b/src/mainboard/google/veyron_rialto/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/google/veyron_rialto/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/zork/Makefile.inc b/src/mainboard/google/zork/Makefile.inc
index 07628c186b..ac828e2765 100644
--- a/src/mainboard/google/zork/Makefile.inc
+++ b/src/mainboard/google/zork/Makefile.inc
@@ -11,7 +11,6 @@ ramstage-y += ec.c
ramstage-y += sku_id.c
ifeq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y)
-verstage-y += memlayout.ld
verstage-y += verstage.c
else
verstage-y += chromeos.c
diff --git a/src/mainboard/opencellular/elgon/Makefile.inc b/src/mainboard/opencellular/elgon/Makefile.inc
index 6b019825ab..c938289db8 100644
--- a/src/mainboard/opencellular/elgon/Makefile.inc
+++ b/src/mainboard/opencellular/elgon/Makefile.inc
@@ -1,18 +1,14 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
-bootblock-y += memlayout.ld
bootblock-y += death.c
-romstage-y += memlayout.ld
romstage-y += romstage.c
romstage-y += bdk_devicetree.c
romstage-y += death.c
ramstage-y += mainboard.c
-ramstage-y += memlayout.ld
ramstage-y += bdk_devicetree.c
ramstage-y += death.c
-verstage-y += memlayout.ld
verstage-y += death.c
diff --git a/src/mainboard/opencellular/elgon/memlayout.ld b/src/mainboard/opencellular/elgon/memlayout.ld
deleted file mode 100644
index 9349362cfa..0000000000
--- a/src/mainboard/opencellular/elgon/memlayout.ld
+++ /dev/null
@@ -1 +0,0 @@
- #include <soc/memlayout.ld>
diff --git a/src/mainboard/sifive/hifive-unleashed/Makefile.inc b/src/mainboard/sifive/hifive-unleashed/Makefile.inc
index 02b8046030..2a32df8756 100644
--- a/src/mainboard/sifive/hifive-unleashed/Makefile.inc
+++ b/src/mainboard/sifive/hifive-unleashed/Makefile.inc
@@ -1,17 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
-bootblock-y += memlayout.ld
bootblock-y += media.c
-romstage-y += memlayout.ld
romstage-y += romstage.c
romstage-y += media.c
-ramstage-y += memlayout.ld
ramstage-y += fixup_fdt.c
ramstage-y += media.c
-
DTB=$(obj)/hifive-unleashed.dtb
DTS=src/mainboard/sifive/hifive-unleashed/hifive-unleashed-a00.dts
$(DTB): $(DTS)
diff --git a/src/mainboard/sifive/hifive-unleashed/memlayout.ld b/src/mainboard/sifive/hifive-unleashed/memlayout.ld
deleted file mode 100644
index 0f1fcec9a0..0000000000
--- a/src/mainboard/sifive/hifive-unleashed/memlayout.ld
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <soc/memlayout.ld>
diff --git a/src/mainboard/ti/beaglebone/Makefile.inc b/src/mainboard/ti/beaglebone/Makefile.inc
index cf3fc5d79a..a703939f01 100644
--- a/src/mainboard/ti/beaglebone/Makefile.inc
+++ b/src/mainboard/ti/beaglebone/Makefile.inc
@@ -5,7 +5,3 @@ bootblock-y += leds.c
romstage-y += romstage.c
#ramstage-y += ramstage.c
-
-bootblock-y += memlayout.ld
-romstage-y += memlayout.ld
-ramstage-y += memlayout.ld
diff --git a/src/mainboard/ti/beaglebone/memlayout.ld b/src/mainboard/ti/beaglebone/memlayout.ld
deleted file mode 100644
index ff79e70ed5..0000000000
--- a/src/mainboard/ti/beaglebone/memlayout.ld
+++ /dev/null
@@ -1 +0,0 @@
-#include <cpu/ti/am335x/memlayout.ld>
diff --git a/src/soc/cavium/cn81xx/Kconfig b/src/soc/cavium/cn81xx/Kconfig
index f64350eb9e..87edf45cde 100644
--- a/src/soc/cavium/cn81xx/Kconfig
+++ b/src/soc/cavium/cn81xx/Kconfig
@@ -14,6 +14,10 @@ config SOC_CAVIUM_CN81XX
if SOC_CAVIUM_CN81XX
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/cavium/cn81xx/memlayout.ld"
+
config VBOOT
select VBOOT_SEPARATE_VERSTAGE
select VBOOT_STARTS_IN_BOOTBLOCK
diff --git a/src/soc/cavium/cn81xx/include/soc/memlayout.ld b/src/soc/cavium/cn81xx/memlayout.ld
index 79673c9974..79673c9974 100644
--- a/src/soc/cavium/cn81xx/include/soc/memlayout.ld
+++ b/src/soc/cavium/cn81xx/memlayout.ld
diff --git a/src/soc/mediatek/mt8173/Kconfig b/src/soc/mediatek/mt8173/Kconfig
index 6476d42b0a..15b833f56f 100644
--- a/src/soc/mediatek/mt8173/Kconfig
+++ b/src/soc/mediatek/mt8173/Kconfig
@@ -13,6 +13,10 @@ config SOC_MEDIATEK_MT8173
if SOC_MEDIATEK_MT8173
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/mediatek/mt8173/memlayout.ld"
+
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
select VBOOT_STARTS_IN_BOOTBLOCK
diff --git a/src/soc/mediatek/mt8173/include/soc/memlayout.ld b/src/soc/mediatek/mt8173/memlayout.ld
index 4aece51cef..4aece51cef 100644
--- a/src/soc/mediatek/mt8173/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8173/memlayout.ld
diff --git a/src/soc/mediatek/mt8183/Kconfig b/src/soc/mediatek/mt8183/Kconfig
index 46249be038..82827d1755 100644
--- a/src/soc/mediatek/mt8183/Kconfig
+++ b/src/soc/mediatek/mt8183/Kconfig
@@ -11,6 +11,10 @@ config SOC_MEDIATEK_MT8183
if SOC_MEDIATEK_MT8183
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/mediatek/mt8183/memlayout.ld"
+
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
select VBOOT_STARTS_IN_BOOTBLOCK
diff --git a/src/soc/mediatek/mt8183/include/soc/memlayout.ld b/src/soc/mediatek/mt8183/memlayout.ld
index a26637766b..a26637766b 100644
--- a/src/soc/mediatek/mt8183/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8183/memlayout.ld
diff --git a/src/soc/nvidia/tegra124/Kconfig b/src/soc/nvidia/tegra124/Kconfig
index c962aead71..deca2cda96 100644
--- a/src/soc/nvidia/tegra124/Kconfig
+++ b/src/soc/nvidia/tegra124/Kconfig
@@ -15,6 +15,10 @@ config SOC_NVIDIA_TEGRA124
if SOC_NVIDIA_TEGRA124
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/nvidia/tegra124/memlayout.ld"
+
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
select VBOOT_STARTS_IN_BOOTBLOCK
diff --git a/src/soc/nvidia/tegra124/include/soc/memlayout.ld b/src/soc/nvidia/tegra124/memlayout.ld
index 94b6fd8d91..94b6fd8d91 100644
--- a/src/soc/nvidia/tegra124/include/soc/memlayout.ld
+++ b/src/soc/nvidia/tegra124/memlayout.ld
diff --git a/src/soc/nvidia/tegra210/Kconfig b/src/soc/nvidia/tegra210/Kconfig
index 780fa18744..32748f3b6b 100644
--- a/src/soc/nvidia/tegra210/Kconfig
+++ b/src/soc/nvidia/tegra210/Kconfig
@@ -13,6 +13,10 @@ config SOC_NVIDIA_TEGRA210
if SOC_NVIDIA_TEGRA210
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/nvidia/tegra210/memlayout.ld"
+
config VBOOT
select VBOOT_STARTS_IN_BOOTBLOCK
select VBOOT_SEPARATE_VERSTAGE
diff --git a/src/soc/nvidia/tegra210/include/soc/memlayout.ld b/src/soc/nvidia/tegra210/memlayout.ld
index e5620bcf6a..e5620bcf6a 100644
--- a/src/soc/nvidia/tegra210/include/soc/memlayout.ld
+++ b/src/soc/nvidia/tegra210/memlayout.ld
diff --git a/src/soc/qualcomm/ipq40xx/Kconfig b/src/soc/qualcomm/ipq40xx/Kconfig
index ef80772b2f..0eabb00752 100644
--- a/src/soc/qualcomm/ipq40xx/Kconfig
+++ b/src/soc/qualcomm/ipq40xx/Kconfig
@@ -10,6 +10,10 @@ config SOC_QC_IPQ40XX
if SOC_QC_IPQ40XX
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/qualcomm/ipq40xx/memlayout.ld"
+
config GENERIC_UDELAY
def_bool n
diff --git a/src/soc/qualcomm/ipq40xx/include/soc/memlayout.ld b/src/soc/qualcomm/ipq40xx/memlayout.ld
index 1a2dd31cc4..1a2dd31cc4 100644
--- a/src/soc/qualcomm/ipq40xx/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/ipq40xx/memlayout.ld
diff --git a/src/soc/qualcomm/ipq806x/Kconfig b/src/soc/qualcomm/ipq806x/Kconfig
index fa0fefef67..7de2a99f1e 100644
--- a/src/soc/qualcomm/ipq806x/Kconfig
+++ b/src/soc/qualcomm/ipq806x/Kconfig
@@ -11,6 +11,10 @@ config SOC_QC_IPQ806X
if SOC_QC_IPQ806X
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/qualcomm/ipq806x/memlayout.ld"
+
config VBOOT
select VBOOT_STARTS_IN_BOOTBLOCK
select VBOOT_VBNV_FLASH
diff --git a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld b/src/soc/qualcomm/ipq806x/memlayout.ld
index 6e7e56cada..6e7e56cada 100644
--- a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/ipq806x/memlayout.ld
diff --git a/src/soc/qualcomm/qcs405/Kconfig b/src/soc/qualcomm/qcs405/Kconfig
index 60d8e3af60..0dc96ba06a 100644
--- a/src/soc/qualcomm/qcs405/Kconfig
+++ b/src/soc/qualcomm/qcs405/Kconfig
@@ -13,6 +13,10 @@ config SOC_QUALCOMM_QCS405
if SOC_QUALCOMM_QCS405
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/qualcomm/qcs405/memlayout.ld"
+
config VBOOT
select VBOOT_SEPARATE_VERSTAGE
select VBOOT_RETURN_FROM_VERSTAGE
diff --git a/src/soc/qualcomm/qcs405/include/soc/memlayout.ld b/src/soc/qualcomm/qcs405/memlayout.ld
index ff2ad2f99c..ff2ad2f99c 100644
--- a/src/soc/qualcomm/qcs405/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/qcs405/memlayout.ld
diff --git a/src/soc/qualcomm/sc7180/Kconfig b/src/soc/qualcomm/sc7180/Kconfig
index faf036e62b..d3dab7acd9 100644
--- a/src/soc/qualcomm/sc7180/Kconfig
+++ b/src/soc/qualcomm/sc7180/Kconfig
@@ -16,6 +16,10 @@ config SOC_QUALCOMM_SC7180
if SOC_QUALCOMM_SC7180
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/qualcomm/sc7180/memlayout.ld"
+
config VBOOT
select VBOOT_SEPARATE_VERSTAGE
select VBOOT_RETURN_FROM_VERSTAGE
diff --git a/src/soc/qualcomm/sc7180/include/soc/memlayout.ld b/src/soc/qualcomm/sc7180/memlayout.ld
index 2a0cd8a417..2a0cd8a417 100644
--- a/src/soc/qualcomm/sc7180/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/sc7180/memlayout.ld
diff --git a/src/soc/qualcomm/sdm845/Kconfig b/src/soc/qualcomm/sdm845/Kconfig
index dbe025e93a..c93ec6c1bb 100644
--- a/src/soc/qualcomm/sdm845/Kconfig
+++ b/src/soc/qualcomm/sdm845/Kconfig
@@ -12,6 +12,10 @@ config SOC_QUALCOMM_SDM845
if SOC_QUALCOMM_SDM845
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/qualcomm/sdm845/memlayout.ld"
+
config VBOOT
select VBOOT_SEPARATE_VERSTAGE
select VBOOT_RETURN_FROM_VERSTAGE
diff --git a/src/soc/qualcomm/sdm845/include/soc/memlayout.ld b/src/soc/qualcomm/sdm845/memlayout.ld
index 30b4920288..30b4920288 100644
--- a/src/soc/qualcomm/sdm845/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/sdm845/memlayout.ld
diff --git a/src/soc/rockchip/rk3288/Kconfig b/src/soc/rockchip/rk3288/Kconfig
index 3198aa4324..3dc9a9b554 100644
--- a/src/soc/rockchip/rk3288/Kconfig
+++ b/src/soc/rockchip/rk3288/Kconfig
@@ -20,6 +20,10 @@ config SOC_ROCKCHIP_RK3288
if SOC_ROCKCHIP_RK3288
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/rockchip/rk3288/memlayout.ld"
+
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
select VBOOT_STARTS_IN_BOOTBLOCK
diff --git a/src/soc/rockchip/rk3288/include/soc/memlayout.ld b/src/soc/rockchip/rk3288/memlayout.ld
index 4ef0163def..4ef0163def 100644
--- a/src/soc/rockchip/rk3288/include/soc/memlayout.ld
+++ b/src/soc/rockchip/rk3288/memlayout.ld
diff --git a/src/soc/rockchip/rk3399/Kconfig b/src/soc/rockchip/rk3399/Kconfig
index 7e3c44b674..4f7af9e0c2 100644
--- a/src/soc/rockchip/rk3399/Kconfig
+++ b/src/soc/rockchip/rk3399/Kconfig
@@ -14,6 +14,10 @@ config SOC_ROCKCHIP_RK3399
if SOC_ROCKCHIP_RK3399
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/rockchip/rk3399/memlayout.ld"
+
config VBOOT
select VBOOT_SEPARATE_VERSTAGE
select VBOOT_RETURN_FROM_VERSTAGE
diff --git a/src/soc/rockchip/rk3399/include/soc/memlayout.ld b/src/soc/rockchip/rk3399/memlayout.ld
index 72836b5130..72836b5130 100644
--- a/src/soc/rockchip/rk3399/include/soc/memlayout.ld
+++ b/src/soc/rockchip/rk3399/memlayout.ld
diff --git a/src/soc/samsung/exynos5250/Kconfig b/src/soc/samsung/exynos5250/Kconfig
index 680bd66cb7..28a89fa9c8 100644
--- a/src/soc/samsung/exynos5250/Kconfig
+++ b/src/soc/samsung/exynos5250/Kconfig
@@ -9,6 +9,10 @@ config CPU_SAMSUNG_EXYNOS5250
if CPU_SAMSUNG_EXYNOS5250
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/samsung/exynos5250/memlayout.ld"
+
config VBOOT
select VBOOT_STARTS_IN_ROMSTAGE
diff --git a/src/soc/samsung/exynos5250/include/soc/memlayout.ld b/src/soc/samsung/exynos5250/memlayout.ld
index be4bb6edd7..be4bb6edd7 100644
--- a/src/soc/samsung/exynos5250/include/soc/memlayout.ld
+++ b/src/soc/samsung/exynos5250/memlayout.ld
diff --git a/src/soc/samsung/exynos5420/Kconfig b/src/soc/samsung/exynos5420/Kconfig
index 3af8e64ac3..1b80ffca32 100644
--- a/src/soc/samsung/exynos5420/Kconfig
+++ b/src/soc/samsung/exynos5420/Kconfig
@@ -11,6 +11,10 @@ config CPU_SAMSUNG_EXYNOS5420
if CPU_SAMSUNG_EXYNOS5420
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/samsung/exynos5420/memlayout.ld"
+
config VBOOT
select VBOOT_STARTS_IN_ROMSTAGE
diff --git a/src/soc/samsung/exynos5420/include/soc/memlayout.ld b/src/soc/samsung/exynos5420/memlayout.ld
index e29900110e..e29900110e 100644
--- a/src/soc/samsung/exynos5420/include/soc/memlayout.ld
+++ b/src/soc/samsung/exynos5420/memlayout.ld
diff --git a/src/soc/sifive/fu540/Kconfig b/src/soc/sifive/fu540/Kconfig
index 64985bd0f0..4aa496131c 100644
--- a/src/soc/sifive/fu540/Kconfig
+++ b/src/soc/sifive/fu540/Kconfig
@@ -17,6 +17,10 @@ config SOC_SIFIVE_FU540
if SOC_SIFIVE_FU540
+config MEMLAYOUT_LD_FILE
+ string
+ default "src/soc/sifive/fu540/memlayout.ld"
+
config RISCV_ARCH
string
default "rv64imac"
diff --git a/src/soc/sifive/fu540/include/soc/memlayout.ld b/src/soc/sifive/fu540/memlayout.ld
index fd63dc0b45..fd63dc0b45 100644
--- a/src/soc/sifive/fu540/include/soc/memlayout.ld
+++ b/src/soc/sifive/fu540/memlayout.ld