1#
2# Copyright 2021 NXP
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7ifneq (${TRUSTED_BOARD_BOOT},0)
8
9ifeq (${GENERATE_COT},0)
10
11DDR_FIP_ARGS += --ddr-immem-udimm-1d ${DDR_IMEM_UDIMM_1D}.sb \
12		--ddr-immem-udimm-2d ${DDR_IMEM_UDIMM_2D}.sb \
13		--ddr-dmmem-udimm-1d ${DDR_DMEM_UDIMM_1D}.sb \
14		--ddr-dmmem-udimm-2d ${DDR_DMEM_UDIMM_2D}.sb \
15		--ddr-immem-rdimm-1d ${DDR_IMEM_RDIMM_1D}.sb \
16		--ddr-immem-rdimm-2d ${DDR_IMEM_RDIMM_2D}.sb \
17		--ddr-dmmem-rdimm-1d ${DDR_DMEM_RDIMM_1D}.sb \
18		--ddr-dmmem-rdimm-2d ${DDR_DMEM_RDIMM_2D}.sb
19endif
20
21UDIMM_DEPS = ${DDR_IMEM_UDIMM_1D}.sb ${DDR_IMEM_UDIMM_2D}.sb ${DDR_DMEM_UDIMM_1D}.sb ${DDR_DMEM_UDIMM_2D}.sb
22RDIMM_DEPS = ${DDR_IMEM_RDIMM_1D}.sb ${DDR_IMEM_RDIMM_2D}.sb ${DDR_DMEM_RDIMM_1D}.sb ${DDR_DMEM_RDIMM_2D}.sb
23DDR_FIP_DEPS += ${UDIMM_DEPS}
24DDR_FIP_DEPS += ${RDIMM_DEPS}
25
26# Max Size of CSF header (CSF_HDR_SZ = 0x3000).
27# Image will be appended at this offset of the header.
28# Path to CST directory is required to generate the CSF header,
29# and prepend it to image before fip image gets generated
30ifeq (${CST_DIR},)
31  $(error Error: CST_DIR not set)
32endif
33
34ifeq (${DDR_INPUT_FILE},)
35DDR_INPUT_FILE:= drivers/nxp/auth/csf_hdr_parser/${CSF_FILE}
36endif
37
38%.sb: %
39	@echo " Generating CSF Header for $@ $<"
40	$(CST_DIR)/create_hdr_esbc --in $< --out $@ --app_off ${CSF_HDR_SZ} \
41					--app $< ${DDR_INPUT_FILE}
42
43endif
44