1#
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
18include ${PLAT_COMMON_PATH}/plat_make_helper/soc_common_def.mk
19include ${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				-I${PLAT_COMMON_PATH}/soc_errata
104
105ifeq (${SECURE_BOOT},yes)
106include ${PLAT_COMMON_PATH}/tbbr/tbbr.mk
107endif
108
109ifeq ($(WARM_BOOT),yes)
110include ${PLAT_COMMON_PATH}/warm_reset/warm_reset.mk
111endif
112
113ifeq (${NXP_NV_SW_MAINT_LAST_EXEC_DATA}, yes)
114include ${PLAT_COMMON_PATH}/nv_storage/nv_storage.mk
115endif
116
117ifeq (${PSCI_NEEDED}, yes)
118include ${PLAT_COMMON_PATH}/psci/psci.mk
119endif
120
121ifeq (${SIPSVC_NEEDED}, yes)
122include ${PLAT_COMMON_PATH}/sip_svc/sipsvc.mk
123endif
124
125ifeq (${DDR_FIP_IO_NEEDED}, yes)
126include ${PLAT_COMMON_PATH}/fip_handler/ddr_fip/ddr_fip_io.mk
127endif
128
129 # for fuse-fip & fuse-programming
130ifeq (${FUSE_PROG}, 1)
131include ${PLAT_COMMON_PATH}/fip_handler/fuse_fip/fuse.mk
132endif
133
134ifeq (${IMG_LOADR_NEEDED},yes)
135include $(PLAT_COMMON_PATH)/img_loadr/img_loadr.mk
136endif
137
138 # Adding source files for the above selected drivers.
139include ${PLAT_DRIVERS_PATH}/drivers.mk
140
141 # Adding SoC specific files
142include ${PLAT_COMMON_PATH}/soc_errata/errata.mk
143
144PLAT_INCLUDES		+=	${NV_STORAGE_INCLUDES}\
145				${WARM_RST_INCLUDES}
146
147BL31_SOURCES		+=	${PLAT_SOC_PATH}/$(ARCH)/${SOC}.S\
148				${WARM_RST_BL31_SOURCES}\
149				${PSCI_SOURCES}\
150				${SIPSVC_SOURCES}\
151				${PLAT_COMMON_PATH}/$(ARCH)/bl31_data.S
152
153PLAT_BL_COMMON_SOURCES	+=	${PLAT_COMMON_PATH}/$(ARCH)/ls_helpers.S\
154				${PLAT_SOC_PATH}/aarch64/${SOC}_helpers.S\
155				${NV_STORAGE_SOURCES}\
156				${WARM_RST_BL_COMM_SOURCES}\
157				${PLAT_SOC_PATH}/soc.c
158
159ifeq (${TEST_BL31}, 1)
160BL31_SOURCES		+=	${PLAT_SOC_PATH}/$(ARCH)/bootmain64.S\
161				${PLAT_SOC_PATH}/$(ARCH)/nonboot64.S
162endif
163
164BL2_SOURCES		+=	${DDR_CNTLR_SOURCES}\
165				${TBBR_SOURCES}\
166				${FUSE_SOURCES}
167
168
169 # Adding TFA setup files
170include ${PLAT_PATH}/common/setup/common.mk
171
172
173 # Adding source files to generate separate DDR FIP image
174include ${PLAT_SOC_PATH}/ddr_fip.mk
175