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