1## SPDX-License-Identifier: GPL-2.0-only 2 3############################################################################### 4# ARM specific options 5############################################################################### 6 7ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y) 8check-ramstage-overlap-regions += postram_cbfs_cache stack ttb 9endif 10 11ifeq ($(CONFIG_ARCH_ARM),y) 12subdirs-y += libgcc/ 13subdirs-y += armv4/ armv7/ 14 15stages_c = $(src)/arch/arm/stages.c 16stages_o = $(obj)/arch/arm/stages.o 17 18$(stages_o): $(stages_c) $(obj)/config.h 19 @printf " CC $(subst $(obj)/,,$(@))\n" 20 $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm 21 22endif # CONFIG_ARCH_ARM 23 24############################################################################### 25# bootblock 26############################################################################### 27 28ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM),y) 29 30decompressor-y += boot.c 31bootblock-y += boot.c 32decompressor-y += div0.c 33bootblock-y += div0.c 34decompressor-y += eabi_compat.c 35bootblock-y += eabi_compat.c 36decompressor-y += memset.S 37bootblock-y += memset.S 38decompressor-y += memcpy.S 39bootblock-y += memcpy.S 40decompressor-y += memmove.S 41bootblock-y += memmove.S 42 43bootblock-y += clock.c 44bootblock-y += stages.c 45 46$(objcbfs)/bootblock.debug: $$(bootblock-objs) 47 @printf " LINK $(subst $(obj)/,,$(@))\n" 48 $(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 49 50$(objcbfs)/decompressor.debug: $$(decompressor-objs) 51 @printf " LINK $(subst $(obj)/,,$(@))\n" 52 $(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 53 54endif # CONFIG_ARCH_BOOTBLOCK_ARM 55 56############################################################################### 57# verification stage 58############################################################################### 59 60ifeq ($(CONFIG_ARCH_VERSTAGE_ARM),y) 61 62$(objcbfs)/verstage.debug: $$(verstage-objs) 63 @printf " LINK $(subst $(obj)/,,$(@))\n" 64 $(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 65 66verstage-y += boot.c 67verstage-y += div0.c 68verstage-y += eabi_compat.c 69verstage-y += memset.S 70verstage-y += memcpy.S 71verstage-y += memmove.S 72verstage-y += stages.c 73 74endif # CONFIG_ARCH_VERSTAGE_ARM 75 76############################################################################### 77# romstage 78############################################################################### 79 80ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM),y) 81 82romstage-y += boot.c 83romstage-y += stages.c 84romstage-y += div0.c 85romstage-y += eabi_compat.c 86romstage-y += memset.S 87romstage-y += memcpy.S 88romstage-y += memmove.S 89romstage-y += clock.c 90rmodules_arm-y += memset.S 91rmodules_arm-y += memcpy.S 92rmodules_arm-y += memmove.S 93rmodules_arm-y += eabi_compat.c 94 95$(objcbfs)/romstage.debug: $$(romstage-objs) 96 @printf " LINK $(subst $(obj)/,,$(@))\n" 97 $(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 98 99endif # CONFIG_ARCH_ROMSTAGE_ARM 100 101############################################################################### 102# ramstage 103############################################################################### 104 105ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y) 106 107ramstage-y += stages.c 108ramstage-y += div0.c 109ramstage-y += eabi_compat.c 110ramstage-y += boot.c 111ramstage-y += tables.c 112ramstage-y += memset.S 113ramstage-y += memcpy.S 114ramstage-y += memmove.S 115ramstage-y += clock.c 116ramstage-y += boot_linux.S 117ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c 118 119rmodules_arm-y += memset.S 120rmodules_arm-y += memcpy.S 121rmodules_arm-y += memmove.S 122rmodules_arm-y += eabi_compat.c 123ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) 124 125$(objcbfs)/ramstage.debug: $$(ramstage-objs) 126 @printf " CC $(subst $(obj)/,,$(@))\n" 127 $(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 128 129endif # CONFIG_ARCH_RAMSTAGE_ARM 130