1 #
2 # Copyright (c) 2018, Texas Instruments Incorporated
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 #
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 #
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
14 # documentation and/or other materials provided with the distribution.
15 #
16 # * Neither the name of Texas Instruments Incorporated nor the names of
17 # its contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #
33 # File: sbl_component.mk
34 # This file is component include make file of SBL.
35 # List of variables set in this file and their purpose:
36 # <mod>_RELPATH - This is the relative path of the module, typically from
37 # top-level directory of the package
38 # <mod>_PATH - This is the absolute path of the module. It derives from
39 # absolute path of the top-level directory (set in env.mk)
40 # and relative path set above
41 # <mod>_INCLUDE - This is the path that has interface header files of the
42 # module. This can be multiple directories (space separated)
43 # <mod>_PKG_LIST - Names of the modules (and sub-modules) that are a part
44 # part of this module, including itself.
45 # <mod>_BOARD_DEPENDENCY - "yes": means the code for this module depends on
46 # platform and the compiled obj/lib has to be kept
47 # under <platform> directory
48 # "no" or "" or if this variable is not defined: means
49 # this module has no platform dependent code and hence
50 # the obj/libs are not kept under <platform> dir.
51 # <mod>_CORE_DEPENDENCY - "yes": means the code for this module depends on
52 # core and the compiled obj/lib has to be kept
53 # under <core> directory
54 # "no" or "" or if this variable is not defined: means
55 # this module has no core dependent code and hence
56 # the obj/libs are not kept under <core> dir.
57 # <mod>_APP_STAGE_FILES - List of source files that belongs to the module
58 # <mod>, but that needs to be compiled at application
59 # build stage (in the context of the app). This is
60 # primarily for link time configurations or if the
61 # source file is dependent on options/defines that are
62 # application dependent. This can be left blank or
63 # not defined at all, in which case, it means there
64 # no source files in the module <mod> that are required
65 # to be compiled in the application build stage.
66 #
67 ifeq ($(sbl_component_make_include), )
69 sbl_BOARDLIST = am65xx_evm am65xx_idk
71 sbl_SOCLIST = am65xx
73 sbl_am65xx_CORELIST = mcu1_0 mcu1_1 mpu1_0 mpu1_1 mpu2_0 mpu2_1
75 ############################
76 # sbl package
77 # List of components included under sbl
78 # The components included here are built and will be part of sbl
79 ############################
80 sbl_LIB_LIST = sbl_lib_$(BOOTMODE)
82 ############################
83 # sbl example
84 # List of examples under sbl (+= is used at each example definition)
85 # All the tests mentioned in list are built when test target is called
86 # List below all examples for allowed values
87 ############################
88 sbl_EXAMPLE_LIST =
90 #
91 # SBL Modules
92 #
94 # SBL LIB
95 sbl_lib_$(BOOTMODE)_COMP_LIST = sbl_lib_$(BOOTMODE)
96 sbl_lib_$(BOOTMODE)_RELPATH = ti/boot/sbl/$(BOOTMODE)
97 sbl_lib_$(BOOTMODE)_PATH = $(PDK_SBL_COMP_PATH)
98 sbl_lib_$(BOOTMODE)_LIBNAME = sbl_lib_$(BOOTMODE)
99 sbl_lib_$(BOOTMODE)_LIBPATH = $(PDK_SBL_COMP_PATH)/lib/$(BOOTMODE)
100 sbl_lib_$(BOOTMODE)_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_lib.mk
101 export sbl_lib_$(BOOTMODE)_MAKEFILE
102 export sbl_lib_$(BOOTMODE)_LIBNAME
103 export sbl_lib_$(BOOTMODE)_LIBPATH
104 sbl_lib_$(BOOTMODE)_BOARD_DEPENDENCY = yes
105 sbl_lib_$(BOOTMODE)_SOC_DEPENDENCY = yes
106 sbl_lib_$(BOOTMODE)_CORE_DEPENDENCY = no
107 export sbl_lib_$(BOOTMODE)_COMP_LIST
108 export sbl_lib_$(BOOTMODE)_BOARD_DEPENDENCY
109 export sbl_lib_$(BOOTMODE)_CORE_DEPENDENCY
110 sbl_lib_$(BOOTMODE)_PKG_LIST = sbl_lib_$(BOOTMODE)
111 sbl_lib_$(BOOTMODE)_INCLUDE = $(sbl_lib_$(BOOTMODE)_PATH)
112 sbl_lib_$(BOOTMODE)_SOCLIST = $(sbl_SOCLIST)
113 sbl_lib_$(BOOTMODE)_BOARDLIST = $(sbl_BOARDLIST)
114 export sbl_lib_$(BOOTMODE)_SOCLIST
115 export sbl_lib_$(BOOTMODE)_BOARDLIST
116 sbl_lib_$(BOOTMODE)_$(SOC)_CORELIST = mcu1_0
117 export sbl_lib_$(BOOTMODE)_$(SOC)_CORELIST
119 #
120 # SBL Examples
121 #
122 # SBL Image
123 sbl_$(BOOTMODE)_img_COMP_LIST = sbl_$(BOOTMODE)_img
124 sbl_$(BOOTMODE)_img_RELPATH = ti/boot/sbl/board/k3
125 sbl_$(BOOTMODE)_img_CUSTOM_BINPATH = $(PDK_SBL_COMP_PATH)/binary/$(BOARD)/$(BOOTMODE)/bin
126 sbl_$(BOOTMODE)_img_PATH = $(PDK_SBL_COMP_PATH)/board/k3
127 sbl_$(BOOTMODE)_img_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_img.mk
128 export sbl_$(BOOTMODE)_img_MAKEFILE
129 sbl_$(BOOTMODE)_img_BOARD_DEPENDENCY = yes
130 sbl_$(BOOTMODE)_img_SOC_DEPENDENCY = yes
131 sbl_$(BOOTMODE)_img_CORE_DEPENDENCY = no
132 export sbl_$(BOOTMODE)_img_COMP_LIST
133 export sbl_$(BOOTMODE)_img_BOARD_DEPENDENCY
134 export sbl_$(BOOTMODE)_img_SOC_DEPENDENCY
135 export sbl_$(BOOTMODE)_img_CORE_DEPENDENCY
136 sbl_$(BOOTMODE)_img_PKG_LIST = sbl
137 sbl_$(BOOTMODE)_img_INCLUDE = $(sbl_$(BOOTMODE)_img_PATH)
138 sbl_$(BOOTMODE)_img_BOARDLIST = $(sbl_BOARDLIST)
139 export sbl_$(BOOTMODE)_img_BOARDLIST
140 sbl_$(BOOTMODE)_img_$(SOC)_CORELIST = mcu1_0
141 export sbl_$(BOOTMODE)_img_$(SOC)_CORELIST
142 sbl_EXAMPLE_LIST += sbl_$(BOOTMODE)_img
143 sbl_$(BOOTMODE)_img_SBL_IMAGEGEN = yes
144 export sbl_$(BOOTMODE)_img_SBL_IMAGEGEN
146 # Individual Core Boot Test
147 sbl_boot_test_COMP_LIST = sbl_boot_test
148 sbl_boot_test_RELPATH = ti/boot/sbl/example/k3MulticoreApp
149 sbl_boot_test_BINPATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp/binary
150 sbl_boot_test_PATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp
151 sbl_boot_test_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_boot_test.mk
152 export sbl_boot_test_MAKEFILE
153 sbl_boot_test_BOARD_DEPENDENCY = no
154 sbl_boot_test_SOC_DEPENDENCY = no
155 sbl_boot_test_CORE_DEPENDENCY = no
156 export sbl_boot_test_COMP_LIST
157 export sbl_boot_test_BOARD_DEPENDENCY
158 export sbl_boot_test_SOC_DEPENDENCY
159 export sbl_boot_test_CORE_DEPENDENCY
160 sbl_boot_test_PKG_LIST = sbl_boot_test
161 sbl_boot_test_INCLUDE = $(sbl_boot_test_PATH)
162 sbl_boot_test_BOARDLIST = am65xx_evm am65xx_idk
163 export sbl_boot_test_BOARDLIST
164 sbl_boot_test_$(SOC)_CORELIST = $(sbl_$(SOC)_CORELIST)
165 export sbl_boot_test_$(SOC)_CORELIST
166 sbl_EXAMPLE_LIST += sbl_boot_test
167 sbl_boot_test_SBL_APPIMAGEGEN = yes
168 export sbl_boot_test_SBL_APPIMAGEGEN
170 # Multicore AMP Boot Test
171 sbl_multicore_amp_COMP_LIST = sbl_multicore_amp
172 sbl_multicore_amp_RELPATH = ti/boot/sbl/example/k3MulticoreApp
173 sbl_multicore_amp_BINPATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp/binary
174 sbl_multicore_amp_PATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp
175 sbl_multicore_amp_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_multicore_amp.mk
176 export sbl_multicore_amp_MAKEFILE
177 sbl_multicore_amp_BOARD_DEPENDENCY = no
178 sbl_multicore_amp_SOC_DEPENDENCY = no
179 sbl_multicore_amp_CORE_DEPENDENCY = no
180 export sbl_multicore_amp_COMP_LIST
181 export sbl_multicore_amp_BOARD_DEPENDENCY
182 export sbl_multicore_amp_SOC_DEPENDENCY
183 export sbl_multicore_amp_CORE_DEPENDENCY
184 sbl_multicore_amp_PKG_LIST = sbl_multicore_amp
185 sbl_multicore_amp_INCLUDE = $(sbl_multicore_amp_PATH)
186 sbl_multicore_amp_BOARDLIST = am65xx_evm am65xx_idk
187 export sbl_multicore_amp_BOARDLIST
188 sbl_multicore_amp_$(SOC)_CORELIST := $(word $(words $(sbl_am65xx_CORELIST)), $(sbl_am65xx_CORELIST))
189 export sbl_multicore_amp_$(SOC)_CORELIST
190 sbl_EXAMPLE_LIST += sbl_multicore_amp
191 sbl_multicore_amp_SBL_APPIMAGEGEN = no
192 export sbl_multicore_amp_SBL_APPIMAGEGEN
194 # R5 Lockstep and MPU SMP Boot Test
195 sbl_smp_test_COMP_LIST = sbl_smp_test
196 sbl_smp_test_RELPATH = ti/boot/sbl/example/k3MulticoreApp
197 sbl_smp_test_BINPATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp/binary
198 sbl_smp_test_PATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp
199 sbl_smp_test_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_smp_test.mk
200 export sbl_smp_test_MAKEFILE
201 sbl_smp_test_BOARD_DEPENDENCY = no
202 sbl_smp_test_SOC_DEPENDENCY = no
203 sbl_smp_test_CORE_DEPENDENCY = no
204 export sbl_smp_test_COMP_LIST
205 export sbl_smp_test_BOARD_DEPENDENCY
206 export sbl_smp_test_SOC_DEPENDENCY
207 export sbl_smp_test_CORE_DEPENDENCY
208 sbl_smp_test_PKG_LIST = sbl_smp_test
209 sbl_smp_test_INCLUDE = $(sbl_smp_test_PATH)
210 sbl_smp_test_BOARDLIST = am65xx_evm am65xx_idk
211 export sbl_smp_test_BOARDLIST
212 sbl_smp_test_$(SOC)_CORELIST = mcu1_0 mpu1_0
213 export sbl_smp_test_$(SOC)_CORELIST
214 sbl_EXAMPLE_LIST += sbl_smp_test
215 sbl_smp_test_SBL_APPIMAGEGEN = yes
216 export sbl_smp_test_SBL_APPIMAGEGEN
218 # Multicore SMP Boot Test
219 sbl_multicore_smp_COMP_LIST = sbl_multicore_smp
220 sbl_multicore_smp_RELPATH = ti/boot/sbl/example/k3MulticoreApp
221 sbl_multicore_smp_BINPATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp/binary
222 sbl_multicore_smp_PATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp
223 sbl_multicore_smp_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_multicore_smp.mk
224 export sbl_multicore_smp_MAKEFILE
225 sbl_multicore_smp_BOARD_DEPENDENCY = no
226 sbl_multicore_smp_SOC_DEPENDENCY = no
227 sbl_multicore_smp_CORE_DEPENDENCY = no
228 export sbl_multicore_smp_COMP_LIST
229 export sbl_multicore_smp_BOARD_DEPENDENCY
230 export sbl_multicore_smp_SOC_DEPENDENCY
231 export sbl_multicore_smp_CORE_DEPENDENCY
232 sbl_multicore_smp_PKG_LIST = sbl_multicore_smp
233 sbl_multicore_smp_INCLUDE = $(sbl_multicore_smp_PATH)
234 sbl_multicore_smp_BOARDLIST = am65xx_evm am65xx_idk
235 export sbl_multicore_smp_BOARDLIST
236 sbl_multicore_smp_$(SOC)_CORELIST := $(word $(words $(sbl_am65xx_CORELIST)), $(sbl_am65xx_CORELIST))
237 export sbl_multicore_smp_$(SOC)_CORELIST
238 sbl_EXAMPLE_LIST += sbl_multicore_smp
239 sbl_multicore_smp_SBL_APPIMAGEGEN = no
240 export sbl_multicore_smp_SBL_APPIMAGEGEN
242 # R5 boot performance Test
243 sbl_boot_perf_test_COMP_LIST = sbl_boot_perf_test
244 sbl_boot_perf_test_RELPATH = ti/boot/sbl/example/k3MulticoreApp
245 sbl_boot_perf_test_BINPATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp/binary
246 sbl_boot_perf_test_PATH = $(PDK_SBL_COMP_PATH)/example/k3MulticoreApp
247 sbl_boot_perf_test_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_mcu0_boot_perf_test.mk
248 export sbl_boot_perf_test_MAKEFILE
249 sbl_boot_perf_test_BOARD_DEPENDENCY = no
250 sbl_boot_perf_test_SOC_DEPENDENCY = no
251 sbl_boot_perf_test_CORE_DEPENDENCY = no
252 export sbl_boot_perf_test_COMP_LIST
253 export sbl_boot_perf_test_BOARD_DEPENDENCY
254 export sbl_boot_perf_test_SOC_DEPENDENCY
255 export sbl_boot_perf_test_CORE_DEPENDENCY
256 sbl_boot_perf_test_PKG_LIST = sbl_boot_perf_test
257 sbl_boot_perf_test_INCLUDE = $(sbl_boot_perf_test_PATH)
258 sbl_boot_perf_test_BOARDLIST = am65xx_evm am65xx_idk
259 export sbl_boot_perf_test_BOARDLIST
260 sbl_boot_perf_test_$(SOC)_CORELIST = mcu1_0
261 export sbl_boot_perf_test_$(SOC)_CORELIST
262 sbl_EXAMPLE_LIST += sbl_boot_perf_test
263 sbl_boot_perf_test_SBL_APPIMAGEGEN = yes
264 export sbl_boot_perf_test_SBL_APPIMAGEGEN
266 # 0 - use cpu for reads (slower, no $ coherency ops needed),
267 # 1 - use dma for data reads (faster, $ coherency ops needed)
268 SBL_CFLAGS = -DSBL_USE_DMA=1
270 # Display profiling info before MCU1_0 boot
271 # increases delay time, between end of SBL
272 # and start of app, but useful for
273 # debugging and tuning performace knobs
274 #SBL_CFLAGS += -DSBL_DISPLAY_PROFILE_INFO
276 ###### Use boot_perf_benchmark example#######
277 ###### to fine tune the perf knobs #########
279 ###########START BOOT PERF KNOBS#############
280 # SBL log level
281 # no logs = 0, only errors =1, normal logs = 2, all logs = 3
282 SBL_CFLAGS += -DSBL_LOG_LEVEL=2
284 SBL_CFLAGS += -DSBL_ENABLE_PLL
285 SBL_CFLAGS += -DSBL_ENABLE_CLOCKS
286 SBL_CFLAGS += -DSBL_ENABLE_DDR
288 ############################################
289 # DISABLING the options above this caption
290 # improves boot time at the cost of moving
291 # PLL, LPSC and DDR init to the app
292 #
293 # ENABLING the options below this caption
294 # improves boot time by skipping stuff SBL
295 # usually does.
296 ###########################################
297 # If enabled, the SBL will branch to the start
298 # of MCU_0 app without resetting the core
299 # if csl defaults are godd enough this enables
300 # app to skip redoing mcu initialization
301 #SBL_CFLAGS += -DSBL_SKIP_MCU_RESET
303 # If enabled, SBL will skip calling
304 # Sciclient_boardCfgPm API. Enabling
305 # it saves boot time, but uart traces
306 # will get garbled. The app must call
307 # Sciclient_boardCfgPm for UART_printf
308 #to work again.
309 #SBL_CFLAGS += -DSBL_SKIP_BRD_CFG_PM
311 ###########END BOOT PERF KNOBS#############
313 # BOOTMODE specific CFLAGS
314 ifeq ($(BOOTMODE), mmcsd)
315 SBL_CFLAGS+= -DBOOT_MMCSD
316 endif # ifeq ($(BOOTMODE), mmcsd)
318 ifeq ($(BOOTMODE), ospi)
319 SBL_CFLAGS += -DBOOT_OSPI
320 endif # ifeq ($(BOOTMODE), ospi)
322 ifeq ($(BOOTMODE), qspi)
323 SBL_CFLAGS += -DBOOT_QSPI
324 endif # ifeq ($(BOOTMODE), qspi)
326 ifeq ($(BOOTMODE), spi)
327 SBL_CFLAGS += -DBOOT_SPI
328 endif # ifeq ($(BOOTMODE), spi)
330 export sbl_LIB_LIST
331 export sbl_EXAMPLE_LIST
332 export SBL_CFLAGS
334 sbl_component_make_include := 1
335 endif