1# 2# (C) Copyright 2002-2006 3# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4# 5# SPDX-License-Identifier: GPL-2.0+ 6# 7 8lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \ 9 lib1funcs.o uldivmod.o div0.o \ 10 div64.o muldi3.o 11 12ifdef CONFIG_CPU_V7M 13obj-y += vectors_m.o crt0.o 14else ifdef CONFIG_ARM64 15obj-y += crt0_64.o 16else 17obj-y += vectors.o crt0.o 18endif 19 20ifdef CONFIG_ARM64 21obj-y += setjmp_aarch64.o 22else 23obj-y += setjmp.o 24endif 25 26ifndef CONFIG_TPL_BUILD 27ifdef CONFIG_ARM64 28obj-y += relocate_64.o 29else 30obj-y += relocate.o 31endif 32 33obj-$(CONFIG_CPU_V7M) += cmd_boot.o 34obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o 35obj-$(CONFIG_CMD_BOOTI) += bootm.o 36obj-$(CONFIG_CMD_BOOTM) += bootm.o 37obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o 38obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o 39else 40obj-$(CONFIG_SPL_FRAMEWORK) += spl.o 41obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o 42obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o 43endif 44obj-$(CONFIG_$(SPL_)USE_ARCH_MEMSET) += memset.o 45obj-$(CONFIG_$(SPL_)USE_ARCH_MEMCPY) += memcpy.o 46obj-$(CONFIG_SEMIHOSTING) += semihosting.o 47 48obj-y += sections.o 49obj-y += stack.o 50ifdef CONFIG_CPU_V7M 51obj-y += interrupts_m.o 52else ifdef CONFIG_ARM64 53obj-$(CONFIG_FSL_LAYERSCAPE) += ccn504.o 54ifneq ($(CONFIG_GICV2)$(CONFIG_GICV3),) 55obj-y += gic_64.o 56endif 57obj-y += interrupts_64.o 58obj-y += stacktrace_64.o 59else 60obj-y += interrupts.o 61obj-y += stacktrace.o 62endif 63ifndef CONFIG_SYSRESET 64obj-y += reset.o 65endif 66 67obj-y += cache.o 68ifndef CONFIG_ARM64 69ifndef CONFIG_CPU_V7M 70obj-y += cache-cp15.o 71endif 72endif 73 74obj-y += psci-dt.o 75 76obj-$(CONFIG_DEBUG_LL) += debug.o 77 78# For EABI conformant tool chains, provide eabi_compat() 79ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS))) 80extra-y += eabi_compat.o 81endif 82 83# some files can only build in ARM or THUMB2, not THUMB1 84 85ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD 86asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL 87ifndef CONFIG_HAS_THUMB2 88 89# for C files, just apend -marm, which will override previous -mthumb* 90 91ifndef CONFIG_ARM64 92CFLAGS_cache.o := -marm 93CFLAGS_cache-cp15.o := -marm 94endif 95 96# For .S, drop -mthumb* and other thumb-related options. 97# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_* 98# was implemented and is used here. 99# Also, define ${target}_NO_THUMB_BUILD for these two targets 100# so that the code knows it should not use Thumb. 101 102AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork 103AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork 104AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD 105AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD 106endif 107endif 108 109# For building EFI apps 110CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI) 111CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI) 112 113CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI) 114CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI) 115 116extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC) 117extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC) 118