blob: c303cedb0359dfed299d35944a5f89f4e4cf5422 [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
Pankaj Guptae64a7a52020-12-09 14:02:41 +053041ifeq (${DDR_FIP_NAME},)
42ifeq (${TRUSTED_BOARD_BOOT},1)
43 DDR_FIP_NAME := ddr_fip_sec.bin
44else
45 DDR_FIP_NAME := ddr_fip.bin
46endif
47endif
48
49ifneq (${TRUSTED_BOARD_BOOT},1)
50
51DDR_FIP_ARGS += --ddr-immem-udimm-1d ${DDR_IMEM_UDIMM_1D} \
52 --ddr-immem-udimm-2d ${DDR_IMEM_UDIMM_2D} \
53 --ddr-dmmem-udimm-1d ${DDR_DMEM_UDIMM_1D} \
54 --ddr-dmmem-udimm-2d ${DDR_DMEM_UDIMM_2D} \
55 --ddr-immem-rdimm-1d ${DDR_IMEM_RDIMM_1D} \
56 --ddr-immem-rdimm-2d ${DDR_IMEM_RDIMM_2D} \
57 --ddr-dmmem-rdimm-1d ${DDR_DMEM_RDIMM_1D} \
58 --ddr-dmmem-rdimm-2d ${DDR_DMEM_RDIMM_2D}
59endif
60
61
62ifeq (${TRUSTED_BOARD_BOOT},1)
63ifeq (${MBEDTLS_DIR},)
64include plat/nxp/soc-lx2160a/ddr_sb.mk
65else
66include plat/nxp/soc-lx2160a/ddr_tbbr.mk
67
68# Variables for use with Certificate Generation Tool
69CRTTOOLPATH ?= tools/cert_create
70CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
71
72ifneq (${GENERATE_COT},0)
73ddr_certificates: ${DDR_CRT_DEPS} ${CRTTOOL}
Chris Kay1870c722024-05-02 17:52:37 +000074 $(q)${CRTTOOL} ${DDR_CRT_ARGS}
75 $(s)echo
76 $(s)echo "Built $@ successfully"
77 $(s)echo "DDR certificates can be found in ${BUILD_PLAT}"
78 $(s)echo
Pankaj Guptae64a7a52020-12-09 14:02:41 +053079endif
80endif
81endif
82
83# Variables for use with Firmware Image Package
84FIPTOOLPATH ?= tools/fiptool
85FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
86
87${BUILD_PLAT}/${DDR_FIP_NAME}: ${DDR_FIP_DEPS} ${FIPTOOL}
88 $(eval ${CHECK_DDR_FIP_CMD})
Chris Kay1870c722024-05-02 17:52:37 +000089 $(q)${FIPTOOL} create ${DDR_FIP_ARGS} $@
90 $(q)${FIPTOOL} info $@
91 $(s)echo
92 $(s)echo "Built $@ successfully"
93 $(s)echo
Pankaj Guptae64a7a52020-12-09 14:02:41 +053094
95fip_ddr: ${BUILD_PLAT}/${DDR_FIP_NAME}