Skip to contentSkip to conversation

sysreset: psci: drop reliance on SPL support

PATCH Superseded Andre Przywara 2 participants 3 messages Apr 23, 2024 – Apr 24, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysreset: psci: drop reliance on SPL support

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.

---
 drivers/sysreset/Kconfig  | 8 +++++++-
 drivers/sysreset/Makefile | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/sysreset/Kconfig +7 -1
index 49c0787b26d..62fe9eb6220 100644
@@ -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 SYSRESET_SPL_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
drivers/sysreset/Makefile +1 -1
index e0e732205df..8d992ae0930 100644
@@ -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
Signature · 1 line
2.35.8
#1 lore raw
Quoted 22 lines · Andre Przywara

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.

---
 drivers/sysreset/Kconfig  | 8 +++++++-
 drivers/sysreset/Makefile | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/sysreset/Kconfig +0 -0
index 49c0787b26d..62fe9eb6220 100644

drivers/sysreset/Kconfig config SYSRESET_PALMAS · line 126

Quoted 9 lines
drivers/sysreset/Kconfig +1 -1
@@ -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 SYSRESET_SPL_PSCI

This should be SPL_SYSRESET_PSCI so that..

[snip]

drivers/sysreset/Kconfig config SYSRESET_PALMAS · line 127

Quoted 2 lines
drivers/sysreset/Kconfig +1 -1
-obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
+obj-$(CONFIG_$(SPL_TPL_)SYSRESET_PSCI) += sysreset_psci.o

This works.

Signature · 1 line
Tom
#2 lore raw

On Tue, 23 Apr 2024 19:01:44 -0600
Tom Rini <[email protected]> wrote:

Hi Tom,

Quoted 31 lines · Andre Przywara
Quoted 30 lines

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.

---
 drivers/sysreset/Kconfig  | 8 +++++++-
 drivers/sysreset/Makefile | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/sysreset/Kconfig +0 -1
index 49c0787b26d..62fe9eb6220 100644
@@ -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.
 
Quoted 3 lines

drivers/sysreset/Kconfig config SYSRESET_PALMAS · line 126

Quoted 1 line
drivers/sysreset/Kconfig +1 -0
+config SYSRESET_SPL_PSCI  

This should be SPL_SYSRESET_PSCI so that..

Ouch, you are of course right! Will send a fixed v2.

Cheers,
Andre

Quoted 7 lines

[snip]

drivers/sysreset/Kconfig

Quoted 2 lines
drivers/sysreset/Kconfig +1 -1
-obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
+obj-$(CONFIG_$(SPL_TPL_)SYSRESET_PSCI) += sysreset_psci.o  

This works.