2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-09-08 19:49:36 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2002-2006
|
2002-09-08 19:49:36 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2016-05-26 16:01:40 +00:00
|
|
|
lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
|
2016-05-26 16:01:44 +00:00
|
|
|
lib1funcs.o uldivmod.o div0.o \
|
|
|
|
div64.o muldi3.o
|
2008-02-27 10:00:47 +00:00
|
|
|
|
2015-03-01 11:44:39 +00:00
|
|
|
ifdef CONFIG_CPU_V7M
|
|
|
|
obj-y += vectors_m.o crt0.o
|
|
|
|
else ifdef CONFIG_ARM64
|
2013-12-14 03:47:35 +00:00
|
|
|
obj-y += crt0_64.o
|
|
|
|
else
|
2014-04-15 14:13:51 +00:00
|
|
|
obj-y += vectors.o crt0.o
|
2013-12-14 03:47:35 +00:00
|
|
|
endif
|
2013-01-08 10:18:02 +00:00
|
|
|
|
2017-10-10 14:21:13 +00:00
|
|
|
ifdef CONFIG_ARM64
|
|
|
|
obj-y += setjmp_aarch64.o
|
|
|
|
else
|
|
|
|
obj-y += setjmp.o
|
|
|
|
endif
|
|
|
|
|
2012-08-31 08:30:13 +00:00
|
|
|
ifndef CONFIG_SPL_BUILD
|
2013-12-14 03:47:35 +00:00
|
|
|
ifdef CONFIG_ARM64
|
|
|
|
obj-y += relocate_64.o
|
|
|
|
else
|
|
|
|
obj-y += relocate.o
|
|
|
|
endif
|
2013-03-11 06:49:57 +00:00
|
|
|
|
2015-05-05 19:00:23 +00:00
|
|
|
obj-$(CONFIG_CPU_V7M) += cmd_boot.o
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
|
2018-01-27 05:59:09 +00:00
|
|
|
obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-$(CONFIG_CMD_BOOTM) += bootm.o
|
2016-08-12 12:31:15 +00:00
|
|
|
obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
|
2012-08-22 22:31:05 +00:00
|
|
|
else
|
2019-07-16 08:12:02 +00:00
|
|
|
obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
|
2016-07-12 18:28:14 +00:00
|
|
|
obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
|
2017-04-18 11:57:26 +00:00
|
|
|
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
|
2011-07-13 05:11:06 +00:00
|
|
|
endif
|
2021-09-02 15:00:17 +00:00
|
|
|
ifdef CONFIG_ARM64
|
|
|
|
obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset-arm64.o
|
|
|
|
obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy-arm64.o
|
|
|
|
else
|
2018-04-07 14:06:36 +00:00
|
|
|
obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
|
|
|
|
obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
|
2021-09-02 15:00:17 +00:00
|
|
|
endif
|
spl: Add semihosting boot method
This adds a boot method for loading the next stage from the host. It is
mostly modeled off of spl_load_image_ext. I am not really sure why/how
spl_load_image_fat uses three different methods to load the image, but
the simple case seems to work OK for now.
To control the presence of this boot method, we add a config symbol.
While we're at it, we update the original semihosting config symbol.
I think semihosting has some advantages of other forms of JTAG boot.
Common other ways to boot from JTAG include:
- Implementing DDR initialization through JTAG (typically with dozens of
lines of TCL) and then loading U-Boot. The DDR initialization
typically uses hard-coded register writes, and is not easily adapted
to different boards. BOOT_DEVICE_SMH allows booting with SPL,
leveraging U-Boot's existing DDR initialization code. This is the
method used by NXP's CodeWarrior IDE on Layerscape processors (see
AN12270).
- Loading a bootloader into SDRAM, waiting for it to initialize DDR, and
then loading U-Boot. This is tricky, because the debugger must stop the
boot after the bootloader has completed its work. Trying to load
U-Boot too early can cause failure to boot. This is the method used by
Xilinx with its Zynq(MP) processors.
- Loading SPL with BOOT_DEVICE_RAM and breaking before SPL loads the
image to load U-Boot at the appropriate place. This can be a bit
tricky, because the load address is dependent on the header size. An
elf with symbols must also be used in order to stop at the appropriate
point. BOOT_DEVICE_SMH can be viewed as an extension of this process,
where SPL automatically stops and tells the host where to place the
image.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-03-22 20:59:19 +00:00
|
|
|
obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += semihosting.o
|
2008-02-27 10:00:47 +00:00
|
|
|
|
2022-02-22 18:49:52 +00:00
|
|
|
ifneq ($(filter y,$(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) $(CONFIG_SAVE_PREV_BL_FDT_ADDR)),)
|
|
|
|
obj-y += save_prev_bl_data.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
# obj-$(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) += save_prev_bl_data.o
|
2020-05-10 20:16:56 +00:00
|
|
|
obj-y += bdinfo.o
|
2014-02-22 16:53:42 +00:00
|
|
|
obj-y += sections.o
|
2021-05-20 11:24:22 +00:00
|
|
|
CFLAGS_REMOVE_sections.o := $(LTO_CFLAGS)
|
|
|
|
|
2015-02-06 22:06:45 +00:00
|
|
|
obj-y += stack.o
|
2015-03-01 11:44:39 +00:00
|
|
|
ifdef CONFIG_CPU_V7M
|
|
|
|
obj-y += interrupts_m.o
|
|
|
|
else ifdef CONFIG_ARM64
|
2017-04-26 00:32:41 +00:00
|
|
|
obj-$(CONFIG_FSL_LAYERSCAPE) += ccn504.o
|
2017-04-26 00:32:40 +00:00
|
|
|
ifneq ($(CONFIG_GICV2)$(CONFIG_GICV3),)
|
2014-03-14 06:26:27 +00:00
|
|
|
obj-y += gic_64.o
|
2017-04-26 00:32:40 +00:00
|
|
|
endif
|
2019-12-16 17:09:43 +00:00
|
|
|
obj-$(CONFIG_GIC_V3_ITS) += gic-v3-its.o
|
2013-12-14 03:47:35 +00:00
|
|
|
obj-y += interrupts_64.o
|
|
|
|
else
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-y += interrupts.o
|
2013-12-14 03:47:35 +00:00
|
|
|
endif
|
2020-03-04 14:23:10 +00:00
|
|
|
ifndef CONFIG_$(SPL_TPL_)SYSRESET
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-y += reset.o
|
2015-08-30 22:55:18 +00:00
|
|
|
endif
|
2009-07-23 11:15:59 +00:00
|
|
|
|
2013-10-17 08:34:52 +00:00
|
|
|
obj-y += cache.o
|
2018-04-26 12:51:28 +00:00
|
|
|
obj-$(CONFIG_SYS_ARM_CACHE_CP15) += cache-cp15.o
|
ARM: fix LTO build for some thumb-interwork cases
Fix LTO build for some thumb-interwork usecases (such as for
da850evm_defconfig), where inline assmebly such as
mrc p15,0,r2,c1,c0,0
causes the compiler to fail during LTO linking with
Error: selected processor does not support `mrc p15,0,r2,c1,c0,0'
in Thumb mode
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-20 11:24:11 +00:00
|
|
|
CFLAGS_REMOVE_cache-cp15.o := $(LTO_CFLAGS)
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
|
2016-06-28 12:18:16 +00:00
|
|
|
obj-y += psci-dt.o
|
|
|
|
|
2014-09-01 02:06:34 +00:00
|
|
|
obj-$(CONFIG_DEBUG_LL) += debug.o
|
|
|
|
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
# For EABI conformant tool chains, provide eabi_compat()
|
|
|
|
ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
|
2013-10-17 08:34:52 +00:00
|
|
|
extra-y += eabi_compat.o
|
2009-07-23 11:15:59 +00:00
|
|
|
endif
|
2015-10-23 16:06:40 +00:00
|
|
|
|
|
|
|
# some files can only build in ARM or THUMB2, not THUMB1
|
|
|
|
|
2017-03-18 13:01:44 +00:00
|
|
|
ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
|
2016-05-26 16:01:37 +00:00
|
|
|
asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
|
2015-10-23 16:06:40 +00:00
|
|
|
ifndef CONFIG_HAS_THUMB2
|
|
|
|
|
|
|
|
# for C files, just apend -marm, which will override previous -mthumb*
|
|
|
|
|
2017-01-02 11:48:26 +00:00
|
|
|
ifndef CONFIG_ARM64
|
2015-10-23 16:06:40 +00:00
|
|
|
CFLAGS_cache.o := -marm
|
|
|
|
CFLAGS_cache-cp15.o := -marm
|
2017-01-02 11:48:26 +00:00
|
|
|
endif
|
2015-10-23 16:06:40 +00:00
|
|
|
|
|
|
|
# For .S, drop -mthumb* and other thumb-related options.
|
|
|
|
# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
|
|
|
|
# was implemented and is used here.
|
|
|
|
# Also, define ${target}_NO_THUMB_BUILD for these two targets
|
|
|
|
# so that the code knows it should not use Thumb.
|
|
|
|
|
|
|
|
AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
|
|
|
|
AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
|
|
|
|
AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
|
|
|
|
AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
|
|
|
|
endif
|
|
|
|
endif
|
2016-11-07 15:47:10 +00:00
|
|
|
|
|
|
|
# For building EFI apps
|
|
|
|
CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
|
|
|
|
CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
|
|
|
|
|
|
|
|
CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
|
|
|
|
CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
|
|
|
|
|
2016-11-17 21:40:10 +00:00
|
|
|
extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
|
2018-12-30 09:52:41 +00:00
|
|
|
# TODO: As of v2019.01 the relocation code for the EFI application cannot
|
|
|
|
# be built on ARMv7-M.
|
|
|
|
ifndef CONFIG_CPU_V7M
|
|
|
|
#extra-$(CONFIG_CMD_BOOTEFI_SELFTEST) += $(EFI_CRT0) $(EFI_RELOC)
|
|
|
|
endif
|
2016-11-07 15:47:10 +00:00
|
|
|
extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
|