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 -Idrivers/renesas/rcar_gen4/pwrc \ 89 -Idrivers/renesas/rcar_gen4/scif \ 90 -Idrivers/renesas/rcar_gen4/ptp \ 91 -Idrivers/renesas/rcar_gen4/mssr 92 93ifneq (${ENABLE_STACK_PROTECTOR},0) 94BL_COMMON_SOURCES += plat/renesas/rcar_gen4/rcar_stack_protector.c 95endif 96 97 98# GIC-600 configuration 99#GICV3_IMPL := GIC600 100GICV3_SUPPORT_GIC600 := 1 101# Include GICv3 driver files 102USE_GIC_DRIVER := 3 103 104BL31_SOURCES += ${RCAR_GIC_SOURCES} \ 105 plat/common/plat_psci_common.c \ 106 plat/renesas/rcar_gen4/plat_topology.c \ 107 plat/renesas/rcar_gen4/aarch64/plat_helpers.S \ 108 plat/renesas/rcar_gen4/aarch64/platform_common.c \ 109 plat/renesas/rcar_gen4/bl31_plat_setup.c \ 110 plat/renesas/rcar_gen4/plat_pm.c \ 111 plat/renesas/rcar_gen4/rcar_common.c \ 112 drivers/delay_timer/delay_timer.c \ 113 drivers/delay_timer/generic_delay_timer.c \ 114 drivers/renesas/rcar_gen4/pwrc/call_sram.S \ 115 drivers/renesas/rcar_gen4/pwrc/pwrc.c \ 116 drivers/renesas/rcar_gen4/scif/scif.c \ 117 drivers/renesas/rcar_gen4/scif/scif_helpers.S \ 118 drivers/renesas/rcar_gen4/mssr/mssr.c \ 119 drivers/renesas/rcar_gen4/ptp/ptp.c \ 120 drivers/arm/cci/cci.c 121 122include lib/xlat_tables_v2/xlat_tables.mk 123PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} 124 125# build the layout images for the bootrom and the necessary srecords 126rcar: rcar_srecord 127distclean realclean clean: clean_srecord 128 129# srecords 130SREC_PATH = ${BUILD_PLAT} 131BL31_ELF_SRC = ${SREC_PATH}/bl31/bl31.elf 132 133clean_srecord: 134 @echo "clean bl31 srecs" 135 rm -f ${SREC_PATH}/bl31.srec 136 137.PHONY: rcar_srecord 138rcar_srecord: $(BL31_ELF_SRC) 139 @echo "generating srec: ${SREC_PATH}/bl31.srec" 140 $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL31_ELF_SRC} ${SREC_PATH}/bl31.srec 141 142