blob: c7bb101be8e96fd966101cfa7bf3a03884ca74b8 [file] [log] [blame]
Daniel Allred635173a2016-05-19 19:10:45 -05001#
2# Copyright (C) 2016, Texas Instruments, Incorporated - http://www.ti.com/
3#
4# SPDX-License-Identifier: GPL-2.0+
5#
6quiet_cmd_mkomapsecimg = MKIMAGE $@
7ifneq ($(TI_SECURE_DEV_PKG),)
8ifneq ($(wildcard $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh),)
9ifneq ($(CONFIG_SPL_BUILD),)
10cmd_mkomapsecimg = $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh \
11 $(patsubst u-boot-spl_HS_%,%,$(@F)) $< $@ $(CONFIG_ISW_ENTRY_ADDR) \
12 $(if $(KBUILD_VERBOSE:1=), >/dev/null)
13else
14cmd_mkomapsecimg = $(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh \
15 $(patsubst u-boot_HS_%,%,$(@F)) $< $@ $(CONFIG_ISW_ENTRY_ADDR) \
16 $(if $(KBUILD_VERBOSE:1=), >/dev/null)
17endif
18else
19cmd_mkomapsecimg = echo "WARNING:" \
20 "$(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh not found." \
21 "$@ was NOT created!"
22endif
23else
24cmd_mkomapsecimg = echo "WARNING: TI_SECURE_DEV_PKG environment" \
25 "variable must be defined for TI secure devices. $@ was NOT created!"
26endif
27
28# Standard X-LOADER target (QPSI, NOR flash)
29u-boot-spl_HS_X-LOADER: $(obj)/u-boot-spl.bin
30 $(call if_changed,mkomapsecimg)
31
32# For MLO targets (SD card boot) the final file name
33# that is copied to the SD card fAT partition must
34# be MLO, so we make a copy of the output file to a
35# new file with that name
36u-boot-spl_HS_MLO: $(obj)/u-boot-spl.bin
37 $(call if_changed,mkomapsecimg)
38 @if [ -f $@ ]; then \
39 cp -f $@ MLO; \
40 fi
41
42# Standard 2ND target (certain peripheral boot modes)
43u-boot-spl_HS_2ND: $(obj)/u-boot-spl.bin
44 $(call if_changed,mkomapsecimg)
45
46# Standard ULO target (certain peripheral boot modes)
47u-boot-spl_HS_ULO: $(obj)/u-boot-spl.bin
48 $(call if_changed,mkomapsecimg)
49
50# Standard ISSW target (certain devices, various boot modes)
51u-boot-spl_HS_ISSW: $(obj)/u-boot-spl.bin
52 $(call if_changed,mkomapsecimg)
53
54# For SPI flash on AM335x and AM43xx, these
55# require special byte swap handling so we use
56# the SPI_X-LOADER target instead of X-LOADER
57# and let the create-boot-image.sh script handle
58# that
59u-boot-spl_HS_SPI_X-LOADER: $(obj)/u-boot-spl.bin
60 $(call if_changed,mkomapsecimg)
61
62# For supporting single stage XiP QSPI on AM43xx, the
63# image is a full u-boot file, not an SPL. In this case
64# the mkomapsecimg command looks for a u-boot-HS_* prefix
65u-boot_HS_XIP_X-LOADER: $(obj)/u-boot.bin
66 $(call if_changed,mkomapsecimg)