ddr_fip.mk 2.4 KB

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