Pankaj Gupta | e64a7a5 | 2020-12-09 14:02:41 +0530 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2020 NXP |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | DDR_PHY_BIN_PATH ?= ./ddr-phy-binary/lx2160a |
| 8 | |
| 9 | ifeq (${DDR_IMEM_UDIMM_1D},) |
| 10 | DDR_IMEM_UDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_pmu_train_imem.bin |
| 11 | endif |
| 12 | |
| 13 | ifeq (${DDR_IMEM_UDIMM_2D},) |
| 14 | DDR_IMEM_UDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_2d_pmu_train_imem.bin |
| 15 | endif |
| 16 | |
| 17 | ifeq (${DDR_DMEM_UDIMM_1D},) |
| 18 | DDR_DMEM_UDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_pmu_train_dmem.bin |
| 19 | endif |
| 20 | |
| 21 | ifeq (${DDR_DMEM_UDIMM_2D},) |
| 22 | DDR_DMEM_UDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_2d_pmu_train_dmem.bin |
| 23 | endif |
| 24 | |
| 25 | ifeq (${DDR_IMEM_RDIMM_1D},) |
| 26 | DDR_IMEM_RDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm_pmu_train_imem.bin |
| 27 | endif |
| 28 | |
| 29 | ifeq (${DDR_IMEM_RDIMM_2D},) |
| 30 | DDR_IMEM_RDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm2d_pmu_train_imem.bin |
| 31 | endif |
| 32 | |
| 33 | ifeq (${DDR_DMEM_RDIMM_1D},) |
| 34 | DDR_DMEM_RDIMM_1D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm_pmu_train_dmem.bin |
| 35 | endif |
| 36 | |
| 37 | ifeq (${DDR_DMEM_RDIMM_2D},) |
| 38 | DDR_DMEM_RDIMM_2D := ${DDR_PHY_BIN_PATH}/ddr4_rdimm2d_pmu_train_dmem.bin |
| 39 | endif |
| 40 | |
| 41 | $(shell mkdir -p '${BUILD_PLAT}') |
| 42 | |
| 43 | ifeq (${DDR_FIP_NAME},) |
| 44 | ifeq (${TRUSTED_BOARD_BOOT},1) |
| 45 | DDR_FIP_NAME := ddr_fip_sec.bin |
| 46 | else |
| 47 | DDR_FIP_NAME := ddr_fip.bin |
| 48 | endif |
| 49 | endif |
| 50 | |
| 51 | ifneq (${TRUSTED_BOARD_BOOT},1) |
| 52 | |
| 53 | DDR_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} |
| 61 | endif |
| 62 | |
| 63 | |
| 64 | ifeq (${TRUSTED_BOARD_BOOT},1) |
| 65 | ifeq (${MBEDTLS_DIR},) |
| 66 | include plat/nxp/soc-lx2160a/ddr_sb.mk |
| 67 | else |
| 68 | include plat/nxp/soc-lx2160a/ddr_tbbr.mk |
| 69 | |
| 70 | # Variables for use with Certificate Generation Tool |
| 71 | CRTTOOLPATH ?= tools/cert_create |
| 72 | CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} |
| 73 | |
| 74 | ifneq (${GENERATE_COT},0) |
| 75 | ddr_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} |
| 81 | endif |
| 82 | endif |
| 83 | endif |
| 84 | |
| 85 | # Variables for use with Firmware Image Package |
| 86 | FIPTOOLPATH ?= tools/fiptool |
| 87 | FIPTOOL ?= ${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 | |
| 97 | fip_ddr: ${BUILD_PLAT}/${DDR_FIP_NAME} |