platform.mk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include lib/libfdt/libfdt.mk
  7. include lib/xlat_tables_v2/xlat_tables.mk
  8. include drivers/arm/gic/v2/gicv2.mk
  9. PLAT_INCLUDES := -Iplat/rpi/common/include \
  10. -Iplat/rpi/rpi4/include
  11. PLAT_BL_COMMON_SOURCES := drivers/ti/uart/aarch64/16550_console.S \
  12. drivers/arm/pl011/aarch64/pl011_console.S \
  13. plat/rpi/common/rpi3_common.c \
  14. plat/rpi/common/rpi3_console_dual.c \
  15. ${XLAT_TABLES_LIB_SRCS}
  16. BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
  17. plat/rpi/common/aarch64/plat_helpers.S \
  18. plat/rpi/common/aarch64/armstub8_header.S \
  19. drivers/delay_timer/delay_timer.c \
  20. drivers/gpio/gpio.c \
  21. drivers/rpi3/gpio/rpi3_gpio.c \
  22. plat/common/plat_gicv2.c \
  23. plat/rpi/common/rpi4_bl31_setup.c \
  24. plat/rpi/rpi4/rpi4_setup.c \
  25. plat/rpi/common/rpi3_pm.c \
  26. plat/common/plat_psci_common.c \
  27. plat/rpi/common/rpi3_topology.c \
  28. common/fdt_fixup.c \
  29. common/fdt_wrappers.c \
  30. ${LIBFDT_SRCS} \
  31. ${GICV2_SOURCES}
  32. # For now we only support BL31, using the kernel loaded by the GPU firmware.
  33. RESET_TO_BL31 := 1
  34. # All CPUs enter armstub8.bin.
  35. COLD_BOOT_SINGLE_CPU := 0
  36. # Tune compiler for Cortex-A72
  37. ifeq ($($(ARCH)-cc-id),arm-clang)
  38. TF_CFLAGS_aarch64 += -mcpu=cortex-a72
  39. else ifneq ($(filter %-clang,$($(ARCH)-cc-id)),)
  40. TF_CFLAGS_aarch64 += -mcpu=cortex-a72
  41. else
  42. TF_CFLAGS_aarch64 += -mtune=cortex-a72
  43. endif
  44. # Add support for platform supplied linker script for BL31 build
  45. $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
  46. # Enable all errata workarounds for Cortex-A72
  47. ERRATA_A72_859971 := 1
  48. WORKAROUND_CVE_2017_5715 := 1
  49. # Add new default target when compiling this platform
  50. all: bl31
  51. # Build config flags
  52. # ------------------
  53. # Disable stack protector by default
  54. ENABLE_STACK_PROTECTOR := 0
  55. # Have different sections for code and rodata
  56. SEPARATE_CODE_AND_RODATA := 1
  57. # Use Coherent memory
  58. USE_COHERENT_MEM := 1
  59. # Platform build flags
  60. # --------------------
  61. # There is not much else than a Linux kernel to load at the moment.
  62. RPI3_DIRECT_LINUX_BOOT := 1
  63. # BL33 images are in AArch64 by default
  64. RPI3_BL33_IN_AARCH32 := 0
  65. # UART to use at runtime. -1 means the runtime UART is disabled.
  66. # Any other value means the default UART will be used.
  67. RPI3_RUNTIME_UART := 0
  68. # Use normal memory mapping for ROM, FIP, SRAM and DRAM
  69. RPI3_USE_UEFI_MAP := 0
  70. # SMCCC PCI support (should be enabled for ACPI builds)
  71. SMC_PCI_SUPPORT := 0
  72. # Process platform flags
  73. # ----------------------
  74. $(eval $(call add_define,RPI3_BL33_IN_AARCH32))
  75. $(eval $(call add_define,RPI3_DIRECT_LINUX_BOOT))
  76. ifdef RPI3_PRELOADED_DTB_BASE
  77. $(eval $(call add_define,RPI3_PRELOADED_DTB_BASE))
  78. endif
  79. $(eval $(call add_define,RPI3_RUNTIME_UART))
  80. $(eval $(call add_define,RPI3_USE_UEFI_MAP))
  81. $(eval $(call add_define,SMC_PCI_SUPPORT))
  82. ifeq (${ARCH},aarch32)
  83. $(error Error: AArch32 not supported on rpi4)
  84. endif
  85. ifneq ($(ENABLE_STACK_PROTECTOR), 0)
  86. PLAT_BL_COMMON_SOURCES += drivers/rpi3/rng/rpi3_rng.c \
  87. plat/rpi/common/rpi3_stack_protector.c
  88. endif
  89. ifeq ($(SMC_PCI_SUPPORT), 1)
  90. BL31_SOURCES += plat/rpi/common/rpi_pci_svc.c
  91. endif