xref: /rk3399_ARM-atf/bl32/sp_min/sp_min.mk (revision d9915518726613919a66b35df7f4cd2db42af3e4)
1c11ba852SSoby Mathew#
2c11ba852SSoby Mathew# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3c11ba852SSoby Mathew#
4c11ba852SSoby Mathew# Redistribution and use in source and binary forms, with or without
5c11ba852SSoby Mathew# modification, are permitted provided that the following conditions are met:
6c11ba852SSoby Mathew#
7c11ba852SSoby Mathew# Redistributions of source code must retain the above copyright notice, this
8c11ba852SSoby Mathew# list of conditions and the following disclaimer.
9c11ba852SSoby Mathew#
10c11ba852SSoby Mathew# Redistributions in binary form must reproduce the above copyright notice,
11c11ba852SSoby Mathew# this list of conditions and the following disclaimer in the documentation
12c11ba852SSoby Mathew# and/or other materials provided with the distribution.
13c11ba852SSoby Mathew#
14c11ba852SSoby Mathew# Neither the name of ARM nor the names of its contributors may be used
15c11ba852SSoby Mathew# to endorse or promote products derived from this software without specific
16c11ba852SSoby Mathew# prior written permission.
17c11ba852SSoby Mathew#
18c11ba852SSoby Mathew# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19c11ba852SSoby Mathew# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20c11ba852SSoby Mathew# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21c11ba852SSoby Mathew# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22c11ba852SSoby Mathew# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23c11ba852SSoby Mathew# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24c11ba852SSoby Mathew# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25c11ba852SSoby Mathew# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26c11ba852SSoby Mathew# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27c11ba852SSoby Mathew# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28c11ba852SSoby Mathew# POSSIBILITY OF SUCH DAMAGE.
29c11ba852SSoby Mathew#
30c11ba852SSoby Mathew
31c11ba852SSoby Mathewifneq (${ARCH}, aarch32)
32c11ba852SSoby Mathew	$(error SP_MIN is only supported on AArch32 platforms)
33c11ba852SSoby Mathewendif
34c11ba852SSoby Mathew
35c11ba852SSoby Mathewinclude lib/psci/psci_lib.mk
36c11ba852SSoby Mathew
37c11ba852SSoby MathewINCLUDES		+=	-Iinclude/bl32/sp_min
38c11ba852SSoby Mathew
39c11ba852SSoby MathewBL32_SOURCES		+=	bl32/sp_min/sp_min_main.c		\
40c11ba852SSoby Mathew				bl32/sp_min/aarch32/entrypoint.S	\
41c11ba852SSoby Mathew				common/runtime_svc.c			\
42c11ba852SSoby Mathew				services/std_svc/std_svc_setup.c	\
43c11ba852SSoby Mathew				${PSCI_LIB_SOURCES}
44c11ba852SSoby Mathew
45c11ba852SSoby Mathewifeq (${ENABLE_PMF}, 1)
46c11ba852SSoby MathewBL32_SOURCES		+=	lib/pmf/pmf_main.c
47c11ba852SSoby Mathewendif
48c11ba852SSoby Mathew
49c11ba852SSoby MathewBL32_LINKERFILE	:=	bl32/sp_min/sp_min.ld.S
50c11ba852SSoby Mathew
51c11ba852SSoby Mathew# Include the platform-specific SP_MIN Makefile
52c11ba852SSoby Mathew# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
53c11ba852SSoby Mathew# on this platform.
54c11ba852SSoby MathewSP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
55c11ba852SSoby Mathewifeq (,${SP_MIN_PLAT_MAKEFILE})
56c11ba852SSoby Mathew  $(error SP_MIN is not supported on platform ${PLAT})
57c11ba852SSoby Mathewelse
58c11ba852SSoby Mathew  include ${SP_MIN_PLAT_MAKEFILE}
59c11ba852SSoby Mathewendif
60c11ba852SSoby Mathew
61*d9915518SYatharth KocharRESET_TO_SP_MIN	:= 0
62c11ba852SSoby Mathew$(eval $(call add_define,RESET_TO_SP_MIN))
63c11ba852SSoby Mathew$(eval $(call assert_boolean,RESET_TO_SP_MIN))
64