1 # SPDX-License-Identifier: GPL-2.0+
3 # Copyright (C) 2016, Texas Instruments, Incorporated - https://www.ti.com/
4 quiet_cmd_mkomapsecimg
= SECURE
$@
5 ifneq ($(TI_SECURE_DEV_PKG
),)
6 ifneq ($(wildcard $(TI_SECURE_DEV_PKG
)/scripts
/create-boot-image.sh
),)
7 ifneq ($(CONFIG_SPL_BUILD
),)
8 cmd_mkomapsecimg
= $(TI_SECURE_DEV_PKG
)/scripts
/create-boot-image.sh \
9 $(patsubst u-boot-spl_HS_
%,%,$(@F
)) $< $@
$(CONFIG_SPL_TEXT_BASE
) \
10 $(if
$(KBUILD_VERBOSE
:1=), >/dev
/null
)
12 cmd_mkomapsecimg
= $(TI_SECURE_DEV_PKG
)/scripts
/create-boot-image.sh \
13 $(patsubst u-boot_HS_
%,%,$(@F
)) $< $@
$(CONFIG_TEXT_BASE
) \
14 $(if
$(KBUILD_VERBOSE
:1=), >/dev
/null
)
17 cmd_mkomapsecimg
= echo
"WARNING:" \
18 "$(TI_SECURE_DEV_PKG)/scripts/create-boot-image.sh not found." \
19 "$@ was NOT secured!"; cp
$< $@
22 cmd_mkomapsecimg
= echo
"WARNING: TI_SECURE_DEV_PKG environment" \
23 "variable must be defined for TI secure devices. \
24 $@ was NOT secured!"; cp
$< $@
27 ifdef CONFIG_SPL_LOAD_FIT
28 quiet_cmd_omapsecureimg
= SECURE
$@
29 ifneq ($(TI_SECURE_DEV_PKG
),)
30 ifneq ($(wildcard $(TI_SECURE_DEV_PKG
)/scripts
/secure-binary-image.sh
),)
31 cmd_omapsecureimg
= $(TI_SECURE_DEV_PKG
)/scripts
/secure-binary-image.sh \
33 $(if
$(KBUILD_VERBOSE
:1=), >/dev
/null
)
35 cmd_omapsecureimg
= echo
"WARNING:" \
36 "$(TI_SECURE_DEV_PKG)/scripts/secure-binary-image.sh not found." \
37 "$@ was NOT secured!"; cp
$< $@
40 cmd_omapsecureimg
= echo
"WARNING: TI_SECURE_DEV_PKG environment" \
41 "variable must be defined for TI secure devices." \
42 "$@ was NOT secured!"; cp
$< $@
47 # Standard X-LOADER target (QPSI, NOR flash)
48 u-boot-spl_HS_X-LOADER
: $(obj
)/u-boot-spl.bin FORCE
49 $(call if_changed
,mkomapsecimg
)
51 # For MLO targets (SD card boot) the final file name that is copied to the SD
52 # card FAT partition must be MLO, so we make a copy of the output file to a new
54 u-boot-spl_HS_MLO
: $(obj
)/u-boot-spl.bin FORCE
55 $(call if_changed
,mkomapsecimg
)
60 # Standard 2ND target (certain peripheral boot modes)
61 u-boot-spl_HS_2ND
: $(obj
)/u-boot-spl.bin FORCE
62 $(call if_changed
,mkomapsecimg
)
64 # Standard ULO target (certain peripheral boot modes)
65 u-boot-spl_HS_ULO
: $(obj
)/u-boot-spl.bin FORCE
66 $(call if_changed
,mkomapsecimg
)
68 # Standard ISSW target (certain devices, various boot modes), when copied to
69 # an SD card FAT partition this file must be called "MLO", we make a copy with
70 # this name to make this clear
71 u-boot-spl_HS_ISSW
: $(obj
)/u-boot-spl.bin FORCE
72 $(call if_changed
,mkomapsecimg
)
77 # For SPI flash on AM335x and AM43xx, these require special byte swap handling
78 # so we use the SPI_X-LOADER target instead of X-LOADER and let the
79 # create-boot-image.sh script handle that
80 u-boot-spl_HS_SPI_X-LOADER
: $(obj
)/u-boot-spl.bin FORCE
81 $(call if_changed
,mkomapsecimg
)
83 # For supporting single stage boot on keystone, the image is a full u-boot
84 # file, not an SPL. This will work for all boot devices, other than SPI
85 # flash. On Keystone devices when booting from an SD card FAT partition this
86 # file must be called "MLO"
87 u-boot_HS_MLO
: $(obj
)/u-boot.bin
88 $(call if_changed
,mkomapsecimg
)
93 # For supporting single stage XiP QSPI on AM43xx, the image is a full u-boot
94 # file, not an SPL. In this case the mkomapsecimg command looks for a
96 u-boot_HS_XIP_X-LOADER
: $(obj
)/u-boot.bin FORCE
97 $(call if_changed
,mkomapsecimg
)
99 # For supporting the SPL loading and interpreting of FIT images whose
100 # components are pre-processed before being integrated into the FIT image in
101 # order to secure them in some way
102 ifdef CONFIG_SPL_LOAD_FIT
104 MKIMAGEFLAGS_u-boot_HS.img
= -f auto
-A
$(ARCH
) -T firmware
-C none
-O u-boot \
105 -a
$(CONFIG_TEXT_BASE
) -e
$(CONFIG_SYS_UBOOT_START
) \
106 -n
"U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
107 $(patsubst %,-b arch
/$(ARCH
)/dts
/%.dtb_HS
,$(subst ",,$(CONFIG_OF_LIST)))
109 OF_LIST_TARGETS = $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST
)))
110 $(OF_LIST_TARGETS
): dtbs
112 %.dtb_HS
: %.dtb FORCE
113 $(call if_changed
,omapsecureimg
)
115 u-boot-nodtb_HS.bin
: u-boot-nodtb.bin FORCE
116 $(call if_changed
,omapsecureimg
)
118 u-boot_HS.img
: u-boot-nodtb_HS.bin u-boot.img
$(patsubst %.dtb
,%.dtb_HS
,$(OF_LIST_TARGETS
)) FORCE
119 $(call if_changed
,mkimage
)
120 $(Q
)if
[ -f
$@
]; then \
121 cp
-f
$@ u-boot.img
; \