blob: 7f663327151874e8fe93c557c1d9c095416d2f90 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
wdenkf47713f2002-09-08 19:49:36 +00002#
Marian Balakowiczf9328632006-09-01 19:49:50 +02003# (C) Copyright 2002-2006
wdenkf47713f2002-09-08 19:49:36 +00004# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
wdenkf47713f2002-09-08 19:49:36 +00005
Marek Vasutc5a543e2016-05-26 18:01:40 +02006lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
Marek Vasut0bf65c62016-05-26 18:01:44 +02007 lib1funcs.o uldivmod.o div0.o \
8 div64.o muldi3.o
wdenkf47713f2002-09-08 19:49:36 +00009
rev13@wp.pl12d8a722015-03-01 12:44:39 +010010ifdef CONFIG_CPU_V7M
11obj-y += vectors_m.o crt0.o
12else ifdef CONFIG_ARM64
David Feng0ae76532013-12-14 11:47:35 +080013obj-y += crt0_64.o
14else
Albert ARIBAUD41623c92014-04-15 16:13:51 +020015obj-y += vectors.o crt0.o
David Feng0ae76532013-12-14 11:47:35 +080016endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090017
Philipp Tomsichb4806d62017-10-10 16:21:13 +020018ifdef CONFIG_ARM64
19obj-y += setjmp_aarch64.o
20else
21obj-y += setjmp.o
22endif
23
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090024ifndef CONFIG_SPL_BUILD
David Feng0ae76532013-12-14 11:47:35 +080025ifdef CONFIG_ARM64
26obj-y += relocate_64.o
27else
28obj-y += relocate.o
29endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090030
Matt Porterf99993c2015-05-05 15:00:23 -040031obj-$(CONFIG_CPU_V7M) += cmd_boot.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090032obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Bin Chen6808ef92018-01-27 16:59:09 +110033obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090034obj-$(CONFIG_CMD_BOOTM) += bootm.o
Tom Rini5db28902016-08-12 08:31:15 -040035obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090036obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090037else
Heiko Stuebner22b7b862019-07-16 10:12:02 +020038obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
Ladislav Michl431889d2016-07-12 20:28:14 +020039obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
B, Ravi984a3c82017-04-18 17:27:26 +053040obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090041endif
Marek Vasuta821a772018-04-07 16:06:36 +020042obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
43obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
Darwin Rambo261d2762014-06-09 11:12:59 -070044obj-$(CONFIG_SEMIHOSTING) += semihosting.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090045
Simon Glass59b0d7d2020-05-10 14:16:56 -060046obj-y += bdinfo.o
Albert ARIBAUDd0b5d9d2014-02-22 17:53:42 +010047obj-y += sections.o
Marek Behún8f969652021-05-20 13:24:22 +020048CFLAGS_REMOVE_sections.o := $(LTO_CFLAGS)
49
Andreas Bießmann68145d42015-02-06 23:06:45 +010050obj-y += stack.o
rev13@wp.pl12d8a722015-03-01 12:44:39 +010051ifdef CONFIG_CPU_V7M
52obj-y += interrupts_m.o
53else ifdef CONFIG_ARM64
Andre Przywara98db26a2017-04-26 01:32:41 +010054obj-$(CONFIG_FSL_LAYERSCAPE) += ccn504.o
Andre Przywara0cef6cb2017-04-26 01:32:40 +010055ifneq ($(CONFIG_GICV2)$(CONFIG_GICV3),)
David Fengc71645a2014-03-14 14:26:27 +080056obj-y += gic_64.o
Andre Przywara0cef6cb2017-04-26 01:32:40 +010057endif
Bharat Kumar Reddy Gooty0bc43562019-12-16 09:09:43 -080058obj-$(CONFIG_GIC_V3_ITS) += gic-v3-its.o
David Feng0ae76532013-12-14 11:47:35 +080059obj-y += interrupts_64.o
60else
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090061obj-y += interrupts.o
David Feng0ae76532013-12-14 11:47:35 +080062endif
Claudius Heineb46e6cc2020-03-04 15:23:10 +010063ifndef CONFIG_$(SPL_TPL_)SYSRESET
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090064obj-y += reset.o
Simon Glassc6aabe92015-08-30 16:55:18 -060065endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090066
67obj-y += cache.o
Lokesh Vutlaf4bcd762018-04-26 18:21:28 +053068obj-$(CONFIG_SYS_ARM_CACHE_CP15) += cache-cp15.o
Marek Behúne5fc9032021-05-20 13:24:11 +020069CFLAGS_REMOVE_cache-cp15.o := $(LTO_CFLAGS)
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090070
Hou Zhiqiang45684ae2016-06-28 20:18:16 +080071obj-y += psci-dt.o
72
Masahiro Yamada51b17d42014-09-01 11:06:34 +090073obj-$(CONFIG_DEBUG_LL) += debug.o
74
Wolfgang Denkf772acf2009-08-17 13:17:29 +020075# For EABI conformant tool chains, provide eabi_compat()
76ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090077extra-y += eabi_compat.o
Wolfgang Denkf772acf2009-08-17 13:17:29 +020078endif
Albert ARIBAUD62e92072015-10-23 18:06:40 +020079
80# some files can only build in ARM or THUMB2, not THUMB1
81
Tom Rini3a649402017-03-18 09:01:44 -040082ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
Marek Vasutc0db6f82016-05-26 18:01:37 +020083asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
Albert ARIBAUD62e92072015-10-23 18:06:40 +020084ifndef CONFIG_HAS_THUMB2
85
86# for C files, just apend -marm, which will override previous -mthumb*
87
Andre Przywaraebda0cc2017-01-02 11:48:26 +000088ifndef CONFIG_ARM64
Albert ARIBAUD62e92072015-10-23 18:06:40 +020089CFLAGS_cache.o := -marm
90CFLAGS_cache-cp15.o := -marm
Andre Przywaraebda0cc2017-01-02 11:48:26 +000091endif
Albert ARIBAUD62e92072015-10-23 18:06:40 +020092
93# For .S, drop -mthumb* and other thumb-related options.
94# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
95# was implemented and is used here.
96# Also, define ${target}_NO_THUMB_BUILD for these two targets
97# so that the code knows it should not use Thumb.
98
99AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
100AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
101AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
102AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
Albert ARIBAUD62e92072015-10-23 18:06:40 +0200103endif
104endif
Simon Glassdd46eef2016-11-07 08:47:10 -0700105
106# For building EFI apps
107CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
108CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
109
110CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
111CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
112
Alexander Graf95b62b22016-11-17 22:40:10 +0100113extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
Heinrich Schuchardte4fd6952018-12-30 10:52:41 +0100114# TODO: As of v2019.01 the relocation code for the EFI application cannot
115# be built on ARMv7-M.
116ifndef CONFIG_CPU_V7M
117#extra-$(CONFIG_CMD_BOOTEFI_SELFTEST) += $(EFI_CRT0) $(EFI_RELOC)
118endif
Simon Glassdd46eef2016-11-07 08:47:10 -0700119extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)