diff mbox series

[v2] sysreset: psci: drop reliance on SPL support

Message ID 20240509230600.11306-1-andre.przywara@arm.com
State New
Delegated to: Andre Przywara
Headers show
Series [v2] sysreset: psci: drop reliance on SPL support | expand

Commit Message

Andre Przywara May 9, 2024, 11:06 p.m. UTC
At the moment enabling CONFIG_SYSRESET_PSCI *selects* SPL_ARM_PSCI_FW,
even though this is a platform design property, so nothing any driver
should enforce. Some platforms load the PSCI runtime (TF-A) only in the
SPL, so PSCI is naturally not available during SPL runtime.

Spit CONFIG_SYSRESET_PSCI up into an SPL and a U-Boot proper version,
and let the former *depend* on SPL_ARM_PSCI_FW.

This allows to enable CONFIG_SYSRESET_PSCI on platforms without SPL PSCI
support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
changelog v1 ... v2:
- change name of symbol to comply with CONFIG_$(SPL_TPL_)SYSRESET_PSCI

 drivers/sysreset/Kconfig  | 8 +++++++-
 drivers/sysreset/Makefile | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Tom Rini May 10, 2024, 1:10 a.m. UTC | #1
On Fri, May 10, 2024 at 12:06:00AM +0100, Andre Przywara wrote:

> At the moment enabling CONFIG_SYSRESET_PSCI *selects* SPL_ARM_PSCI_FW,
> even though this is a platform design property, so nothing any driver
> should enforce. Some platforms load the PSCI runtime (TF-A) only in the
> SPL, so PSCI is naturally not available during SPL runtime.
> 
> Spit CONFIG_SYSRESET_PSCI up into an SPL and a U-Boot proper version,
> and let the former *depend* on SPL_ARM_PSCI_FW.
> 
> This allows to enable CONFIG_SYSRESET_PSCI on platforms without SPL PSCI
> support.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox series

Patch

diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
index 49c0787b26d..ede9e23eacf 100644
--- a/drivers/sysreset/Kconfig
+++ b/drivers/sysreset/Kconfig
@@ -119,11 +119,17 @@  config SYSRESET_PALMAS
 config SYSRESET_PSCI
 	bool "Enable support for PSCI System Reset"
 	depends on ARM_PSCI_FW
-	select SPL_ARM_PSCI_FW if SPL
 	help
 	  Enable PSCI SYSTEM_RESET function call.  To use this, PSCI firmware
 	  must be running on your system.
 
+config SPL_SYSRESET_PSCI
+	bool "Enable support for PSCI System Reset in SPL"
+	depends on SPL_ARM_PSCI_FW
+	help
+	  Enable PSCI SYSTEM_RESET function call in the SPL. To use this, PSCI
+	  firmware must be running on your system before the SPL.
+
 config SYSRESET_SBI
 	bool "Enable support for SBI System Reset"
 	depends on RISCV_SMODE && SBI_V02
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index e0e732205df..8d992ae0930 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -14,7 +14,7 @@  obj-$(CONFIG_SYSRESET_MPC83XX) += sysreset_mpc83xx.o
 obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
 obj-$(CONFIG_SYSRESET_OCTEON) += sysreset_octeon.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_PALMAS) += sysreset_palmas.o
-obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
+obj-$(CONFIG_$(SPL_TPL_)SYSRESET_PSCI) += sysreset_psci.o
 obj-$(CONFIG_SYSRESET_SBI) += sysreset_sbi.o
 obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
 obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o