blob: f14a9e86d9b94a197ce5e58bb28c4a2c58e0b3ff [file] [log] [blame]
Pankaj Guptae64a7a52020-12-09 14:02:41 +05301#
2# Copyright 2020 NXP
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7DDR_PHY_BIN_PATH ?= ./ddr-phy-binary/lx2160a
8
9ifeq (${DDR_IMEM_UDIMM_1D},)
10 DDR_IMEM_UDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_pmu_train_imem.bin
11endif
12
13ifeq (${DDR_IMEM_UDIMM_2D},)
14 DDR_IMEM_UDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_2d_pmu_train_imem.bin
15endif
16
17ifeq (${DDR_DMEM_UDIMM_1D},)
18 DDR_DMEM_UDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_pmu_train_dmem.bin
19endif
20
21ifeq (${DDR_DMEM_UDIMM_2D},)
22 DDR_DMEM_UDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_2d_pmu_train_dmem.bin
23endif
24
25ifeq (${DDR_IMEM_RDIMM_1D},)
26 DDR_IMEM_RDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm_pmu_train_imem.bin
27endif
28
29ifeq (${DDR_IMEM_RDIMM_2D},)
30 DDR_IMEM_RDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm2d_pmu_train_imem.bin
31endif
32
33ifeq (${DDR_DMEM_RDIMM_1D},)
34 DDR_DMEM_RDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm_pmu_train_dmem.bin
35endif
36
37ifeq (${DDR_DMEM_RDIMM_2D},)
38 DDR_DMEM_RDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm2d_pmu_train_dmem.bin
39endif
40
41$(shell mkdir -p '${BUILD_PLAT}')
42
43ifeq (${DDR_FIP_NAME},)
44ifeq (${TRUSTED_BOARD_BOOT},1)
45 DDR_FIP_NAME := ddr_fip_sec.bin
46else
47 DDR_FIP_NAME := ddr_fip.bin
48endif
49endif
50
51ifneq (${TRUSTED_BOARD_BOOT},1)
52
53DDR_FIP_ARGS += --ddr-immem-udimm-1d ${DDR_IMEM_UDIMM_1D} \
54 --ddr-immem-udimm-2d ${DDR_IMEM_UDIMM_2D} \
55 --ddr-dmmem-udimm-1d ${DDR_DMEM_UDIMM_1D} \
56 --ddr-dmmem-udimm-2d ${DDR_DMEM_UDIMM_2D} \
57 --ddr-immem-rdimm-1d ${DDR_IMEM_RDIMM_1D} \
58 --ddr-immem-rdimm-2d ${DDR_IMEM_RDIMM_2D} \
59 --ddr-dmmem-rdimm-1d ${DDR_DMEM_RDIMM_1D} \
60 --ddr-dmmem-rdimm-2d ${DDR_DMEM_RDIMM_2D}
61endif
62
63
64ifeq (${TRUSTED_BOARD_BOOT},1)
65ifeq (${MBEDTLS_DIR},)
66include plat/nxp/soc-lx2160a/ddr_sb.mk
67else
68include plat/nxp/soc-lx2160a/ddr_tbbr.mk
69
70# Variables for use with Certificate Generation Tool
71CRTTOOLPATH ?= tools/cert_create
72CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
73
74ifneq (${GENERATE_COT},0)
75ddr_certificates: ${DDR_CRT_DEPS} ${CRTTOOL}
76 ${Q}${CRTTOOL} ${DDR_CRT_ARGS}
77 @${ECHO_BLANK_LINE}
78 @echo "Built $@ successfully"
79 @echo "DDR certificates can be found in ${BUILD_PLAT}"
80 @${ECHO_BLANK_LINE}
81endif
82endif
83endif
84
85# Variables for use with Firmware Image Package
86FIPTOOLPATH ?= tools/fiptool
87FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
88
89${BUILD_PLAT}/${DDR_FIP_NAME}: ${DDR_FIP_DEPS} ${FIPTOOL}
90 $(eval ${CHECK_DDR_FIP_CMD})
91 ${Q}${FIPTOOL} create ${DDR_FIP_ARGS} $@
92 ${Q}${FIPTOOL} info $@
93 @${ECHO_BLANK_LINE}
94 @echo "Built $@ successfully"
95 @${ECHO_BLANK_LINE}
96
97fip_ddr: ${BUILD_PLAT}/${DDR_FIP_NAME}