Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 1 | # Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved. |
| 2 | # Copyright (c) 2021-2022, Xilinx, Inc. All rights reserved. |
| 3 | # Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | |
| 7 | PLAT_PATH := plat/amd/versal2 |
| 8 | |
Amit Nagal | ddb5b06 | 2024-08-08 22:15:19 -1200 | [diff] [blame^] | 9 | override NEED_BL1 := no |
| 10 | override NEED_BL2 := no |
| 11 | |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 12 | # A78 Erratum for SoC |
| 13 | ERRATA_A78_AE_1941500 := 1 |
| 14 | ERRATA_A78_AE_1951502 := 1 |
| 15 | ERRATA_A78_AE_2376748 := 1 |
| 16 | ERRATA_A78_AE_2395408 := 1 |
| 17 | ERRATA_ABI_SUPPORT := 1 |
| 18 | |
| 19 | # Platform Supports Armv8.2 extensions |
| 20 | ARM_ARCH_MAJOR := 8 |
| 21 | ARM_ARCH_MINOR := 2 |
| 22 | |
| 23 | override PROGRAMMABLE_RESET_ADDRESS := 1 |
| 24 | PSCI_EXTENDED_STATE_ID := 1 |
| 25 | SEPARATE_CODE_AND_RODATA := 1 |
| 26 | override RESET_TO_BL31 := 1 |
| 27 | PL011_GENERIC_UART := 1 |
| 28 | IPI_CRC_CHECK := 0 |
| 29 | GIC_ENABLE_V4_EXTN := 0 |
| 30 | GICV3_SUPPORT_GIC600 := 1 |
| 31 | |
| 32 | override CTX_INCLUDE_AARCH32_REGS := 0 |
| 33 | |
Akshay Belsare | c4f29f0 | 2024-09-11 14:17:37 +0530 | [diff] [blame] | 34 | # Platform to support Dynamic XLAT Table by default |
| 35 | override PLAT_XLAT_TABLES_DYNAMIC := 1 |
| 36 | $(eval $(call add_define,PLAT_XLAT_TABLES_DYNAMIC)) |
| 37 | |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 38 | ifdef MEM_BASE |
| 39 | $(eval $(call add_define,MEM_BASE)) |
| 40 | |
| 41 | ifndef MEM_SIZE |
Michal Simek | a7178ca | 2024-08-02 13:19:23 +0200 | [diff] [blame] | 42 | $(error "MEM_BASE defined without MEM_SIZE") |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 43 | endif |
| 44 | $(eval $(call add_define,MEM_SIZE)) |
| 45 | |
| 46 | ifdef MEM_PROGBITS_SIZE |
| 47 | $(eval $(call add_define,MEM_PROGBITS_SIZE)) |
| 48 | endif |
| 49 | endif |
| 50 | |
| 51 | ifdef BL32_MEM_BASE |
| 52 | $(eval $(call add_define,BL32_MEM_BASE)) |
| 53 | |
| 54 | ifndef BL32_MEM_SIZE |
Michal Simek | a7178ca | 2024-08-02 13:19:23 +0200 | [diff] [blame] | 55 | $(error "BL32_MEM_BASE defined without BL32_MEM_SIZE") |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 56 | endif |
| 57 | $(eval $(call add_define,BL32_MEM_SIZE)) |
| 58 | endif |
| 59 | |
| 60 | ifdef IPI_CRC_CHECK |
| 61 | $(eval $(call add_define,IPI_CRC_CHECK)) |
| 62 | endif |
| 63 | |
| 64 | USE_COHERENT_MEM := 0 |
| 65 | HW_ASSISTED_COHERENCY := 1 |
| 66 | |
Maheedhar Bollapalli | 9c411e3 | 2024-07-01 07:07:53 +0000 | [diff] [blame] | 67 | VERSAL2_CONSOLE ?= pl011 |
Michal Simek | b954eb4 | 2024-09-10 15:55:04 +0200 | [diff] [blame] | 68 | ifeq (${VERSAL2_CONSOLE}, $(filter ${VERSAL2_CONSOLE},pl011 pl011_0 pl011_1 dcc dtb none)) |
Maheedhar Bollapalli | 9c411e3 | 2024-07-01 07:07:53 +0000 | [diff] [blame] | 69 | else |
| 70 | $(error "Please define VERSAL2_CONSOLE") |
| 71 | endif |
| 72 | |
| 73 | $(eval $(call add_define_val,VERSAL2_CONSOLE,VERSAL2_CONSOLE_ID_${VERSAL2_CONSOLE})) |
| 74 | |
| 75 | # Runtime console in default console in DEBUG build |
| 76 | ifeq ($(DEBUG), 1) |
| 77 | CONSOLE_RUNTIME ?= pl011 |
| 78 | endif |
| 79 | |
| 80 | # Runtime console |
| 81 | ifdef CONSOLE_RUNTIME |
| 82 | ifeq (${CONSOLE_RUNTIME}, $(filter ${CONSOLE_RUNTIME},pl011 pl011_0 pl011_1 dcc dtb)) |
| 83 | $(eval $(call add_define_val,CONSOLE_RUNTIME,RT_CONSOLE_ID_${CONSOLE_RUNTIME})) |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 84 | else |
Maheedhar Bollapalli | 9c411e3 | 2024-07-01 07:07:53 +0000 | [diff] [blame] | 85 | $(error "Please define CONSOLE_RUNTIME") |
| 86 | endif |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 87 | endif |
| 88 | |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 89 | |
| 90 | ifdef XILINX_OF_BOARD_DTB_ADDR |
| 91 | $(eval $(call add_define,XILINX_OF_BOARD_DTB_ADDR)) |
| 92 | endif |
| 93 | |
| 94 | PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ |
| 95 | -Iplat/xilinx/common/include/ \ |
| 96 | -Iplat/xilinx/common/ipi_mailbox_service/ \ |
| 97 | -I${PLAT_PATH}/include/ \ |
| 98 | -Iplat/xilinx/versal/pm_service/ |
| 99 | |
| 100 | # Include GICv3 driver files |
| 101 | include drivers/arm/gic/v3/gicv3.mk |
| 102 | include lib/xlat_tables_v2/xlat_tables.mk |
| 103 | include lib/libfdt/libfdt.mk |
| 104 | |
| 105 | PLAT_BL_COMMON_SOURCES := \ |
| 106 | drivers/arm/dcc/dcc_console.c \ |
| 107 | drivers/delay_timer/delay_timer.c \ |
| 108 | drivers/delay_timer/generic_delay_timer.c \ |
| 109 | ${GICV3_SOURCES} \ |
| 110 | drivers/arm/pl011/aarch64/pl011_console.S \ |
| 111 | plat/common/aarch64/crash_console_helpers.S \ |
| 112 | plat/arm/common/arm_common.c \ |
| 113 | plat/common/plat_gicv3.c \ |
| 114 | ${PLAT_PATH}/aarch64/helpers.S \ |
| 115 | ${PLAT_PATH}/aarch64/common.c \ |
| 116 | ${PLAT_PATH}/plat_topology.c \ |
| 117 | ${XLAT_TABLES_LIB_SRCS} |
| 118 | |
| 119 | BL31_SOURCES += drivers/arm/cci/cci.c \ |
| 120 | lib/cpus/aarch64/cortex_a78_ae.S \ |
| 121 | lib/cpus/aarch64/cortex_a78.S \ |
| 122 | plat/common/plat_psci_common.c \ |
| 123 | drivers/scmi-msg/base.c \ |
| 124 | drivers/scmi-msg/entry.c \ |
| 125 | drivers/scmi-msg/smt.c \ |
| 126 | drivers/scmi-msg/clock.c \ |
| 127 | drivers/scmi-msg/power_domain.c \ |
| 128 | drivers/scmi-msg/reset_domain.c \ |
| 129 | ${PLAT_PATH}/scmi.c |
| 130 | |
| 131 | BL31_SOURCES += ${PLAT_PATH}/plat_psci.c |
| 132 | |
| 133 | BL31_SOURCES += plat/xilinx/common/plat_fdt.c \ |
Maheedhar Bollapalli | 9c411e3 | 2024-07-01 07:07:53 +0000 | [diff] [blame] | 134 | common/fdt_wrappers.c \ |
| 135 | plat/xilinx/common/plat_fdt.c \ |
| 136 | plat/xilinx/common/plat_console.c \ |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 137 | plat/xilinx/common/plat_startup.c \ |
| 138 | plat/xilinx/common/ipi.c \ |
| 139 | plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \ |
| 140 | ${PLAT_PATH}/soc_ipi.c \ |
| 141 | plat/xilinx/common/versal.c \ |
| 142 | ${PLAT_PATH}/bl31_setup.c \ |
| 143 | common/fdt_fixup.c \ |
Andre Przywara | 467f8fb | 2024-03-21 13:27:56 +0000 | [diff] [blame] | 144 | common/fdt_wrappers.c \ |
Amit Nagal | 055796f | 2024-06-05 12:32:38 +0530 | [diff] [blame] | 145 | ${LIBFDT_SRCS} \ |
| 146 | ${PLAT_PATH}/sip_svc_setup.c \ |
| 147 | ${PLAT_PATH}/gicv3.c |
| 148 | |
| 149 | ifeq (${ERRATA_ABI_SUPPORT}, 1) |
| 150 | # enable the cpu macros for errata abi interface |
| 151 | CORTEX_A78_AE_H_INC := 1 |
| 152 | $(eval $(call add_define, CORTEX_A78_AE_H_INC)) |
| 153 | endif |
Amit Nagal | ddb5b06 | 2024-08-08 22:15:19 -1200 | [diff] [blame^] | 154 | |
| 155 | # Enable Handoff protocol using transfer lists |
| 156 | TRANSFER_LIST := 1 |
| 157 | |
| 158 | include lib/transfer_list/transfer_list.mk |
| 159 | BL31_SOURCES += plat/xilinx/common/plat_xfer_list.c |