Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 1 | # |
dp-arm | 230011c | 2017-03-07 11:02:47 +0000 | [diff] [blame] | 2 | # Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 5 | # |
| 6 | |
| 7 | include lib/libfdt/libfdt.mk |
| 8 | |
Fu Wei | c2f7844 | 2017-05-27 21:21:42 +0800 | [diff] [blame] | 9 | # Enable new version of image loading on QEMU platforms |
| 10 | LOAD_IMAGE_V2 := 1 |
| 11 | |
| 12 | ifeq ($(NEED_BL32),yes) |
| 13 | $(eval $(call add_define,QEMU_LOAD_BL32)) |
| 14 | endif |
| 15 | |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 16 | PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ |
| 17 | -Iinclude/plat/arm/common/aarch64/ \ |
| 18 | -Iplat/qemu/include \ |
| 19 | -Iinclude/common/tbbr |
| 20 | |
Fu Wei | 77ecd46 | 2017-07-31 18:28:32 +0800 | [diff] [blame] | 21 | # Use translation tables library v2 by default |
| 22 | ARM_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 Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 26 | |
| 27 | PLAT_BL_COMMON_SOURCES := plat/qemu/qemu_common.c \ |
Fu Wei | 77ecd46 | 2017-07-31 18:28:32 +0800 | [diff] [blame] | 28 | drivers/arm/pl011/aarch64/pl011_console.S |
| 29 | |
| 30 | ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1) |
| 31 | PLAT_BL_COMMON_SOURCES += lib/xlat_tables/xlat_tables_common.c \ |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 32 | lib/xlat_tables/aarch64/xlat_tables.c |
Fu Wei | 77ecd46 | 2017-07-31 18:28:32 +0800 | [diff] [blame] | 33 | else |
| 34 | include lib/xlat_tables_v2/xlat_tables.mk |
| 35 | |
| 36 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} |
| 37 | endif |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 38 | |
| 39 | BL1_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 Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 49 | plat/qemu/aarch64/plat_helpers.S \ |
| 50 | plat/qemu/qemu_bl1_setup.c |
| 51 | |
| 52 | BL2_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 Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 56 | 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 Wei | c2f7844 | 2017-05-27 21:21:42 +0800 | [diff] [blame] | 63 | ifeq (${LOAD_IMAGE_V2},1) |
| 64 | BL2_SOURCES += plat/qemu/qemu_bl2_mem_params_desc.c \ |
| 65 | plat/qemu/qemu_image_load.c \ |
| 66 | common/desc_image_load.c |
| 67 | endif |
Jens Wiklander | 0acbaaa | 2017-08-24 13:16:26 +0200 | [diff] [blame] | 68 | ifeq (${SPD},opteed) |
| 69 | BL2_SOURCES += lib/optee/optee_utils.c |
| 70 | endif |
| 71 | |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 72 | |
| 73 | BL31_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 Wiklander | 1017a6e | 2017-08-24 13:16:20 +0200 | [diff] [blame] | 79 | plat/common/plat_psci_common.c \ |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 80 | 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 Wiklander | 0acbaaa | 2017-08-24 13:16:26 +0200 | [diff] [blame] | 86 | |
| 87 | # Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images |
| 88 | # in the FIP if the platform requires. |
| 89 | ifneq ($(BL32_EXTRA1),) |
| 90 | $(eval $(call FIP_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1)) |
| 91 | endif |
| 92 | ifneq ($(BL32_EXTRA2),) |
| 93 | $(eval $(call FIP_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2)) |
| 94 | endif |
| 95 | |
Jens Wiklander | 52c798e | 2015-12-07 14:37:10 +0100 | [diff] [blame] | 96 | # Disable the PSCI platform compatibility layer |
| 97 | ENABLE_PLAT_COMPAT := 0 |
| 98 | |
| 99 | BL32_RAM_LOCATION := tdram |
| 100 | ifeq (${BL32_RAM_LOCATION}, tsram) |
| 101 | BL32_RAM_LOCATION_ID = SEC_SRAM_ID |
| 102 | else ifeq (${BL32_RAM_LOCATION}, tdram) |
| 103 | BL32_RAM_LOCATION_ID = SEC_DRAM_ID |
| 104 | else |
| 105 | $(error "Unsupported BL32_RAM_LOCATION value") |
| 106 | endif |
| 107 | |
| 108 | # Process flags |
| 109 | $(eval $(call add_define,BL32_RAM_LOCATION_ID)) |