aboutsummaryrefslogtreecommitdiff
path: root/spm/ivy/ivy.mk
blob: 244d20969faa70c8b6e96fa8e33fec7405889401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# Copyright (c) 2018, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

include lib/sprt/sprt_client.mk

IVY_DTB		:= $(BUILD_PLAT)/ivy.dtb

IVY_INCLUDES :=					\
	-Iinclude					\
	-Iinclude/common				\
	-Iinclude/common/${ARCH}			\
	-Iinclude/lib					\
	-Iinclude/lib/${ARCH}				\
	-Iinclude/lib/stdlib				\
	-Iinclude/lib/stdlib/sys			\
	-Iinclude/lib/sprt				\
	-Iinclude/lib/utils				\
	-Iinclude/lib/xlat_tables			\
	-Iinclude/runtime_services			\
	-Iinclude/runtime_services/secure_el0_payloads	\
	-Ispm/ivy					\
	-Ispm/common					\
	${SPRT_LIB_INCLUDES}

IVY_SOURCES	:=					\
	$(addprefix spm/ivy/,			\
		aarch64/ivy_entrypoint.S		\
		ivy_main.c				\
	)						\
	$(addprefix spm/common/,			\
		aarch64/sp_arch_helpers.S		\
		sp_helpers.c				\
	)						\

STDLIB_SOURCES	:=	$(addprefix lib/stdlib/,	\
	assert.c					\
	mem.c						\
	putchar.c					\
	printf.c					\
	rand.c						\
	strlen.c					\
	subr_prf.c					\
)

# TODO: Remove dependency on TFTF files.
IVY_SOURCES	+=					\
	tftf/framework/debug.c				\
	tftf/framework/${ARCH}/asm_debug.S

IVY_SOURCES	+= 	drivers/arm/pl011/${ARCH}/pl011_console.S	\
			lib/${ARCH}/cache_helpers.S			\
			lib/${ARCH}/misc_helpers.S			\
			lib/locks/${ARCH}/spinlock.S			\
			lib/utils/mp_printf.c				\
			${STDLIB_SOURCES}				\
			${SPRT_LIB_SOURCES}

IVY_LINKERFILE	:=	spm/ivy/ivy.ld.S

IVY_DEFINES	:=

$(eval $(call add_define,IVY_DEFINES,DEBUG))
$(eval $(call add_define,IVY_DEFINES,ENABLE_ASSERTIONS))
$(eval $(call add_define,IVY_DEFINES,LOG_LEVEL))
$(eval $(call add_define,IVY_DEFINES,PLAT_${PLAT}))
ifeq (${ARCH},aarch32)
        $(eval $(call add_define,IVY_DEFINES,AARCH32))
else
        $(eval $(call add_define,IVY_DEFINES,AARCH64))
endif

$(IVY_DTB) : $(BUILD_PLAT)/ivy $(BUILD_PLAT)/ivy/ivy.elf
$(IVY_DTB) : spm/ivy/ivy.dts
	@echo "  DTBGEN  spm/ivy/ivy.dts"
	${Q}tools/generate_dtb/generate_dtb.sh \
		ivy spm/ivy/ivy.dts $(BUILD_PLAT)
	@echo
	@echo "Built $@ successfully"
	@echo

ivy: $(IVY_DTB) $(AUTOGEN_DIR)/tests_list.h