allwinner-common.mk 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #
  2. # Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include lib/xlat_tables_v2/xlat_tables.mk
  7. include lib/libfdt/libfdt.mk
  8. include drivers/arm/gic/v2/gicv2.mk
  9. AW_PLAT := plat/allwinner
  10. PLAT_INCLUDES := -Iinclude/plat/arm/common/aarch64 \
  11. -I${AW_PLAT}/common/include \
  12. -I${AW_PLAT}/${PLAT}/include
  13. PLAT_BL_COMMON_SOURCES := drivers/ti/uart/${ARCH}/16550_console.S \
  14. ${XLAT_TABLES_LIB_SRCS} \
  15. ${AW_PLAT}/common/plat_helpers.S \
  16. ${AW_PLAT}/common/sunxi_common.c
  17. BL31_SOURCES += drivers/allwinner/axp/common.c \
  18. ${GICV2_SOURCES} \
  19. drivers/delay_timer/delay_timer.c \
  20. drivers/delay_timer/generic_delay_timer.c \
  21. lib/cpus/${ARCH}/cortex_a53.S \
  22. plat/common/plat_gicv2.c \
  23. plat/common/plat_psci_common.c \
  24. ${AW_PLAT}/common/sunxi_bl31_setup.c \
  25. ${AW_PLAT}/${PLAT}/sunxi_idle_states.c \
  26. ${AW_PLAT}/common/sunxi_pm.c \
  27. ${AW_PLAT}/${PLAT}/sunxi_power.c \
  28. ${AW_PLAT}/common/sunxi_security.c \
  29. ${AW_PLAT}/common/sunxi_topology.c
  30. # By default, attempt to use SCPI to the ARISC management processor. If SCPI
  31. # is not enabled or SCP firmware is not loaded, fall back to a simpler native
  32. # implementation that does not support CPU or system suspend.
  33. #
  34. # If SCP firmware will always be present (or absent), the unused implementation
  35. # can be compiled out.
  36. SUNXI_PSCI_USE_NATIVE ?= 1
  37. SUNXI_PSCI_USE_SCPI ?= 1
  38. $(eval $(call assert_boolean,SUNXI_PSCI_USE_NATIVE))
  39. $(eval $(call assert_boolean,SUNXI_PSCI_USE_SCPI))
  40. $(eval $(call add_define,SUNXI_PSCI_USE_NATIVE))
  41. $(eval $(call add_define,SUNXI_PSCI_USE_SCPI))
  42. ifeq (${SUNXI_PSCI_USE_NATIVE}${SUNXI_PSCI_USE_SCPI},00)
  43. $(error "At least one of SCPI or native PSCI ops must be enabled")
  44. endif
  45. ifeq (${SUNXI_PSCI_USE_NATIVE},1)
  46. BL31_SOURCES += ${AW_PLAT}/common/sunxi_cpu_ops.c \
  47. ${AW_PLAT}/common/sunxi_native_pm.c
  48. endif
  49. ifeq (${SUNXI_PSCI_USE_SCPI},1)
  50. BL31_SOURCES += drivers/allwinner/sunxi_msgbox.c \
  51. drivers/arm/css/scpi/css_scpi.c \
  52. ${AW_PLAT}/common/sunxi_scpi_pm.c
  53. endif
  54. SUNXI_SETUP_REGULATORS ?= 1
  55. $(eval $(call assert_boolean,SUNXI_SETUP_REGULATORS))
  56. $(eval $(call add_define,SUNXI_SETUP_REGULATORS))
  57. SUNXI_BL31_IN_DRAM ?= 0
  58. $(eval $(call assert_boolean,SUNXI_BL31_IN_DRAM))
  59. ifeq (${SUNXI_BL31_IN_DRAM},1)
  60. SUNXI_AMEND_DTB := 1
  61. $(eval $(call add_define,SUNXI_BL31_IN_DRAM))
  62. endif
  63. SUNXI_AMEND_DTB ?= 0
  64. $(eval $(call assert_boolean,SUNXI_AMEND_DTB))
  65. $(eval $(call add_define,SUNXI_AMEND_DTB))
  66. ifeq (${SUNXI_AMEND_DTB},1)
  67. BL31_SOURCES += common/fdt_fixup.c \
  68. ${AW_PLAT}/common/sunxi_prepare_dtb.c
  69. endif
  70. # The bootloader is guaranteed to only run on CPU 0 by the boot ROM.
  71. COLD_BOOT_SINGLE_CPU := 1
  72. # Do not enable SPE (not supported on ARM v8.0).
  73. ENABLE_SPE_FOR_NS := 0
  74. # Do not enable SVE (not supported on ARM v8.0).
  75. ENABLE_SVE_FOR_NS := 0
  76. # Enable workarounds for Cortex-A53 errata. Allwinner uses at least r0p4.
  77. ERRATA_A53_835769 := 1
  78. ERRATA_A53_843419 := 1
  79. ERRATA_A53_855873 := 1
  80. ERRATA_A53_1530924 := 1
  81. # The traditional U-Boot load address is 160MB into DRAM.
  82. PRELOADED_BL33_BASE ?= 0x4a000000
  83. # The reset vector can be changed for each CPU.
  84. PROGRAMMABLE_RESET_ADDRESS := 1
  85. # Allow mapping read-only data as execute-never.
  86. SEPARATE_CODE_AND_RODATA := 1
  87. # BL31 gets loaded alongside BL33 (U-Boot) by U-Boot's SPL
  88. RESET_TO_BL31 := 1
  89. # This platform is single-cluster and does not require coherency setup.
  90. WARMBOOT_ENABLE_DCACHE_EARLY := 1