diff mbox series

board: ti: am62x: beagleplay: Disable semi-functional PSCI reset support

Message ID c93b19ed-43fe-44a2-9726-371fb9d2f825@web.de
State Changes Requested
Delegated to: Tom Rini
Headers show
Series board: ti: am62x: beagleplay: Disable semi-functional PSCI reset support | expand

Commit Message

Jan Kiszka Aug. 24, 2023, 9:53 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

At this point, system shutdown is not supported by the DM firmware that
TF-A calls. As we can't de-select only this feature, declare complete
PSCI reset support as non-functional so that we don't signal incomplete
support to the OS via EFI runtime services. This makes power-off under
Linux work again when booting via EFI.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 board/ti/am62x/beagleplay_a53.config | 2 ++
 1 file changed, 2 insertions(+)

--
2.35.3

Comments

Tom Rini Aug. 24, 2023, 9:58 p.m. UTC | #1
On Thu, Aug 24, 2023 at 11:53:17PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> At this point, system shutdown is not supported by the DM firmware that
> TF-A calls. As we can't de-select only this feature, declare complete
> PSCI reset support as non-functional so that we don't signal incomplete
> support to the OS via EFI runtime services. This makes power-off under
> Linux work again when booting via EFI.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  board/ti/am62x/beagleplay_a53.config | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/board/ti/am62x/beagleplay_a53.config b/board/ti/am62x/beagleplay_a53.config
> index 967f794446d..8b0f671bc9e 100644
> --- a/board/ti/am62x/beagleplay_a53.config
> +++ b/board/ti/am62x/beagleplay_a53.config
> @@ -53,3 +53,5 @@ CONFIG_SPI=n
>  CONFIG_SPI_FLASH=n
>  CONFIG_SPL_DM_SPI_FLASH=n
>  CONFIG_SPL_SPI_FLASH_SUPPORT=n
> +# DM firmware lacks support for shutdown
> +# CONFIG_PSCI_RESET is not set

Is this lack of feature for just the beagleplay part of the firmware
stack or more generically to the TI am62x platforms?
Nishanth Menon Aug. 25, 2023, 1:16 a.m. UTC | #2
On 17:58-20230824, Tom Rini wrote:
> On Thu, Aug 24, 2023 at 11:53:17PM +0200, Jan Kiszka wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> > 
> > At this point, system shutdown is not supported by the DM firmware that
> > TF-A calls. As we can't de-select only this feature, declare complete
> > PSCI reset support as non-functional so that we don't signal incomplete
> > support to the OS via EFI runtime services. This makes power-off under
> > Linux work again when booting via EFI.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> >  board/ti/am62x/beagleplay_a53.config | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/board/ti/am62x/beagleplay_a53.config b/board/ti/am62x/beagleplay_a53.config
> > index 967f794446d..8b0f671bc9e 100644
> > --- a/board/ti/am62x/beagleplay_a53.config
> > +++ b/board/ti/am62x/beagleplay_a53.config
> > @@ -53,3 +53,5 @@ CONFIG_SPI=n
> >  CONFIG_SPI_FLASH=n
> >  CONFIG_SPL_DM_SPI_FLASH=n
> >  CONFIG_SPL_SPI_FLASH_SUPPORT=n
> > +# DM firmware lacks support for shutdown
> > +# CONFIG_PSCI_RESET is not set
> 
> Is this lack of feature for just the beagleplay part of the firmware
> stack or more generically to the TI am62x platforms?

Thanks a ton Jan for digging deep into this and finding this. So much
appreciated.

This is all K3 platforms with the exception of j7200-evm.

PSCI SYSTEM_OFF function is routed by TFA to DM, there is no implementation
on DM side since involved PMIC and team is trying to lock in a manner in
which it is easier for people to describe things.

PSCI SYSTEM_RESET on the other hand is handled correctly by DM.

Even though CONFIG_POWEROFF is disabled, apparently enabling PSCI_RESET
results in EFI runtime services gets to think that poweroff is also
supported. Looking at drivers/firmware/psci.c[1] efi request for
poweroff is via EFI_RESET_SHUTDOWN[2] - so the specification itself
mandates that both reset AND poweroff should be implemented.

Luckily for us we have a broken u-boot reset implementation, which last
I looked was not following the h/w specifications and the intent was to
move to PSCI -> DM for reset so that system can properly reset and not
get randomly hung during reset under certain circumstances.

But, given the circumstances, I can pick this up and do it at am62_evm
level rather than at just beagle level. I will pick this patch up and
roll it up into v6 of the beagleplay series - but will modify am62x_evm
config instead.

[1] https://github.com/u-boot/u-boot/blob/master/drivers/firmware/psci.c#L246
[2] https://uefi.org/specs/UEFI/2.9_A/08_Services_Runtime_Services.html?highlight=efiresetshutdown#resetsystem
diff mbox series

Patch

diff --git a/board/ti/am62x/beagleplay_a53.config b/board/ti/am62x/beagleplay_a53.config
index 967f794446d..8b0f671bc9e 100644
--- a/board/ti/am62x/beagleplay_a53.config
+++ b/board/ti/am62x/beagleplay_a53.config
@@ -53,3 +53,5 @@  CONFIG_SPI=n
 CONFIG_SPI_FLASH=n
 CONFIG_SPL_DM_SPI_FLASH=n
 CONFIG_SPL_SPI_FLASH_SUPPORT=n
+# DM firmware lacks support for shutdown
+# CONFIG_PSCI_RESET is not set