All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: Adding U-Boot version in FDT chosen node
@ 2022-04-11 18:17 Francesco Dolcini
  2022-04-11 18:27 ` Sean Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Francesco Dolcini @ 2022-04-11 18:17 UTC (permalink / raw)
  To: u-boot; +Cc: sjg, Rob Herring

Hello all,
I have a need to pass the u-boot version string to the operating
system and I'm thinking at adding `u-boot,version` property storing
`version_string` in it in the FDT `chosen` node.

Is this something that would be generally useful? Would be a patch like
that acceptable in upstream u-boot? Is there any other obvious way to
achieve something like that already implemented (using the cmdline would
work without any code change, but probably not the nicest solution).

Francesco


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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-11 18:17 RFC: Adding U-Boot version in FDT chosen node Francesco Dolcini
@ 2022-04-11 18:27 ` Sean Anderson
  2022-04-12 13:35 ` Rob Herring
  2022-04-20 17:01 ` Francesco Dolcini
  2 siblings, 0 replies; 8+ messages in thread
From: Sean Anderson @ 2022-04-11 18:27 UTC (permalink / raw)
  To: Francesco Dolcini, u-boot; +Cc: sjg, Rob Herring

Hi Francesco,

On 4/11/22 2:17 PM, Francesco Dolcini wrote:
> Hello all,
> I have a need to pass the u-boot version string to the operating
> system and I'm thinking at adding `u-boot,version` property storing
> `version_string` in it in the FDT `chosen` node.
> 
> Is this something that would be generally useful? Would be a patch like
> that acceptable in upstream u-boot? Is there any other obvious way to
> achieve something like that already implemented (using the cmdline would
> work without any code change, but probably not the nicest solution).
> 
> Francesco
> 

I think a standard way to communicate this would be nice. In the last
project I needed to do this, I put the following in my board file

/* Use a version without spaces so we don't have to quote it */
const char version_string[] = PLAIN_VERSION;

and then I added "my-prefix.u_boot_ver=${ver}" to my bootargs. This
works OK, but it's a bit ugly to read (you have to grep on
/proc/cmdline).

Somethins to consider would be how we want to expose versions from
different bootloader stages. For example, should SPL's version be
added?

--Sean

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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-11 18:17 RFC: Adding U-Boot version in FDT chosen node Francesco Dolcini
  2022-04-11 18:27 ` Sean Anderson
@ 2022-04-12 13:35 ` Rob Herring
  2022-04-20 17:01 ` Francesco Dolcini
  2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2022-04-12 13:35 UTC (permalink / raw)
  To: Francesco Dolcini; +Cc: U-Boot Mailing List, Simon Glass

On Mon, Apr 11, 2022 at 1:18 PM Francesco Dolcini
<francesco.dolcini@toradex.com> wrote:
>
> Hello all,
> I have a need to pass the u-boot version string to the operating
> system and I'm thinking at adding `u-boot,version` property storing
> `version_string` in it in the FDT `chosen` node.
>
> Is this something that would be generally useful? Would be a patch like
> that acceptable in upstream u-boot? Is there any other obvious way to
> achieve something like that already implemented (using the cmdline would
> work without any code change, but probably not the nicest solution).

Seems fine to me. Please add it here[1].

Rob

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml

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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-11 18:17 RFC: Adding U-Boot version in FDT chosen node Francesco Dolcini
  2022-04-11 18:27 ` Sean Anderson
  2022-04-12 13:35 ` Rob Herring
@ 2022-04-20 17:01 ` Francesco Dolcini
  2022-04-20 17:33   ` Tom Rini
  2022-04-20 21:51   ` Mark Kettenis
  2 siblings, 2 replies; 8+ messages in thread
From: Francesco Dolcini @ 2022-04-20 17:01 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, sjg, Rob Herring

+Tom

On Mon, Apr 11, 2022 at 08:17:55PM +0200, Francesco Dolcini wrote:
> Hello all,
> I have a need to pass the u-boot version string to the operating
> system and I'm thinking at adding `u-boot,version` property storing
> `version_string` in it in the FDT `chosen` node.
> 
> Is this something that would be generally useful? Would be a patch like
> that acceptable in upstream u-boot? Is there any other obvious way to
> achieve something like that already implemented (using the cmdline would
> work without any code change, but probably not the nicest solution).

Any concern on this Tom? I'm asking you directly since you recently
acknowledged another change [0] related to the chosen node.

[0] https://lore.kernel.org/all/20220412201444.GN14282@bill-the-cat/

Francesco


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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-20 17:01 ` Francesco Dolcini
@ 2022-04-20 17:33   ` Tom Rini
  2022-04-20 21:51   ` Mark Kettenis
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Rini @ 2022-04-20 17:33 UTC (permalink / raw)
  To: Francesco Dolcini; +Cc: u-boot, sjg, Rob Herring

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

On Wed, Apr 20, 2022 at 07:01:43PM +0200, Francesco Dolcini wrote:
> +Tom
> 
> On Mon, Apr 11, 2022 at 08:17:55PM +0200, Francesco Dolcini wrote:
> > Hello all,
> > I have a need to pass the u-boot version string to the operating
> > system and I'm thinking at adding `u-boot,version` property storing
> > `version_string` in it in the FDT `chosen` node.
> > 
> > Is this something that would be generally useful? Would be a patch like
> > that acceptable in upstream u-boot? Is there any other obvious way to
> > achieve something like that already implemented (using the cmdline would
> > work without any code change, but probably not the nicest solution).
> 
> Any concern on this Tom? I'm asking you directly since you recently
> acknowledged another change [0] related to the chosen node.
> 
> [0] https://lore.kernel.org/all/20220412201444.GN14282@bill-the-cat/

So, the patch I applied had a matching update to the relevant DT schema.
I don't see a problem with adding this information as well, but would
suggest starting by having a matching schema change and explanation of
use cases there.  Thanks!

-- 
Tom

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

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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-20 17:01 ` Francesco Dolcini
  2022-04-20 17:33   ` Tom Rini
@ 2022-04-20 21:51   ` Mark Kettenis
  2022-04-21  8:34     ` Francesco Dolcini
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Kettenis @ 2022-04-20 21:51 UTC (permalink / raw)
  To: Francesco Dolcini; +Cc: trini, u-boot, sjg, robh

> Date: Wed, 20 Apr 2022 19:01:43 +0200
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> +Tom
> 
> On Mon, Apr 11, 2022 at 08:17:55PM +0200, Francesco Dolcini wrote:
> > Hello all,
> > I have a need to pass the u-boot version string to the operating
> > system and I'm thinking at adding `u-boot,version` property storing
> > `version_string` in it in the FDT `chosen` node.
> > 
> > Is this something that would be generally useful? Would be a patch like
> > that acceptable in upstream u-boot? Is there any other obvious way to
> > achieve something like that already implemented (using the cmdline would
> > work without any code change, but probably not the nicest solution).
> 
> Any concern on this Tom? I'm asking you directly since you recently
> acknowledged another change [0] related to the chosen node.
> 
> [0] https://lore.kernel.org/all/20220412201444.GN14282@bill-the-cat/

To be honest, putting this in the "chosen" node feels odd.
Traditionally device trees have a node dedicated to the firmware.  For
example Sun OpenFirmware systems had a "openprom" node with a
"version" property.  And OpenPOWER systems have an
"ibm,firmware-versions" node.

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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-20 21:51   ` Mark Kettenis
@ 2022-04-21  8:34     ` Francesco Dolcini
  2022-04-21 10:02       ` Mark Kettenis
  0 siblings, 1 reply; 8+ messages in thread
From: Francesco Dolcini @ 2022-04-21  8:34 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: Francesco Dolcini, trini, u-boot, sjg, robh

Hello Mark

On Wed, Apr 20, 2022 at 11:51:44PM +0200, Mark Kettenis wrote:
> > Date: Wed, 20 Apr 2022 19:01:43 +0200
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > +Tom
> > 
> > On Mon, Apr 11, 2022 at 08:17:55PM +0200, Francesco Dolcini wrote:
> > > Hello all,
> > > I have a need to pass the u-boot version string to the operating
> > > system and I'm thinking at adding `u-boot,version` property storing
> > > `version_string` in it in the FDT `chosen` node.
> > > 
> > > Is this something that would be generally useful? Would be a patch like
> > > that acceptable in upstream u-boot? Is there any other obvious way to
> > > achieve something like that already implemented (using the cmdline would
> > > work without any code change, but probably not the nicest solution).
> > 
> > Any concern on this Tom? I'm asking you directly since you recently
> > acknowledged another change [0] related to the chosen node.
> > 
> > [0] https://lore.kernel.org/all/20220412201444.GN14282@bill-the-cat/
> 
> To be honest, putting this in the "chosen" node feels odd.
> Traditionally device trees have a node dedicated to the firmware.  For
> example Sun OpenFirmware systems had a "openprom" node with a
> "version" property.  And OpenPOWER systems have an
> "ibm,firmware-versions" node.

I would personally not mind the parent node of this property, however
from my partial understanding on the recent device tree architecture
decisions we do want only the description of the hardware and real
devices into it.

No software artifact nor software configuration should be part of it,
with the only exception of the chosen node [0].

Rob in cc can comment if I understood this wrong.

[0] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt

Francesco

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

* Re: RFC: Adding U-Boot version in FDT chosen node
  2022-04-21  8:34     ` Francesco Dolcini
@ 2022-04-21 10:02       ` Mark Kettenis
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Kettenis @ 2022-04-21 10:02 UTC (permalink / raw)
  To: Francesco Dolcini; +Cc: francesco.dolcini, trini, u-boot, sjg, robh

> Date: Thu, 21 Apr 2022 10:34:34 +0200
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Hello Mark
> 
> On Wed, Apr 20, 2022 at 11:51:44PM +0200, Mark Kettenis wrote:
> > > Date: Wed, 20 Apr 2022 19:01:43 +0200
> > > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > 
> > > +Tom
> > > 
> > > On Mon, Apr 11, 2022 at 08:17:55PM +0200, Francesco Dolcini wrote:
> > > > Hello all,
> > > > I have a need to pass the u-boot version string to the operating
> > > > system and I'm thinking at adding `u-boot,version` property storing
> > > > `version_string` in it in the FDT `chosen` node.
> > > > 
> > > > Is this something that would be generally useful? Would be a patch like
> > > > that acceptable in upstream u-boot? Is there any other obvious way to
> > > > achieve something like that already implemented (using the cmdline would
> > > > work without any code change, but probably not the nicest solution).
> > > 
> > > Any concern on this Tom? I'm asking you directly since you recently
> > > acknowledged another change [0] related to the chosen node.
> > > 
> > > [0] https://lore.kernel.org/all/20220412201444.GN14282@bill-the-cat/
> > 
> > To be honest, putting this in the "chosen" node feels odd.
> > Traditionally device trees have a node dedicated to the firmware.  For
> > example Sun OpenFirmware systems had a "openprom" node with a
> > "version" property.  And OpenPOWER systems have an
> > "ibm,firmware-versions" node.
> 
> I would personally not mind the parent node of this property, however
> from my partial understanding on the recent device tree architecture
> decisions we do want only the description of the hardware and real
> devices into it.

Well, if that were true, device trees for virtualized platforms
(e.g. QEMU with virtio devices) wouldn't work.  And things like PSCI
on arm64 wouldn't be discoverable.  The boundary between "real
hardware" and "firmware" is somewhat vague anyway.  The hardware may
be an integrated microcontroller running a firmware, where the
firmware is what actually defines the programming interface.

> No software artifact nor software configuration should be part of it,
> with the only exception of the chosen node [0].

The device tree specification itself uses slightly different text:

  "The /chosen node does not represent a real device in the system but
   describes parameters chosen or specified by the system firmware at run
   time. It shall be a child of the root node."

I wouldn't call the U-Boot version number a "paramater chosen or
specified by the system firmware at run time".

On the other hand, U-Boot doesn't provide some sort of U-Boot specific
firmware interface to the OS.  The firmware interfaces it does provide
are industry standard interfaces such as UEFI, SMBIOS and PSCI.  And
what you're trying to do is just provide some static information about
the U-Boot version that is providing those interfaces.  Note U-Boot
already provides its version number is provided through the UEFI and
SMBIOS interfaces.  But of course not all "boards" enable those
interfaces.

Anyway, I'm just pointing out here that I think "/chosen" isn't
necessarily the "obvious" place to provide this information, and that
there is a precedent for providing this information in a separate
top-level node.

> Rob in cc can comment if I understood this wrong.
> 
> [0] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt

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

end of thread, other threads:[~2022-04-21 10:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 18:17 RFC: Adding U-Boot version in FDT chosen node Francesco Dolcini
2022-04-11 18:27 ` Sean Anderson
2022-04-12 13:35 ` Rob Herring
2022-04-20 17:01 ` Francesco Dolcini
2022-04-20 17:33   ` Tom Rini
2022-04-20 21:51   ` Mark Kettenis
2022-04-21  8:34     ` Francesco Dolcini
2022-04-21 10:02       ` Mark Kettenis

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.