]> Git Repo - J-u-boot.git/blame - arch/arm/config.mk
arm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c
[J-u-boot.git] / arch / arm / config.mk
CommitLineData
83d290c5 1# SPDX-License-Identifier: GPL-2.0+
39f0e5f8
WD
2#
3# (C) Copyright 2000-2002
4# Wolfgang Denk, DENX Software Engineering, [email protected].
39f0e5f8 5
8ae86b76 6ifndef CONFIG_STANDALONE_LOAD_ADDR
a93fbf4a 7ifneq ($(CONFIG_ARCH_OMAP2PLUS),)
8ae86b76 8CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
262ae0a6 9else
8ae86b76 10CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
262ae0a6
MF
11endif
12endif
13
dd46eef2
SG
14CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections
15CFLAGS_EFI := -fpic -fshort-wchar
16
fd725691 17LDFLAGS_FINAL += --gc-sections
3102274d 18PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
0ae76531 19 -fno-common -ffixed-r9
bf1af3d8
MY
20PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
21 $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
fd725691 22
b745e828 23# LLVM support
3b6407b8
TR
24LLVM_RELFLAGS := $(call cc-option,-mllvm,) \
25 $(call cc-option,-mno-movt,)
b745e828
TR
26PLATFORM_RELFLAGS += $(LLVM_RELFLAGS)
27
90f984e3 28PLATFORM_CPPFLAGS += -D__ARM__
10a451cd 29
d57259b9
ÁFR
30ifdef CONFIG_ARM64
31PLATFORM_ELFFLAGS += -B aarch64 -O elf64-littleaarch64
32else
33PLATFORM_ELFFLAGS += -B arm -O elf32-littlearm
34endif
35
5356f545 36# Choose between ARM/Thumb instruction sets
3a649407 37ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
75d7a0d7
SA
38AFLAGS_IMPLICIT_IT := $(call as-option,-Wa$(comma)-mimplicit-it=always)
39PF_CPPFLAGS_ARM := $(AFLAGS_IMPLICIT_IT) \
40 $(call cc-option, -mthumb -mthumb-interwork,\
5356f545
A
41 $(call cc-option,-marm,)\
42 $(call cc-option,-mno-thumb-interwork,)\
43 )
44else
45PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
46 $(call cc-option,-mno-thumb-interwork,)
47endif
f772acf8 48
06a119a0 49# Only test once
3a649407 50ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
d2366dfe 51archprepare: checkthumb checkgcc6
388b2e52
MY
52
53checkthumb:
6e2f1538
TR
54 @if test "$(call cc-name)" = "gcc" -a \
55 "$(call cc-version)" -lt "0404"; then \
388b2e52
MY
56 echo -n '*** Your GCC does not produce working '; \
57 echo 'binaries in THUMB mode.'; \
58 echo '*** Your board is configured for THUMB mode.'; \
59 false; \
60 fi
d2366dfe
TR
61else
62archprepare: checkgcc6
388b2e52 63endif
06a119a0 64
d2366dfe
TR
65checkgcc6:
66 @if test "$(call cc-name)" = "gcc" -a \
67 "$(call cc-version)" -lt "0600"; then \
6b867dab
TR
68 echo '*** Your GCC is older than 6.0 and is not supported'; \
69 false; \
d2366dfe
TR
70 fi
71
72
f772acf8
WD
73# Try if EABI is supported, else fall back to old API,
74# i. e. for example:
75# - with ELDK 4.2 (EABI supported), use:
5356f545 76# -mabi=aapcs-linux
f772acf8 77# - with ELDK 4.1 (gcc 4.x, no EABI), use:
5356f545 78# -mabi=apcs-gnu
f772acf8 79# - with ELDK 3.1 (gcc 3.x), use:
5356f545 80# -mapcs-32
cca4e4ae 81PF_CPPFLAGS_ABI := $(call cc-option,\
5356f545 82 -mabi=aapcs-linux,\
cca4e4ae
WD
83 $(call cc-option,\
84 -mapcs-32,\
f772acf8 85 $(call cc-option,\
cca4e4ae
WD
86 -mabi=apcs-gnu,\
87 )\
5356f545 88 )\
cca4e4ae
WD
89 )
90PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
f772acf8
WD
91
92# For EABI, make sure to provide raise()
93ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
5253418a
A
94# This file is parsed many times, so the string may get added multiple
95# times. Also, the prefix needs to be different based on whether
96# CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
97# before adding the correct one.
a86cf89c
MY
98PLATFORM_LIBS := arch/arm/lib/eabi_compat.o \
99 $(filter-out arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
f772acf8 100endif
92d5ecba 101
92d5ecba 102# needed for relocation
a4594e41 103LDFLAGS_u-boot += -pie
0f20bb60
AM
104
105#
106# FIXME: binutils versions < 2.22 have a bug in the assembler where
107# branches to weak symbols can be incorrectly optimized in thumb mode
108# to a short branch (b.n instruction) that won't reach when the symbol
109# gets preempted
110#
111# http://sourceware.org/bugzilla/show_bug.cgi?id=12532
112#
3a649407 113ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
0f20bb60
AM
114ifeq ($(GAS_BUG_12532),)
115export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
116 then echo y; else echo n; fi)
117endif
118ifeq ($(GAS_BUG_12532),y)
119PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
120endif
121endif
c37980c3 122
c37980c3 123ifneq ($(CONFIG_SPL_BUILD),y)
373d7983 124# Check that only R_ARM_RELATIVE relocations are generated.
e6385c7e 125INPUTS-y += checkarmreloc
373d7983
JH
126# The movt / movw can hardcode 16 bit parts of the addresses in the
127# instruction. Relocation is not supported for that case, so disable
128# such usage by requiring word relocations.
129PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations)
397d7d5a 130PLATFORM_CPPFLAGS += $(call cc-option, -fno-pic)
c37980c3 131endif
47ed5dd0
AA
132
133# limit ourselves to the sections we want in the .bin.
0ae76531 134ifdef CONFIG_ARM64
df88cb3b 135OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \
cf2a8fd6 136 -j .u_boot_list -j .rela.dyn -j .got -j .got.plt \
7e21fbca 137 -j .binman_sym_table -j .text_rest
0ae76531 138else
a5aa7ff3 139OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
cf2a8fd6 140 -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \
7e21fbca 141 -j .binman_sym_table -j .text_rest
0ae76531 142endif
630d2345 143
54cc4dcf
PA
144# if a dtb section exists we always have to include it
145# there are only two cases where it is generated
146# 1) OF_EMBEDED is turned on
147# 2) unit tests include device tree blobs
072b2d88 148OBJCOPYFLAGS += -j .dtb.init.rodata
072b2d88 149
50149ea3
AG
150ifdef CONFIG_EFI_LOADER
151OBJCOPYFLAGS += -j .efi_runtime -j .efi_runtime_rel
152endif
153
630d2345
MY
154ifneq ($(CONFIG_IMX_CONFIG),)
155ifdef CONFIG_SPL
156ifndef CONFIG_SPL_BUILD
e6385c7e 157INPUTS-y += SPL
630d2345
MY
158endif
159else
e64348f5 160ifeq ($(CONFIG_OF_SEPARATE),y)
e6385c7e 161INPUTS-y += u-boot-dtb.imx
e64348f5 162else
e6385c7e 163INPUTS-y += u-boot.imx
630d2345
MY
164endif
165endif
ed0c2c0a 166ifneq ($(CONFIG_VF610),)
e6385c7e 167INPUTS-y += u-boot.vyb
ed0c2c0a 168endif
e64348f5 169endif
dd46eef2
SG
170
171EFI_LDS := elf_arm_efi.lds
172EFI_CRT0 := crt0_arm_efi.o
173EFI_RELOC := reloc_arm_efi.o
This page took 0.550937 seconds and 4 git commands to generate.