All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
@ 2022-09-22 13:45 Quentin Schulz
  2022-09-22 13:53 ` Marek Vasut
  2022-09-22 15:55 ` Quentin Schulz
  0 siblings, 2 replies; 6+ messages in thread
From: Quentin Schulz @ 2022-09-22 13:45 UTC (permalink / raw)
  Cc: sjg, foss+uboot, marex, u-boot, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
that it is kept in SPL/TPL variant of the device tree. However, a device
is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
regardless of u-boot,dm-pre-reloc DT property presence. This flag is
currently only set by drivers directly.

However, this flag should be allowed to be set on a per-device basis
even if the driver does not hardcode it so that the device will be
probed in SPL/TPL regardless of the driver's defaults.

This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
node contains the u-boot,dm-pre-reloc property.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/core/lists.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index c49695b24f..86b75ffede 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -260,6 +260,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
 				ret);
 			return log_msg_ret("bind", ret);
 		} else {
+			if (ofnode_pre_reloc(node))
+				dev_or_flags(dev, DM_FLAG_PRE_RELOC);
+
 			found = true;
 			if (devp)
 				*devp = dev;
-- 
2.37.3


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

* Re: [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
  2022-09-22 13:45 [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property Quentin Schulz
@ 2022-09-22 13:53 ` Marek Vasut
  2022-09-29 14:34   ` Tom Rini
  2022-09-22 15:55 ` Quentin Schulz
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2022-09-22 13:53 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: sjg, u-boot, Quentin Schulz, Tom Rini

On 9/22/22 15:45, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
> that it is kept in SPL/TPL variant of the device tree. However, a device
> is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
> regardless of u-boot,dm-pre-reloc DT property presence. This flag is
> currently only set by drivers directly.
> 
> However, this flag should be allowed to be set on a per-device basis
> even if the driver does not hardcode it so that the device will be
> probed in SPL/TPL regardless of the driver's defaults.
> 
> This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
> node contains the u-boot,dm-pre-reloc property.
> 
> Cc: Quentin Schulz <foss+uboot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>   drivers/core/lists.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> index c49695b24f..86b75ffede 100644
> --- a/drivers/core/lists.c
> +++ b/drivers/core/lists.c
> @@ -260,6 +260,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
>   				ret);
>   			return log_msg_ret("bind", ret);
>   		} else {
> +			if (ofnode_pre_reloc(node))
> +				dev_or_flags(dev, DM_FLAG_PRE_RELOC);
> +
>   			found = true;
>   			if (devp)
>   				*devp = dev;

Reviewed-by: Marek Vasut <marex@denx.de>

Tom, this does look like a bugfix for this release, but it would be good 
to have Simon look over this too.

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

* Re: [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
  2022-09-22 13:45 [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property Quentin Schulz
  2022-09-22 13:53 ` Marek Vasut
@ 2022-09-22 15:55 ` Quentin Schulz
  1 sibling, 0 replies; 6+ messages in thread
From: Quentin Schulz @ 2022-09-22 15:55 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: sjg, marex, u-boot

Hi all,

On 9/22/22 15:45, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
> that it is kept in SPL/TPL variant of the device tree. However, a device
> is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
> regardless of u-boot,dm-pre-reloc DT property presence. This flag is
> currently only set by drivers directly.
> 
> However, this flag should be allowed to be set on a per-device basis
> even if the driver does not hardcode it so that the device will be
> probed in SPL/TPL regardless of the driver's defaults.
> 
> This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
> node contains the u-boot,dm-pre-reloc property.
> 
> Cc: Quentin Schulz <foss+uboot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

This patch can be abandoned, it is now superseded by:
https://lore.kernel.org/u-boot/20220922155326.3293815-1-foss+uboot@0leil.net/

Cheers,
Quentin

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

* Re: [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
  2022-09-22 13:53 ` Marek Vasut
@ 2022-09-29 14:34   ` Tom Rini
  2022-09-29 15:23     ` quentin.schulz
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2022-09-29 14:34 UTC (permalink / raw)
  To: Marek Vasut; +Cc: Quentin Schulz, sjg, u-boot, Quentin Schulz

[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]

On Thu, Sep 22, 2022 at 03:53:46PM +0200, Marek Vasut wrote:
> On 9/22/22 15:45, Quentin Schulz wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > 
> > One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
> > that it is kept in SPL/TPL variant of the device tree. However, a device
> > is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
> > regardless of u-boot,dm-pre-reloc DT property presence. This flag is
> > currently only set by drivers directly.
> > 
> > However, this flag should be allowed to be set on a per-device basis
> > even if the driver does not hardcode it so that the device will be
> > probed in SPL/TPL regardless of the driver's defaults.
> > 
> > This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
> > node contains the u-boot,dm-pre-reloc property.
> > 
> > Cc: Quentin Schulz <foss+uboot@0leil.net>
> > Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > ---
> >   drivers/core/lists.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> > index c49695b24f..86b75ffede 100644
> > --- a/drivers/core/lists.c
> > +++ b/drivers/core/lists.c
> > @@ -260,6 +260,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
> >   				ret);
> >   			return log_msg_ret("bind", ret);
> >   		} else {
> > +			if (ofnode_pre_reloc(node))
> > +				dev_or_flags(dev, DM_FLAG_PRE_RELOC);
> > +
> >   			found = true;
> >   			if (devp)
> >   				*devp = dev;
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
> 
> Tom, this does look like a bugfix for this release, but it would be good to
> have Simon look over this too.

Cycling back here, I would like to hear what Simon thinks here.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
  2022-09-29 14:34   ` Tom Rini
@ 2022-09-29 15:23     ` quentin.schulz
  2022-09-29 15:24       ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: quentin.schulz @ 2022-09-29 15:23 UTC (permalink / raw)
  To: Tom Rini, Marek Vasut, Quentin Schulz, sjg, u-boot

Hi Tom,

On 9/29/22 4:34 PM, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Sep 22, 2022 at 03:53:46PM +0200, Marek Vasut wrote:
> > On 9/22/22 15:45, Quentin Schulz wrote:
> >> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> >>
> >> One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
> >> that it is kept in SPL/TPL variant of the device tree. However, a device
> >> is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
> >> regardless of u-boot,dm-pre-reloc DT property presence. This flag is
> >> currently only set by drivers directly.
> >>
> >> However, this flag should be allowed to be set on a per-device basis
> >> even if the driver does not hardcode it so that the device will be
> >> probed in SPL/TPL regardless of the driver's defaults.
> >>
> >> This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
> >> node contains the u-boot,dm-pre-reloc property.
> >>
> >> Cc: Quentin Schulz <foss+uboot@0leil.net>
> >> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> >> ---
> >>    drivers/core/lists.c | 3 +++
> >>    1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> >> index c49695b24f..86b75ffede 100644
> >> --- a/drivers/core/lists.c
> >> +++ b/drivers/core/lists.c
> >> @@ -260,6 +260,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
> >>    				ret);
> >>    			return log_msg_ret("bind", ret);
> >>    		} else {
> >> +			if (ofnode_pre_reloc(node))
> >> +				dev_or_flags(dev, DM_FLAG_PRE_RELOC);
> >> +
> >>    			found = true;
> >>    			if (devp)
> >>    				*devp = dev;
> >
> > Reviewed-by: Marek Vasut <marex@denx.de>
> >
> > Tom, this does look like a bugfix for this release, but it would be good to
> > have Simon look over this too.
> 
> Cycling back here, I would like to hear what Simon thinks here.
> 

This patch is superseded by https://lore.kernel.org/u-boot/20220922155326.3293815-1-foss+uboot@0leil.net/, please abandon it.

Cheers,
Quentin

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

* Re: [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property
  2022-09-29 15:23     ` quentin.schulz
@ 2022-09-29 15:24       ` Tom Rini
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2022-09-29 15:24 UTC (permalink / raw)
  To: quentin.schulz; +Cc: Marek Vasut, Quentin Schulz, sjg, u-boot

[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]

On Thu, Sep 29, 2022 at 05:23:15PM +0200, quentin.schulz@theobroma-systems.com wrote:
> Hi Tom,
> 
> On 9/29/22 4:34 PM, Tom Rini <trini@konsulko.com> wrote:
> > On Thu, Sep 22, 2022 at 03:53:46PM +0200, Marek Vasut wrote:
> > > On 9/22/22 15:45, Quentin Schulz wrote:
> > >> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > >>
> > >> One needs to set u-boot,dm-pre-reloc in a device Device Tree node so
> > >> that it is kept in SPL/TPL variant of the device tree. However, a device
> > >> is automatically probed only if it's flagged with DM_FLAG_PRE_RELOC,
> > >> regardless of u-boot,dm-pre-reloc DT property presence. This flag is
> > >> currently only set by drivers directly.
> > >>
> > >> However, this flag should be allowed to be set on a per-device basis
> > >> even if the driver does not hardcode it so that the device will be
> > >> probed in SPL/TPL regardless of the driver's defaults.
> > >>
> > >> This sets the DM_FLAG_PRE_RELOC for all U_BOOT_CLASS devices whose DT
> > >> node contains the u-boot,dm-pre-reloc property.
> > >>
> > >> Cc: Quentin Schulz <foss+uboot@0leil.net>
> > >> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > >> ---
> > >>    drivers/core/lists.c | 3 +++
> > >>    1 file changed, 3 insertions(+)
> > >>
> > >> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> > >> index c49695b24f..86b75ffede 100644
> > >> --- a/drivers/core/lists.c
> > >> +++ b/drivers/core/lists.c
> > >> @@ -260,6 +260,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
> > >>    				ret);
> > >>    			return log_msg_ret("bind", ret);
> > >>    		} else {
> > >> +			if (ofnode_pre_reloc(node))
> > >> +				dev_or_flags(dev, DM_FLAG_PRE_RELOC);
> > >> +
> > >>    			found = true;
> > >>    			if (devp)
> > >>    				*devp = dev;
> > >
> > > Reviewed-by: Marek Vasut <marex@denx.de>
> > >
> > > Tom, this does look like a bugfix for this release, but it would be good to
> > > have Simon look over this too.
> > 
> > Cycling back here, I would like to hear what Simon thinks here.
> > 
> 
> This patch is superseded by https://lore.kernel.org/u-boot/20220922155326.3293815-1-foss+uboot@0leil.net/, please abandon it.

Done, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-09-29 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 13:45 [PATCH] dm: automatically set DM_FLAG_PRE_RELOC based on device-tree property Quentin Schulz
2022-09-22 13:53 ` Marek Vasut
2022-09-29 14:34   ` Tom Rini
2022-09-29 15:23     ` quentin.schulz
2022-09-29 15:24       ` Tom Rini
2022-09-22 15:55 ` Quentin Schulz

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.