blob: 166fa9e3dad0bf160dca4feaa62b11b0f7baddaf [file] [log] [blame]
wdenkf47713f2002-09-08 19:49:36 +00001#
Marian Balakowiczf9328632006-09-01 19:49:50 +02002# (C) Copyright 2002-2006
wdenkf47713f2002-09-08 19:49:36 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkf47713f2002-09-08 19:49:36 +00006#
7
Marek Vasutc5a543e2016-05-26 18:01:40 +02008lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
Marek Vasut0bf65c62016-05-26 18:01:44 +02009 lib1funcs.o uldivmod.o div0.o \
10 div64.o muldi3.o
wdenkf47713f2002-09-08 19:49:36 +000011
rev13@wp.pl12d8a722015-03-01 12:44:39 +010012ifdef CONFIG_CPU_V7M
13obj-y += vectors_m.o crt0.o
14else ifdef CONFIG_ARM64
David Feng0ae76532013-12-14 11:47:35 +080015obj-y += crt0_64.o
16else
Albert ARIBAUD41623c92014-04-15 16:13:51 +020017obj-y += vectors.o crt0.o
David Feng0ae76532013-12-14 11:47:35 +080018endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090019
20ifndef CONFIG_SPL_BUILD
David Feng0ae76532013-12-14 11:47:35 +080021ifdef CONFIG_ARM64
22obj-y += relocate_64.o
23else
24obj-y += relocate.o
25endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090026
Matt Porterf99993c2015-05-05 15:00:23 -040027obj-$(CONFIG_CPU_V7M) += cmd_boot.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090028obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Tom Rini5db28902016-08-12 08:31:15 -040029obj-$(CONFIG_CMD_BOOTI) += bootm.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090030obj-$(CONFIG_CMD_BOOTM) += bootm.o
Tom Rini5db28902016-08-12 08:31:15 -040031obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090032obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090033else
34obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
Ladislav Michl431889d2016-07-12 20:28:14 +020035obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090036endif
Tom Rini40d55342017-01-12 13:16:02 -050037obj-$(CONFIG_$(SPL_)USE_ARCH_MEMSET) += memset.o
38obj-$(CONFIG_$(SPL_)USE_ARCH_MEMCPY) += memcpy.o
Darwin Rambo261d2762014-06-09 11:12:59 -070039obj-$(CONFIG_SEMIHOSTING) += semihosting.o
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090040
Albert ARIBAUDd0b5d9d2014-02-22 17:53:42 +010041obj-y += sections.o
Andreas Bießmann68145d42015-02-06 23:06:45 +010042obj-y += stack.o
rev13@wp.pl12d8a722015-03-01 12:44:39 +010043ifdef CONFIG_CPU_V7M
44obj-y += interrupts_m.o
45else ifdef CONFIG_ARM64
Bhupesh Sharma3ffa95c2015-07-01 09:58:03 +053046obj-y += ccn504.o
David Fengc71645a2014-03-14 14:26:27 +080047obj-y += gic_64.o
David Feng0ae76532013-12-14 11:47:35 +080048obj-y += interrupts_64.o
49else
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090050obj-y += interrupts.o
David Feng0ae76532013-12-14 11:47:35 +080051endif
Stephen Warren11636252016-05-12 12:03:35 -060052ifndef CONFIG_SYSRESET
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090053obj-y += reset.o
Simon Glassc6aabe92015-08-30 16:55:18 -060054endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090055
56obj-y += cache.o
David Feng0ae76532013-12-14 11:47:35 +080057ifndef CONFIG_ARM64
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090058obj-y += cache-cp15.o
David Feng0ae76532013-12-14 11:47:35 +080059endif
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090060
Hou Zhiqiang45684ae2016-06-28 20:18:16 +080061obj-y += psci-dt.o
62
Masahiro Yamada51b17d42014-09-01 11:06:34 +090063obj-$(CONFIG_DEBUG_LL) += debug.o
64
Wolfgang Denkf772acf2009-08-17 13:17:29 +020065# For EABI conformant tool chains, provide eabi_compat()
66ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
Masahiro Yamadafa8f9502013-10-17 17:34:52 +090067extra-y += eabi_compat.o
Wolfgang Denkf772acf2009-08-17 13:17:29 +020068endif
Albert ARIBAUD62e92072015-10-23 18:06:40 +020069
Marek Vasutc0db6f82016-05-26 18:01:37 +020070asflags-y += -DCONFIG_ARM_ASM_UNIFIED
Marek Vasutc0db6f82016-05-26 18:01:37 +020071
Albert ARIBAUD62e92072015-10-23 18:06:40 +020072# some files can only build in ARM or THUMB2, not THUMB1
73
74ifdef CONFIG_SYS_THUMB_BUILD
Marek Vasutc0db6f82016-05-26 18:01:37 +020075asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
Albert ARIBAUD62e92072015-10-23 18:06:40 +020076ifndef CONFIG_HAS_THUMB2
77
78# for C files, just apend -marm, which will override previous -mthumb*
79
Andre Przywaraebda0cc2017-01-02 11:48:26 +000080ifndef CONFIG_ARM64
Albert ARIBAUD62e92072015-10-23 18:06:40 +020081CFLAGS_cache.o := -marm
82CFLAGS_cache-cp15.o := -marm
Andre Przywaraebda0cc2017-01-02 11:48:26 +000083endif
Albert ARIBAUD62e92072015-10-23 18:06:40 +020084
85# For .S, drop -mthumb* and other thumb-related options.
86# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
87# was implemented and is used here.
88# Also, define ${target}_NO_THUMB_BUILD for these two targets
89# so that the code knows it should not use Thumb.
90
91AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
92AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
93AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
94AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
Albert ARIBAUD62e92072015-10-23 18:06:40 +020095endif
96endif
Simon Glassdd46eef2016-11-07 08:47:10 -070097
98# For building EFI apps
99CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
100CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
101
102CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
103CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
104
Alexander Graf95b62b22016-11-17 22:40:10 +0100105extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
Simon Glassdd46eef2016-11-07 08:47:10 -0700106extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)