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