2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2011-07-18 07:48:07 +00:00
|
|
|
#
|
|
|
|
# (C) Copyright 2000-2011
|
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
|
|
|
# (C) Copyright 2011
|
|
|
|
# Daniel Schwierzeck, daniel.schwierzeck@googlemail.com.
|
|
|
|
#
|
|
|
|
# (C) Copyright 2011
|
|
|
|
# Texas Instruments Incorporated - http://www.ti.com/
|
|
|
|
# Aneesh V <aneesh@ti.com>
|
|
|
|
# Based on top-level Makefile.
|
|
|
|
#
|
|
|
|
|
2014-02-04 08:24:24 +00:00
|
|
|
src := $(obj)
|
|
|
|
|
|
|
|
# Create output directory if not already present
|
|
|
|
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
|
|
|
|
|
2014-02-04 08:24:18 +00:00
|
|
|
include $(srctree)/scripts/Kbuild.include
|
|
|
|
|
kconfig: switch to single .config configuration
When Kconfig for U-boot was examined, one of the biggest issues was
how to support multiple images (Normal, SPL, TPL). There were
actually two options, "single .config" and "multiple .config".
After some discussions and thought experiments, I chose the latter,
i.e. to create ".config", "spl/.config", "tpl/.config" for Normal,
SPL, TPL, respectively.
It is true that the "multiple .config" strategy provided us the
maximum flexibility and helped to avoid duplicating CONFIGs among
Normal, SPL, TPL, but I have noticed some fatal problems:
[1] It is impossible to share CONFIG options across the images.
If you change the configuration of Main image, you often have to
adjust some SPL configurations correspondingly. Currently, we
cannot handle the dependencies between them. It means one of the
biggest advantages of Kconfig is lost.
[2] It is too painful to change both ".config" and "spl/.config".
Sunxi guys started to work around this problem by creating a new
configuration target. Commit cbdd9a9737cc (sunxi: kconfig: Add
%_felconfig rule to enable FEL build of sunxi platforms.) added
"make *_felconfig" to enable CONFIG_SPL_FEL on both images.
Changing the configuration of multiple images in one command is a
generic demand. The current implementation cannot propose any
good solution about this.
[3] Kconfig files are getting ugly and difficult to understand.
Commit b724bd7d6349 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to
Kconfig) has sprinkled "if !SPL_BUILD" over the Kconfig files.
[4] The build system got more complicated than it should be.
To adjust Linux-originated Kconfig to U-Boot, the helper script
"scripts/multiconfig.sh" was introduced. Writing a complicated
text processor is a shell script sometimes caused problems.
Now I believe the "single .config" will serve us better. With it,
all the problems above would go away. Instead, we will have to add
some CONFIG_SPL_* (and CONFIG_TPL_*) options such as CONFIG_SPL_DM,
but we will not have much. Anyway, this is what we do now in
scripts/Makefile.spl.
I admit my mistake with my apology and this commit switches to the
single .config configuration.
It is not so difficult to do that:
- Remove unnecessary processings from scripts/multiconfig.sh
This file will remain for a while to support the current defconfig
format. It will be removed after more cleanups are done.
- Adjust some makefiles and Kconfigs
- Add some entries to include/config_uncmd_spl.h and the new file
scripts/Makefile.uncmd_spl. Some CONFIG options that are not
supported on SPL must be disabled because one .config is shared
between SPL and U-Boot proper going forward. I know this is not
a beautiful solution and I think we can do better, but let's see
how much we will have to describe them.
- update doc/README.kconfig
More cleaning up patches will follow this.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-02-24 13:26:20 +00:00
|
|
|
-include include/config/auto.conf
|
kconfig: switch to Kconfig
This commit enables Kconfig.
Going forward, we use Kconfig for the board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.
Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple boot images (Normal, SPL, TPL)
from one source tree.
Each image needs its own configuration input.
Usage:
Run "make <board>_defconfig" to do the board configuration.
It will create the .config file and additionally spl/.config, tpl/.config
if SPL, TPL is enabled, respectively.
You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.
Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
and do likewise for tpl/.config file.
The generic syntax of configuration targets for SPL, TPL is:
<target_image>/<config_command>
Here, <target_image> is either 'spl' or 'tpl'
<config_command> is 'config', 'menuconfig', 'xconfig', etc.
When the configuration is done, run "make".
(Or "make <board>_defconfig all" will do the configuration and build
in one time.)
For futher information of how Kconfig works in U-Boot,
please read the comment block of scripts/multiconfig.py.
By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.
Prior to Kconfig, we used C headers to define a set of configs.
We expect a very long term to migrate from C headers to Kconfig.
Two different infractructure must coexist in the interim.
In our former configuration scheme, include/autoconf.mk was generated
for use in makefiles.
It is still generated under include/, spl/include/, tpl/include/ directory
for the Normal, SPL, TPL image, respectively.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-07-30 05:08:17 +00:00
|
|
|
-include $(obj)/include/autoconf.mk
|
2014-02-04 08:24:22 +00:00
|
|
|
|
2020-04-17 07:21:37 +00:00
|
|
|
UBOOTINCLUDE := -I$(obj)/include $(UBOOTINCLUDE)
|
|
|
|
|
kconfig: switch to single .config configuration
When Kconfig for U-boot was examined, one of the biggest issues was
how to support multiple images (Normal, SPL, TPL). There were
actually two options, "single .config" and "multiple .config".
After some discussions and thought experiments, I chose the latter,
i.e. to create ".config", "spl/.config", "tpl/.config" for Normal,
SPL, TPL, respectively.
It is true that the "multiple .config" strategy provided us the
maximum flexibility and helped to avoid duplicating CONFIGs among
Normal, SPL, TPL, but I have noticed some fatal problems:
[1] It is impossible to share CONFIG options across the images.
If you change the configuration of Main image, you often have to
adjust some SPL configurations correspondingly. Currently, we
cannot handle the dependencies between them. It means one of the
biggest advantages of Kconfig is lost.
[2] It is too painful to change both ".config" and "spl/.config".
Sunxi guys started to work around this problem by creating a new
configuration target. Commit cbdd9a9737cc (sunxi: kconfig: Add
%_felconfig rule to enable FEL build of sunxi platforms.) added
"make *_felconfig" to enable CONFIG_SPL_FEL on both images.
Changing the configuration of multiple images in one command is a
generic demand. The current implementation cannot propose any
good solution about this.
[3] Kconfig files are getting ugly and difficult to understand.
Commit b724bd7d6349 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to
Kconfig) has sprinkled "if !SPL_BUILD" over the Kconfig files.
[4] The build system got more complicated than it should be.
To adjust Linux-originated Kconfig to U-Boot, the helper script
"scripts/multiconfig.sh" was introduced. Writing a complicated
text processor is a shell script sometimes caused problems.
Now I believe the "single .config" will serve us better. With it,
all the problems above would go away. Instead, we will have to add
some CONFIG_SPL_* (and CONFIG_TPL_*) options such as CONFIG_SPL_DM,
but we will not have much. Anyway, this is what we do now in
scripts/Makefile.spl.
I admit my mistake with my apology and this commit switches to the
single .config configuration.
It is not so difficult to do that:
- Remove unnecessary processings from scripts/multiconfig.sh
This file will remain for a while to support the current defconfig
format. It will be removed after more cleanups are done.
- Adjust some makefiles and Kconfigs
- Add some entries to include/config_uncmd_spl.h and the new file
scripts/Makefile.uncmd_spl. Some CONFIG options that are not
supported on SPL must be disabled because one .config is shared
between SPL and U-Boot proper going forward. I know this is not
a beautiful solution and I think we can do better, but let's see
how much we will have to describe them.
- update doc/README.kconfig
More cleaning up patches will follow this.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-02-24 13:26:20 +00:00
|
|
|
KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
|
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
|
|
|
KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
|
|
|
|
endif
|
|
|
|
|
2013-08-16 07:16:15 +00:00
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
|
|
|
SPL_BIN := u-boot-tpl
|
|
|
|
else
|
|
|
|
SPL_BIN := u-boot-spl
|
|
|
|
endif
|
|
|
|
|
2017-01-16 14:03:28 +00:00
|
|
|
ifdef CONFIG_SPL_BUILD
|
|
|
|
SPL_ := SPL_
|
2017-04-02 15:50:30 +00:00
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
|
|
|
SPL_TPL_ := TPL_
|
|
|
|
else
|
|
|
|
SPL_TPL_ := SPL_
|
|
|
|
endif
|
2017-01-16 14:03:28 +00:00
|
|
|
else
|
|
|
|
SPL_ :=
|
2017-04-02 15:50:30 +00:00
|
|
|
SPL_TPL_ :=
|
2017-01-16 14:03:28 +00:00
|
|
|
endif
|
|
|
|
|
2018-10-01 18:22:11 +00:00
|
|
|
ifeq ($(obj)$(CONFIG_SUPPORT_SPL),spl)
|
|
|
|
$(error You cannot build SPL without enabling CONFIG_SUPPORT_SPL)
|
|
|
|
endif
|
|
|
|
ifeq ($(obj)$(CONFIG_SUPPORT_TPL),tpl)
|
|
|
|
$(error You cannot build TPL without enabling CONFIG_SUPPORT_TPL)
|
|
|
|
endif
|
|
|
|
|
2014-03-11 02:05:19 +00:00
|
|
|
include $(srctree)/config.mk
|
2014-11-21 22:51:33 +00:00
|
|
|
include $(srctree)/arch/$(ARCH)/Makefile
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2018-02-14 05:44:36 +00:00
|
|
|
include $(srctree)/scripts/Makefile.lib
|
|
|
|
|
2014-03-05 07:59:40 +00:00
|
|
|
# Enable garbage collection of un-used sections for SPL
|
|
|
|
KBUILD_CFLAGS += -ffunction-sections -fdata-sections
|
|
|
|
LDFLAGS_FINAL += --gc-sections
|
|
|
|
|
2014-02-04 08:24:33 +00:00
|
|
|
# FIX ME
|
2014-03-05 07:59:40 +00:00
|
|
|
cpp_flags := $(KBUILD_CPPFLAGS) $(PLATFORM_CPPFLAGS) $(UBOOTINCLUDE) \
|
|
|
|
$(NOSTDINC_FLAGS)
|
2016-07-04 17:58:10 +00:00
|
|
|
c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
|
2014-02-04 08:24:33 +00:00
|
|
|
|
2014-03-11 02:05:20 +00:00
|
|
|
HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2014-04-25 12:54:31 +00:00
|
|
|
libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
|
2014-02-04 08:24:37 +00:00
|
|
|
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
|
|
|
|
|
2019-07-16 08:12:02 +00:00
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
|
|
|
libs-$(CONFIG_TPL_FRAMEWORK) += common/spl/
|
|
|
|
else
|
2014-02-04 08:24:37 +00:00
|
|
|
libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
|
2019-07-16 08:12:02 +00:00
|
|
|
endif
|
2015-10-19 12:49:56 +00:00
|
|
|
libs-y += common/init/
|
2016-09-13 05:18:25 +00:00
|
|
|
|
|
|
|
# Special handling for a few options which support SPL/TPL
|
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
2017-08-03 18:21:49 +00:00
|
|
|
libs-$(CONFIG_TPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
|
2016-09-13 05:18:25 +00:00
|
|
|
libs-$(CONFIG_TPL_LIBGENERIC_SUPPORT) += lib/
|
|
|
|
else
|
2017-08-03 18:21:49 +00:00
|
|
|
libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
|
2016-09-13 05:18:25 +00:00
|
|
|
libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
|
2018-12-05 13:23:38 +00:00
|
|
|
ifdef CONFIG_SPL_FRAMEWORK
|
|
|
|
libs-$(CONFIG_PARTITIONS) += disk/
|
|
|
|
endif
|
2016-09-13 05:18:25 +00:00
|
|
|
endif
|
|
|
|
|
2015-08-11 22:31:44 +00:00
|
|
|
libs-y += drivers/
|
2019-01-10 14:44:13 +00:00
|
|
|
libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
|
2019-10-01 11:56:33 +00:00
|
|
|
libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/cdns3/
|
2015-11-09 09:45:07 +00:00
|
|
|
libs-y += dts/
|
2014-02-04 08:24:37 +00:00
|
|
|
libs-y += fs/
|
|
|
|
libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
|
|
|
|
libs-$(CONFIG_SPL_NET_SUPPORT) += net/
|
2020-10-26 02:38:26 +00:00
|
|
|
libs-$(CONFIG_SPL_UNIT_TEST) += test/
|
2011-07-13 05:11:08 +00:00
|
|
|
|
2014-02-04 08:24:37 +00:00
|
|
|
head-y := $(addprefix $(obj)/,$(head-y))
|
|
|
|
libs-y := $(addprefix $(obj)/,$(libs-y))
|
|
|
|
u-boot-spl-dirs := $(patsubst %/,%,$(filter %/, $(libs-y)))
|
|
|
|
|
|
|
|
libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
|
2013-11-11 05:36:00 +00:00
|
|
|
|
2012-08-31 08:30:14 +00:00
|
|
|
# Add GCC lib
|
2014-03-05 07:59:38 +00:00
|
|
|
ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
|
2014-02-27 13:40:34 +00:00
|
|
|
PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
|
2014-02-24 11:44:14 +00:00
|
|
|
PLATFORM_LIBS := $(filter-out %/lib.a, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
|
2012-08-31 08:30:14 +00:00
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:37 +00:00
|
|
|
u-boot-spl-init := $(head-y)
|
|
|
|
u-boot-spl-main := $(libs-y)
|
2017-06-29 09:11:21 +00:00
|
|
|
ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA
|
2016-07-04 17:58:10 +00:00
|
|
|
u-boot-spl-platdata := $(obj)/dts/dt-platdata.o
|
|
|
|
endif
|
2011-07-18 07:48:07 +00:00
|
|
|
|
|
|
|
# Linker Script
|
2017-07-28 17:20:49 +00:00
|
|
|
# First test whether there's a linker-script for the specific stage defined...
|
|
|
|
ifneq ($(CONFIG_$(SPL_TPL_)LDSCRIPT),)
|
2011-07-18 07:48:07 +00:00
|
|
|
# need to strip off double quotes
|
2017-07-04 12:47:46 +00:00
|
|
|
LDSCRIPT := $(addprefix $(srctree)/,$(CONFIG_$(SPL_TPL_)LDSCRIPT:"%"=%))
|
2017-07-28 17:20:49 +00:00
|
|
|
else
|
|
|
|
# ...then fall back to the generic SPL linker-script
|
|
|
|
ifneq ($(CONFIG_SPL_LDSCRIPT),)
|
|
|
|
# need to strip off double quotes
|
|
|
|
LDSCRIPT := $(addprefix $(srctree)/,$(CONFIG_SPL_LDSCRIPT:"%"=%))
|
|
|
|
endif
|
2011-07-18 07:48:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(wildcard $(LDSCRIPT)),)
|
2014-03-11 02:05:19 +00:00
|
|
|
LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-spl.lds
|
2011-07-18 07:48:07 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(wildcard $(LDSCRIPT)),)
|
2014-03-11 02:05:19 +00:00
|
|
|
LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-spl.lds
|
2011-07-18 07:48:07 +00:00
|
|
|
endif
|
2011-11-21 10:49:37 +00:00
|
|
|
ifeq ($(wildcard $(LDSCRIPT)),)
|
2014-03-11 02:05:19 +00:00
|
|
|
LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot-spl.lds
|
2011-11-21 10:49:37 +00:00
|
|
|
endif
|
2011-07-18 07:48:07 +00:00
|
|
|
ifeq ($(wildcard $(LDSCRIPT)),)
|
|
|
|
$(error could not find linker script)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Special flags for CPP when processing the linker script.
|
|
|
|
# Pass the version down so we can handle backwards compatibility
|
|
|
|
# on the fly.
|
|
|
|
LDPPFLAGS += \
|
2014-03-11 02:05:19 +00:00
|
|
|
-include $(srctree)/include/u-boot/u-boot.lds.h \
|
2014-03-11 02:05:21 +00:00
|
|
|
-include $(objtree)/include/config.h \
|
2011-11-21 10:49:40 +00:00
|
|
|
-DCPUDIR=$(CPUDIR) \
|
2011-07-18 07:48:07 +00:00
|
|
|
$(shell $(LD) --version | \
|
|
|
|
sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
|
|
|
|
|
2019-01-22 22:09:26 +00:00
|
|
|
# Turn various CONFIG symbols into IMAGE symbols for easy reuse of
|
|
|
|
# the scripts between SPL and TPL.
|
|
|
|
ifneq ($(CONFIG_$(SPL_TPL_)MAX_SIZE),)
|
|
|
|
LDPPFLAGS += -DIMAGE_MAX_SIZE=$(CONFIG_$(SPL_TPL_)MAX_SIZE)
|
|
|
|
endif
|
|
|
|
ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),)
|
|
|
|
LDPPFLAGS += -DIMAGE_TEXT_BASE=$(CONFIG_$(SPL_TPL_)TEXT_BASE)
|
|
|
|
endif
|
|
|
|
|
2016-11-06 15:37:58 +00:00
|
|
|
MKIMAGEOUTPUT ?= /dev/null
|
|
|
|
|
2014-03-14 04:00:14 +00:00
|
|
|
quiet_cmd_mkimage = MKIMAGE $@
|
2014-02-24 02:12:15 +00:00
|
|
|
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
Makefile: always preserve output for images that can contain HAB Blocks
The current makefile logic disables creation of the
SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
line, the rationale presumably being that the user wants and gets the
information on the console.
However, from general principles, I don't think a higher V= level
should affect which build artifacts get generated (and certainly
shouldn't produce fewer). Concretely, it's also a problem that when
doing a V=1 build in a terminal, the relevant HAB blocks lines easily
drown in all the other V=1 output.
Moreover, build systems such as Yocto by default pass V=1, so in that
case the information gets hidden away in the do_compile log file, making
it nigh impossible to create a recipe for creating signed U-boot images
- I don't want to disable V=1, because having verbose output in the log
file is valuable when things go wrong, but OTOH trying to go digging in
the do_compile log file (and getting exactly the right lines) is not
pleasant to even think about.
So change the logic so that for V=0, the mkimage output is redirected
to MKIMAGEOUTPUT (which is also the current behaviour), while for any
other value of V, we _additionally_ write the information to make's
stdout, whatever that might be.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Breno Lima <breno.lima@nxp.com>
2018-03-23 11:08:02 +00:00
|
|
|
>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
|
2012-10-16 13:06:06 +00:00
|
|
|
|
2018-08-27 10:27:15 +00:00
|
|
|
quiet_cmd_mkfitimage = MKIMAGE $@
|
|
|
|
cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(SPL_ITS) -E $@ \
|
|
|
|
$(if $(KBUILD_VERBOSE:1=), MKIMAGEOUTPUT)
|
|
|
|
|
2014-02-24 02:12:15 +00:00
|
|
|
MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)
|
|
|
|
|
|
|
|
MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE)
|
|
|
|
|
2016-02-05 08:55:13 +00:00
|
|
|
MLO MLO.byteswap: $(obj)/u-boot-spl.bin FORCE
|
2014-02-24 02:12:15 +00:00
|
|
|
$(call if_changed,mkimage)
|
2011-07-21 13:10:30 +00:00
|
|
|
|
2015-11-17 12:56:57 +00:00
|
|
|
ifeq ($(CONFIG_SYS_SOC),"at91")
|
2014-05-19 12:23:40 +00:00
|
|
|
MKIMAGEFLAGS_boot.bin = -T atmelimage
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
|
|
|
|
MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
|
|
|
|
|
2019-04-02 08:57:23 +00:00
|
|
|
$(obj)/boot.bin: $(obj)/../tools/atmel_pmecc_params
|
2014-05-19 12:23:40 +00:00
|
|
|
endif
|
|
|
|
|
2019-04-02 08:57:23 +00:00
|
|
|
$(obj)/boot.bin: $(obj)/u-boot-spl.bin FORCE
|
2014-05-19 12:23:40 +00:00
|
|
|
$(call if_changed,mkimage)
|
2015-11-17 12:56:57 +00:00
|
|
|
else
|
2016-04-27 12:03:29 +00:00
|
|
|
ifdef CONFIG_ARCH_ZYNQ
|
2016-09-20 09:37:24 +00:00
|
|
|
MKIMAGEFLAGS_boot.bin = -T zynqimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE)
|
2016-04-27 12:03:29 +00:00
|
|
|
endif
|
|
|
|
ifdef CONFIG_ARCH_ZYNQMP
|
arm64: zynqmp: accept an absolute path for PMUFW_INIT_FILE
The value of PMUFW_INIT_FILE is prefixed with "$(srctree)/", thus
forcing it to be a relative path inside the U-Boot source tree. Since
the PMUFW is a binary file generated outside of U-Boot, the PMUFW
binary must be copied inside the U-Boot source tree before the
build.
This generates a few problems:
* if the source tree is shared among different out-of-tree builds,
they will pollute (and potentially corrupt) each other
* the source tree cannot be read-only
* any buildsystem must add a command to copy the PMUFW binary
* putting an externally-generated binary in the source tree is ugly
as hell
Avoid these problems by accepting an absolute path for
PMUFW_INIT_FILE. This would be as simple as removing the "$(srctree)/"
prefix, but in order to keep backward compatibility we rather use the
shell and readlink to get the absolute path even when starting from a
relative path.
Since 'readlink -f' produces an empty string if the file does not
exist, we also add a check to ensure the file configured in
PMUFW_INIT_FILE exists. Otherwise the build would exit successfully,
but produce a boot.bin without PMUFW as if PMUFW_INIT_FILE were empty.
Tested in the 12 possible combinations of:
- PMUFW_INIT_FILE empty, relative, absolute, non-existing
- building in-tree, in subdir, in other directory
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Emmanuel Vadot <manu@bidouilliste.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-06-04 10:21:01 +00:00
|
|
|
ifneq ($(CONFIG_PMUFW_INIT_FILE),"")
|
|
|
|
spl/boot.bin: zynqmp-check-pmufw
|
|
|
|
zynqmp-check-pmufw: FORCE
|
|
|
|
( cd $(srctree) && test -r $(CONFIG_PMUFW_INIT_FILE) ) \
|
|
|
|
|| ( echo "Cannot read $(CONFIG_PMUFW_INIT_FILE)" && false )
|
|
|
|
endif
|
2016-10-21 10:58:17 +00:00
|
|
|
MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE) \
|
arm64: zynqmp: accept an absolute path for PMUFW_INIT_FILE
The value of PMUFW_INIT_FILE is prefixed with "$(srctree)/", thus
forcing it to be a relative path inside the U-Boot source tree. Since
the PMUFW is a binary file generated outside of U-Boot, the PMUFW
binary must be copied inside the U-Boot source tree before the
build.
This generates a few problems:
* if the source tree is shared among different out-of-tree builds,
they will pollute (and potentially corrupt) each other
* the source tree cannot be read-only
* any buildsystem must add a command to copy the PMUFW binary
* putting an externally-generated binary in the source tree is ugly
as hell
Avoid these problems by accepting an absolute path for
PMUFW_INIT_FILE. This would be as simple as removing the "$(srctree)/"
prefix, but in order to keep backward compatibility we rather use the
shell and readlink to get the absolute path even when starting from a
relative path.
Since 'readlink -f' produces an empty string if the file does not
exist, we also add a check to ensure the file configured in
PMUFW_INIT_FILE exists. Otherwise the build would exit successfully,
but produce a boot.bin without PMUFW as if PMUFW_INIT_FILE were empty.
Tested in the 12 possible combinations of:
- PMUFW_INIT_FILE empty, relative, absolute, non-existing
- building in-tree, in subdir, in other directory
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Emmanuel Vadot <manu@bidouilliste.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-06-04 10:21:01 +00:00
|
|
|
-n "$(shell cd $(srctree); readlink -f $(CONFIG_PMUFW_INIT_FILE))"
|
2016-04-27 12:03:29 +00:00
|
|
|
endif
|
2015-11-17 12:56:57 +00:00
|
|
|
|
2019-01-16 11:14:00 +00:00
|
|
|
$(obj)/$(SPL_BIN)-align.bin: $(obj)/$(SPL_BIN).bin
|
|
|
|
@dd if=$< of=$@ conv=block,sync bs=4 2>/dev/null;
|
|
|
|
|
|
|
|
spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE
|
2015-11-17 12:56:57 +00:00
|
|
|
$(call if_changed,mkimage)
|
|
|
|
endif
|
2014-05-19 12:23:40 +00:00
|
|
|
|
2020-10-26 02:38:30 +00:00
|
|
|
INPUTS-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).sym
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2011-08-18 22:37:20 +00:00
|
|
|
ifdef CONFIG_SAMSUNG
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-y += $(obj)/$(BOARD)-spl.bin
|
2011-08-18 22:37:20 +00:00
|
|
|
endif
|
|
|
|
|
2019-03-20 20:15:21 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_SOCFPGA_GEN5)$(CONFIG_TARGET_SOCFPGA_ARRIA10),)
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-y += $(obj)/$(SPL_BIN).sfp
|
2015-07-15 00:53:45 +00:00
|
|
|
endif
|
|
|
|
|
2016-10-13 08:49:35 +00:00
|
|
|
ifdef CONFIG_ARCH_SUNXI
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-y += $(obj)/sunxi-spl.bin
|
2017-02-27 17:22:13 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_NAND_SUNXI
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-y += $(obj)/sunxi-spl-with-ecc.bin
|
2017-02-27 17:22:13 +00:00
|
|
|
endif
|
2014-05-05 10:52:30 +00:00
|
|
|
endif
|
|
|
|
|
2014-10-30 08:59:59 +00:00
|
|
|
ifeq ($(CONFIG_SYS_SOC),"at91")
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-y += $(obj)/boot.bin
|
2014-10-30 08:59:59 +00:00
|
|
|
endif
|
|
|
|
|
2019-04-26 03:58:53 +00:00
|
|
|
ifdef CONFIG_TPL_BUILD
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \
|
2019-08-24 13:22:49 +00:00
|
|
|
$(obj)/u-boot-x86-reset16-tpl.bin
|
2019-04-26 03:58:53 +00:00
|
|
|
else
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \
|
2019-08-24 13:22:49 +00:00
|
|
|
$(obj)/u-boot-x86-reset16-spl.bin
|
2019-04-26 03:58:53 +00:00
|
|
|
endif
|
2017-01-16 14:04:03 +00:00
|
|
|
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin
|
|
|
|
INPUTS-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin
|
2016-04-27 12:03:29 +00:00
|
|
|
|
2020-07-19 19:56:01 +00:00
|
|
|
INPUTS-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin
|
2018-11-15 02:07:49 +00:00
|
|
|
|
2020-07-19 19:56:01 +00:00
|
|
|
all: $(INPUTS-y)
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2015-06-23 21:38:29 +00:00
|
|
|
quiet_cmd_cat = CAT $@
|
|
|
|
cmd_cat = cat $(filter-out $(PHONY), $^) > $@
|
|
|
|
|
2016-02-01 01:10:51 +00:00
|
|
|
quiet_cmd_copy = COPY $@
|
|
|
|
cmd_copy = cp $< $@
|
|
|
|
|
2017-09-15 10:57:32 +00:00
|
|
|
ifneq ($(CONFIG_SPL_MULTI_DTB_FIT),y)
|
|
|
|
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).dtb
|
|
|
|
else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_LZO),y)
|
|
|
|
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.lzo
|
|
|
|
else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_GZIP),y)
|
|
|
|
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.gz
|
|
|
|
else
|
|
|
|
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit
|
|
|
|
endif
|
|
|
|
|
2019-04-26 03:58:38 +00:00
|
|
|
# Build the .dtb file if:
|
|
|
|
# - we are not using OF_PLATDATA
|
|
|
|
# - we are using OF_CONTROL
|
|
|
|
# - we have either OF_SEPARATE or OF_HOSTFILE
|
|
|
|
build_dtb :=
|
|
|
|
ifeq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA),)
|
|
|
|
ifneq ($(CONFIG_$(SPL_TPL_)OF_CONTROL),)
|
|
|
|
ifeq ($(CONFIG_OF_SEPARATE)$(CONFIG_OF_HOSTFILE),y)
|
|
|
|
build_dtb := y
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2017-09-15 10:57:32 +00:00
|
|
|
|
2019-04-26 03:58:38 +00:00
|
|
|
ifneq ($(build_dtb),)
|
2017-01-16 14:03:34 +00:00
|
|
|
$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
|
|
|
|
$(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
|
2017-09-15 10:57:32 +00:00
|
|
|
$(FINAL_DTB_CONTAINER) FORCE
|
2015-06-23 21:38:29 +00:00
|
|
|
$(call if_changed,cat)
|
|
|
|
|
2016-02-01 01:10:51 +00:00
|
|
|
$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
|
|
|
|
$(call if_changed,copy)
|
|
|
|
else
|
|
|
|
$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
|
|
|
|
$(call if_changed,copy)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
|
2015-06-23 21:38:29 +00:00
|
|
|
$(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
|
|
|
|
@bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ {size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \
|
|
|
|
dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null;
|
|
|
|
|
2017-11-21 12:29:56 +00:00
|
|
|
$(obj)/$(SPL_BIN).dtb: dts/dt-spl.dtb FORCE
|
|
|
|
$(call if_changed,copy)
|
2015-06-23 21:38:29 +00:00
|
|
|
|
2017-10-17 04:42:43 +00:00
|
|
|
pythonpath = PYTHONPATH=scripts/dtc/pylibfdt
|
2016-07-04 17:58:10 +00:00
|
|
|
|
|
|
|
quiet_cmd_dtocc = DTOC C $@
|
|
|
|
cmd_dtocc = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ platdata
|
|
|
|
|
|
|
|
quiet_cmd_dtoch = DTOC H $@
|
|
|
|
cmd_dtoch = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ struct
|
|
|
|
|
|
|
|
quiet_cmd_plat = PLAT $@
|
2020-04-17 07:21:35 +00:00
|
|
|
cmd_plat = $(CC) $(c_flags) -c $< -o $(filter-out $(PHONY),$@)
|
2016-07-04 17:58:10 +00:00
|
|
|
|
2020-04-17 07:21:35 +00:00
|
|
|
targets += $(obj)/dts/dt-platdata.o
|
2017-08-29 20:16:00 +00:00
|
|
|
$(obj)/dts/dt-platdata.o: $(obj)/dts/dt-platdata.c \
|
2020-04-17 07:21:37 +00:00
|
|
|
include/generated/dt-structs-gen.h prepare FORCE
|
2016-07-04 17:58:10 +00:00
|
|
|
$(call if_changed,plat)
|
|
|
|
|
|
|
|
PHONY += dts_dir
|
|
|
|
dts_dir:
|
|
|
|
$(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
|
|
|
|
|
2017-10-17 04:42:44 +00:00
|
|
|
include/generated/dt-structs-gen.h: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
|
2016-07-04 17:58:10 +00:00
|
|
|
$(call if_changed,dtoch)
|
|
|
|
|
2017-10-17 04:42:44 +00:00
|
|
|
$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
|
2016-07-04 17:58:10 +00:00
|
|
|
$(call if_changed,dtocc)
|
|
|
|
|
2011-08-18 22:37:20 +00:00
|
|
|
ifdef CONFIG_SAMSUNG
|
2013-12-26 04:14:27 +00:00
|
|
|
ifdef CONFIG_VAR_SIZE_SPL
|
|
|
|
VAR_SIZE_PARAM = --vs
|
|
|
|
else
|
|
|
|
VAR_SIZE_PARAM =
|
|
|
|
endif
|
2014-02-04 08:24:24 +00:00
|
|
|
$(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin
|
2014-03-11 02:05:21 +00:00
|
|
|
$(if $(wildcard $(objtree)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
|
|
|
|
$(objtree)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
|
|
|
|
$(objtree)/tools/mkexynosspl) $(VAR_SIZE_PARAM) $< $@
|
2011-08-18 22:37:20 +00:00
|
|
|
endif
|
|
|
|
|
2014-02-24 02:12:14 +00:00
|
|
|
quiet_cmd_objcopy = OBJCOPY $@
|
|
|
|
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
|
|
|
|
2017-01-16 14:04:03 +00:00
|
|
|
OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary \
|
2019-04-26 03:58:53 +00:00
|
|
|
$(if $(CONFIG_$(SPL_TPL_)X86_16BIT_INIT),-R .start16 -R .resetvec)
|
2014-02-24 02:12:14 +00:00
|
|
|
|
2016-02-01 01:10:51 +00:00
|
|
|
$(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
|
2014-02-24 02:12:14 +00:00
|
|
|
$(call if_changed,objcopy)
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2019-08-24 13:22:49 +00:00
|
|
|
OBJCOPYFLAGS_u-boot-x86-start16-spl.bin := -O binary -j .start16
|
|
|
|
$(obj)/u-boot-x86-start16-spl.bin: $(obj)/u-boot-spl FORCE
|
2017-01-16 14:04:03 +00:00
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
2019-08-24 13:22:49 +00:00
|
|
|
OBJCOPYFLAGS_u-boot-x86-start16-tpl.bin := -O binary -j .start16
|
|
|
|
$(obj)/u-boot-x86-start16-tpl.bin: $(obj)/u-boot-tpl FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
|
|
OBJCOPYFLAGS_u-boot-x86-reset16-spl.bin := -O binary -j .resetvec
|
|
|
|
$(obj)/u-boot-x86-reset16-spl.bin: $(obj)/u-boot-spl FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
|
|
OBJCOPYFLAGS_u-boot-x86-reset16-tpl.bin := -O binary -j .resetvec
|
|
|
|
$(obj)/u-boot-x86-reset16-tpl.bin: $(obj)/u-boot-tpl FORCE
|
2019-04-26 03:58:53 +00:00
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
2014-02-04 08:24:24 +00:00
|
|
|
LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
|
2017-04-09 18:33:58 +00:00
|
|
|
|
|
|
|
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
|
|
|
|
LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker)
|
|
|
|
|
2019-01-22 22:09:24 +00:00
|
|
|
# Pick the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL)
|
2017-07-04 12:47:46 +00:00
|
|
|
ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),)
|
|
|
|
LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE)
|
|
|
|
endif
|
2014-02-04 08:24:22 +00:00
|
|
|
|
2018-04-15 13:21:09 +00:00
|
|
|
ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
|
|
|
|
MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage_v1
|
|
|
|
else
|
2016-02-01 01:10:53 +00:00
|
|
|
MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
|
2018-04-15 13:21:09 +00:00
|
|
|
endif
|
2016-02-01 01:10:53 +00:00
|
|
|
$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
|
2015-07-15 00:53:45 +00:00
|
|
|
$(call if_changed,mkimage)
|
|
|
|
|
2014-05-05 10:52:30 +00:00
|
|
|
quiet_cmd_mksunxiboot = MKSUNXI $@
|
2017-04-26 00:32:49 +00:00
|
|
|
cmd_mksunxiboot = $(objtree)/tools/mksunxiboot \
|
|
|
|
--default-dt $(CONFIG_DEFAULT_DEVICE_TREE) $< $@
|
2016-02-05 08:55:13 +00:00
|
|
|
$(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE
|
2014-05-05 10:52:30 +00:00
|
|
|
$(call if_changed,mksunxiboot)
|
|
|
|
|
2017-02-27 17:22:13 +00:00
|
|
|
quiet_cmd_sunxi_spl_image_builder = SUNXI_SPL_IMAGE_BUILDER $@
|
|
|
|
cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \
|
|
|
|
-c $(CONFIG_NAND_SUNXI_SPL_ECC_STRENGTH)/$(CONFIG_NAND_SUNXI_SPL_ECC_SIZE) \
|
|
|
|
-p $(CONFIG_SYS_NAND_PAGE_SIZE) \
|
|
|
|
-o $(CONFIG_SYS_NAND_OOBSIZE) \
|
|
|
|
-u $(CONFIG_NAND_SUNXI_SPL_USABLE_PAGE_SIZE) \
|
|
|
|
-e $(CONFIG_SYS_NAND_BLOCK_SIZE) \
|
|
|
|
-s -b $< $@
|
|
|
|
$(obj)/sunxi-spl-with-ecc.bin: $(obj)/sunxi-spl.bin
|
|
|
|
$(call if_changed,sunxi_spl_image_builder)
|
|
|
|
|
2018-11-15 02:07:49 +00:00
|
|
|
|
|
|
|
# MediaTek's specific SPL build
|
|
|
|
MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \
|
|
|
|
-a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) \
|
|
|
|
-n "$(patsubst "%",%,$(CONFIG_MTK_BROM_HEADER_INFO))"
|
|
|
|
|
|
|
|
$(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE
|
|
|
|
$(call if_changed,mkimage)
|
|
|
|
|
2020-10-26 02:38:30 +00:00
|
|
|
quiet_cmd_sym ?= SYM $@
|
|
|
|
cmd_sym ?= $(OBJDUMP) -t $< > $@
|
|
|
|
$(obj)/$(SPL_BIN).sym: $(obj)/$(SPL_BIN) FORCE
|
|
|
|
$(call if_changed,sym)
|
|
|
|
|
2016-07-04 17:57:44 +00:00
|
|
|
# Rule to link u-boot-spl
|
|
|
|
# May be overridden by arch/$(ARCH)/config.mk
|
|
|
|
quiet_cmd_u-boot-spl ?= LD $@
|
2020-03-27 15:46:27 +00:00
|
|
|
cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_$(@F)) \
|
2014-02-04 08:24:37 +00:00
|
|
|
$(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
|
2016-07-04 17:58:10 +00:00
|
|
|
$(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
|
|
|
|
$(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \
|
|
|
|
--end-group \
|
2014-10-23 16:30:44 +00:00
|
|
|
$(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN))
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2016-07-04 17:58:10 +00:00
|
|
|
$(obj)/$(SPL_BIN): $(u-boot-spl-platdata) $(u-boot-spl-init) \
|
|
|
|
$(u-boot-spl-main) $(obj)/u-boot-spl.lds FORCE
|
2014-10-23 16:30:44 +00:00
|
|
|
$(call if_changed,u-boot-spl)
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2014-02-04 08:24:37 +00:00
|
|
|
$(sort $(u-boot-spl-init) $(u-boot-spl-main)): $(u-boot-spl-dirs) ;
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2014-02-04 08:24:37 +00:00
|
|
|
PHONY += $(u-boot-spl-dirs)
|
2020-04-17 07:21:37 +00:00
|
|
|
$(u-boot-spl-dirs): $(u-boot-spl-platdata) prepare
|
2014-02-04 08:24:37 +00:00
|
|
|
$(Q)$(MAKE) $(build)=$@
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2020-04-17 07:21:37 +00:00
|
|
|
PHONY += prepare
|
|
|
|
prepare:
|
|
|
|
$(Q)$(MAKE) $(build)=$(obj)/.
|
|
|
|
|
2014-02-24 02:12:19 +00:00
|
|
|
quiet_cmd_cpp_lds = LDS $@
|
2014-04-09 11:10:43 +00:00
|
|
|
cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
|
2018-10-01 18:22:43 +00:00
|
|
|
-D__ASSEMBLY__ -x assembler-with-cpp -std=c99 -P -o $@ $<
|
2014-02-24 02:12:19 +00:00
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
$(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
|
2014-04-09 11:10:43 +00:00
|
|
|
$(call if_changed_dep,cpp_lds)
|
2011-07-18 07:48:07 +00:00
|
|
|
|
2014-02-24 02:12:14 +00:00
|
|
|
# read all saved command lines
|
|
|
|
|
|
|
|
targets := $(wildcard $(sort $(targets)))
|
|
|
|
cmd_files := $(wildcard $(obj)/.*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
|
|
|
|
|
|
|
|
ifneq ($(cmd_files),)
|
|
|
|
$(cmd_files): ; # Do not try to update included dependency files
|
|
|
|
include $(cmd_files)
|
|
|
|
endif
|
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
PHONY += FORCE
|
|
|
|
FORCE:
|
|
|
|
|
2017-09-15 10:57:32 +00:00
|
|
|
PHONY += dtbs
|
|
|
|
dtbs:
|
|
|
|
$(Q)$(MAKE) $(build)=dts dtbs
|
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
# Declare the contents of the .PHONY variable as phony. We keep that
|
|
|
|
# information in a variable so we can use it in if_changed and friends.
|
|
|
|
.PHONY: $(PHONY)
|
2017-09-15 10:57:32 +00:00
|
|
|
|
2020-05-04 12:38:31 +00:00
|
|
|
SPL_OF_LIST_TARGETS = $(patsubst %,dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST)))
|
|
|
|
SHRUNK_ARCH_DTB = $(addprefix $(obj)/,$(SPL_OF_LIST_TARGETS))
|
2017-09-15 10:57:32 +00:00
|
|
|
.SECONDEXPANSION:
|
2020-05-04 12:38:30 +00:00
|
|
|
$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@) dts_dir
|
2017-09-15 10:57:32 +00:00
|
|
|
$(call if_changed,fdtgrep)
|
|
|
|
|
2020-05-04 12:38:31 +00:00
|
|
|
targets += $(SPL_OF_LIST_TARGETS)
|
|
|
|
|
2017-09-15 10:57:32 +00:00
|
|
|
MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
|
|
|
|
-n "Multi DTB fit image for $(SPL_BIN)" -E \
|
|
|
|
$(patsubst %,-b %,$(SHRUNK_ARCH_DTB))
|
|
|
|
|
|
|
|
$(obj)/$(SPL_BIN).multidtb.fit: /dev/null $(SHRUNK_ARCH_DTB) FORCE
|
|
|
|
$(call if_changed,mkimage)
|
2018-06-03 19:26:57 +00:00
|
|
|
ifneq ($(SOURCE_DATE_EPOCH),)
|
|
|
|
touch -d @$(SOURCE_DATE_EPOCH) $(obj)/$(SPL_BIN).multidtb.fit
|
|
|
|
chmod 0600 $(obj)/$(SPL_BIN).multidtb.fit
|
|
|
|
endif
|
2017-09-15 10:57:32 +00:00
|
|
|
|
|
|
|
$(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit
|
|
|
|
@gzip -kf9 $< > $@
|
|
|
|
|
|
|
|
$(obj)/$(SPL_BIN).multidtb.fit.lzo: $(obj)/$(SPL_BIN).multidtb.fit
|
|
|
|
@lzop -f9 $< > $@
|
2018-08-27 10:27:15 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_ARCH_K3
|
|
|
|
tispl.bin: $(obj)/u-boot-spl-nodtb.bin $(SHRUNK_ARCH_DTB) $(SPL_ITS) FORCE
|
|
|
|
$(call if_changed,mkfitimage)
|
|
|
|
endif
|