blob: 6e96cfb0c5dd41a8bd87b26084b8f91a9543997c [file] [log] [blame]
wdenkf47713f2002-09-08 19:49:36 +00001#
Marian Balakowiczd62379d2006-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 Denkd79de1d2013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkf47713f2002-09-08 19:49:36 +00006#
7
Marek Vasut14fefa02016-05-26 18:01:40 +02008lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
Marek Vasuteb91a462016-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.plb3b57e82015-03-01 12:44:39 +010012ifdef CONFIG_CPU_V7M
13obj-y += vectors_m.o crt0.o
14else ifdef CONFIG_ARM64
David Feng85fd5f12013-12-14 11:47:35 +080015obj-y += crt0_64.o
16else
Albert ARIBAUD9852cc62014-04-15 16:13:51 +020017obj-y += vectors.o crt0.o
David Feng85fd5f12013-12-14 11:47:35 +080018endif
Albert ARIBAUDfacdae52013-01-08 10:18:02 +000019
Allen Martinea74c932012-08-31 08:30:13 +000020ifndef CONFIG_SPL_BUILD
David Feng85fd5f12013-12-14 11:47:35 +080021ifdef CONFIG_ARM64
22obj-y += relocate_64.o
23else
24obj-y += relocate.o
25endif
Simon Glass97bbf182013-03-11 06:49:57 +000026
Matt Porterbd1fef52015-05-05 15:00:23 -040027obj-$(CONFIG_CPU_V7M) += cmd_boot.o
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090028obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Tom Rini36f067f2016-08-12 08:31:15 -040029obj-$(CONFIG_CMD_BOOTI) += bootm.o
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090030obj-$(CONFIG_CMD_BOOTM) += bootm.o
Tom Rini36f067f2016-08-12 08:31:15 -040031obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090032obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
Tom Rini31dfba42012-08-22 15:31:05 -070033else
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090034obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
Ladislav Michl9c743722016-07-12 20:28:14 +020035obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
Aneesh V55fc5b62011-07-13 05:11:06 +000036endif
Tom Rini443b5162017-01-12 13:16:02 -050037obj-$(CONFIG_$(SPL_)USE_ARCH_MEMSET) += memset.o
38obj-$(CONFIG_$(SPL_)USE_ARCH_MEMCPY) += memcpy.o
Darwin Rambod32d4112014-06-09 11:12:59 -070039obj-$(CONFIG_SEMIHOSTING) += semihosting.o
wdenkf47713f2002-09-08 19:49:36 +000040
Albert ARIBAUD9d25fa42014-02-22 17:53:42 +010041obj-y += sections.o
Andreas Bießmann25429862015-02-06 23:06:45 +010042obj-y += stack.o
rev13@wp.plb3b57e82015-03-01 12:44:39 +010043ifdef CONFIG_CPU_V7M
44obj-y += interrupts_m.o
45else ifdef CONFIG_ARM64
Bhupesh Sharma8238f342015-07-01 09:58:03 +053046obj-y += ccn504.o
David Feng79bbde02014-03-14 14:26:27 +080047obj-y += gic_64.o
David Feng85fd5f12013-12-14 11:47:35 +080048obj-y += interrupts_64.o
49else
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090050obj-y += interrupts.o
David Feng85fd5f12013-12-14 11:47:35 +080051endif
Stephen Warren859f2562016-05-12 12:03:35 -060052ifndef CONFIG_SYSRESET
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090053obj-y += reset.o
Simon Glass3f67b7d2015-08-30 16:55:18 -060054endif
Stefano Babic84fb0dd2012-03-15 04:01:41 +000055
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090056obj-y += cache.o
David Feng85fd5f12013-12-14 11:47:35 +080057ifndef CONFIG_ARM64
Vikas Manocha948c61b2017-03-27 13:02:44 -070058ifndef CONFIG_CPU_V7M
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090059obj-y += cache-cp15.o
David Feng85fd5f12013-12-14 11:47:35 +080060endif
Vikas Manocha948c61b2017-03-27 13:02:44 -070061endif
Wolfgang Denkd47f4862009-08-17 13:17:29 +020062
Hou Zhiqiangdae02772016-06-28 20:18:16 +080063obj-y += psci-dt.o
64
Masahiro Yamadadf00e522014-09-01 11:06:34 +090065obj-$(CONFIG_DEBUG_LL) += debug.o
66
Wolfgang Denkd47f4862009-08-17 13:17:29 +020067# For EABI conformant tool chains, provide eabi_compat()
68ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
Masahiro Yamada5a0c0ba2013-10-17 17:34:52 +090069extra-y += eabi_compat.o
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020070endif
Albert ARIBAUDa3823222015-10-23 18:06:40 +020071
Marek Vasutd0869182016-05-26 18:01:37 +020072asflags-y += -DCONFIG_ARM_ASM_UNIFIED
Marek Vasutd0869182016-05-26 18:01:37 +020073
Albert ARIBAUDa3823222015-10-23 18:06:40 +020074# some files can only build in ARM or THUMB2, not THUMB1
75
Tom Rini1c640a62017-03-18 09:01:44 -040076ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
Marek Vasutd0869182016-05-26 18:01:37 +020077asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
Albert ARIBAUDa3823222015-10-23 18:06:40 +020078ifndef CONFIG_HAS_THUMB2
79
80# for C files, just apend -marm, which will override previous -mthumb*
81
Andre Przywara67bf8202017-01-02 11:48:26 +000082ifndef CONFIG_ARM64
Albert ARIBAUDa3823222015-10-23 18:06:40 +020083CFLAGS_cache.o := -marm
84CFLAGS_cache-cp15.o := -marm
Andre Przywara67bf8202017-01-02 11:48:26 +000085endif
Albert ARIBAUDa3823222015-10-23 18:06:40 +020086
87# For .S, drop -mthumb* and other thumb-related options.
88# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
89# was implemented and is used here.
90# Also, define ${target}_NO_THUMB_BUILD for these two targets
91# so that the code knows it should not use Thumb.
92
93AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
94AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
95AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
96AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
Albert ARIBAUDa3823222015-10-23 18:06:40 +020097endif
98endif
Simon Glassfc03fb92016-11-07 08:47:10 -070099
100# For building EFI apps
101CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
102CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
103
104CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
105CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
106
Alexander Grafb5483512016-11-17 22:40:10 +0100107extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
Simon Glassfc03fb92016-11-07 08:47:10 -0700108extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)