platform.mk 3.49 KB
Newer Older
1
#
2
# Copyright (c) 2020, Arm Limited. All rights reserved.
3
4
5
6
#
# SPDX-License-Identifier: BSD-3-Clause
#

7
8
include lib/libfdt/libfdt.mk

9
10
11
12
13
RESET_TO_BL31 := 1
ifeq (${RESET_TO_BL31}, 0)
$(error "This is a BL31-only port; RESET_TO_BL31 must be enabled")
endif

14
15
16
17
ifeq (${ENABLE_PIE}, 1)
override SEPARATE_CODE_AND_RODATA := 1
endif

18
19
20
21
22
23
24
25
26
CTX_INCLUDE_AARCH32_REGS := 0
ifeq (${CTX_INCLUDE_AARCH32_REGS}, 1)
$(error "This is an AArch64-only port; CTX_INCLUDE_AARCH32_REGS must be disabled")
endif

ifeq (${TRUSTED_BOARD_BOOT}, 1)
$(error "TRUSTED_BOARD_BOOT must be disabled")
endif

27
PRELOADED_BL33_BASE := 0x80080000
28

29
FPGA_PRELOADED_DTB_BASE := 0x80070000
30
31
$(eval $(call add_define,FPGA_PRELOADED_DTB_BASE))

32
33
34
FPGA_PRELOADED_CMD_LINE := 0x1000
$(eval $(call add_define,FPGA_PRELOADED_CMD_LINE))

35
36
37
# Treating this as a memory-constrained port for now
USE_COHERENT_MEM	:=	0

38
# This can be overridden depending on CPU(s) used in the FPGA image
39
40
HW_ASSISTED_COHERENCY	:=	1

Andre Przywara's avatar
Andre Przywara committed
41
42
PL011_GENERIC_UART	:=	1

43
44
SUPPORT_UNKNOWN_MPID	?=	1

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FPGA_CPU_LIBS	:=	lib/cpus/${ARCH}/aem_generic.S

# select a different set of CPU files, depending on whether we compile for
# hardware assisted coherency cores or not
ifeq (${HW_ASSISTED_COHERENCY}, 0)
# Cores used without DSU
	FPGA_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a35.S	\
				lib/cpus/aarch64/cortex_a53.S	\
				lib/cpus/aarch64/cortex_a57.S	\
				lib/cpus/aarch64/cortex_a72.S	\
				lib/cpus/aarch64/cortex_a73.S
else
# AArch64-only cores
	FPGA_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a76.S		\
				lib/cpus/aarch64/cortex_a76ae.S		\
				lib/cpus/aarch64/cortex_a77.S		\
61
				lib/cpus/aarch64/cortex_a78.S		\
62
				lib/cpus/aarch64/neoverse_n_common.S	\
63
				lib/cpus/aarch64/neoverse_n1.S		\
64
				lib/cpus/aarch64/neoverse_n2.S		\
65
				lib/cpus/aarch64/neoverse_e1.S		\
66
				lib/cpus/aarch64/neoverse_v1.S		\
67
				lib/cpus/aarch64/cortex_a78_ae.S	\
68
				lib/cpus/aarch64/cortex_a65.S		\
69
70
71
72
				lib/cpus/aarch64/cortex_a65ae.S		\
				lib/cpus/aarch64/cortex_klein.S		\
				lib/cpus/aarch64/cortex_matterhorn.S

73
74
75
76
# AArch64/AArch32 cores
	FPGA_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a55.S	\
				lib/cpus/aarch64/cortex_a75.S
endif
77

78
79
80
81
82
83
ifeq (${SUPPORT_UNKNOWN_MPID}, 1)
# Add support for unknown/invalid MPIDs (aarch64 only)
$(eval $(call add_define,SUPPORT_UNKNOWN_MPID))
	FPGA_CPU_LIBS	+=	lib/cpus/aarch64/generic.S
endif

84
85
# Allow detection of GIC-600
GICV3_SUPPORT_GIC600	:=	1
86
87
88
89
90

# Include GICv3 driver files
include drivers/arm/gic/v3/gicv3.mk

FPGA_GIC_SOURCES	:=	${GICV3_SOURCES}			\
91
92
				plat/common/plat_gicv3.c		\
				plat/arm/board/arm_fpga/fpga_gicv3.c
93

Andre Przywara's avatar
Andre Przywara committed
94
95
FDT_SOURCES		:=	fdts/arm_fpga.dts

96
97
98
99
PLAT_INCLUDES		:=	-Iplat/arm/board/arm_fpga/include

PLAT_BL_COMMON_SOURCES	:=	plat/arm/board/arm_fpga/${ARCH}/fpga_helpers.S

100
BL31_SOURCES		+=	common/fdt_wrappers.c				\
101
				common/fdt_fixup.c				\
102
				drivers/delay_timer/delay_timer.c		\
103
104
105
106
107
108
109
110
111
112
				drivers/delay_timer/generic_delay_timer.c	\
				drivers/arm/pl011/${ARCH}/pl011_console.S	\
				plat/common/plat_psci_common.c			\
				plat/arm/board/arm_fpga/fpga_pm.c			\
				plat/arm/board/arm_fpga/fpga_topology.c		\
				plat/arm/board/arm_fpga/fpga_console.c		\
				plat/arm/board/arm_fpga/fpga_bl31_setup.c		\
				${FPGA_CPU_LIBS}				\
				${FPGA_GIC_SOURCES}

Andre Przywara's avatar
Andre Przywara committed
113
$(eval $(call MAKE_S,$(BUILD_PLAT),plat/arm/board/arm_fpga/rom_trampoline.S,31))
114
$(eval $(call MAKE_LD,$(BUILD_PLAT)/build_axf.ld,plat/arm/board/arm_fpga/build_axf.ld.S,31))
Andre Przywara's avatar
Andre Przywara committed
115

116
117
118
119
120
bl31.axf: bl31 dtbs ${BUILD_PLAT}/rom_trampoline.o ${BUILD_PLAT}/build_axf.ld
	$(ECHO) "  LD      $@"
	$(Q)$(LD) -T ${BUILD_PLAT}/build_axf.ld -L ${BUILD_PLAT} --strip-debug -o ${BUILD_PLAT}/bl31.axf

all: bl31.axf