Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
@ 2019-11-11 13:34 Anup Patel
  2019-11-11 13:43 ` Anup Patel
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Anup Patel @ 2019-11-11 13:34 UTC (permalink / raw)
  To: Palmer Dabbelt, Paul Walmsley
  Cc: Anup Patel, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, linux-riscv, Christoph Hellwig

We can use SYSCON reboot and poweroff drivers for the
SiFive test device found on QEMU virt machine and SiFive
SOCs.

This patch enables SYSCON reboot and poweroff drivers
in RV64 and RV32 defconfigs.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
 arch/riscv/configs/defconfig      | 4 ++++
 arch/riscv/configs/rv32_defconfig | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 420a0dbef386..73a6ee31a7d2 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -63,6 +63,10 @@ CONFIG_HW_RANDOM_VIRTIO=y
 CONFIG_SPI=y
 CONFIG_SPI_SIFIVE=y
 # CONFIG_PTP_1588_CLOCK is not set
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
+CONFIG_POWER_RESET_SYSCON_POWEROFF=y
+CONFIG_SYSCON_REBOOT_MODE=y
 CONFIG_DRM=y
 CONFIG_DRM_RADEON=y
 CONFIG_DRM_VIRTIO_GPU=y
diff --git a/arch/riscv/configs/rv32_defconfig b/arch/riscv/configs/rv32_defconfig
index 87ee6e62b64b..1429e1254295 100644
--- a/arch/riscv/configs/rv32_defconfig
+++ b/arch/riscv/configs/rv32_defconfig
@@ -61,6 +61,10 @@ CONFIG_VIRTIO_CONSOLE=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_VIRTIO=y
 # CONFIG_PTP_1588_CLOCK is not set
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
+CONFIG_POWER_RESET_SYSCON_POWEROFF=y
+CONFIG_SYSCON_REBOOT_MODE=y
 CONFIG_DRM=y
 CONFIG_DRM_RADEON=y
 CONFIG_DRM_VIRTIO_GPU=y
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 13:34 [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers Anup Patel
@ 2019-11-11 13:43 ` Anup Patel
  2019-11-11 14:05   ` David Abdurachmanov
  2019-11-11 14:08 ` Andreas Schwab
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Anup Patel @ 2019-11-11 13:43 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	linux-riscv, Christoph Hellwig

Correct Palmer's email address

> -----Original Message-----
> From: Anup Patel
> Sent: Monday, November 11, 2019 7:05 PM
> To: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
> <paul.walmsley@sifive.com>
> Cc: Atish Patra <Atish.Patra@wdc.com>; Alistair Francis
> <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup Patel
> <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
> kernel@vger.kernel.org; Anup Patel <Anup.Patel@wdc.com>
> Subject: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
> 
> We can use SYSCON reboot and poweroff drivers for the SiFive test device
> found on QEMU virt machine and SiFive SOCs.
> 
> This patch enables SYSCON reboot and poweroff drivers in RV64 and RV32
> defconfigs.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> ---
>  arch/riscv/configs/defconfig      | 4 ++++
>  arch/riscv/configs/rv32_defconfig | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 420a0dbef386..73a6ee31a7d2 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -63,6 +63,10 @@ CONFIG_HW_RANDOM_VIRTIO=y  CONFIG_SPI=y
> CONFIG_SPI_SIFIVE=y  # CONFIG_PTP_1588_CLOCK is not set
> +CONFIG_POWER_RESET=y
> +CONFIG_POWER_RESET_SYSCON=y
> +CONFIG_POWER_RESET_SYSCON_POWEROFF=y
> +CONFIG_SYSCON_REBOOT_MODE=y
>  CONFIG_DRM=y
>  CONFIG_DRM_RADEON=y
>  CONFIG_DRM_VIRTIO_GPU=y
> diff --git a/arch/riscv/configs/rv32_defconfig
> b/arch/riscv/configs/rv32_defconfig
> index 87ee6e62b64b..1429e1254295 100644
> --- a/arch/riscv/configs/rv32_defconfig
> +++ b/arch/riscv/configs/rv32_defconfig
> @@ -61,6 +61,10 @@ CONFIG_VIRTIO_CONSOLE=y
> CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y  #
> CONFIG_PTP_1588_CLOCK is not set
> +CONFIG_POWER_RESET=y
> +CONFIG_POWER_RESET_SYSCON=y
> +CONFIG_POWER_RESET_SYSCON_POWEROFF=y
> +CONFIG_SYSCON_REBOOT_MODE=y
>  CONFIG_DRM=y
>  CONFIG_DRM_RADEON=y
>  CONFIG_DRM_VIRTIO_GPU=y
> --
> 2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 13:43 ` Anup Patel
@ 2019-11-11 14:05   ` David Abdurachmanov
  0 siblings, 0 replies; 14+ messages in thread
From: David Abdurachmanov @ 2019-11-11 14:05 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	Paul Walmsley, Palmer Dabbelt, linux-riscv, Christoph Hellwig

On Mon, Nov 11, 2019 at 3:43 PM Anup Patel <Anup.Patel@wdc.com> wrote:
>
> Correct Palmer's email address
>
> > -----Original Message-----
> > From: Anup Patel
> > Sent: Monday, November 11, 2019 7:05 PM
> > To: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
> > <paul.walmsley@sifive.com>
> > Cc: Atish Patra <Atish.Patra@wdc.com>; Alistair Francis
> > <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup Patel
> > <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
> > kernel@vger.kernel.org; Anup Patel <Anup.Patel@wdc.com>
> > Subject: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
> >
> > We can use SYSCON reboot and poweroff drivers for the SiFive test device
> > found on QEMU virt machine and SiFive SOCs.
> >
> > This patch enables SYSCON reboot and poweroff drivers in RV64 and RV32
> > defconfigs.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > ---
> >  arch/riscv/configs/defconfig      | 4 ++++
> >  arch/riscv/configs/rv32_defconfig | 4 ++++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> > index 420a0dbef386..73a6ee31a7d2 100644
> > --- a/arch/riscv/configs/defconfig
> > +++ b/arch/riscv/configs/defconfig
> > @@ -63,6 +63,10 @@ CONFIG_HW_RANDOM_VIRTIO=y  CONFIG_SPI=y
> > CONFIG_SPI_SIFIVE=y  # CONFIG_PTP_1588_CLOCK is not set
> > +CONFIG_POWER_RESET=y

Why not to add

    select POWER_RESET

to arch/riscv/Kconfig ?

This seems to be a popular choice (?). I went this path recently while
enabling gpio-restart on SiFive Unleashed on a private branch.

[..]
arch/arm/mach-exynos/Kconfig:   select POWER_RESET
arch/arm/mach-exynos/Kconfig:   select POWER_RESET_SYSCON
arch/arm/mach-exynos/Kconfig:   select POWER_RESET_SYSCON_POWEROFF
arch/arm/mach-gemini/Kconfig:   select POWER_RESET
arch/arm/mach-gemini/Kconfig:   select POWER_RESET_GEMINI_POWEROFF
arch/arm/mach-gemini/Kconfig:   select POWER_RESET_SYSCON
arch/arm/mach-hisi/Kconfig:     select POWER_RESET
arch/arm/mach-hisi/Kconfig:     select POWER_RESET_HISI
arch/arm/mach-integrator/Kconfig:       select POWER_RESET
arch/arm/mach-integrator/Kconfig:       select POWER_RESET_VERSATILE
arch/arm/mach-realview/Kconfig: select POWER_RESET
arch/arm/mach-realview/Kconfig: select POWER_RESET_VERSATILE
arch/arm/mach-versatile/Kconfig:        select POWER_RESET
arch/arm/mach-versatile/Kconfig:        select POWER_RESET_VERSATILE
arch/arm/mach-vexpress/Kconfig: select POWER_RESET
arch/arm/mach-vexpress/Kconfig: select POWER_RESET_VEXPRESS
arch/arm64/Kconfig:     select POWER_RESET
[..]

> > +CONFIG_POWER_RESET_SYSCON=y
> > +CONFIG_POWER_RESET_SYSCON_POWEROFF=y
> > +CONFIG_SYSCON_REBOOT_MODE=y
> >  CONFIG_DRM=y
> >  CONFIG_DRM_RADEON=y
> >  CONFIG_DRM_VIRTIO_GPU=y
> > diff --git a/arch/riscv/configs/rv32_defconfig
> > b/arch/riscv/configs/rv32_defconfig
> > index 87ee6e62b64b..1429e1254295 100644
> > --- a/arch/riscv/configs/rv32_defconfig
> > +++ b/arch/riscv/configs/rv32_defconfig
> > @@ -61,6 +61,10 @@ CONFIG_VIRTIO_CONSOLE=y
> > CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y  #
> > CONFIG_PTP_1588_CLOCK is not set
> > +CONFIG_POWER_RESET=y
> > +CONFIG_POWER_RESET_SYSCON=y
> > +CONFIG_POWER_RESET_SYSCON_POWEROFF=y
> > +CONFIG_SYSCON_REBOOT_MODE=y
> >  CONFIG_DRM=y
> >  CONFIG_DRM_RADEON=y
> >  CONFIG_DRM_VIRTIO_GPU=y
> > --
> > 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 13:34 [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers Anup Patel
  2019-11-11 13:43 ` Anup Patel
@ 2019-11-11 14:08 ` Andreas Schwab
  2019-11-11 14:21   ` Anup Patel
  2019-11-11 17:06 ` Paul Walmsley
  2019-11-23  3:03 ` Paul Walmsley
  3 siblings, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2019-11-11 14:08 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, Palmer Dabbelt, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, linux-riscv, Christoph Hellwig

On Nov 11 2019, Anup Patel wrote:

> We can use SYSCON reboot and poweroff drivers for the
> SiFive test device found on QEMU virt machine and SiFive
> SOCs.

I don't see any syscon-reboot compatible in the device tree.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 14:08 ` Andreas Schwab
@ 2019-11-11 14:21   ` Anup Patel
  2019-11-11 14:32     ` Andreas Schwab
  0 siblings, 1 reply; 14+ messages in thread
From: Anup Patel @ 2019-11-11 14:21 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	Paul Walmsley, Palmer Dabbelt, linux-riscv, Christoph Hellwig



> -----Original Message-----
> From: Andreas Schwab <schwab@suse.de>
> Sent: Monday, November 11, 2019 7:38 PM
> To: Anup Patel <Anup.Patel@wdc.com>
> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
> 
> On Nov 11 2019, Anup Patel wrote:
> 
> > We can use SYSCON reboot and poweroff drivers for the SiFive test
> > device found on QEMU virt machine and SiFive SOCs.
> 
> I don't see any syscon-reboot compatible in the device tree.

I have sent patch to QEMU as well for generating SYSCON DT nodes.

Regards,
Anup

> 
> Andreas.
> 
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196
> BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7 "And now for something
> completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 14:21   ` Anup Patel
@ 2019-11-11 14:32     ` Andreas Schwab
  2019-11-11 16:51       ` Anup Patel
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2019-11-11 14:32 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	Paul Walmsley, Palmer Dabbelt, linux-riscv, Christoph Hellwig

On Nov 11 2019, Anup Patel wrote:

>> -----Original Message-----
>> From: Andreas Schwab <schwab@suse.de>
>> Sent: Monday, November 11, 2019 7:38 PM
>> To: Anup Patel <Anup.Patel@wdc.com>
>> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
>> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
>> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
>> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
>> kernel@vger.kernel.org
>> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
>> 
>> On Nov 11 2019, Anup Patel wrote:
>> 
>> > We can use SYSCON reboot and poweroff drivers for the SiFive test
>> > device found on QEMU virt machine and SiFive SOCs.
>> 
>> I don't see any syscon-reboot compatible in the device tree.
>
> I have sent patch to QEMU as well for generating SYSCON DT nodes.

What about the kernel DT?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 14:32     ` Andreas Schwab
@ 2019-11-11 16:51       ` Anup Patel
  2019-11-11 16:55         ` Andreas Schwab
  0 siblings, 1 reply; 14+ messages in thread
From: Anup Patel @ 2019-11-11 16:51 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	Paul Walmsley, Palmer Dabbelt, linux-riscv, Christoph Hellwig



> -----Original Message-----
> From: Andreas Schwab <schwab@suse.de>
> Sent: Monday, November 11, 2019 8:02 PM
> To: Anup Patel <Anup.Patel@wdc.com>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>; Paul Walmsley
> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
> 
> On Nov 11 2019, Anup Patel wrote:
> 
> >> -----Original Message-----
> >> From: Andreas Schwab <schwab@suse.de>
> >> Sent: Monday, November 11, 2019 7:38 PM
> >> To: Anup Patel <Anup.Patel@wdc.com>
> >> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
> >> Alistair Francis <Alistair.Francis@wdc.com>; Christoph Hellwig
> >> <hch@lst.de>; Anup Patel <anup@brainfault.org>;
> >> linux-riscv@lists.infradead.org; linux- kernel@vger.kernel.org
> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff
> >> drivers
> >>
> >> On Nov 11 2019, Anup Patel wrote:
> >>
> >> > We can use SYSCON reboot and poweroff drivers for the SiFive test
> >> > device found on QEMU virt machine and SiFive SOCs.
> >>
> >> I don't see any syscon-reboot compatible in the device tree.
> >
> > I have sent patch to QEMU as well for generating SYSCON DT nodes.
> 
> What about the kernel DT?

For QEMU virt machine, the DT is generated by QEMU at runtime
so we don't need an explicit DT file in Linux sources.

Regards,
Anup

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 16:51       ` Anup Patel
@ 2019-11-11 16:55         ` Andreas Schwab
  2019-11-11 16:59           ` Christoph Hellwig
  2019-11-11 17:01           ` David Abdurachmanov
  0 siblings, 2 replies; 14+ messages in thread
From: Andreas Schwab @ 2019-11-11 16:55 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, linux-kernel, Atish Patra, Alistair Francis,
	Paul Walmsley, Palmer Dabbelt, linux-riscv, Christoph Hellwig

On Nov 11 2019, Anup Patel wrote:

>> -----Original Message-----
>> From: Andreas Schwab <schwab@suse.de>
>> Sent: Monday, November 11, 2019 8:02 PM
>> To: Anup Patel <Anup.Patel@wdc.com>
>> Cc: Palmer Dabbelt <palmer@dabbelt.com>; Paul Walmsley
>> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
>> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
>> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
>> kernel@vger.kernel.org
>> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
>> 
>> On Nov 11 2019, Anup Patel wrote:
>> 
>> >> -----Original Message-----
>> >> From: Andreas Schwab <schwab@suse.de>
>> >> Sent: Monday, November 11, 2019 7:38 PM
>> >> To: Anup Patel <Anup.Patel@wdc.com>
>> >> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
>> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
>> >> Alistair Francis <Alistair.Francis@wdc.com>; Christoph Hellwig
>> >> <hch@lst.de>; Anup Patel <anup@brainfault.org>;
>> >> linux-riscv@lists.infradead.org; linux- kernel@vger.kernel.org
>> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff
>> >> drivers
>> >>
>> >> On Nov 11 2019, Anup Patel wrote:
>> >>
>> >> > We can use SYSCON reboot and poweroff drivers for the SiFive test
>> >> > device found on QEMU virt machine and SiFive SOCs.
>> >>
>> >> I don't see any syscon-reboot compatible in the device tree.
>> >
>> > I have sent patch to QEMU as well for generating SYSCON DT nodes.
>> 
>> What about the kernel DT?
>
> For QEMU virt machine, the DT is generated by QEMU at runtime
> so we don't need an explicit DT file in Linux sources.

What about the HiFiveU?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 16:55         ` Andreas Schwab
@ 2019-11-11 16:59           ` Christoph Hellwig
  2019-11-11 17:01           ` David Abdurachmanov
  1 sibling, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2019-11-11 16:59 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Anup Patel, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, Palmer Dabbelt, linux-riscv,
	Christoph Hellwig

On Mon, Nov 11, 2019 at 05:55:36PM +0100, Andreas Schwab wrote:
> > For QEMU virt machine, the DT is generated by QEMU at runtime
> > so we don't need an explicit DT file in Linux sources.
> 
> What about the HiFiveU?

According to Palmer the IP block exists there, but isn't actually
wired up to reset or reboot the board.  So adding the DT entries
is rather pointless.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 16:55         ` Andreas Schwab
  2019-11-11 16:59           ` Christoph Hellwig
@ 2019-11-11 17:01           ` David Abdurachmanov
  2019-11-11 17:05             ` Andreas Schwab
  1 sibling, 1 reply; 14+ messages in thread
From: David Abdurachmanov @ 2019-11-11 17:01 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Anup Patel, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, Palmer Dabbelt, linux-riscv,
	Christoph Hellwig

On Mon, Nov 11, 2019 at 6:55 PM Andreas Schwab <schwab@suse.de> wrote:
>
> On Nov 11 2019, Anup Patel wrote:
>
> >> -----Original Message-----
> >> From: Andreas Schwab <schwab@suse.de>
> >> Sent: Monday, November 11, 2019 8:02 PM
> >> To: Anup Patel <Anup.Patel@wdc.com>
> >> Cc: Palmer Dabbelt <palmer@dabbelt.com>; Paul Walmsley
> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
> >> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
> >> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
> >> kernel@vger.kernel.org
> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
> >>
> >> On Nov 11 2019, Anup Patel wrote:
> >>
> >> >> -----Original Message-----
> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> Sent: Monday, November 11, 2019 7:38 PM
> >> >> To: Anup Patel <Anup.Patel@wdc.com>
> >> >> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
> >> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
> >> >> Alistair Francis <Alistair.Francis@wdc.com>; Christoph Hellwig
> >> >> <hch@lst.de>; Anup Patel <anup@brainfault.org>;
> >> >> linux-riscv@lists.infradead.org; linux- kernel@vger.kernel.org
> >> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff
> >> >> drivers
> >> >>
> >> >> On Nov 11 2019, Anup Patel wrote:
> >> >>
> >> >> > We can use SYSCON reboot and poweroff drivers for the SiFive test
> >> >> > device found on QEMU virt machine and SiFive SOCs.
> >> >>
> >> >> I don't see any syscon-reboot compatible in the device tree.
> >> >
> >> > I have sent patch to QEMU as well for generating SYSCON DT nodes.
> >>
> >> What about the kernel DT?
> >
> > For QEMU virt machine, the DT is generated by QEMU at runtime
> > so we don't need an explicit DT file in Linux sources.
>
> What about the HiFiveU?

Unleashed uses gpio-restart which depends on gpio driver (not upstreamed and
not posted for review on mailing list). I have that working on my build.

david

>
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 17:01           ` David Abdurachmanov
@ 2019-11-11 17:05             ` Andreas Schwab
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2019-11-11 17:05 UTC (permalink / raw)
  To: David Abdurachmanov
  Cc: Anup Patel, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, Palmer Dabbelt, linux-riscv,
	Christoph Hellwig

On Nov 11 2019, David Abdurachmanov wrote:

> On Mon, Nov 11, 2019 at 6:55 PM Andreas Schwab <schwab@suse.de> wrote:
>>
>> On Nov 11 2019, Anup Patel wrote:
>>
>> >> -----Original Message-----
>> >> From: Andreas Schwab <schwab@suse.de>
>> >> Sent: Monday, November 11, 2019 8:02 PM
>> >> To: Anup Patel <Anup.Patel@wdc.com>
>> >> Cc: Palmer Dabbelt <palmer@dabbelt.com>; Paul Walmsley
>> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>; Alistair
>> >> Francis <Alistair.Francis@wdc.com>; Christoph Hellwig <hch@lst.de>; Anup
>> >> Patel <anup@brainfault.org>; linux-riscv@lists.infradead.org; linux-
>> >> kernel@vger.kernel.org
>> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
>> >>
>> >> On Nov 11 2019, Anup Patel wrote:
>> >>
>> >> >> -----Original Message-----
>> >> >> From: Andreas Schwab <schwab@suse.de>
>> >> >> Sent: Monday, November 11, 2019 7:38 PM
>> >> >> To: Anup Patel <Anup.Patel@wdc.com>
>> >> >> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
>> >> >> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
>> >> >> Alistair Francis <Alistair.Francis@wdc.com>; Christoph Hellwig
>> >> >> <hch@lst.de>; Anup Patel <anup@brainfault.org>;
>> >> >> linux-riscv@lists.infradead.org; linux- kernel@vger.kernel.org
>> >> >> Subject: Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff
>> >> >> drivers
>> >> >>
>> >> >> On Nov 11 2019, Anup Patel wrote:
>> >> >>
>> >> >> > We can use SYSCON reboot and poweroff drivers for the SiFive test
>> >> >> > device found on QEMU virt machine and SiFive SOCs.
>> >> >>
>> >> >> I don't see any syscon-reboot compatible in the device tree.
>> >> >
>> >> > I have sent patch to QEMU as well for generating SYSCON DT nodes.
>> >>
>> >> What about the kernel DT?
>> >
>> > For QEMU virt machine, the DT is generated by QEMU at runtime
>> > so we don't need an explicit DT file in Linux sources.
>>
>> What about the HiFiveU?
>
> Unleashed uses gpio-restart which depends on gpio driver (not upstreamed and
> not posted for review on mailing list). I have that working on my build.

I do have that, too.  But I wonder about the "SiFive SOCs" reference
above.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 13:34 [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers Anup Patel
  2019-11-11 13:43 ` Anup Patel
  2019-11-11 14:08 ` Andreas Schwab
@ 2019-11-11 17:06 ` Paul Walmsley
  2019-11-12  4:19   ` Anup Patel
  2019-11-23  3:03 ` Paul Walmsley
  3 siblings, 1 reply; 14+ messages in thread
From: Paul Walmsley @ 2019-11-11 17:06 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, Palmer Dabbelt, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, linux-riscv, Christoph Hellwig

On Mon, 11 Nov 2019, Anup Patel wrote:

> We can use SYSCON reboot and poweroff drivers for the
> SiFive test device found on QEMU virt machine and SiFive
> SOCs.
> 
> This patch enables SYSCON reboot and poweroff drivers
> in RV64 and RV32 defconfigs.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

I'd much prefer Christoph's driver, once it's fixed up per my earlier 
comments.  This business with writing random registers based on what's in 
the DT data has always been a bad idea.


- Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 17:06 ` Paul Walmsley
@ 2019-11-12  4:19   ` Anup Patel
  0 siblings, 0 replies; 14+ messages in thread
From: Anup Patel @ 2019-11-12  4:19 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Palmer Dabbelt, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, Paul Walmsley, linux-riscv, Christoph Hellwig

On Mon, Nov 11, 2019 at 10:36 PM Paul Walmsley <paul@pwsan.com> wrote:
>
> On Mon, 11 Nov 2019, Anup Patel wrote:
>
> > We can use SYSCON reboot and poweroff drivers for the
> > SiFive test device found on QEMU virt machine and SiFive
> > SOCs.
> >
> > This patch enables SYSCON reboot and poweroff drivers
> > in RV64 and RV32 defconfigs.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
>
> I'd much prefer Christoph's driver, once it's fixed up per my earlier
> comments.  This business with writing random registers based on what's in
> the DT data has always been a bad idea.

Like mentioned in other email thread, we are not writing random
date to registers. In fact, we are describing Reboot and Poweroff
mechanism in DT using SYSCON Reboot and Poweroff DT nodes.

This is not a new approach. It has been used by a variety of SOCs
in past.

Regards,
Anup

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers
  2019-11-11 13:34 [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers Anup Patel
                   ` (2 preceding siblings ...)
  2019-11-11 17:06 ` Paul Walmsley
@ 2019-11-23  3:03 ` Paul Walmsley
  3 siblings, 0 replies; 14+ messages in thread
From: Paul Walmsley @ 2019-11-23  3:03 UTC (permalink / raw)
  To: Anup Patel
  Cc: Anup Patel, Palmer Dabbelt, linux-kernel, Atish Patra,
	Alistair Francis, linux-riscv, Christoph Hellwig

On Mon, 11 Nov 2019, Anup Patel wrote:

> We can use SYSCON reboot and poweroff drivers for the
> SiFive test device found on QEMU virt machine and SiFive
> SOCs.
> 
> This patch enables SYSCON reboot and poweroff drivers
> in RV64 and RV32 defconfigs.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

Sounds like Christoph isn't planning to follow up on his reset driver.  
So this patch looks OK to me, as far as QEMU is concerned.  Still it seems 
best to avoid SYSCON for real hardware as much as possible, so, will plan 
to apply this after CONFIG_SOC_VIRT support lands.

thanks,

- Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 13:34 [PATCH] RISC-V: Enable SYSCON reboot and poweroff drivers Anup Patel
2019-11-11 13:43 ` Anup Patel
2019-11-11 14:05   ` David Abdurachmanov
2019-11-11 14:08 ` Andreas Schwab
2019-11-11 14:21   ` Anup Patel
2019-11-11 14:32     ` Andreas Schwab
2019-11-11 16:51       ` Anup Patel
2019-11-11 16:55         ` Andreas Schwab
2019-11-11 16:59           ` Christoph Hellwig
2019-11-11 17:01           ` David Abdurachmanov
2019-11-11 17:05             ` Andreas Schwab
2019-11-11 17:06 ` Paul Walmsley
2019-11-12  4:19   ` Anup Patel
2019-11-23  3:03 ` Paul Walmsley

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org
	public-inbox-index linux-riscv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git