Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 1 | # |
Juan Pablo Conde | 6aba3b1 | 2023-08-09 13:19:21 -0500 | [diff] [blame] | 2 | # Copyright (c) 2019-2023, Arm Limited. All rights reserved. |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 7 | include common/fdt_wrappers.mk |
| 8 | |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 9 | ifdef ARM_CORTEX_A5 |
| 10 | # Use the SP804 timer instead of the generic one |
Madhukar Pappireddy | 7a554a1 | 2020-08-12 13:18:19 -0500 | [diff] [blame] | 11 | USE_SP804_TIMER := 1 |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 12 | BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c |
| 13 | endif |
| 14 | |
Alexei Fedorov | caa1802 | 2020-07-14 10:47:25 +0100 | [diff] [blame] | 15 | # Include GICv2 driver files |
| 16 | include drivers/arm/gic/v2/gicv2.mk |
| 17 | |
| 18 | FVP_VE_GIC_SOURCES := ${GICV2_SOURCES} \ |
| 19 | plat/common/plat_gicv2.c \ |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 20 | plat/arm/common/arm_gicv2.c |
| 21 | |
| 22 | FVP_VE_SECURITY_SOURCES := plat/arm/board/fvp_ve/fvp_ve_security.c |
| 23 | |
| 24 | PLAT_INCLUDES := -Iplat/arm/board/fvp_ve/include |
| 25 | |
| 26 | PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp_ve/fvp_ve_common.c \ |
| 27 | plat/arm/common/${ARCH}/arm_helpers.S \ |
| 28 | plat/arm/common/arm_common.c \ |
| 29 | plat/arm/common/arm_console.c \ |
| 30 | drivers/arm/pl011/${ARCH}/pl011_console.S \ |
| 31 | plat/arm/board/common/${ARCH}/board_arm_helpers.S |
| 32 | |
| 33 | ifdef ARM_CORTEX_A5 |
| 34 | FVP_VE_CPU_LIBS := lib/cpus/aarch32/cortex_a5.S |
| 35 | else |
| 36 | FVP_VE_CPU_LIBS := lib/cpus/aarch32/cortex_a7.S |
| 37 | endif |
| 38 | |
| 39 | BL1_SOURCES += drivers/arm/sp805/sp805.c \ |
| 40 | drivers/io/io_fip.c \ |
| 41 | drivers/io/io_memmap.c \ |
| 42 | drivers/io/io_storage.c \ |
| 43 | plat/arm/common/arm_bl1_setup.c \ |
| 44 | plat/arm/common/arm_err.c \ |
Ambroise Vincent | fa42c9e | 2019-07-04 14:58:45 +0100 | [diff] [blame] | 45 | plat/arm/board/fvp_ve/fvp_ve_err.c \ |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 46 | plat/arm/common/arm_io_storage.c \ |
Louis Mayencourt | 6b232d9 | 2020-02-28 16:57:30 +0000 | [diff] [blame] | 47 | plat/arm/common/fconf/arm_fconf_io.c \ |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 48 | drivers/cfi/v2m/v2m_flash.c \ |
| 49 | plat/arm/board/fvp_ve/${ARCH}/fvp_ve_helpers.S \ |
| 50 | plat/arm/board/fvp_ve/fvp_ve_bl1_setup.c \ |
| 51 | lib/aarch32/arm32_aeabi_divmod.c \ |
| 52 | lib/aarch32/arm32_aeabi_divmod_a32.S \ |
| 53 | ${FVP_VE_CPU_LIBS} \ |
| 54 | ${DYN_CFG_SOURCES} |
| 55 | |
| 56 | BL2_SOURCES += plat/arm/board/fvp_ve/fvp_ve_bl2_setup.c \ |
| 57 | lib/aarch32/arm32_aeabi_divmod.c \ |
| 58 | lib/aarch32/arm32_aeabi_divmod_a32.S \ |
| 59 | drivers/delay_timer/delay_timer.c \ |
| 60 | drivers/delay_timer/generic_delay_timer.c \ |
| 61 | drivers/cfi/v2m/v2m_flash.c \ |
| 62 | drivers/io/io_fip.c \ |
| 63 | drivers/io/io_memmap.c \ |
| 64 | drivers/io/io_storage.c \ |
| 65 | plat/arm/common/arm_bl2_setup.c \ |
| 66 | plat/arm/common/arm_err.c \ |
Ambroise Vincent | fa42c9e | 2019-07-04 14:58:45 +0100 | [diff] [blame] | 67 | plat/arm/board/fvp_ve/fvp_ve_err.c \ |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 68 | plat/arm/common/arm_io_storage.c \ |
Louis Mayencourt | 6b232d9 | 2020-02-28 16:57:30 +0000 | [diff] [blame] | 69 | plat/arm/common/fconf/arm_fconf_io.c \ |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 70 | plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c \ |
| 71 | plat/arm/common/arm_image_load.c \ |
| 72 | common/desc_image_load.c \ |
| 73 | ${DYN_CFG_SOURCES} \ |
| 74 | ${FVP_VE_SECURITY_SOURCES} |
| 75 | |
| 76 | # Add the FDT_SOURCES and options for Dynamic Config (only for Unix env) |
| 77 | ifdef UNIX_MK |
| 78 | |
Manish V Badarkhe | 64616a5 | 2020-05-31 08:53:40 +0100 | [diff] [blame] | 79 | FDT_SOURCES += plat/arm/board/fvp_ve/fdts/fvp_ve_fw_config.dts \ |
| 80 | plat/arm/board/fvp_ve/fdts/fvp_ve_tb_fw_config.dts |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 81 | |
Manish V Badarkhe | 64616a5 | 2020-05-31 08:53:40 +0100 | [diff] [blame] | 82 | FVP_FW_CONFIG := ${BUILD_PLAT}/fdts/fvp_ve_fw_config.dtb |
| 83 | FVP_TB_FW_CONFIG := ${BUILD_PLAT}/fdts/fvp_ve_tb_fw_config.dtb |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 84 | |
Manish V Badarkhe | 64616a5 | 2020-05-31 08:53:40 +0100 | [diff] [blame] | 85 | # Add the FW_CONFIG to FIP and specify the same to certtool |
Anders Dellien | 3f69474 | 2020-08-23 19:32:48 +0100 | [diff] [blame] | 86 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_FW_CONFIG},--fw-config,${FVP_FW_CONFIG})) |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 87 | # Add the TB_FW_CONFIG to FIP and specify the same to certtool |
Anders Dellien | 3f69474 | 2020-08-23 19:32:48 +0100 | [diff] [blame] | 88 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_TB_FW_CONFIG},--tb-fw-config,${FVP_TB_FW_CONFIG})) |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 89 | |
| 90 | FDT_SOURCES += ${FVP_HW_CONFIG_DTS} |
| 91 | $(eval FVP_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb, \ |
| 92 | fdts/$(notdir ${FVP_HW_CONFIG_DTS}))) |
| 93 | # Add the HW_CONFIG to FIP and specify the same to certtool |
Anders Dellien | 3f69474 | 2020-08-23 19:32:48 +0100 | [diff] [blame] | 94 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG})) |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 95 | endif |
| 96 | |
| 97 | NEED_BL32 := yes |
| 98 | |
Juan Pablo Conde | 6aba3b1 | 2023-08-09 13:19:21 -0500 | [diff] [blame] | 99 | ifeq (${AARCH32_SP},none) |
| 100 | $(error Variable AARCH32_SP has to be set for AArch32) |
| 101 | endif |
| 102 | |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 103 | # Modification of arm_common.mk |
| 104 | |
| 105 | # Process ARM_DISABLE_TRUSTED_WDOG flag |
| 106 | # By default, Trusted Watchdog is always enabled unless SPIN_ON_BL1_EXIT is set |
| 107 | ARM_DISABLE_TRUSTED_WDOG := 0 |
| 108 | ifeq (${SPIN_ON_BL1_EXIT}, 1) |
| 109 | ARM_DISABLE_TRUSTED_WDOG := 1 |
| 110 | endif |
| 111 | $(eval $(call assert_boolean,ARM_DISABLE_TRUSTED_WDOG)) |
| 112 | $(eval $(call add_define,ARM_DISABLE_TRUSTED_WDOG)) |
| 113 | |
| 114 | # Use translation tables library v1 if using Cortex-A5 |
| 115 | ifdef ARM_CORTEX_A5 |
| 116 | ARM_XLAT_TABLES_LIB_V1 := 1 |
| 117 | else |
| 118 | ARM_XLAT_TABLES_LIB_V1 := 0 |
| 119 | endif |
| 120 | $(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1)) |
| 121 | $(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1)) |
| 122 | |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 123 | ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1) |
| 124 | # Only use nonlpae version of xlatv1 otherwise use xlat v2 |
| 125 | PLAT_BL_COMMON_SOURCES += lib/xlat_tables/${ARCH}/nonlpae_tables.c |
| 126 | else |
| 127 | include lib/xlat_tables_v2/xlat_tables.mk |
| 128 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} |
| 129 | endif |
| 130 | |
Louis Mayencourt | 5a15b2d | 2019-10-17 14:46:51 +0100 | [diff] [blame] | 131 | # Firmware Configuration Framework sources |
| 132 | include lib/fconf/fconf.mk |
| 133 | |
Chris Kay | b296ada | 2021-05-20 13:22:43 +0100 | [diff] [blame] | 134 | BL1_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES} |
| 135 | BL2_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES} |
| 136 | |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 137 | # Add `libfdt` and Arm common helpers required for Dynamic Config |
| 138 | include lib/libfdt/libfdt.mk |
| 139 | |
| 140 | DYN_CFG_SOURCES += plat/arm/common/arm_dyn_cfg.c \ |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 141 | plat/arm/common/arm_dyn_cfg_helpers.c |
Usama Arif | e97998f | 2018-11-30 15:43:56 +0000 | [diff] [blame] | 142 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 143 | DYN_CFG_SOURCES += ${FDT_WRAPPERS_SOURCES} |