]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sbl.git/blob - sbl_component.mk
PRSDK:4658 Changes SBL output folder from img to binary
[keystone-rtos/sbl.git] / sbl_component.mk
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 # Only MMCSD supported for IDK
77 # Oveerride even if user inadvertently
78 # tries to build it.
79 ############################
80 ifeq ($(BOARD), am65xx_idk)
81   override BOOTMODE = mmcsd
82 endif # ifeq ($(BOARD), am65xx_idk)
84 ############################
85 # sbl package
86 # List of components included under sbl
87 # The components included here are built and will be part of sbl
88 ############################
89 sbl_LIB_LIST = sbl_lib_$(BOOTMODE)
91 ############################
92 # sbl example
93 # List of examples under sbl (+= is used at each example definition)
94 # All the tests mentioned in list are built when test target is called
95 # List below all examples for allowed values
96 ############################
97 sbl_EXAMPLE_LIST =
99 #
100 # SBL Modules
103 # SBL LIB
104 sbl_lib_$(BOOTMODE)_COMP_LIST = sbl_lib_$(BOOTMODE)
105 sbl_lib_$(BOOTMODE)_RELPATH = ti/boot/sbl
106 sbl_lib_$(BOOTMODE)_PATH = $(PDK_SBL_COMP_PATH)
107 sbl_lib_$(BOOTMODE)_LIBNAME = sbl_lib_$(BOOTMODE)
108 sbl_lib_$(BOOTMODE)_OBJPATH = $(PDK_SBL_COMP_PATH)/obj/$(BOOTMODE)
109 sbl_lib_$(BOOTMODE)_LIBPATH = $(PDK_SBL_COMP_PATH)/lib/$(BOOTMODE)
110 sbl_lib_$(BOOTMODE)_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_lib.mk
111 export sbl_lib_$(BOOTMODE)_MAKEFILE
112 export sbl_lib_$(BOOTMODE)_LIBNAME
113 export sbl_lib_$(BOOTMODE)_LIBPATH
114 sbl_lib_$(BOOTMODE)_BOARD_DEPENDENCY = yes
115 sbl_lib_$(BOOTMODE)_SOC_DEPENDENCY = yes
116 sbl_lib_$(BOOTMODE)_CORE_DEPENDENCY = yes
117 export sbl_lib_$(BOOTMODE)_COMP_LIST
118 export sbl_lib_$(BOOTMODE)_BOARD_DEPENDENCY
119 export sbl_lib_$(BOOTMODE)_CORE_DEPENDENCY
120 sbl_lib_$(BOOTMODE)_PKG_LIST = sbl_lib_$(BOOTMODE)
121 sbl_lib_$(BOOTMODE)_INCLUDE = $(sbl_lib_$(BOOTMODE)_PATH)
122 sbl_lib_$(BOOTMODE)_SOCLIST = $(sbl_SOCLIST)
123 sbl_lib_$(BOOTMODE)_BOARDLIST = $(sbl_BOARDLIST)
124 export sbl_lib_$(BOOTMODE)_SOCLIST
125 export sbl_lib_$(BOOTMODE)_BOARDLIST
126 sbl_lib_$(BOOTMODE)_$(SOC)_CORELIST = mcu1_0
127 export sbl_lib_$(BOOTMODE)_$(SOC)_CORELIST
130 # SBL Examples
132 # SBL Image
133 sbl_$(BOOTMODE)_img_COMP_LIST = sbl_$(BOOTMODE)_img
134 sbl_$(BOOTMODE)_img_RELPATH = ti/boot/sbl/board/$(SOC)
135 sbl_$(BOOTMODE)_img_OBJPATH = $(PDK_SBL_COMP_PATH)/obj/$(BOOTMODE)
136 sbl_$(BOOTMODE)_img_BINPATH = $(PDK_SBL_COMP_PATH)/binary/$(BOOTMODE)
137 sbl_$(BOOTMODE)_img_PATH = $(PDK_SBL_COMP_PATH)/board/$(BOARD)
138 sbl_$(BOOTMODE)_img_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_img.mk
139 export sbl_$(BOOTMODE)_img_MAKEFILE
140 sbl_$(BOOTMODE)_img_BOARD_DEPENDENCY = yes
141 sbl_$(BOOTMODE)_img_CORE_DEPENDENCY = no
142 export sbl_$(BOOTMODE)_img_COMP_LIST
143 export sbl_$(BOOTMODE)_img_BOARD_DEPENDENCY
144 export sbl_$(BOOTMODE)_img_CORE_DEPENDENCY
145 sbl_$(BOOTMODE)_img_PKG_LIST = sbl
146 sbl_$(BOOTMODE)_img_INCLUDE = $(sbl_$(BOOTMODE)_img_PATH)
147 sbl_$(BOOTMODE)_img_BOARDLIST = $(sbl_BOARDLIST)
148 export sbl_$(BOOTMODE)_img_BOARDLIST
149 sbl_$(BOOTMODE)_img_$(SOC)_CORELIST = mcu1_0
150 export sbl_$(BOOTMODE)_img_$(SOC)_CORELIST
151 sbl_EXAMPLE_LIST += sbl_$(BOOTMODE)_img
152 sbl_$(BOOTMODE)_img_SBL_IMAGEGEN = yes
153 export sbl_$(BOOTMODE)_img_SBL_IMAGEGEN
155 # Individual Core Boot Test
156 sbl_boot_test_COMP_LIST = sbl_boot_test
157 sbl_boot_test_RELPATH = ti/boot/sbl/example/ampMulticoreApp
158 sbl_boot_test_OBJPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/obj
159 sbl_boot_test_BINPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/binary
160 sbl_boot_test_PATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp
161 sbl_boot_test_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_boot_test.mk
162 export sbl_boot_test_MAKEFILE
163 sbl_boot_test_BOARD_DEPENDENCY = yes
164 sbl_boot_test_CORE_DEPENDENCY = no
165 export sbl_boot_test_COMP_LIST
166 export sbl_boot_test_BOARD_DEPENDENCY
167 export sbl_boot_test_CORE_DEPENDENCY
168 sbl_boot_test_PKG_LIST = sbl_boot_test
169 sbl_boot_test_INCLUDE = $(sbl_boot_test_PATH)
170 sbl_boot_test_BOARDLIST = am65xx_evm am65xx_idk
171 export sbl_boot_test_BOARDLIST
172 sbl_boot_test_$(SOC)_CORELIST = $(sbl_$(SOC)_CORELIST)
173 export sbl_boot_test_$(SOC)_CORELIST
174 sbl_EXAMPLE_LIST += sbl_boot_test
175 sbl_boot_test_SBL_APPIMAGEGEN = yes
176 export sbl_boot_test_SBL_APPIMAGEGEN
178 # Multicore AMP Boot Test
179 sbl_multicore_amp_COMP_LIST = sbl_multicore_amp
180 sbl_multicore_amp_RELPATH = ti/boot/sbl/example/ampMulticoreApp
181 sbl_multicore_amp_OBJPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/obj
182 sbl_multicore_amp_BINPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/binary
183 sbl_multicore_amp_PATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp
184 sbl_multicore_amp_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_multicore_amp.mk
185 export sbl_multicore_amp_MAKEFILE
186 sbl_multicore_amp_BOARD_DEPENDENCY = yes
187 sbl_multicore_amp_CORE_DEPENDENCY = no
188 export sbl_multicore_amp_COMP_LIST
189 export sbl_multicore_amp_BOARD_DEPENDENCY
190 export sbl_multicore_amp_CORE_DEPENDENCY
191 sbl_multicore_amp_PKG_LIST = sbl_multicore_amp
192 sbl_multicore_amp_INCLUDE = $(sbl_multicore_amp_PATH)
193 sbl_multicore_amp_BOARDLIST = am65xx_evm am65xx_idk
194 export sbl_multicore_amp_BOARDLIST
195 sbl_multicore_amp_$(SOC)_CORELIST := $(word $(words $(sbl_am65xx_CORELIST)), $(sbl_am65xx_CORELIST))
196 export sbl_multicore_amp_$(SOC)_CORELIST
197 sbl_EXAMPLE_LIST += sbl_multicore_amp
198 sbl_multicore_amp_SBL_APPIMAGEGEN = no
199 export sbl_multicore_amp_SBL_APPIMAGEGEN
201 # R5 Lockstep and MPU SMP Boot Test
202 sbl_smp_test_COMP_LIST = sbl_smp_test
203 sbl_smp_test_RELPATH = ti/boot/sbl/example/ampMulticoreApp
204 sbl_smp_test_OBJPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/obj
205 sbl_smp_test_BINPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/binary
206 sbl_smp_test_PATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp
207 sbl_smp_test_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_smp_test.mk
208 export sbl_smp_test_MAKEFILE
209 sbl_smp_test_BOARD_DEPENDENCY = yes
210 sbl_smp_test_CORE_DEPENDENCY = no
211 export sbl_smp_test_COMP_LIST
212 export sbl_smp_test_BOARD_DEPENDENCY
213 export sbl_smp_test_CORE_DEPENDENCY
214 sbl_smp_test_PKG_LIST = sbl_smp_test
215 sbl_smp_test_INCLUDE = $(sbl_smp_test_PATH)
216 sbl_smp_test_BOARDLIST = am65xx_evm am65xx_idk
217 export sbl_smp_test_BOARDLIST
218 sbl_smp_test_$(SOC)_CORELIST = mcu1_0 mpu1_0
219 export sbl_smp_test_$(SOC)_CORELIST
220 sbl_EXAMPLE_LIST += sbl_smp_test
221 sbl_smp_test_SBL_APPIMAGEGEN = yes
222 export sbl_smp_test_SBL_APPIMAGEGEN
224 # Multicore SMP Boot Test
225 sbl_multicore_smp_COMP_LIST = sbl_multicore_smp
226 sbl_multicore_smp_RELPATH = ti/boot/sbl/example/ampMulticoreApp
227 sbl_multicore_smp_OBJPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/obj
228 sbl_multicore_smp_BINPATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp/binary
229 sbl_multicore_smp_PATH = $(PDK_SBL_COMP_PATH)/example/ampMulticoreApp
230 sbl_multicore_smp_MAKEFILE = -f$(PDK_SBL_COMP_PATH)/build/sbl_multicore_smp.mk
231 export sbl_multicore_smp_MAKEFILE
232 sbl_multicore_smp_BOARD_DEPENDENCY = yes
233 sbl_multicore_smp_CORE_DEPENDENCY = no
234 export sbl_multicore_smp_COMP_LIST
235 export sbl_multicore_smp_BOARD_DEPENDENCY
236 export sbl_multicore_smp_CORE_DEPENDENCY
237 sbl_multicore_smp_PKG_LIST = sbl_multicore_smp
238 sbl_multicore_smp_INCLUDE = $(sbl_multicore_smp_PATH)
239 sbl_multicore_smp_BOARDLIST = am65xx_evm am65xx_idk
240 export sbl_multicore_smp_BOARDLIST
241 sbl_multicore_smp_$(SOC)_CORELIST := $(word $(words $(sbl_am65xx_CORELIST)), $(sbl_am65xx_CORELIST))
242 export sbl_multicore_smp_$(SOC)_CORELIST
243 sbl_EXAMPLE_LIST += sbl_multicore_smp
244 sbl_multicore_smp_SBL_APPIMAGEGEN = no
245 export sbl_multicore_smp_SBL_APPIMAGEGEN
247 PDK_CFLAGS += -DOSAL_NONOS_CONFIGNUM_SEMAPHORE=16
249 # SBL log level
250 # no logs = 0, only errors =1, normal logs = 2, all logs = 3
251 SBL_CFLAGS = -DSBL_LOG_LEVEL=2
253 # BOOTMODE specific CFLAGS
254 ifeq ($(BOOTMODE), mmcsd)
255   SBL_CFLAGS+= -DBOOT_MMCSD
256 endif # ifeq ($(BOOTMODE), mmcsd)
258 ifeq ($(BOOTMODE), ospi)
259   SBL_CFLAGS += -DBOOT_OSPI
260 endif # ifeq ($(BOOTMODE), ospi)
262 ifeq ($(BOOTMODE), qspi)
263   SBL_CFLAGS += -DBOOT_QSPI
264 endif # ifeq ($(BOOTMODE), qspi)
266 ifeq ($(BOOTMODE), spi)
267   SBL_CFLAGS += -DBOOT_SPI
268 endif # ifeq ($(BOOTMODE), spi)
270 export sbl_LIB_LIST
271 export sbl_EXAMPLE_LIST
272 export SBL_CFLAGS
274 sbl_component_make_include := 1
275 endif