2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2000-2006
|
2002-07-20 20:14:13 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2010-01-21 09:03:22 +00:00
|
|
|
# Enable all the config-independent tools
|
|
|
|
ifneq ($(HOST_TOOLS_ALL),)
|
2018-03-13 13:23:04 +00:00
|
|
|
CONFIG_KIRKWOOD = y
|
2010-01-21 09:03:22 +00:00
|
|
|
CONFIG_LCD_LOGO = y
|
2010-08-15 04:03:19 +00:00
|
|
|
CONFIG_CMD_LOADS = y
|
2010-01-21 09:03:22 +00:00
|
|
|
CONFIG_CMD_NET = y
|
2011-07-27 11:22:36 +00:00
|
|
|
CONFIG_XWAY_SWAP_BYTES = y
|
2010-01-21 09:03:22 +00:00
|
|
|
CONFIG_NETCONSOLE = y
|
|
|
|
CONFIG_SHA1_CHECK_UB_IMG = y
|
2016-11-10 12:13:23 +00:00
|
|
|
CONFIG_ARCH_SUNXI = y
|
2010-01-21 09:03:22 +00:00
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:39 +00:00
|
|
|
subdir-$(HOST_TOOLS_ALL) += gdb
|
|
|
|
|
2011-06-19 08:27:39 +00:00
|
|
|
# Merge all the different vars for envcrc into one
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
|
|
|
|
CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params
|
2014-05-19 12:23:40 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo
|
|
|
|
hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo
|
|
|
|
HOSTCFLAGS_bmp_logo.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc
|
2017-08-03 18:21:49 +00:00
|
|
|
envcrc-objs := envcrc.o lib/crc32.o env/embedded.o lib/sha1.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr
|
|
|
|
HOSTCFLAGS_gen_eth_addr.o := -pedantic
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2016-11-25 15:30:32 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_NET) += gen_ethaddr_crc
|
|
|
|
gen_ethaddr_crc-objs := gen_ethaddr_crc.o lib/crc8.o
|
|
|
|
HOSTCFLAGS_gen_ethaddr_crc.o := -pedantic
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_LOADS) += img2srec
|
|
|
|
HOSTCFLAGS_img2srec.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes
|
|
|
|
HOSTCFLAGS_xway-swap-bytes.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += mkenvimage
|
|
|
|
mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += dumpimage mkimage
|
|
|
|
hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
|
2014-02-04 08:24:10 +00:00
|
|
|
|
tools: provide a tool to convert a binary file to an include
For testing EFI disk management we need an in-memory image of
a disk.
The tool file2include converts a file to a C include. The file
is separated into strings of 8 bytes. Only the non-zero strings
are written to the include. The output format has been designed
to maintain readability.
#define EFI_ST_DISK_IMG { 0x00010000, { \
{0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \
{0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \
{0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \
...
{0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \
{0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \
{0, NULL} } }
As the disk image needed for testing contains mostly zeroes a high
compression ratio can be attained.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-17 19:16:09 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_BOOTEFI_SELFTEST) += file2include
|
|
|
|
|
2019-05-03 20:37:05 +00:00
|
|
|
FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
|
2020-02-21 06:12:55 +00:00
|
|
|
FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o common/image-fit-sig.o
|
2019-12-18 17:25:41 +00:00
|
|
|
FIT_CIPHER_OBJS-$(CONFIG_FIT_CIPHER) := common/image-cipher.o
|
2017-05-27 13:38:19 +00:00
|
|
|
|
2017-10-17 13:30:18 +00:00
|
|
|
# The following files are synced with upstream DTC.
|
|
|
|
# Use synced versions from scripts/dtc/libfdt/.
|
2020-04-16 09:30:17 +00:00
|
|
|
LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \
|
|
|
|
fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o)
|
2017-05-27 13:38:17 +00:00
|
|
|
|
2014-06-06 05:04:32 +00:00
|
|
|
RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
|
2015-01-23 10:31:50 +00:00
|
|
|
rsa-sign.o rsa-verify.o rsa-checksum.o \
|
|
|
|
rsa-mod-exp.o)
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2019-12-18 17:25:41 +00:00
|
|
|
AES_OBJS-$(CONFIG_FIT_CIPHER) := $(addprefix lib/aes/, \
|
2019-12-18 17:25:42 +00:00
|
|
|
aes-encrypt.o aes-decrypt.o)
|
2019-12-18 17:25:41 +00:00
|
|
|
|
2015-12-29 12:22:43 +00:00
|
|
|
ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
|
2015-08-30 22:55:24 +00:00
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
# common objs for dumpimage and mkimage
|
|
|
|
dumpimage-mkimage-objs := aisimage.o \
|
2014-05-19 12:23:39 +00:00
|
|
|
atmelimage.o \
|
2019-05-03 20:37:05 +00:00
|
|
|
$(FIT_OBJS-y) \
|
2014-02-04 08:24:10 +00:00
|
|
|
$(FIT_SIG_OBJS-y) \
|
2019-12-18 17:25:41 +00:00
|
|
|
$(FIT_CIPHER_OBJS-y) \
|
2020-04-16 09:30:17 +00:00
|
|
|
common/fdt_region.o \
|
2014-06-12 13:24:51 +00:00
|
|
|
common/bootm.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/crc32.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
default_image.o \
|
2014-06-22 04:33:29 +00:00
|
|
|
lib/fdtdec_common.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/fdtdec.o \
|
|
|
|
common/image.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
imagetool.o \
|
|
|
|
imximage.o \
|
2018-10-16 04:50:30 +00:00
|
|
|
imx8image.o \
|
2018-11-20 10:19:36 +00:00
|
|
|
imx8mimage.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
kwbimage.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/md5.o \
|
2015-03-31 09:40:49 +00:00
|
|
|
lpc32xximage.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
mxsimage.o \
|
|
|
|
omapimage.o \
|
|
|
|
os_support.o \
|
|
|
|
pblimage.o \
|
2014-05-14 02:45:00 +00:00
|
|
|
pbl_crc32.o \
|
2016-09-26 07:08:06 +00:00
|
|
|
vybridimage.o \
|
2018-03-12 09:46:04 +00:00
|
|
|
stm32image.o \
|
2015-08-30 22:55:24 +00:00
|
|
|
$(ROCKCHIP_OBS) \
|
2014-03-06 02:40:50 +00:00
|
|
|
socfpgaimage.o \
|
2018-11-25 18:22:19 +00:00
|
|
|
lib/crc16.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/sha1.o \
|
|
|
|
lib/sha256.o \
|
2015-01-23 10:31:58 +00:00
|
|
|
common/hash.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
ublimage.o \
|
2015-11-17 12:56:56 +00:00
|
|
|
zynqimage.o \
|
2016-04-27 12:03:29 +00:00
|
|
|
zynqmpimage.o \
|
2018-04-13 12:18:52 +00:00
|
|
|
zynqmpbif.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
$(LIBFDT_OBJS) \
|
2016-07-11 14:09:48 +00:00
|
|
|
gpimage.o \
|
|
|
|
gpimage-common.o \
|
2018-11-15 02:07:49 +00:00
|
|
|
mtk_image.o \
|
2019-12-18 17:25:41 +00:00
|
|
|
$(RSA_OBJS-y) \
|
|
|
|
$(AES_OBJS-y)
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o
|
|
|
|
mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o
|
|
|
|
fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o
|
|
|
|
fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o
|
tools: provide a tool to convert a binary file to an include
For testing EFI disk management we need an in-memory image of
a disk.
The tool file2include converts a file to a C include. The file
is separated into strings of 8 bytes. Only the non-zero strings
are written to the include. The output format has been designed
to maintain readability.
#define EFI_ST_DISK_IMG { 0x00010000, { \
{0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \
{0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \
{0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \
...
{0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \
{0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \
{0, NULL} } }
As the disk image needed for testing contains mostly zeroes a high
compression ratio can be attained.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-17 19:16:09 +00:00
|
|
|
file2include-objs := file2include.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2018-12-08 00:00:41 +00:00
|
|
|
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),)
|
2014-02-04 08:24:10 +00:00
|
|
|
# Add CONFIG_MXS into host CFLAGS, so we can check whether or not register
|
|
|
|
# the mxsimage support within tools/mxsimage.c .
|
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
|
|
|
HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS
|
2014-02-04 08:24:10 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_FIT_SIGNATURE
|
|
|
|
# This affects include/image.h, but including the board config file
|
|
|
|
# is tricky, so manually define this options here.
|
|
|
|
HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE
|
2018-06-09 15:38:05 +00:00
|
|
|
HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=$(CONFIG_FIT_SIGNATURE_MAX_SIZE)
|
2014-02-04 08:24:10 +00:00
|
|
|
endif
|
|
|
|
|
2019-12-18 17:25:41 +00:00
|
|
|
ifdef CONFIG_FIT_CIPHER
|
|
|
|
# This affects include/image.h, but including the board config file
|
|
|
|
# is tricky, so manually define this options here.
|
|
|
|
HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER
|
|
|
|
endif
|
|
|
|
|
2015-07-20 09:20:38 +00:00
|
|
|
ifdef CONFIG_SYS_U_BOOT_OFFS
|
|
|
|
HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS)
|
2015-02-07 12:03:00 +00:00
|
|
|
endif
|
|
|
|
|
2017-01-11 15:01:00 +00:00
|
|
|
ifneq ($(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
|
|
|
|
HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE
|
|
|
|
endif
|
|
|
|
|
2014-06-05 07:41:49 +00:00
|
|
|
# MXSImage needs LibSSL
|
2017-01-11 15:01:00 +00:00
|
|
|
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)
|
2019-04-10 22:58:49 +00:00
|
|
|
HOSTCFLAGS_kwbimage.o += \
|
|
|
|
$(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
|
2020-03-27 15:46:27 +00:00
|
|
|
HOSTLDLIBS_mkimage += \
|
2015-05-16 16:36:15 +00:00
|
|
|
$(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")
|
2016-02-16 22:29:28 +00:00
|
|
|
|
|
|
|
# OS X deprecate openssl in favour of CommonCrypto, supress deprecation
|
|
|
|
# warnings on those systems
|
|
|
|
ifeq ($(HOSTOS),darwin)
|
|
|
|
HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations
|
|
|
|
HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations
|
|
|
|
HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
|
|
|
|
endif
|
2014-06-05 07:41:49 +00:00
|
|
|
endif
|
|
|
|
|
2017-09-24 03:14:33 +00:00
|
|
|
HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\"
|
2017-06-25 07:43:33 +00:00
|
|
|
|
2020-03-27 15:46:27 +00:00
|
|
|
HOSTLDLIBS_dumpimage := $(HOSTLDLIBS_mkimage)
|
|
|
|
HOSTLDLIBS_fit_info := $(HOSTLDLIBS_mkimage)
|
|
|
|
HOSTLDLIBS_fit_check_sign := $(HOSTLDLIBS_mkimage)
|
2014-06-05 07:41:49 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl
|
|
|
|
hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
|
|
|
|
HOSTCFLAGS_mkexynosspl.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-12-16 05:02:38 +00:00
|
|
|
ifdtool-objs := $(LIBFDT_OBJS) ifdtool.o
|
2014-11-11 01:00:22 +00:00
|
|
|
hostprogs-$(CONFIG_X86) += ifdtool
|
|
|
|
|
2019-07-08 19:18:20 +00:00
|
|
|
ifwitool-objs := ifwitool.o
|
|
|
|
hostprogs-$(CONFIG_X86)$(CONFIG_SANDBOX) += ifwitool
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_MX23) += mxsboot
|
|
|
|
hostprogs-$(CONFIG_MX28) += mxsboot
|
|
|
|
HOSTCFLAGS_mxsboot.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2016-10-13 08:49:35 +00:00
|
|
|
hostprogs-$(CONFIG_ARCH_SUNXI) += mksunxiboot
|
2017-02-27 17:22:02 +00:00
|
|
|
hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder
|
|
|
|
sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o
|
2014-05-05 10:52:30 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_NETCONSOLE) += ncb
|
|
|
|
hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
ubsha1-objs := os_support.o ubsha1.o lib/sha1.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
|
|
|
HOSTCFLAGS_ubsha1.o := -pedantic
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_KIRKWOOD) += kwboot
|
2015-12-21 12:56:33 +00:00
|
|
|
hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += proftool
|
|
|
|
hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela
|
2017-12-26 05:55:56 +00:00
|
|
|
hostprogs-$(CONFIG_RISCV) += prelink-riscv
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2015-06-23 21:38:28 +00:00
|
|
|
hostprogs-y += fdtgrep
|
2020-04-16 09:30:17 +00:00
|
|
|
fdtgrep-objs += $(LIBFDT_OBJS) common/fdt_region.o fdtgrep.o
|
2015-06-23 21:38:28 +00:00
|
|
|
|
2019-05-24 20:07:04 +00:00
|
|
|
ifneq ($(TOOLS_ONLY),y)
|
|
|
|
hostprogs-y += spl_size_limit
|
|
|
|
endif
|
|
|
|
|
MIPS: Stop building position independent code
U-Boot has up until now built with -fpic for the MIPS architecture,
producing position independent code which uses indirection through a
global offset table, making relocation fairly straightforward as it
simply involves patching up GOT entries.
Using -fpic does however have some downsides. The biggest of these is
that generated code is bloated in various ways. For example, function
calls are indirected through the GOT & the t9 register:
8f998064 lw t9,-32668(gp)
0320f809 jalr t9
Without -fpic the call is simply:
0f803f01 jal be00fc04 <puts>
This is more compact & faster (due to the lack of the load & the
dependency the jump has on its result). It is also easier to read &
debug because the disassembly shows what function is being called,
rather than just an offset from gp which would then have to be looked up
in the ELF to discover the target function.
Another disadvantage of -fpic is that each function begins with a
sequence to calculate the value of the gp register, for example:
3c1c0004 lui gp,0x4
279c3384 addiu gp,gp,13188
0399e021 addu gp,gp,t9
Without using -fpic this sequence no longer appears at the start of each
function, reducing code size considerably.
This patch switches U-Boot from building with -fpic to building with
-fno-pic, in order to gain the benefits described above. The cost of
this is an extra step during the build process to extract relocation
data from the ELF & write it into a new .rel section in a compact
format, plus the added complexity of dealing with multiple types of
relocation rather than the single type that applied to the GOT. The
benefit is smaller, cleaner, more debuggable code. The relocate_code()
function is reimplemented in C to handle the new relocation scheme,
which also makes it easier to read & debug.
Taking maltael_defconfig as an example the size of u-boot.bin built
using the Codescape MIPS 2016.05-06 toolchain (gcc 4.9.2, binutils
2.24.90) shrinks from 254KiB to 224KiB.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: u-boot@lists.denx.de
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2017-06-19 18:53:47 +00:00
|
|
|
hostprogs-$(CONFIG_MIPS) += mips-relocs
|
|
|
|
|
2019-11-13 00:44:53 +00:00
|
|
|
hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler
|
|
|
|
HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include
|
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
# We build some files with extra pedantic flags to try to minimize things
|
|
|
|
# that won't build on some weird host compiler -- though there are lots of
|
|
|
|
# exceptions for files that aren't complaint.
|
|
|
|
HOSTCFLAGS_crc32.o := -pedantic
|
2016-11-25 15:30:31 +00:00
|
|
|
HOSTCFLAGS_crc8.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
HOSTCFLAGS_md5.o := -pedantic
|
|
|
|
HOSTCFLAGS_sha1.o := -pedantic
|
2014-03-03 11:19:25 +00:00
|
|
|
HOSTCFLAGS_sha256.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 05:04:32 +00:00
|
|
|
quiet_cmd_wrap = WRAP $@
|
2014-10-30 02:06:11 +00:00
|
|
|
cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@
|
2014-06-06 05:04:32 +00:00
|
|
|
|
2017-08-03 18:21:49 +00:00
|
|
|
$(obj)/lib/%.c $(obj)/common/%.c $(obj)/env/%.c:
|
2014-06-06 05:04:32 +00:00
|
|
|
$(call cmd,wrap)
|
|
|
|
|
|
|
|
clean-dirs := lib common
|
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
always := $(hostprogs-y)
|
2013-06-13 22:10:02 +00:00
|
|
|
|
2009-03-13 23:54:35 +00:00
|
|
|
# Generated LCD/video logo
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_H = $(objtree)/include/bmp_logo.h
|
|
|
|
LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
|
2009-03-13 23:54:35 +00:00
|
|
|
LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H)
|
2011-10-20 23:04:20 +00:00
|
|
|
LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_DATA_H)
|
2009-03-13 23:54:35 +00:00
|
|
|
LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H)
|
2011-10-20 23:04:20 +00:00
|
|
|
LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_DATA_H)
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2013-05-27 12:18:43 +00:00
|
|
|
# Generic logo
|
2009-03-13 23:54:34 +00:00
|
|
|
ifeq ($(LOGO_BMP),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp
|
2013-05-27 12:18:43 +00:00
|
|
|
|
|
|
|
# Use board logo and fallback to vendor
|
2014-03-03 09:40:56 +00:00
|
|
|
ifneq ($(wildcard $(srctree)/$(src)/logos/$(BOARD).bmp),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/$(BOARD).bmp
|
2013-05-27 12:18:43 +00:00
|
|
|
else
|
2014-03-03 09:40:56 +00:00
|
|
|
ifneq ($(wildcard $(srctree)/$(src)/logos/$(VENDOR).bmp),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/$(VENDOR).bmp
|
2009-03-13 23:54:34 +00:00
|
|
|
endif
|
2011-07-16 10:26:50 +00:00
|
|
|
endif
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2013-05-27 12:18:43 +00:00
|
|
|
endif # !LOGO_BMP
|
|
|
|
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
|
|
|
# Use native tools and options
|
2009-03-13 23:54:51 +00:00
|
|
|
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
|
2013-07-30 22:26:11 +00:00
|
|
|
# Define _GNU_SOURCE to obtain the getline prototype from stdio.h
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
2018-01-21 10:19:18 +00:00
|
|
|
HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
|
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
|
|
|
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
2018-03-02 22:13:42 +00:00
|
|
|
-I$(srctree)/scripts/dtc/libfdt \
|
2014-03-11 02:05:20 +00:00
|
|
|
-I$(srctree)/tools \
|
2010-10-07 19:51:12 +00:00
|
|
|
-DUSE_HOSTCC \
|
2013-07-30 22:26:11 +00:00
|
|
|
-D__KERNEL_STRICT_NAMES \
|
2019-03-30 14:29:23 +00:00
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-std=gnu99
|
2008-02-29 15:00:24 +00:00
|
|
|
|
2017-01-30 02:12:08 +00:00
|
|
|
__build: $(LOGO-y)
|
2002-07-20 20:14:13 +00:00
|
|
|
|
2014-02-04 08:24:24 +00:00
|
|
|
$(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
|
|
|
|
$(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@
|
2011-10-20 23:04:20 +00:00
|
|
|
|
2019-06-13 03:12:38 +00:00
|
|
|
ifeq ($(CONFIG_DM_VIDEO),y)
|
|
|
|
$(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP)
|
|
|
|
$(obj)/bmp_logo --gen-bmp $(LOGO_BMP) > $@
|
|
|
|
else
|
2014-02-04 08:24:24 +00:00
|
|
|
$(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP)
|
|
|
|
$(obj)/bmp_logo --gen-data $(LOGO_BMP) > $@
|
2019-06-13 03:12:38 +00:00
|
|
|
#endif
|
|
|
|
endif
|
2014-02-04 08:24:39 +00:00
|
|
|
|
|
|
|
# Let clean descend into subdirs
|
|
|
|
subdir- += env
|
2014-03-03 02:06:19 +00:00
|
|
|
|
|
|
|
ifneq ($(CROSS_BUILD_TOOLS),)
|
2017-03-13 08:43:16 +00:00
|
|
|
override HOSTCC = $(CC)
|
2019-05-01 13:08:25 +00:00
|
|
|
override HOSTCFLAGS = $(CFLAGS)
|
2014-03-03 02:06:19 +00:00
|
|
|
|
|
|
|
quiet_cmd_crosstools_strip = STRIP $^
|
|
|
|
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
|
|
|
$(obj)/.strip: $(call objectify,$(filter $(always),$(hostprogs-y)))
|
|
|
|
$(call cmd,crosstools_strip)
|
|
|
|
|
|
|
|
always += .strip
|
|
|
|
endif
|
|
|
|
clean-files += .strip
|