All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
@ 2025-03-30  9:28 Svyatoslav Ryhel
  2025-03-30  9:28 ` [PATCH v1 1/1] " Svyatoslav Ryhel
  0 siblings, 1 reply; 6+ messages in thread
From: Svyatoslav Ryhel @ 2025-03-30  9:28 UTC (permalink / raw)
  To: Tom Rini, Caleb Connolly, Kongyang Liu, Simon Glass,
	Svyatoslav Ryhel, Robert Marko
  Cc: u-boot

GPIO reset and power-off functionality depends on device tree data, which
is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
config option.

Svyatoslav Ryhel (1):
  sysreset: add PHASE_ to GPIO reset and poweroff configs

 drivers/sysreset/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.43.0


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

* [PATCH v1 1/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
  2025-03-30  9:28 [PATCH v1 0/1] sysreset: add PHASE_ to GPIO reset and poweroff configs Svyatoslav Ryhel
@ 2025-03-30  9:28 ` Svyatoslav Ryhel
  2025-03-31 10:16   ` Quentin Schulz
  0 siblings, 1 reply; 6+ messages in thread
From: Svyatoslav Ryhel @ 2025-03-30  9:28 UTC (permalink / raw)
  To: Tom Rini, Caleb Connolly, Kongyang Liu, Simon Glass,
	Svyatoslav Ryhel, Robert Marko
  Cc: u-boot

GPIO reset and power-off functionality depends on device tree data, which
is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
config option.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 drivers/sysreset/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index 796fc9effa5..ded91a4d325 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -8,8 +8,8 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
 obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
 obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
 obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
-obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
-obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
+obj-$(CONFIG_$(PHASE_)POWEROFF_GPIO) += poweroff_gpio.o
+obj-$(CONFIG_$(PHASE_)SYSRESET_GPIO) += sysreset_gpio.o
 obj-$(CONFIG_$(PHASE_)SYSRESET_MAX77663) += sysreset_max77663.o
 obj-$(CONFIG_SYSRESET_MPC83XX) += sysreset_mpc83xx.o
 obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
-- 
2.43.0


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

* Re: [PATCH v1 1/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
  2025-03-30  9:28 ` [PATCH v1 1/1] " Svyatoslav Ryhel
@ 2025-03-31 10:16   ` Quentin Schulz
  2025-03-31 10:27     ` Svyatoslav Ryhel
  0 siblings, 1 reply; 6+ messages in thread
From: Quentin Schulz @ 2025-03-31 10:16 UTC (permalink / raw)
  To: Svyatoslav Ryhel, Tom Rini, Caleb Connolly, Kongyang Liu,
	Simon Glass, Robert Marko
  Cc: u-boot

Hi Svyatoslav,

On 3/30/25 11:28 AM, Svyatoslav Ryhel wrote:
> GPIO reset and power-off functionality depends on device tree data, which
> is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
> config option.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>   drivers/sysreset/Makefile | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> index 796fc9effa5..ded91a4d325 100644
> --- a/drivers/sysreset/Makefile
> +++ b/drivers/sysreset/Makefile
> @@ -8,8 +8,8 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
>   obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
>   obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
>   obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
> -obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
> -obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
> +obj-$(CONFIG_$(PHASE_)POWEROFF_GPIO) += poweroff_gpio.o
> +obj-$(CONFIG_$(PHASE_)SYSRESET_GPIO) += sysreset_gpio.o

Are you sure this is safe for all boards?

Essentially, right now POWEROFF_GPIO/SYSRESET_GPIO would be built for 
devices with TPL/SPL_SYSRESET symbol enabled, but with this change it 
would be disabled, possibly breaking their setup.

I'm not against this change, it's just that there may be additional 
changes made to defconfigs to transition to this new symbol...

... which you haven't added here. I don't know what's the policy, but I 
think it makes sense to add the VPL/TPL/SPL symbols here so that people 
can simply enable the symbols whenever they need it enabled in the phase 
instead of needing to send another patch before doing that.

Cheers,
Quentin

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

* Re: [PATCH v1 1/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
  2025-03-31 10:16   ` Quentin Schulz
@ 2025-03-31 10:27     ` Svyatoslav Ryhel
  2025-03-31 10:31       ` Quentin Schulz
  0 siblings, 1 reply; 6+ messages in thread
From: Svyatoslav Ryhel @ 2025-03-31 10:27 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: Tom Rini, Caleb Connolly, Kongyang Liu, Simon Glass, Robert Marko,
	u-boot

пн, 31 бер. 2025 р. о 13:16 Quentin Schulz <quentin.schulz@cherry.de> пише:
>
> Hi Svyatoslav,
>
> On 3/30/25 11:28 AM, Svyatoslav Ryhel wrote:
> > GPIO reset and power-off functionality depends on device tree data, which
> > is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
> > config option.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
> >   drivers/sysreset/Makefile | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> > index 796fc9effa5..ded91a4d325 100644
> > --- a/drivers/sysreset/Makefile
> > +++ b/drivers/sysreset/Makefile
> > @@ -8,8 +8,8 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
> >   obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
> >   obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
> >   obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
> > -obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
> > -obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
> > +obj-$(CONFIG_$(PHASE_)POWEROFF_GPIO) += poweroff_gpio.o
> > +obj-$(CONFIG_$(PHASE_)SYSRESET_GPIO) += sysreset_gpio.o
>
> Are you sure this is safe for all boards?
>
> Essentially, right now POWEROFF_GPIO/SYSRESET_GPIO would be built for
> devices with TPL/SPL_SYSRESET symbol enabled, but with this change it
> would be disabled, possibly breaking their setup.
>
> I'm not against this change, it's just that there may be additional
> changes made to defconfigs to transition to this new symbol...
>
> ... which you haven't added here. I don't know what's the policy, but I
> think it makes sense to add the VPL/TPL/SPL symbols here so that people

You mean config SPL_POWEROFF_GPIO and SPL_SYSRESET_GPIO? It seems a
good idea, I wonder if there is a simpler way to add this without
adding Kconfig entry for every boot stage. Maybe you know such
example?

> can simply enable the symbols whenever they need it enabled in the phase
> instead of needing to send another patch before doing that.
>
> Cheers,
> Quentin

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

* Re: [PATCH v1 1/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
  2025-03-31 10:27     ` Svyatoslav Ryhel
@ 2025-03-31 10:31       ` Quentin Schulz
  2025-03-31 10:33         ` Svyatoslav Ryhel
  0 siblings, 1 reply; 6+ messages in thread
From: Quentin Schulz @ 2025-03-31 10:31 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Tom Rini, Caleb Connolly, Kongyang Liu, Simon Glass, Robert Marko,
	u-boot

On 3/31/25 12:27 PM, Svyatoslav Ryhel wrote:
> пн, 31 бер. 2025 р. о 13:16 Quentin Schulz <quentin.schulz@cherry.de> пише:
>>
>> Hi Svyatoslav,
>>
>> On 3/30/25 11:28 AM, Svyatoslav Ryhel wrote:
>>> GPIO reset and power-off functionality depends on device tree data, which
>>> is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
>>> config option.
>>>
>>> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
>>> ---
>>>    drivers/sysreset/Makefile | 4 ++--
>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
>>> index 796fc9effa5..ded91a4d325 100644
>>> --- a/drivers/sysreset/Makefile
>>> +++ b/drivers/sysreset/Makefile
>>> @@ -8,8 +8,8 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
>>>    obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
>>>    obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
>>>    obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
>>> -obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
>>> -obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
>>> +obj-$(CONFIG_$(PHASE_)POWEROFF_GPIO) += poweroff_gpio.o
>>> +obj-$(CONFIG_$(PHASE_)SYSRESET_GPIO) += sysreset_gpio.o
>>
>> Are you sure this is safe for all boards?
>>
>> Essentially, right now POWEROFF_GPIO/SYSRESET_GPIO would be built for
>> devices with TPL/SPL_SYSRESET symbol enabled, but with this change it
>> would be disabled, possibly breaking their setup.
>>
>> I'm not against this change, it's just that there may be additional
>> changes made to defconfigs to transition to this new symbol...
>>
>> ... which you haven't added here. I don't know what's the policy, but I
>> think it makes sense to add the VPL/TPL/SPL symbols here so that people
> 
> You mean config SPL_POWEROFF_GPIO and SPL_SYSRESET_GPIO? It seems a
> good idea, I wonder if there is a simpler way to add this without
> adding Kconfig entry for every boot stage. Maybe you know such
> example?
> 

We don't have such a mechanism, each symbol needs to be "duplicated" 
right now.

The thing is, we cannot really automate it (globally at the very least) 
as some symbols have different dependencies (and possibly different 
default values, etc...) depending on which PHASE they apply. 
Additionally, some symbols are for all PHASEs, not only proper. Maybe 
there's some magic we can have in Kconfig for that, but we would need to 
create a plugin for it.

I think this may have been raised in the "xPL proposal" thread on the ML.

Cheers,
Quentin

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

* Re: [PATCH v1 1/1] sysreset: add PHASE_ to GPIO reset and poweroff configs
  2025-03-31 10:31       ` Quentin Schulz
@ 2025-03-31 10:33         ` Svyatoslav Ryhel
  0 siblings, 0 replies; 6+ messages in thread
From: Svyatoslav Ryhel @ 2025-03-31 10:33 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: Tom Rini, Caleb Connolly, Kongyang Liu, Simon Glass, Robert Marko,
	u-boot

пн, 31 бер. 2025 р. о 13:31 Quentin Schulz <quentin.schulz@cherry.de> пише:
>
> On 3/31/25 12:27 PM, Svyatoslav Ryhel wrote:
> > пн, 31 бер. 2025 р. о 13:16 Quentin Schulz <quentin.schulz@cherry.de> пише:
> >>
> >> Hi Svyatoslav,
> >>
> >> On 3/30/25 11:28 AM, Svyatoslav Ryhel wrote:
> >>> GPIO reset and power-off functionality depends on device tree data, which
> >>> is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
> >>> config option.
> >>>
> >>> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> >>> ---
> >>>    drivers/sysreset/Makefile | 4 ++--
> >>>    1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> >>> index 796fc9effa5..ded91a4d325 100644
> >>> --- a/drivers/sysreset/Makefile
> >>> +++ b/drivers/sysreset/Makefile
> >>> @@ -8,8 +8,8 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
> >>>    obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
> >>>    obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
> >>>    obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
> >>> -obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
> >>> -obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
> >>> +obj-$(CONFIG_$(PHASE_)POWEROFF_GPIO) += poweroff_gpio.o
> >>> +obj-$(CONFIG_$(PHASE_)SYSRESET_GPIO) += sysreset_gpio.o
> >>
> >> Are you sure this is safe for all boards?
> >>
> >> Essentially, right now POWEROFF_GPIO/SYSRESET_GPIO would be built for
> >> devices with TPL/SPL_SYSRESET symbol enabled, but with this change it
> >> would be disabled, possibly breaking their setup.
> >>
> >> I'm not against this change, it's just that there may be additional
> >> changes made to defconfigs to transition to this new symbol...
> >>
> >> ... which you haven't added here. I don't know what's the policy, but I
> >> think it makes sense to add the VPL/TPL/SPL symbols here so that people
> >
> > You mean config SPL_POWEROFF_GPIO and SPL_SYSRESET_GPIO? It seems a
> > good idea, I wonder if there is a simpler way to add this without
> > adding Kconfig entry for every boot stage. Maybe you know such
> > example?
> >
>
> We don't have such a mechanism, each symbol needs to be "duplicated"
> right now.
>
> The thing is, we cannot really automate it (globally at the very least)
> as some symbols have different dependencies (and possibly different
> default values, etc...) depending on which PHASE they apply.
> Additionally, some symbols are for all PHASEs, not only proper. Maybe
> there's some magic we can have in Kconfig for that, but we would need to
> create a plugin for it.
>
> I think this may have been raised in the "xPL proposal" thread on the ML.
>

Thank you. So duplication it is.

> Cheers,
> Quentin

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

end of thread, other threads:[~2025-03-31 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-30  9:28 [PATCH v1 0/1] sysreset: add PHASE_ to GPIO reset and poweroff configs Svyatoslav Ryhel
2025-03-30  9:28 ` [PATCH v1 1/1] " Svyatoslav Ryhel
2025-03-31 10:16   ` Quentin Schulz
2025-03-31 10:27     ` Svyatoslav Ryhel
2025-03-31 10:31       ` Quentin Schulz
2025-03-31 10:33         ` Svyatoslav Ryhel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.