soc.mk 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #
  2. # Copyright 2018-2020 NXP
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # SoC-specific build parameters
  7. SOC := lx2160a
  8. PLAT_PATH := plat/nxp
  9. PLAT_COMMON_PATH:= plat/nxp/common
  10. PLAT_DRIVERS_PATH:= drivers/nxp
  11. PLAT_SOC_PATH := ${PLAT_PATH}/soc-${SOC}
  12. BOARD_PATH := ${PLAT_SOC_PATH}/${BOARD}
  13. # get SoC-specific defnitions
  14. include ${PLAT_SOC_PATH}/soc.def
  15. include ${PLAT_COMMON_PATH}/plat_make_helper/soc_common_def.mk
  16. include ${PLAT_COMMON_PATH}/plat_make_helper/plat_build_macros.mk
  17. # SoC-specific
  18. NXP_WDOG_RESTART := yes
  19. # Selecting dependent module,
  20. # Selecting dependent drivers, and
  21. # Adding defines.
  22. # for features enabled above.
  23. ifeq (${NXP_WDOG_RESTART}, yes)
  24. NXP_NV_SW_MAINT_LAST_EXEC_DATA := yes
  25. LS_EL3_INTERRUPT_HANDLER := yes
  26. $(eval $(call add_define, NXP_WDOG_RESTART))
  27. endif
  28. # For Security Features
  29. DISABLE_FUSE_WRITE := 1
  30. $(eval $(call SET_NXP_MAKE_FLAG,SMMU_NEEDED,BL2))
  31. ifeq (${TRUSTED_BOARD_BOOT}, 1)
  32. ifeq (${GENERATE_COT},1)
  33. # Save Keys to be used by DDR FIP image
  34. SAVE_KEYS=1
  35. endif
  36. $(eval $(call SET_NXP_MAKE_FLAG,SFP_NEEDED,BL2))
  37. $(eval $(call SET_NXP_MAKE_FLAG,SNVS_NEEDED,BL2))
  38. # Used by create_pbl tool to
  39. # create bl2_<boot_mode>_sec.pbl image
  40. SECURE_BOOT := yes
  41. endif
  42. $(eval $(call SET_NXP_MAKE_FLAG,CRYPTO_NEEDED,BL_COMM))
  43. # Selecting Drivers for SoC
  44. $(eval $(call SET_NXP_MAKE_FLAG,DCFG_NEEDED,BL_COMM))
  45. $(eval $(call SET_NXP_MAKE_FLAG,TIMER_NEEDED,BL_COMM))
  46. $(eval $(call SET_NXP_MAKE_FLAG,INTERCONNECT_NEEDED,BL_COMM))
  47. $(eval $(call SET_NXP_MAKE_FLAG,GIC_NEEDED,BL31))
  48. $(eval $(call SET_NXP_MAKE_FLAG,CONSOLE_NEEDED,BL_COMM))
  49. $(eval $(call SET_NXP_MAKE_FLAG,PMU_NEEDED,BL_COMM))
  50. $(eval $(call SET_NXP_MAKE_FLAG,DDR_DRIVER_NEEDED,BL2))
  51. $(eval $(call SET_NXP_MAKE_FLAG,TZASC_NEEDED,BL2))
  52. $(eval $(call SET_NXP_MAKE_FLAG,I2C_NEEDED,BL2))
  53. $(eval $(call SET_NXP_MAKE_FLAG,IMG_LOADR_NEEDED,BL2))
  54. # Selecting PSCI & SIP_SVC support
  55. $(eval $(call SET_NXP_MAKE_FLAG,PSCI_NEEDED,BL31))
  56. $(eval $(call SET_NXP_MAKE_FLAG,SIPSVC_NEEDED,BL31))
  57. # Selecting Boot Source for the TFA images.
  58. ifeq (${BOOT_MODE}, flexspi_nor)
  59. $(eval $(call SET_NXP_MAKE_FLAG,XSPI_NEEDED,BL2))
  60. $(eval $(call add_define,FLEXSPI_NOR_BOOT))
  61. else
  62. ifeq (${BOOT_MODE}, sd)
  63. $(eval $(call SET_NXP_MAKE_FLAG,SD_MMC_NEEDED,BL2))
  64. $(eval $(call add_define,SD_BOOT))
  65. else
  66. ifeq (${BOOT_MODE}, emmc)
  67. $(eval $(call SET_NXP_MAKE_FLAG,SD_MMC_NEEDED,BL2))
  68. $(eval $(call add_define,EMMC_BOOT))
  69. else
  70. $(error Un-supported Boot Mode = ${BOOT_MODE})
  71. endif
  72. endif
  73. endif
  74. # Separate DDR-FIP image to be loaded.
  75. $(eval $(call SET_NXP_MAKE_FLAG,DDR_FIP_IO_NEEDED,BL2))
  76. # Source File Addition
  77. # #####################
  78. PLAT_INCLUDES += -I${PLAT_COMMON_PATH}/include/default\
  79. -I${BOARD_PATH}\
  80. -I${PLAT_COMMON_PATH}/include/default/ch_${CHASSIS}\
  81. -I${PLAT_SOC_PATH}/include\
  82. -I${PLAT_COMMON_PATH}/soc_errata
  83. ifeq (${SECURE_BOOT},yes)
  84. include ${PLAT_COMMON_PATH}/tbbr/tbbr.mk
  85. endif
  86. ifeq ($(WARM_BOOT),yes)
  87. include ${PLAT_COMMON_PATH}/warm_reset/warm_reset.mk
  88. endif
  89. ifeq (${NXP_NV_SW_MAINT_LAST_EXEC_DATA}, yes)
  90. include ${PLAT_COMMON_PATH}/nv_storage/nv_storage.mk
  91. endif
  92. ifeq (${PSCI_NEEDED}, yes)
  93. include ${PLAT_COMMON_PATH}/psci/psci.mk
  94. endif
  95. ifeq (${SIPSVC_NEEDED}, yes)
  96. include ${PLAT_COMMON_PATH}/sip_svc/sipsvc.mk
  97. endif
  98. ifeq (${DDR_FIP_IO_NEEDED}, yes)
  99. include ${PLAT_COMMON_PATH}/fip_handler/ddr_fip/ddr_fip_io.mk
  100. endif
  101. # for fuse-fip & fuse-programming
  102. ifeq (${FUSE_PROG}, 1)
  103. include ${PLAT_COMMON_PATH}/fip_handler/fuse_fip/fuse.mk
  104. endif
  105. ifeq (${IMG_LOADR_NEEDED},yes)
  106. include $(PLAT_COMMON_PATH)/img_loadr/img_loadr.mk
  107. endif
  108. # Adding source files for the above selected drivers.
  109. include ${PLAT_DRIVERS_PATH}/drivers.mk
  110. # Adding SoC specific files
  111. include ${PLAT_COMMON_PATH}/soc_errata/errata.mk
  112. PLAT_INCLUDES += ${NV_STORAGE_INCLUDES}\
  113. ${WARM_RST_INCLUDES}
  114. BL31_SOURCES += ${PLAT_SOC_PATH}/$(ARCH)/${SOC}.S\
  115. ${WARM_RST_BL31_SOURCES}\
  116. ${PSCI_SOURCES}\
  117. ${SIPSVC_SOURCES}\
  118. ${PLAT_COMMON_PATH}/$(ARCH)/bl31_data.S
  119. PLAT_BL_COMMON_SOURCES += ${PLAT_COMMON_PATH}/$(ARCH)/ls_helpers.S\
  120. ${PLAT_SOC_PATH}/aarch64/${SOC}_helpers.S\
  121. ${NV_STORAGE_SOURCES}\
  122. ${WARM_RST_BL_COMM_SOURCES}\
  123. ${PLAT_SOC_PATH}/soc.c
  124. ifeq (${TEST_BL31}, 1)
  125. BL31_SOURCES += ${PLAT_SOC_PATH}/$(ARCH)/bootmain64.S\
  126. ${PLAT_SOC_PATH}/$(ARCH)/nonboot64.S
  127. endif
  128. BL2_SOURCES += ${DDR_CNTLR_SOURCES}\
  129. ${TBBR_SOURCES}\
  130. ${FUSE_SOURCES}
  131. # Adding TFA setup files
  132. include ${PLAT_PATH}/common/setup/common.mk
  133. # Adding source files to generate separate DDR FIP image
  134. include ${PLAT_SOC_PATH}/ddr_fip.mk