1f5cb15b0SAndre Przywara# 2f5cb15b0SAndre Przywara# Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. 3f5cb15b0SAndre Przywara# 4f5cb15b0SAndre Przywara# SPDX-License-Identifier: BSD-3-Clause 5f5cb15b0SAndre Przywara# 6f5cb15b0SAndre Przywara 7f5cb15b0SAndre Przywarainclude lib/libfdt/libfdt.mk 8f5cb15b0SAndre Przywarainclude lib/xlat_tables_v2/xlat_tables.mk 9f5cb15b0SAndre Przywara 10f5cb15b0SAndre PrzywaraPLAT_INCLUDES := -Iplat/rpi/common/include \ 11f5cb15b0SAndre Przywara -Iplat/rpi/rpi4/include 12f5cb15b0SAndre Przywara 13f5cb15b0SAndre PrzywaraPLAT_BL_COMMON_SOURCES := drivers/ti/uart/aarch64/16550_console.S \ 145e6d821cSAndre Przywara drivers/arm/pl011/aarch64/pl011_console.S \ 15f5cb15b0SAndre Przywara plat/rpi/common/rpi3_common.c \ 16f5cb15b0SAndre Przywara ${XLAT_TABLES_LIB_SRCS} 17f5cb15b0SAndre Przywara 18f5cb15b0SAndre PrzywaraBL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \ 19*07aa0c7eSAndre Przywara plat/rpi/common/aarch64/plat_helpers.S \ 20c4597e13SAndre Przywara plat/rpi/rpi4/aarch64/armstub8_header.S \ 21f5cb15b0SAndre Przywara drivers/arm/gic/common/gic_common.c \ 22f5cb15b0SAndre Przywara drivers/arm/gic/v2/gicv2_helpers.c \ 23f5cb15b0SAndre Przywara drivers/arm/gic/v2/gicv2_main.c \ 249cc3fa1bSAndre Przywara drivers/delay_timer/delay_timer.c \ 259cc3fa1bSAndre Przywara drivers/gpio/gpio.c \ 269cc3fa1bSAndre Przywara drivers/rpi3/gpio/rpi3_gpio.c \ 27f5cb15b0SAndre Przywara plat/common/plat_gicv2.c \ 28f5cb15b0SAndre Przywara plat/rpi/rpi4/rpi4_bl31_setup.c \ 29f5cb15b0SAndre Przywara plat/rpi/common/rpi3_pm.c \ 30f5cb15b0SAndre Przywara plat/common/plat_psci_common.c \ 31f5cb15b0SAndre Przywara plat/rpi/common/rpi3_topology.c \ 32f67fa69cSAndre Przywara common/fdt_fixup.c \ 33f5cb15b0SAndre Przywara ${LIBFDT_SRCS} 34f5cb15b0SAndre Przywara 35f5cb15b0SAndre Przywara# For now we only support BL31, using the kernel loaded by the GPU firmware. 36f5cb15b0SAndre PrzywaraRESET_TO_BL31 := 1 37f5cb15b0SAndre Przywara 38f5cb15b0SAndre Przywara# All CPUs enter armstub8.bin. 39f5cb15b0SAndre PrzywaraCOLD_BOOT_SINGLE_CPU := 0 40f5cb15b0SAndre Przywara 41f5cb15b0SAndre Przywara# Tune compiler for Cortex-A72 42f5cb15b0SAndre Przywaraifeq ($(notdir $(CC)),armclang) 43f5cb15b0SAndre Przywara TF_CFLAGS_aarch64 += -mcpu=cortex-a72 44f5cb15b0SAndre Przywaraelse ifneq ($(findstring clang,$(notdir $(CC))),) 45f5cb15b0SAndre Przywara TF_CFLAGS_aarch64 += -mcpu=cortex-a72 46f5cb15b0SAndre Przywaraelse 47f5cb15b0SAndre Przywara TF_CFLAGS_aarch64 += -mtune=cortex-a72 48f5cb15b0SAndre Przywaraendif 49f5cb15b0SAndre Przywara 50c4597e13SAndre Przywara# Add support for platform supplied linker script for BL31 build 51c4597e13SAndre Przywara$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT)) 52f5cb15b0SAndre Przywara 53f5cb15b0SAndre Przywara# Enable all errata workarounds for Cortex-A72 54f5cb15b0SAndre PrzywaraERRATA_A72_859971 := 1 55f5cb15b0SAndre Przywara 56f5cb15b0SAndre PrzywaraWORKAROUND_CVE_2017_5715 := 1 57f5cb15b0SAndre Przywara 58f5cb15b0SAndre Przywara# Add new default target when compiling this platform 59f5cb15b0SAndre Przywaraall: bl31 60f5cb15b0SAndre Przywara 61f5cb15b0SAndre Przywara# Build config flags 62f5cb15b0SAndre Przywara# ------------------ 63f5cb15b0SAndre Przywara 64f5cb15b0SAndre Przywara# Disable stack protector by default 65f5cb15b0SAndre PrzywaraENABLE_STACK_PROTECTOR := 0 66f5cb15b0SAndre Przywara 67f5cb15b0SAndre Przywara# Have different sections for code and rodata 68f5cb15b0SAndre PrzywaraSEPARATE_CODE_AND_RODATA := 1 69f5cb15b0SAndre Przywara 70f5cb15b0SAndre Przywara# Use Coherent memory 71f5cb15b0SAndre PrzywaraUSE_COHERENT_MEM := 1 72f5cb15b0SAndre Przywara 73f5cb15b0SAndre Przywara# Platform build flags 74f5cb15b0SAndre Przywara# -------------------- 75f5cb15b0SAndre Przywara 76448fb352SAndre Przywara# There is not much else than a Linux kernel to load at the moment. 77448fb352SAndre PrzywaraRPI3_DIRECT_LINUX_BOOT := 1 78f5cb15b0SAndre Przywara 79f5cb15b0SAndre Przywara# BL33 images are in AArch64 by default 80f5cb15b0SAndre PrzywaraRPI3_BL33_IN_AARCH32 := 0 81f5cb15b0SAndre Przywara 82f5cb15b0SAndre Przywara# UART to use at runtime. -1 means the runtime UART is disabled. 83f5cb15b0SAndre Przywara# Any other value means the default UART will be used. 84f5cb15b0SAndre PrzywaraRPI3_RUNTIME_UART := 0 85f5cb15b0SAndre Przywara 86f5cb15b0SAndre Przywara# Use normal memory mapping for ROM, FIP, SRAM and DRAM 87f5cb15b0SAndre PrzywaraRPI3_USE_UEFI_MAP := 0 88f5cb15b0SAndre Przywara 89f5cb15b0SAndre Przywara# Process platform flags 90f5cb15b0SAndre Przywara# ---------------------- 91f5cb15b0SAndre Przywara 92f5cb15b0SAndre Przywara$(eval $(call add_define,RPI3_BL33_IN_AARCH32)) 93f5cb15b0SAndre Przywara$(eval $(call add_define,RPI3_DIRECT_LINUX_BOOT)) 94f5cb15b0SAndre Przywaraifdef RPI3_PRELOADED_DTB_BASE 95f5cb15b0SAndre Przywara$(eval $(call add_define,RPI3_PRELOADED_DTB_BASE)) 96f5cb15b0SAndre Przywaraendif 97f5cb15b0SAndre Przywara$(eval $(call add_define,RPI3_RUNTIME_UART)) 98f5cb15b0SAndre Przywara$(eval $(call add_define,RPI3_USE_UEFI_MAP)) 99f5cb15b0SAndre Przywara 100f5cb15b0SAndre Przywaraifeq (${ARCH},aarch32) 101f5cb15b0SAndre Przywara $(error Error: AArch32 not supported on rpi4) 102f5cb15b0SAndre Przywaraendif 103f5cb15b0SAndre Przywara 104f5cb15b0SAndre Przywaraifneq ($(ENABLE_STACK_PROTECTOR), 0) 105f5cb15b0SAndre PrzywaraPLAT_BL_COMMON_SOURCES += drivers/rpi3/rng/rpi3_rng.c \ 106f5cb15b0SAndre Przywara plat/rpi/common/rpi3_stack_protector.c 107f5cb15b0SAndre Przywaraendif 108