Debian Codegraph @

plat/nxp/soc-lx2160a/soc.mk

raw
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
18 include ${PLAT_COMMON_PATH}/plat_make_helper/soc_common_def.mk
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 $(eval $(call SET_NXP_MAKE_FLAG,SMMU_NEEDED,BL2))
40 ifeq (${TRUSTED_BOARD_BOOT}, 1)
41 ifeq (${GENERATE_COT},1)
42 # Save Keys to be used by DDR FIP image
43 SAVE_KEYS=1
44 endif
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 -I${PLAT_COMMON_PATH}/soc_errata
104
105 ifeq (${SECURE_BOOT},yes)
106 include ${PLAT_COMMON_PATH}/tbbr/tbbr.mk
107 endif
108
109 ifeq ($(WARM_BOOT),yes)
110 include ${PLAT_COMMON_PATH}/warm_reset/warm_reset.mk
111 endif
112
113 ifeq (${NXP_NV_SW_MAINT_LAST_EXEC_DATA}, yes)
114 include ${PLAT_COMMON_PATH}/nv_storage/nv_storage.mk
115 endif
116
117 ifeq (${PSCI_NEEDED}, yes)
118 include ${PLAT_COMMON_PATH}/psci/psci.mk
119 endif
120
121 ifeq (${SIPSVC_NEEDED}, yes)
122 include ${PLAT_COMMON_PATH}/sip_svc/sipsvc.mk
123 endif
124
125 ifeq (${DDR_FIP_IO_NEEDED}, yes)
126 include ${PLAT_COMMON_PATH}/fip_handler/ddr_fip/ddr_fip_io.mk
127 endif
128
129 # for fuse-fip & fuse-programming
130 ifeq (${FUSE_PROG}, 1)
131 include ${PLAT_COMMON_PATH}/fip_handler/fuse_fip/fuse.mk
132 endif
133
134 ifeq (${IMG_LOADR_NEEDED},yes)
135 include $(PLAT_COMMON_PATH)/img_loadr/img_loadr.mk
136 endif
137
138 # Adding source files for the above selected drivers.
139 include ${PLAT_DRIVERS_PATH}/drivers.mk
140
141 # Adding SoC specific files
142 include ${PLAT_COMMON_PATH}/soc_errata/errata.mk
143
144 PLAT_INCLUDES += ${NV_STORAGE_INCLUDES}\
145 ${WARM_RST_INCLUDES}
146
147 BL31_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
153 PLAT_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
159 ifeq (${TEST_BL31}, 1)
160 BL31_SOURCES += ${PLAT_SOC_PATH}/$(ARCH)/bootmain64.S\
161 ${PLAT_SOC_PATH}/$(ARCH)/nonboot64.S
162 endif
163
164 BL2_SOURCES += ${DDR_CNTLR_SOURCES}\
165 ${TBBR_SOURCES}\
166 ${FUSE_SOURCES}
167
168
169 # Adding TFA setup files
170 include ${PLAT_PATH}/common/setup/common.mk
171
172
173 # Adding source files to generate separate DDR FIP image
174 include ${PLAT_SOC_PATH}/ddr_fip.mk