xref: /rk3399_ARM-atf/plat/renesas/rcar_gen4/platform.mk (revision a4defaefe65379554f464e9cf2b4f4d9818740aa)
1#
2# Copyright (c) 2018-2025, Renesas Electronics Corporation. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7PROGRAMMABLE_RESET_ADDRESS	:= 0
8COLD_BOOT_SINGLE_CPU		:= 1
9ARM_CCI_PRODUCT_ID		:= 500
10TRUSTED_BOARD_BOOT		:= 1
11RESET_TO_BL31			:= 1
12GENERATE_COT			:= 1
13ENABLE_SVE_FOR_NS		:= 0
14MULTI_CONSOLE_API		:= 1
15INIT_UNUSED_NS_EL2		:= 1
16
17CRASH_REPORTING			:= 1
18HANDLE_EA_EL3_FIRST_NS		:= 1
19ENABLE_STACK_PROTECTOR	:= strong
20
21ifndef PTP_NONSECURE_ACCESS
22  PTP_NONSECURE_ACCESS:=0
23endif
24$(eval $(call add_define,PTP_NONSECURE_ACCESS))
25
26ifeq (${SPD},none)
27  SPD_NONE:=1
28  $(eval $(call add_define,SPD_NONE))
29endif
30
31# LSI setting common define
32RCAR_S4:=9
33RCAR_V3U:=10
34RCAR_V4H:=11
35RCAR_V4M:=12
36RCAR_AUTO:=99
37$(eval $(call add_define,RCAR_S4))
38$(eval $(call add_define,RCAR_V3U))
39$(eval $(call add_define,RCAR_V4H))
40$(eval $(call add_define,RCAR_V4M))
41$(eval $(call add_define,RCAR_AUTO))
42PLAT_EXTRA_LD_SCRIPT	:=	1
43
44ifndef LSI
45  $(error "Error: Unknown LSI. Please use LSI=<LSI name> to specify the LSI")
46else
47  ifeq (${LSI},AUTO)
48    RCAR_LSI:=${RCAR_AUTO}
49  else ifeq (${LSI},S4)
50    RCAR_LSI:=${RCAR_S4}
51  else ifeq (${LSI},V3U)
52    RCAR_LSI:=${RCAR_V3U}
53  else ifeq (${LSI},V4H)
54    RCAR_LSI:=${RCAR_V4H}
55  else ifeq (${LSI},V4M)
56    RCAR_LSI:=${RCAR_V4M}
57  else
58    $(error "Error: ${LSI} is not supported.")
59  endif
60  $(eval $(call add_define,RCAR_LSI))
61endif
62
63ifeq (${RCAR_LSI},${RCAR_S4})
64# Enable workarounds for selected Cortex-A55 errata.
65ERRATA_A55_1530923 := 1
66BL31_SOURCES += lib/cpus/aarch64/cortex_a55.S
67else
68# Enable workarounds for selected Cortex-A76 errata.
69DYNAMIC_WORKAROUND_CVE_2018_3639 := 1
70ERRATA_A76_1073348  :=1
71ERRATA_A76_1130799  :=1
72ERRATA_A76_1220197  :=1
73ERRATA_A76_1257314  :=1
74ERRATA_A76_1262606  :=1
75ERRATA_A76_1262888  :=1
76ERRATA_A76_1275112  :=1
77ERRATA_A76_1286807  :=1
78ERRATA_A76_1946160  :=1
79ERRATA_A76_2743102  :=1
80
81BL31_SOURCES +=	lib/cpus/aarch64/cortex_a76.S
82endif
83
84USE_COHERENT_MEM := 0
85HW_ASSISTED_COHERENCY := 1
86
87PLAT_INCLUDES	:=	-Iplat/renesas/rcar_gen4/include		\
88			-Iplat/renesas/rcar_gen4			\
89			-Iplat/renesas/common/include			\
90			-Idrivers/renesas/common/scif			\
91			-Idrivers/renesas/common/timer			\
92			-Idrivers/renesas/rcar_gen4/pwrc		\
93			-Idrivers/renesas/rcar_gen4/ptp			\
94			-Idrivers/renesas/rcar_gen4/mssr
95
96ifneq (${ENABLE_STACK_PROTECTOR},0)
97BL_COMMON_SOURCES	+=	plat/renesas/common/rcar_stack_protector.c
98endif
99
100# GIC-600 configuration
101#GICV3_IMPL := GIC600
102GICV3_SUPPORT_GIC600 := 1
103# Include GICv3 driver files
104USE_GIC_DRIVER := 3
105
106BL31_SOURCES	+=	${RCAR_GIC_SOURCES}				\
107			plat/common/plat_psci_common.c			\
108			plat/renesas/rcar_gen4/plat_topology.c		\
109			plat/renesas/rcar_gen4/aarch64/plat_helpers.S	\
110			plat/renesas/rcar_gen4/aarch64/platform_common.c \
111			plat/renesas/rcar_gen4/bl31_plat_setup.c	\
112			plat/renesas/rcar_gen4/plat_pm.c		\
113			plat/renesas/rcar_gen4/rcar_common.c		\
114			drivers/delay_timer/delay_timer.c		\
115			drivers/delay_timer/generic_delay_timer.c	\
116			drivers/renesas/common/pwrc/call_sram.S		\
117			drivers/renesas/common/scif/scif-common.c	\
118			drivers/renesas/common/scif/scif_helpers.S	\
119			drivers/renesas/common/timer/timer.c		\
120			drivers/renesas/rcar_gen4/pwrc/pwrc.c		\
121			drivers/renesas/rcar_gen4/scif/scif.c		\
122			drivers/renesas/rcar_gen4/mssr/mssr.c		\
123			drivers/renesas/rcar_gen4/ptp/ptp.c		\
124			drivers/arm/cci/cci.c
125
126include lib/xlat_tables_v2/xlat_tables.mk
127PLAT_BL_COMMON_SOURCES	+=	${XLAT_TABLES_LIB_SRCS}
128
129# build the layout images for the bootrom and the necessary srecords
130rcar: rcar_srecord
131distclean realclean clean: clean_srecord
132
133# srecords
134SREC_PATH	= ${BUILD_PLAT}
135BL31_ELF_SRC	= ${SREC_PATH}/bl31/bl31.elf
136
137clean_srecord:
138	@echo "clean bl31 srecs"
139	rm -f ${SREC_PATH}/bl31.srec
140
141.PHONY: rcar_srecord
142rcar_srecord: $(BL31_ELF_SRC)
143	@echo "generating srec: ${SREC_PATH}/bl31.srec"
144	$(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL31_ELF_SRC} ${SREC_PATH}/bl31.srec
145
146