blob: ed197a1d1fbafc51e81d47a8a95be36e3bf79428 [file] [log] [blame]
Jens Wiklander52c798e2015-12-07 14:37:10 +01001#
dp-arm230011c2017-03-07 11:02:47 +00002# Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
Jens Wiklander52c798e2015-12-07 14:37:10 +01003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Jens Wiklander52c798e2015-12-07 14:37:10 +01005#
6
7include lib/libfdt/libfdt.mk
8
Fu Weic2f78442017-05-27 21:21:42 +08009# Enable new version of image loading on QEMU platforms
10LOAD_IMAGE_V2 := 1
11
12ifeq ($(NEED_BL32),yes)
13$(eval $(call add_define,QEMU_LOAD_BL32))
14endif
15
Jens Wiklander52c798e2015-12-07 14:37:10 +010016PLAT_INCLUDES := -Iinclude/plat/arm/common/ \
17 -Iinclude/plat/arm/common/aarch64/ \
18 -Iplat/qemu/include \
19 -Iinclude/common/tbbr
20
Fu Wei77ecd462017-07-31 18:28:32 +080021# Use translation tables library v2 by default
22ARM_XLAT_TABLES_LIB_V1 := 0
23$(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1))
24$(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
25
Jens Wiklander52c798e2015-12-07 14:37:10 +010026
27PLAT_BL_COMMON_SOURCES := plat/qemu/qemu_common.c \
Fu Wei77ecd462017-07-31 18:28:32 +080028 drivers/arm/pl011/aarch64/pl011_console.S
29
30ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
31PLAT_BL_COMMON_SOURCES += lib/xlat_tables/xlat_tables_common.c \
Jens Wiklander52c798e2015-12-07 14:37:10 +010032 lib/xlat_tables/aarch64/xlat_tables.c
Fu Wei77ecd462017-07-31 18:28:32 +080033else
34include lib/xlat_tables_v2/xlat_tables.mk
35
36PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS}
37endif
Jens Wiklander52c798e2015-12-07 14:37:10 +010038
39BL1_SOURCES += drivers/io/io_semihosting.c \
40 drivers/io/io_storage.c \
41 drivers/io/io_fip.c \
42 drivers/io/io_memmap.c \
43 lib/semihosting/semihosting.c \
44 lib/semihosting/aarch64/semihosting_call.S \
45 plat/qemu/qemu_io_storage.c \
46 lib/cpus/aarch64/aem_generic.S \
47 lib/cpus/aarch64/cortex_a53.S \
48 lib/cpus/aarch64/cortex_a57.S \
Jens Wiklander52c798e2015-12-07 14:37:10 +010049 plat/qemu/aarch64/plat_helpers.S \
50 plat/qemu/qemu_bl1_setup.c
51
52BL2_SOURCES += drivers/io/io_semihosting.c \
53 drivers/io/io_storage.c \
54 drivers/io/io_fip.c \
55 drivers/io/io_memmap.c \
Jens Wiklander52c798e2015-12-07 14:37:10 +010056 lib/semihosting/semihosting.c \
57 lib/semihosting/aarch64/semihosting_call.S\
58 plat/qemu/qemu_io_storage.c \
59 plat/qemu/aarch64/plat_helpers.S \
60 plat/qemu/qemu_bl2_setup.c \
61 plat/qemu/dt.c \
62 $(LIBFDT_SRCS)
Fu Weic2f78442017-05-27 21:21:42 +080063ifeq (${LOAD_IMAGE_V2},1)
64BL2_SOURCES += plat/qemu/qemu_bl2_mem_params_desc.c \
65 plat/qemu/qemu_image_load.c \
66 common/desc_image_load.c
67endif
Jens Wiklander0acbaaa2017-08-24 13:16:26 +020068ifeq (${SPD},opteed)
69BL2_SOURCES += lib/optee/optee_utils.c
70endif
71
Jens Wiklander52c798e2015-12-07 14:37:10 +010072
73BL31_SOURCES += lib/cpus/aarch64/aem_generic.S \
74 lib/cpus/aarch64/cortex_a53.S \
75 lib/cpus/aarch64/cortex_a57.S \
76 drivers/arm/gic/v2/gicv2_helpers.c \
77 drivers/arm/gic/v2/gicv2_main.c \
78 drivers/arm/gic/common/gic_common.c \
Jens Wiklander1017a6e2017-08-24 13:16:20 +020079 plat/common/plat_psci_common.c \
Jens Wiklander52c798e2015-12-07 14:37:10 +010080 plat/qemu/qemu_pm.c \
81 plat/qemu/topology.c \
82 plat/qemu/aarch64/plat_helpers.S \
83 plat/qemu/qemu_bl31_setup.c \
84 plat/qemu/qemu_gic.c
85
Jens Wiklander0acbaaa2017-08-24 13:16:26 +020086
87# Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
88# in the FIP if the platform requires.
89ifneq ($(BL32_EXTRA1),)
90$(eval $(call FIP_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
91endif
92ifneq ($(BL32_EXTRA2),)
93$(eval $(call FIP_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
94endif
95
Jens Wiklander52c798e2015-12-07 14:37:10 +010096# Disable the PSCI platform compatibility layer
97ENABLE_PLAT_COMPAT := 0
98
99BL32_RAM_LOCATION := tdram
100ifeq (${BL32_RAM_LOCATION}, tsram)
101 BL32_RAM_LOCATION_ID = SEC_SRAM_ID
102else ifeq (${BL32_RAM_LOCATION}, tdram)
103 BL32_RAM_LOCATION_ID = SEC_DRAM_ID
104else
105 $(error "Unsupported BL32_RAM_LOCATION value")
106endif
107
108# Process flags
109$(eval $(call add_define,BL32_RAM_LOCATION_ID))