* [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff
@ 2021-07-13 15:04 Michal Simek
2021-07-13 15:04 ` [PATCH 1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled Michal Simek
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Michal Simek @ 2021-07-13 15:04 UTC (permalink / raw)
To: u-boot, git
Cc: Bin Meng, Igor Opaniuk, Marek Behún, Patrick Delaunay,
Yann Gautier
Hi,
it is time to do reset/poweroff via sysreset framework to align it with
psci 1.1 spec.
Thanks,
Michal
Michal Simek (3):
psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is
enabled
arm64: zynqmp: Do not define do_reset() if sysreset is enabled
arm64: zynqmp: Enable reset and poweroff via sysreset framework
board/xilinx/zynqmp/zynqmp.c | 2 ++
configs/xilinx_zynqmp_virt_defconfig | 3 +++
drivers/firmware/psci.c | 2 +-
3 files changed, 6 insertions(+), 1 deletion(-)
--
2.32.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled
2021-07-13 15:04 [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
@ 2021-07-13 15:04 ` Michal Simek
2021-07-13 15:04 ` [PATCH 2/3] arm64: zynqmp: Do not define do_reset() if sysreset " Michal Simek
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-07-13 15:04 UTC (permalink / raw)
To: u-boot, git
Cc: Bin Meng, Igor Opaniuk, Marek Behún, Patrick Delaunay,
Yann Gautier
CONFIG_SYSRESET_CMD_POWEROFF defines do_poweroff() in sysreset-uclass.c
that's why don't define it twice when both CONFIG_SYSRESET_CMD_POWEROFF and
CONFIG_CMD_POWEROFF are enabled. CONFIG_SYSRESET_CMD_POWEROFF depends on
CONFIG_CMD_POWEROFF.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/firmware/psci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index 89cb7d88e5b3..657e7eb5aea3 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -210,7 +210,7 @@ void psci_sys_poweroff(void)
invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
}
-#ifdef CONFIG_CMD_POWEROFF
+#if IS_ENABLED(CONFIG_CMD_POWEROFF) && !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF)
int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
do_psci_probe();
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] arm64: zynqmp: Do not define do_reset() if sysreset is enabled
2021-07-13 15:04 [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
2021-07-13 15:04 ` [PATCH 1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled Michal Simek
@ 2021-07-13 15:04 ` Michal Simek
2021-07-13 15:04 ` [PATCH 3/3] arm64: zynqmp: Enable reset and poweroff via sysreset framework Michal Simek
2021-07-26 7:20 ` [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-07-13 15:04 UTC (permalink / raw)
To: u-boot, git
The SPL can also be compiled with sysreset drivers just fine, so
update the condition to cater for that option.
The same change was done by commit efa1a62ad2dd ("ARM: imx8m: Do not define
do_reset() if sysreset is enabled").
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
board/xilinx/zynqmp/zynqmp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 18d5c515def1..38c910fa5bab 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -499,9 +499,11 @@ int dram_init(void)
}
#endif
+#if !CONFIG_IS_ENABLED(SYSRESET)
void reset_cpu(void)
{
}
+#endif
static u8 __maybe_unused zynqmp_get_bootmode(void)
{
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] arm64: zynqmp: Enable reset and poweroff via sysreset framework
2021-07-13 15:04 [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
2021-07-13 15:04 ` [PATCH 1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled Michal Simek
2021-07-13 15:04 ` [PATCH 2/3] arm64: zynqmp: Do not define do_reset() if sysreset " Michal Simek
@ 2021-07-13 15:04 ` Michal Simek
2021-07-26 7:20 ` [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-07-13 15:04 UTC (permalink / raw)
To: u-boot, git
reset and poweroff are called via hooks in psci driver which is going
around sysreset framework that's why enable sysreset drivers and do reset
and poweroff via this framework. Using this flow will allow us to call
SYSTEM_WARM_RESET based on psci 1.1 spec which can be calles with reset -w
command.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
configs/xilinx_zynqmp_virt_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index 5f32ca49300f..bac1e181d265 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -157,6 +157,9 @@ CONFIG_ZYNQ_SERIAL=y
CONFIG_SPI=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQMP_GQSPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_POWEROFF=y
+CONFIG_SYSRESET_PSCI=y
CONFIG_TPM2_TIS_SPI=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff
2021-07-13 15:04 [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
` (2 preceding siblings ...)
2021-07-13 15:04 ` [PATCH 3/3] arm64: zynqmp: Enable reset and poweroff via sysreset framework Michal Simek
@ 2021-07-26 7:20 ` Michal Simek
3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-07-26 7:20 UTC (permalink / raw)
To: U-Boot, git
Cc: Bin Meng, Igor Opaniuk, Marek Behún, Patrick Delaunay,
Yann Gautier
út 13. 7. 2021 v 17:04 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Hi,
>
> it is time to do reset/poweroff via sysreset framework to align it with
> psci 1.1 spec.
>
> Thanks,
> Michal
>
>
> Michal Simek (3):
> psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is
> enabled
> arm64: zynqmp: Do not define do_reset() if sysreset is enabled
> arm64: zynqmp: Enable reset and poweroff via sysreset framework
>
> board/xilinx/zynqmp/zynqmp.c | 2 ++
> configs/xilinx_zynqmp_virt_defconfig | 3 +++
> drivers/firmware/psci.c | 2 +-
> 3 files changed, 6 insertions(+), 1 deletion(-)
>
> --
> 2.32.0
>
Applied.
M
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-26 7:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-13 15:04 [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
2021-07-13 15:04 ` [PATCH 1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled Michal Simek
2021-07-13 15:04 ` [PATCH 2/3] arm64: zynqmp: Do not define do_reset() if sysreset " Michal Simek
2021-07-13 15:04 ` [PATCH 3/3] arm64: zynqmp: Enable reset and poweroff via sysreset framework Michal Simek
2021-07-26 7:20 ` [PATCH 0/3] arm64: zynqmp: Use sysreset framework for reset and poweroff Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox