blob: 8ab1430839798a731c77da53e6b94130120ce495 [file] [log] [blame]
Pankaj Guptaf24e1a32020-12-09 14:02:41 +05301#
2# Copyright 2018-2020 NXP
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7
8 # SoC-specific build parameters
9SOC := lx2160a
10PLAT_PATH := plat/nxp
11PLAT_COMMON_PATH:= plat/nxp/common
12PLAT_DRIVERS_PATH:= drivers/nxp
13PLAT_SOC_PATH := ${PLAT_PATH}/soc-${SOC}
14BOARD_PATH := ${PLAT_SOC_PATH}/${BOARD}
15
16 # get SoC-specific defnitions
17include ${PLAT_SOC_PATH}/soc.def
Jiafei Pan742595c2021-06-25 16:51:12 +080018include ${PLAT_COMMON_PATH}/plat_make_helper/soc_common_def.mk
Pankaj Guptaf24e1a32020-12-09 14:02:41 +053019include ${PLAT_COMMON_PATH}/plat_make_helper/plat_build_macros.mk
20
21 # SoC-specific
22NXP_WDOG_RESTART := yes
23
24
25 # Selecting dependent module,
26 # Selecting dependent drivers, and
27 # Adding defines.
28
29 # for features enabled above.
30ifeq (${NXP_WDOG_RESTART}, yes)
31NXP_NV_SW_MAINT_LAST_EXEC_DATA := yes
32LS_EL3_INTERRUPT_HANDLER := yes
33$(eval $(call add_define, NXP_WDOG_RESTART))
34endif
35
36
37 # For Security Features
38DISABLE_FUSE_WRITE := 1
39ifeq (${TRUSTED_BOARD_BOOT}, 1)
40ifeq (${GENERATE_COT},1)
41# Save Keys to be used by DDR FIP image
42SAVE_KEYS=1
43endif
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
49SECURE_BOOT := yes
50endif
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.
74ifeq (${BOOT_MODE}, flexspi_nor)
75$(eval $(call SET_NXP_MAKE_FLAG,XSPI_NEEDED,BL2))
76$(eval $(call add_define,FLEXSPI_NOR_BOOT))
77else
78ifeq (${BOOT_MODE}, sd)
79$(eval $(call SET_NXP_MAKE_FLAG,SD_MMC_NEEDED,BL2))
80$(eval $(call add_define,SD_BOOT))
81else
82ifeq (${BOOT_MODE}, emmc)
83$(eval $(call SET_NXP_MAKE_FLAG,SD_MMC_NEEDED,BL2))
84$(eval $(call add_define,EMMC_BOOT))
85else
86$(error Un-supported Boot Mode = ${BOOT_MODE})
87endif
88endif
89endif
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
99PLAT_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
104ifeq (${SECURE_BOOT},yes)
105include ${PLAT_COMMON_PATH}/tbbr/tbbr.mk
106endif
107
108ifeq ($(WARM_BOOT),yes)
109include ${PLAT_COMMON_PATH}/warm_reset/warm_reset.mk
110endif
111
112ifeq (${NXP_NV_SW_MAINT_LAST_EXEC_DATA}, yes)
113include ${PLAT_COMMON_PATH}/nv_storage/nv_storage.mk
114endif
115
116ifeq (${PSCI_NEEDED}, yes)
117include ${PLAT_COMMON_PATH}/psci/psci.mk
118endif
119
120ifeq (${SIPSVC_NEEDED}, yes)
121include ${PLAT_COMMON_PATH}/sip_svc/sipsvc.mk
122endif
123
124ifeq (${DDR_FIP_IO_NEEDED}, yes)
125include ${PLAT_COMMON_PATH}/fip_handler/ddr_fip/ddr_fip_io.mk
126endif
127
128 # for fuse-fip & fuse-programming
129ifeq (${FUSE_PROG}, 1)
130include ${PLAT_COMMON_PATH}/fip_handler/fuse_fip/fuse.mk
131endif
132
133ifeq (${IMG_LOADR_NEEDED},yes)
134include $(PLAT_COMMON_PATH)/img_loadr/img_loadr.mk
135endif
136
137 # Adding source files for the above selected drivers.
138include ${PLAT_DRIVERS_PATH}/drivers.mk
139
140 # Adding SoC specific files
141include ${PLAT_SOC_PATH}/erratas_soc.mk
142
143PLAT_INCLUDES += ${NV_STORAGE_INCLUDES}\
144 ${WARM_RST_INCLUDES}
145
146BL31_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
152PLAT_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
158ifeq (${TEST_BL31}, 1)
159BL31_SOURCES += ${PLAT_SOC_PATH}/$(ARCH)/bootmain64.S\
160 ${PLAT_SOC_PATH}/$(ARCH)/nonboot64.S
161endif
162
163BL2_SOURCES += ${DDR_CNTLR_SOURCES}\
164 ${TBBR_SOURCES}\
165 ${FUSE_SOURCES}
166
167
168 # Adding TFA setup files
169include ${PLAT_PATH}/common/setup/common.mk
170
171
172 # Adding source files to generate separate DDR FIP image
173include ${PLAT_SOC_PATH}/ddr_fip.mk