From 188a9888e7b541299133a75b7632fdda2584833d Mon Sep 17 00:00:00 2001 From: Andrey Skvortsov Date: Sun, 27 Aug 2023 23:09:45 +0300 Subject: [PATCH] fix(allwinner): enable dtb modifications for CPU idle states to the rich OS Commit e2b18771fc2a0528dda18dbdaac08dd8530df25a ("feat(allwinner): provide CPU idle states to the rich OS") added functionality to amend dtb, when SCPI as the PSCI backend is available. But this functionality is disabled by default even for platforms, that support it, like A64. As a result rich OS don't get information about available CPU idle states. Due to size constraints of A64 platform DEBUG=1 can be built with dtb amend functionality only with LTO enabled. So ENABLE_LTO is enabled by default for this platform. ``` aarch64-linux-gnu-ld.bfd: address 0x500dd of build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM' aarch64-linux-gnu-ld.bfd: BL31 image has exceeded its limit. aarch64-linux-gnu-ld.bfd: region `RAM' overflowed by 224 bytes ``` To build with ENABLE_LTO=0 and DEBUG=1 it's required SUNXI_AMEND_DTB=0 to explicitly disable dtb amend functionality. sun50i_r329 SUNXI_AMEND_DTB=1 DEBUG=1 build fails with 'region `RAM' overflowed by 120 bytes'. To avoid unnecessary RAM consumption on other resource-constraints platforms (like sun50i_r329) SUNXI_AMEND_DTB is enabled only on sun50i_a64. Otherwise On other platforms sunxi_idle_states are empty. Signed-off-by: Andrey Skvortsov Change-Id: I81fcf31b5bd2bd02a9f3361a6a519632f087445d --- plat/allwinner/sun50i_a64/platform.mk | 4 ++++ plat/allwinner/sun50i_a64/platform_defaults.mk | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 plat/allwinner/sun50i_a64/platform_defaults.mk diff --git a/plat/allwinner/sun50i_a64/platform.mk b/plat/allwinner/sun50i_a64/platform.mk index e3c7c529b..cced7f0b7 100644 --- a/plat/allwinner/sun50i_a64/platform.mk +++ b/plat/allwinner/sun50i_a64/platform.mk @@ -4,6 +4,10 @@ # SPDX-License-Identifier: BSD-3-Clause # +# To report supported idle states +# this has to be defined before allwinner-common.mk +SUNXI_AMEND_DTB := 1 + # The differences between the platform are covered by the include files. include plat/allwinner/common/allwinner-common.mk diff --git a/plat/allwinner/sun50i_a64/platform_defaults.mk b/plat/allwinner/sun50i_a64/platform_defaults.mk new file mode 100644 index 000000000..5b61029c6 --- /dev/null +++ b/plat/allwinner/sun50i_a64/platform_defaults.mk @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024, ARM Limited and Contributors. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +# LTO has to be enabled on this platform due to memory constraints +ENABLE_LTO := 1 +