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