diff mbox series

riscv: dts: sifive unmatched: Add gpio poweroff

Message ID 20211231061110.89403-1-w6rz@comcast.net
State Accepted
Commit db3f02df1853acf4d678bcddb3f1eab23219b410
Headers show
Series riscv: dts: sifive unmatched: Add gpio poweroff | expand

Commit Message

Ron Economos Dec. 31, 2021, 6:11 a.m. UTC
This patch is required for the following commit to work.

commit f2928e224d85 ("riscv: set default pm_power_off to NULL")

Signed-off-by: Ron Economos <w6rz@comcast.net>
---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ron Economos Dec. 31, 2021, 3:35 p.m. UTC | #1
On 12/30/21 10:58 PM, James Clarke wrote:
> On 31 Dec 2021, at 06:11, Ron Economos <w6rz@comcast.net> wrote:
>> This patch is required for the following commit to work.
>>
>> commit f2928e224d85 ("riscv: set default pm_power_off to NULL")
>>
>> Signed-off-by: Ron Economos <w6rz@comcast.net>
>> ---
>> arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
>> index 6bfa1f24d3de..c4ed9efdff03 100644
>> --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
>> +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
>> @@ -39,6 +39,11 @@ rtcclk: rtcclk {
>>         clock-frequency = <RTCCLK_FREQ>;
>>         clock-output-names = "rtcclk";
>>     };
>> +
>> +    gpio-poweroff {
>> +        compatible = "gpio-poweroff";
>> +        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
>> +    };
> Why? It’s abstracted by firmware, which works.
>
> Jess
>
I didn't realize that OpenSBI 1.0 had been released last week. Please 
disregard this patch.

Ron
Jessica Clarke Dec. 31, 2021, 5:16 p.m. UTC | #2
On 31 Dec 2021, at 16:49, Dimitri John Ledkov <dimitri.ledkov@canonical.com> wrote:
> 
> However, in some configurations uboot loads kernel provided dtb, then this pin needs to be defines for SBI to provide poweroff via this pin.
> 
> Kernel, uboot, opensbi dtbs for unmatched must be consistent with each other and all should define poweroff pin.

U-Boot SPL loads its embedded DTB for OpenSBI’s use. U-Boot “proper”
loads the kernel’s DTB for the kernel’s use. The DTB loaded for the
kernel is never fed back somehow. Just as we don’t provide DDR timing
information in the kernel DTB, only U-Boot’s, there should be no need
to provide information about this GPIO to the kernel. Either the kernel
will prioritise SBI power-off, which renders the DTB node a complete
waste of space, and possibly confusing to exist, or the kernel will
prioritise GPIO power-off, which should be discouraged as you’re
supposed to use standardised firmware interfaces for these kinds of
platform-specific things.

Jess

> On Fri, 31 Dec 2021, 06:58 James Clarke, <jrtc27@jrtc27.com> wrote:
> On 31 Dec 2021, at 06:11, Ron Economos <w6rz@comcast.net> wrote:
> > 
> > This patch is required for the following commit to work.
> > 
> > commit f2928e224d85 ("riscv: set default pm_power_off to NULL")
> > 
> > Signed-off-by: Ron Economos <w6rz@comcast.net>
> > ---
> > arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 5 +++++
> > 1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
> > index 6bfa1f24d3de..c4ed9efdff03 100644
> > --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
> > +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
> > @@ -39,6 +39,11 @@ rtcclk: rtcclk {
> >        clock-frequency = <RTCCLK_FREQ>;
> >        clock-output-names = "rtcclk";
> >    };
> > +
> > +    gpio-poweroff {
> > +        compatible = "gpio-poweroff";
> > +        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
> > +    };
> 
> Why? It’s abstracted by firmware, which works.
> 
> Jess
>
diff mbox series

Patch

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 6bfa1f24d3de..c4ed9efdff03 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -39,6 +39,11 @@  rtcclk: rtcclk {
 		clock-frequency = <RTCCLK_FREQ>;
 		clock-output-names = "rtcclk";
 	};
+
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+	};
 };
 
 &uart0 {