blob: 67275fba616e3ab7116745387b9be4ae954a8bf1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
wdenkf47713f2002-09-08 19:49:36 +00002#
Marian Balakowiczd62379d2006-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 Vasut14fefa02016-05-26 18:01:40 +02006lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
Marek Vasuteb91a462016-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.plb3b57e82015-03-01 12:44:39 +010010ifdef CONFIG_CPU_V7M
11obj-y += vectors_m.o crt0.o
12else ifdef CONFIG_ARM64
David Feng85fd5f12013-12-14 11:47:35 +080013obj-y += crt0_64.o
14else
Albert ARIBAUD9852cc62014-04-15 16:13:51 +020015obj-y += vectors.o crt0.o
David Feng85fd5f12013-12-14 11:47:35 +080016endif
Albert ARIBAUDfacdae52013-01-08 10:18:02 +000017
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020018ifdef CONFIG_ARM64
19obj-y += setjmp_aarch64.o
20else
21obj-y += setjmp.o
22endif
23
Allen Martinea74c932012-08-31 08:30:13 +000024ifndef CONFIG_SPL_BUILD
David Feng85fd5f12013-12-14 11:47:35 +080025ifdef CONFIG_ARM64
26obj-y += relocate_64.o
27else
28obj-y += relocate.o
29endif
Simon Glass97bbf182013-03-11 06:49:57 +000030
Matt Porterbd1fef52015-05-05 15:00:23 -040031obj-$(CONFIG_CPU_V7M) += cmd_boot.o
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090032obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Bin Chendac184b2018-01-27 16:59:09 +110033obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090034obj-$(CONFIG_CMD_BOOTM) += bootm.o
Tom Rini36f067f2016-08-12 08:31:15 -040035obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
Tom Rini31dfba42012-08-22 15:31:05 -070036else
Heiko Stuebner4a0da7c2019-07-16 10:12:02 +020037obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
Nathan Barrett-Morrisonc20400a2022-02-02 15:05:18 -050038ifdef CONFIG_SPL_FRAMEWORK
39obj-$(CONFIG_CMD_BOOTI) += image.o
40obj-$(CONFIG_CMD_BOOTZ) += zimage.o
41endif
B, Ravi4d863562017-04-18 17:27:26 +053042obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Aneesh V55fc5b62011-07-13 05:11:06 +000043endif
Stefan Roese27c3e952021-09-02 17:00:17 +020044ifdef CONFIG_ARM64
45obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset-arm64.o
46obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy-arm64.o
47else
Marek Vasut6e3abf32018-04-07 16:06:36 +020048obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
49obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
Stefan Roese27c3e952021-09-02 17:00:17 +020050endif
Philip Oberfichtnerc55a2522022-08-17 15:07:13 +020051obj-$(CONFIG_$(SPL_TPL_)SYS_L2_PL310) += cache-pl310.o
Sean Anderson89346ad2022-03-22 16:59:19 -040052obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += semihosting.o
wdenkf47713f2002-09-08 19:49:36 +000053
Dzmitry Sankouskia3463062022-02-22 21:49:52 +030054ifneq ($(filter y,$(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) $(CONFIG_SAVE_PREV_BL_FDT_ADDR)),)
55obj-y += save_prev_bl_data.o
56endif
57
58# obj-$(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) += save_prev_bl_data.o
Simon Glassa83ab162020-05-10 14:16:56 -060059obj-y += bdinfo.o
Albert ARIBAUD9d25fa42014-02-22 17:53:42 +010060obj-y += sections.o
Marek Behún4778a582021-05-20 13:24:22 +020061CFLAGS_REMOVE_sections.o := $(LTO_CFLAGS)
62
Andreas Bießmann25429862015-02-06 23:06:45 +010063obj-y += stack.o
rev13@wp.plb3b57e82015-03-01 12:44:39 +010064ifdef CONFIG_CPU_V7M
65obj-y += interrupts_m.o
66else ifdef CONFIG_ARM64
Andre Przywara739a9d12017-04-26 01:32:41 +010067obj-$(CONFIG_FSL_LAYERSCAPE) += ccn504.o
Andre Przywarae7782232017-04-26 01:32:40 +010068ifneq ($(CONFIG_GICV2)$(CONFIG_GICV3),)
David Feng79bbde02014-03-14 14:26:27 +080069obj-y += gic_64.o
Andre Przywarae7782232017-04-26 01:32:40 +010070endif
Bharat Kumar Reddy Gooty436efc02019-12-16 09:09:43 -080071obj-$(CONFIG_GIC_V3_ITS) += gic-v3-its.o
David Feng85fd5f12013-12-14 11:47:35 +080072obj-y += interrupts_64.o
73else
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090074obj-y += interrupts.o
David Feng85fd5f12013-12-14 11:47:35 +080075endif
Claudius Heine39396fe2020-03-04 15:23:10 +010076ifndef CONFIG_$(SPL_TPL_)SYSRESET
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090077obj-y += reset.o
Simon Glass3f67b7d2015-08-30 16:55:18 -060078endif
Stefano Babic84fb0dd2012-03-15 04:01:41 +000079
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090080obj-y += cache.o
Lokesh Vutla5a5bb6c2018-04-26 18:21:28 +053081obj-$(CONFIG_SYS_ARM_CACHE_CP15) += cache-cp15.o
Marek Behúna62fac92021-05-20 13:24:11 +020082CFLAGS_REMOVE_cache-cp15.o := $(LTO_CFLAGS)
Wolfgang Denkd47f4862009-08-17 13:17:29 +020083
Hou Zhiqiangdae02772016-06-28 20:18:16 +080084obj-y += psci-dt.o
85
Masahiro Yamadadf00e522014-09-01 11:06:34 +090086obj-$(CONFIG_DEBUG_LL) += debug.o
87
Raymond Maob579a692024-02-03 08:36:25 -080088obj-$(CONFIG_BLOBLIST) += xferlist.o
89
Wolfgang Denkd47f4862009-08-17 13:17:29 +020090# For EABI conformant tool chains, provide eabi_compat()
91ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090092extra-y += eabi_compat.o
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020093endif
Albert ARIBAUDa3823222015-10-23 18:06:40 +020094
95# some files can only build in ARM or THUMB2, not THUMB1
96
Tom Rini1c640a62017-03-18 09:01:44 -040097ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
Marek Vasutd0869182016-05-26 18:01:37 +020098asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
Albert ARIBAUDa3823222015-10-23 18:06:40 +020099ifndef CONFIG_HAS_THUMB2
100
101# for C files, just apend -marm, which will override previous -mthumb*
102
Andre Przywara67bf8202017-01-02 11:48:26 +0000103ifndef CONFIG_ARM64
Albert ARIBAUDa3823222015-10-23 18:06:40 +0200104CFLAGS_cache.o := -marm
105CFLAGS_cache-cp15.o := -marm
Andre Przywara67bf8202017-01-02 11:48:26 +0000106endif
Albert ARIBAUDa3823222015-10-23 18:06:40 +0200107
108# For .S, drop -mthumb* and other thumb-related options.
109# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
110# was implemented and is used here.
111# Also, define ${target}_NO_THUMB_BUILD for these two targets
112# so that the code knows it should not use Thumb.
113
114AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
115AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
116AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
117AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
Sean Anderson6babd842023-07-31 17:27:33 -0400118
119# This is only necessary to force ARM mode on THUMB1 targets.
120ifneq ($(CONFIG_SYS_ARM_ARCH),4)
121obj-y += bitops.o
122endif
Albert ARIBAUDa3823222015-10-23 18:06:40 +0200123endif
124endif
Simon Glassfc03fb92016-11-07 08:47:10 -0700125
126# For building EFI apps
127CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
128CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
129
130CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
131CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
132
Alexander Grafb5483512016-11-17 22:40:10 +0100133extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
Heinrich Schuchardt95dc0fd2018-12-30 10:52:41 +0100134# TODO: As of v2019.01 the relocation code for the EFI application cannot
135# be built on ARMv7-M.
136ifndef CONFIG_CPU_V7M
137#extra-$(CONFIG_CMD_BOOTEFI_SELFTEST) += $(EFI_CRT0) $(EFI_RELOC)
138endif
Simon Glassfc03fb92016-11-07 08:47:10 -0700139extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)