Skip to contentSkip to conversation

armv8: fsl-layerscape: Allow use of PSCI handlers for ls1088a

PATCH New Mathew McBride 2 participants 8 messages Oct 18, 2019 – Nov 11, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover armv8: fsl-layerscape: Allow use of PSCI handlers for ls1088a

This patch allows the use of PSCI for power operations - this is desirable if the target board has implemented it's own power operation handlers in Trusted Firmware/EL3.

Layerscape has it's own EFI service handlers for power operations - if PSCI is used the generic handlers will be used instead.

Note that all of the existing Layerscape boards in-tree are blacklisted from PSCI_RESET by default - to use this you must enable it for your board.

Mathew McBride (2):
armv8: dts: ls1088a: add PSCI binding for LS1088A
armv8: fsl-layerscape: do not use layerscape EFI reset if PSCI used

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +-
 arch/arm/dts/fsl-ls1088a.dtsi           | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/2 armv8: dts: ls1088a: add PSCI binding for LS1088A

This allows the use of PSCI calls to trusted firmware to initiate reset and poweroff events with CONFIG_PSCI_RESET and CONFIG_ARM_PSCI_FW. This is desirable, for example, if the target board has implemented a custom reset or poweroff procedure in EL3.

---
 arch/arm/dts/fsl-ls1088a.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/fsl-ls1088a.dtsi +5 -0
index 4be1ab87d2..abc8b21a11 100644
@@ -192,4 +192,9 @@
 		status = "disabled";
 	};
 
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
 };
Signature · 1 line
2.19.1
#2 lore raw

PATCH 1/2 armv8: dts: ls1088a: add PSCI binding for LS1088A

Quoted 36 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Friday, October 18, 2019 8:58 AM
To: u-boot at lists.denx.de
Cc: Priyanka Jain <[email protected]>; Mathew McBride <[email protected]>
Subject: [PATCH 1/2] armv8: dts: ls1088a: add PSCI binding for LS1088A

This allows the use of PSCI calls to trusted firmware to initiate reset and poweroff events with CONFIG_PSCI_RESET and CONFIG_ARM_PSCI_FW. This is desirable, for example, if the target board has implemented a custom reset or poweroff procedure in EL3.

---
arch/arm/dts/fsl-ls1088a.dtsi | 5 +++++

1 file changed, 5 insertions(+)
arch/arm/dts/fsl-ls1088a.dtsi index renamed from arch/arm/dts/fsl-ls1088a.dtsi +0 -0

4be1ab87d2..abc8b21a11 100644

arch/arm/dts/fsl-ls1088a.dtsi +5 -1
@@ -192,4 +192,9 @@
 		status = "disabled";
 	};
 
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
 };
--
Quoted 1 line

2.19.1

Mathew, Have you tested this change on any standard NXP ls1088a board?

--priyankajain

#3 lore raw

PATCH 1/2 armv8: dts: ls1088a: add PSCI binding for LS1088A

Hell Priyanka,

Quoted 9 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Friday, October 18, 2019 8:58 AM
To: u-boot at lists.denx.de
Cc: Priyanka Jain <[email protected]>; Mathew McBride <[email protected]>
Subject: [PATCH 1/2] armv8: dts: ls1088a: add PSCI binding for LS1088A

2.19.1

[snip]

Quoted 3 lines

Mathew, Have you tested this change on any standard NXP ls1088a board?

--priyankajain

Not yet - I can test it on an LS1088ARDB if needed.

In theory, this should have no effect on the NXP reference boards as they are all blacklisted from CONFIG_PSCI_RESET in arch/arm/cpu/armv8/Kconfig.

Regards,
Mathew

#4 lore raw

PATCH 1/2 armv8: dts: ls1088a: add PSCI binding for LS1088A

Quoted 26 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Saturday, October 19, 2019 2:16 AM
To: Priyanka Jain <[email protected]>; u-boot at lists.denx.de; Pramod Kumar <[email protected]>
Subject: RE: [PATCH 1/2] armv8: dts: ls1088a: add PSCI binding for LS1088A

Hell Priyanka,

Quoted 9 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Friday, October 18, 2019 8:58 AM
To: u-boot at lists.denx.de
Cc: Priyanka Jain <[email protected]>; Mathew McBride <[email protected]>
Subject: [PATCH 1/2] armv8: dts: ls1088a: add PSCI binding for LS1088A

2.19.1

[snip]

Quoted 3 lines

Mathew, Have you tested this change on any standard NXP ls1088a board?

--priyankajain

Quoted 7 lines

Not yet - I can test it on an LS1088ARDB if needed.

In theory, this should have no effect on the NXP reference boards as they are all blacklisted from CONFIG_PSCI_RESET in arch/arm/cpu/armv8/Kconfig.

Regards,
Mathew

Thanks for confirming.

--priyankajain

#5 lore raw

PATCH 1/2 armv8: dts: ls1088a: add PSCI binding for LS1088A

In reply to Mathew McBride
Quoted 36 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Friday, October 18, 2019 8:58 AM
To: u-boot at lists.denx.de
Cc: Priyanka Jain <[email protected]>; Mathew McBride <[email protected]>
Subject: [PATCH 1/2] armv8: dts: ls1088a: add PSCI binding for LS1088A

This allows the use of PSCI calls to trusted firmware to initiate reset and poweroff events with CONFIG_PSCI_RESET and CONFIG_ARM_PSCI_FW. This is desirable, for example, if the target board has implemented a custom reset or poweroff procedure in EL3.

---
arch/arm/dts/fsl-ls1088a.dtsi | 5 +++++

1 file changed, 5 insertions(+)
arch/arm/dts/fsl-ls1088a.dtsi index renamed from arch/arm/dts/fsl-ls1088a.dtsi +0 -0

4be1ab87d2..abc8b21a11 100644

arch/arm/dts/fsl-ls1088a.dtsi +5 -1
@@ -192,4 +192,9 @@
 		status = "disabled";
 	};
 
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
 };
--
Quoted 1 line

2.19.1

Applied to fsl-qoriq master, awaiting upstream.

Thanks
priyankajain

#6 lore raw

PATCH 2/2 armv8: fsl-layerscape: do not use layerscape EFI reset if PSCI used

In reply to Mathew McBride

If the secure world reset handlers are used (via CONFIG_PSCI_RESET), then do not use the layerscape-specific implementation.

---
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -1
index a5d0b5370f..b4012793fd 100644
@@ -1218,7 +1218,7 @@ void __efi_runtime reset_cpu(ulong addr)
 #endif
 }
 
-#ifdef CONFIG_EFI_LOADER
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_PSCI_RESET)
 
 void __efi_runtime EFIAPI efi_reset_system(
 		       enum efi_reset_type reset_type,
Signature · 1 line
2.19.1
#7 lore raw

PATCH 2/2 armv8: fsl-layerscape: do not use layerscape EFI reset if PSCI used

Quoted 30 lines

-----Original Message-----
From: Mathew McBride <[email protected]>
Sent: Friday, October 18, 2019 8:58 AM
To: u-boot at lists.denx.de
Cc: Priyanka Jain <[email protected]>; Mathew McBride <[email protected]>
Subject: [PATCH 2/2] armv8: fsl-layerscape: do not use layerscape EFI reset if PSCI used

If the secure world reset handlers are used (via CONFIG_PSCI_RESET), then do not use the layerscape-specific implementation.

---
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -1
index a5d0b5370f..b4012793fd 100644
@@ -1218,7 +1218,7 @@ void __efi_runtime reset_cpu(ulong addr)  #endif  }
 
-#ifdef CONFIG_EFI_LOADER
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_PSCI_RESET)
 
Quoted 4 lines

void __efi_runtime EFIAPI efi_reset_system(
enum efi_reset_type reset_type,
--
2.19.1

Trimmed subject .Applied to fsl-qoriq master, awaiting upstream.

Thanks
priyankajain