ddr_fip.mk 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. $(shell mkdir -p '${BUILD_PLAT}')
  32. ifeq (${DDR_FIP_NAME},)
  33. ifeq (${TRUSTED_BOARD_BOOT},1)
  34. DDR_FIP_NAME := ddr_fip_sec.bin
  35. else
  36. DDR_FIP_NAME := ddr_fip.bin
  37. endif
  38. endif
  39. ifneq (${TRUSTED_BOARD_BOOT},1)
  40. DDR_FIP_ARGS += --ddr-immem-udimm-1d ${DDR_IMEM_UDIMM_1D} \
  41. --ddr-immem-udimm-2d ${DDR_IMEM_UDIMM_2D} \
  42. --ddr-dmmem-udimm-1d ${DDR_DMEM_UDIMM_1D} \
  43. --ddr-dmmem-udimm-2d ${DDR_DMEM_UDIMM_2D} \
  44. --ddr-immem-rdimm-1d ${DDR_IMEM_RDIMM_1D} \
  45. --ddr-immem-rdimm-2d ${DDR_IMEM_RDIMM_2D} \
  46. --ddr-dmmem-rdimm-1d ${DDR_DMEM_RDIMM_1D} \
  47. --ddr-dmmem-rdimm-2d ${DDR_DMEM_RDIMM_2D}
  48. endif
  49. ifeq (${TRUSTED_BOARD_BOOT},1)
  50. ifeq (${MBEDTLS_DIR},)
  51. include plat/nxp/soc-lx2160a/ddr_sb.mk
  52. else
  53. include plat/nxp/soc-lx2160a/ddr_tbbr.mk
  54. # Variables for use with Certificate Generation Tool
  55. CRTTOOLPATH ?= tools/cert_create
  56. CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
  57. ifneq (${GENERATE_COT},0)
  58. ddr_certificates: ${DDR_CRT_DEPS} ${CRTTOOL}
  59. ${Q}${CRTTOOL} ${DDR_CRT_ARGS}
  60. @${ECHO_BLANK_LINE}
  61. @echo "Built $@ successfully"
  62. @echo "DDR certificates can be found in ${BUILD_PLAT}"
  63. @${ECHO_BLANK_LINE}
  64. endif
  65. endif
  66. endif
  67. # Variables for use with Firmware Image Package
  68. FIPTOOLPATH ?= tools/fiptool
  69. FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
  70. ${BUILD_PLAT}/${DDR_FIP_NAME}: ${DDR_FIP_DEPS} ${FIPTOOL}
  71. $(eval ${CHECK_DDR_FIP_CMD})
  72. ${Q}${FIPTOOL} create ${DDR_FIP_ARGS} $@
  73. ${Q}${FIPTOOL} info $@
  74. @${ECHO_BLANK_LINE}
  75. @echo "Built $@ successfully"
  76. @${ECHO_BLANK_LINE}
  77. fip_ddr: ${BUILD_PLAT}/${DDR_FIP_NAME}