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