xref: /openbmc/u-boot/arch/arm/lib/Makefile (revision b08c8c48)
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_SPL_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 image.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
58else
59obj-y	+= interrupts.o
60endif
61ifndef CONFIG_SYSRESET
62obj-y	+= reset.o
63endif
64
65obj-y	+= cache.o
66ifndef CONFIG_ARM64
67ifndef CONFIG_CPU_V7M
68obj-y	+= cache-cp15.o
69endif
70endif
71
72obj-y	+= psci-dt.o
73
74obj-$(CONFIG_DEBUG_LL)	+= debug.o
75
76# For EABI conformant tool chains, provide eabi_compat()
77ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
78extra-y	+= eabi_compat.o
79endif
80
81# some files can only build in ARM or THUMB2, not THUMB1
82
83ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
84asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
85ifndef CONFIG_HAS_THUMB2
86
87# for C files, just apend -marm, which will override previous -mthumb*
88
89ifndef CONFIG_ARM64
90CFLAGS_cache.o := -marm
91CFLAGS_cache-cp15.o := -marm
92endif
93
94# For .S, drop -mthumb* and other thumb-related options.
95# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
96# was implemented and is used here.
97# Also, define ${target}_NO_THUMB_BUILD for these two targets
98# so that the code knows it should not use Thumb.
99
100AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
101AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
102AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
103AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
104endif
105endif
106
107# For building EFI apps
108CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
109CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
110
111CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
112CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
113
114extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
115extra-$(CONFIG_CMD_BOOTEFI_SELFTEST) += $(EFI_CRT0) $(EFI_RELOC)
116extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
117