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