2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2016-05-20 00:10:45 +00:00
|
|
|
#
|
2023-11-01 20:56:03 +00:00
|
|
|
# Copyright (C) 2016, Texas Instruments, Incorporated - https://www.ti.com/
|
2017-01-06 22:20:02 +00:00
|
|
|
quiet_cmd_mkomapsecimg = SECURE $@
|
2016-05-20 00:10:45 +00:00
|
|
|
ifneq ($(TI_SECURE_DEV_PKG),)
|
|
|
|
ifneq ($(wildcard $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh),)
|
|
|
|
ifneq ($(CONFIG_SPL_BUILD),)
|
|
|
|
cmd_mkomapsecimg = $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh \
|
2022-07-15 17:31:48 +00:00
|
|
|
$(patsubst u-boot-spl_HS_%,%,$(@F)) $< $@ $(CONFIG_SPL_TEXT_BASE) \
|
2016-05-20 00:10:45 +00:00
|
|
|
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
|
|
|
else
|
|
|
|
cmd_mkomapsecimg = $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh \
|
2022-10-21 00:22:39 +00:00
|
|
|
$(patsubst u-boot_HS_%,%,$(@F)) $< $@ $(CONFIG_TEXT_BASE) \
|
2016-06-27 14:19:20 +00:00
|
|
|
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
2016-05-20 00:10:45 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
cmd_mkomapsecimg = echo "WARNING:" \
|
|
|
|
"$(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh not found." \
|
2017-01-06 22:20:02 +00:00
|
|
|
"$@ was NOT secured!"; cp $< $@
|
2016-05-20 00:10:45 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
cmd_mkomapsecimg = echo "WARNING: TI_SECURE_DEV_PKG environment" \
|
2017-01-06 22:20:02 +00:00
|
|
|
"variable must be defined for TI secure devices. \
|
|
|
|
$@ was NOT secured!"; cp $< $@
|
2016-05-20 00:10:45 +00:00
|
|
|
endif
|
|
|
|
|
2016-06-27 14:19:20 +00:00
|
|
|
ifdef CONFIG_SPL_LOAD_FIT
|
|
|
|
quiet_cmd_omapsecureimg = SECURE $@
|
|
|
|
ifneq ($(TI_SECURE_DEV_PKG),)
|
|
|
|
ifneq ($(wildcard $(TI_SECURE_DEV_PKG)/scripts/secure-binary-image.sh),)
|
|
|
|
cmd_omapsecureimg = $(TI_SECURE_DEV_PKG)/scripts/secure-binary-image.sh \
|
|
|
|
$< $@ \
|
|
|
|
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
|
|
|
else
|
|
|
|
cmd_omapsecureimg = echo "WARNING:" \
|
|
|
|
"$(TI_SECURE_DEV_PKG)/scripts/secure-binary-image.sh not found." \
|
2017-01-06 22:20:02 +00:00
|
|
|
"$@ was NOT secured!"; cp $< $@
|
2016-06-27 14:19:20 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
cmd_omapsecureimg = echo "WARNING: TI_SECURE_DEV_PKG environment" \
|
|
|
|
"variable must be defined for TI secure devices." \
|
2017-01-06 22:20:02 +00:00
|
|
|
"$@ was NOT secured!"; cp $< $@
|
2016-06-27 14:19:20 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2016-05-20 00:10:45 +00:00
|
|
|
# Standard X-LOADER target (QPSI, NOR flash)
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_X-LOADER: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
|
|
|
|
2016-06-27 14:19:20 +00:00
|
|
|
# For MLO targets (SD card boot) the final file name that is copied to the SD
|
|
|
|
# card FAT partition must be MLO, so we make a copy of the output file to a new
|
|
|
|
# file with that name
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_MLO: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
|
|
|
@if [ -f $@ ]; then \
|
|
|
|
cp -f $@ MLO; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Standard 2ND target (certain peripheral boot modes)
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_2ND: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
|
|
|
|
|
|
|
# Standard ULO target (certain peripheral boot modes)
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_ULO: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
|
|
|
|
2017-06-13 20:04:59 +00:00
|
|
|
# Standard ISSW target (certain devices, various boot modes), when copied to
|
|
|
|
# an SD card FAT partition this file must be called "MLO", we make a copy with
|
|
|
|
# this name to make this clear
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_ISSW: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
2017-06-13 20:04:59 +00:00
|
|
|
@if [ -f $@ ]; then \
|
|
|
|
cp -f $@ MLO; \
|
|
|
|
fi
|
2016-05-20 00:10:45 +00:00
|
|
|
|
2016-06-27 14:19:20 +00:00
|
|
|
# For SPI flash on AM335x and AM43xx, these require special byte swap handling
|
|
|
|
# so we use the SPI_X-LOADER target instead of X-LOADER and let the
|
|
|
|
# create-boot-image.sh script handle that
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-spl_HS_SPI_X-LOADER: $(obj)/u-boot-spl.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
|
|
|
|
2017-04-07 15:00:05 +00:00
|
|
|
# For supporting single stage boot on keystone, the image is a full u-boot
|
|
|
|
# file, not an SPL. This will work for all boot devices, other than SPI
|
2017-06-13 20:04:59 +00:00
|
|
|
# flash. On Keystone devices when booting from an SD card FAT partition this
|
|
|
|
# file must be called "MLO"
|
2017-04-07 15:00:05 +00:00
|
|
|
u-boot_HS_MLO: $(obj)/u-boot.bin
|
|
|
|
$(call if_changed,mkomapsecimg)
|
2017-06-13 20:04:59 +00:00
|
|
|
@if [ -f $@ ]; then \
|
|
|
|
cp -f $@ MLO; \
|
|
|
|
fi
|
2017-04-07 15:00:05 +00:00
|
|
|
|
2016-06-27 14:19:20 +00:00
|
|
|
# For supporting single stage XiP QSPI on AM43xx, the image is a full u-boot
|
|
|
|
# file, not an SPL. In this case the mkomapsecimg command looks for a
|
|
|
|
# u-boot-HS_* prefix
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot_HS_XIP_X-LOADER: $(obj)/u-boot.bin FORCE
|
2016-05-20 00:10:45 +00:00
|
|
|
$(call if_changed,mkomapsecimg)
|
2016-06-27 14:19:20 +00:00
|
|
|
|
|
|
|
# For supporting the SPL loading and interpreting of FIT images whose
|
|
|
|
# components are pre-processed before being integrated into the FIT image in
|
|
|
|
# order to secure them in some way
|
|
|
|
ifdef CONFIG_SPL_LOAD_FIT
|
|
|
|
|
|
|
|
MKIMAGEFLAGS_u-boot_HS.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
|
2023-08-25 01:59:48 +00:00
|
|
|
-a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
|
2016-06-27 14:19:20 +00:00
|
|
|
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
|
2017-01-06 22:20:02 +00:00
|
|
|
$(patsubst %,-b arch/$(ARCH)/dts/%.dtb_HS,$(subst ",,$(CONFIG_OF_LIST)))
|
2016-06-27 14:19:20 +00:00
|
|
|
|
|
|
|
OF_LIST_TARGETS = $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST)))
|
|
|
|
$(OF_LIST_TARGETS): dtbs
|
|
|
|
|
2017-01-06 22:20:02 +00:00
|
|
|
%.dtb_HS: %.dtb FORCE
|
2016-06-27 14:19:20 +00:00
|
|
|
$(call if_changed,omapsecureimg)
|
|
|
|
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot-nodtb_HS.bin: u-boot-nodtb.bin FORCE
|
2016-06-27 14:19:20 +00:00
|
|
|
$(call if_changed,omapsecureimg)
|
|
|
|
|
2017-01-06 22:20:02 +00:00
|
|
|
u-boot_HS.img: u-boot-nodtb_HS.bin u-boot.img $(patsubst %.dtb,%.dtb_HS,$(OF_LIST_TARGETS)) FORCE
|
2016-06-27 14:19:20 +00:00
|
|
|
$(call if_changed,mkimage)
|
|
|
|
$(Q)if [ -f $@ ]; then \
|
|
|
|
cp -f $@ u-boot.img; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
endif
|