All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode
@ 2022-09-29  0:09 Christian Kohlschütter
  2022-09-29  2:36 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Kohlschütter @ 2022-09-29  0:09 UTC (permalink / raw)
  To: u-boot; +Cc: Christian Kohlschütter

Currently, device trees can only specify an asset tag for the
"baseboard" type, not for the "chassis" (system enclosure) type, which
usually carries the more user-visible asset tag.

Add support for the chassis asset-tag, and update the documentation.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
---
 doc/device-tree-bindings/sysinfo/smbios.txt | 4 ++++
 lib/smbios.c                                | 1 +
 2 files changed, 5 insertions(+)

diff --git a/doc/device-tree-bindings/sysinfo/smbios.txt b/doc/device-tree-bindings/sysinfo/smbios.txt
index b522322802..2c1c9abf7c 100644
--- a/doc/device-tree-bindings/sysinfo/smbios.txt
+++ b/doc/device-tree-bindings/sysinfo/smbios.txt
@@ -44,6 +44,9 @@ Within each subnode the following tables are recognised:
 "chassis" subnode optional properties:
 
   - manufacturer: Product manufacturer for chassis
+  - asset-tag:    Asset tag for the system enclosure, sometimes used in
+                      organisations to track devices
+
 
 
 Example:
@@ -72,6 +75,7 @@ sysinfo {
 		/* Type 3 table */
 		chassis {
 			manufacturer = "Google";
+			asset-tag = "XYZ789";
 		};
 	};
 };
diff --git a/lib/smbios.c b/lib/smbios.c
index d7f4999e8b..8f8f160882 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -347,6 +347,7 @@ static int smbios_write_type3(ulong *current, int handle,
 	if (!t->manufacturer)
 		t->manufacturer = smbios_add_string(ctx, "Unknown");
 	t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP;
+	t->asset_tag_number = smbios_add_prop(ctx, "asset-tag");
 	t->bootup_state = SMBIOS_STATE_SAFE;
 	t->power_supply_state = SMBIOS_STATE_SAFE;
 	t->thermal_state = SMBIOS_STATE_SAFE;
-- 
2.36.2


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

* Re: [PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode
  2022-09-29  0:09 [PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode Christian Kohlschütter
@ 2022-09-29  2:36 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2022-09-29  2:36 UTC (permalink / raw)
  To: Christian Kohlschütter; +Cc: U-Boot Mailing List

On Wed, 28 Sept 2022 at 18:09, Christian Kohlschütter
<christian@kohlschutter.com> wrote:
>
> Currently, device trees can only specify an asset tag for the
> "baseboard" type, not for the "chassis" (system enclosure) type, which
> usually carries the more user-visible asset tag.
>
> Add support for the chassis asset-tag, and update the documentation.
>
> Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
> ---
>  doc/device-tree-bindings/sysinfo/smbios.txt | 4 ++++
>  lib/smbios.c                                | 1 +
>  2 files changed, 5 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
> diff --git a/doc/device-tree-bindings/sysinfo/smbios.txt b/doc/device-tree-bindings/sysinfo/smbios.txt
> index b522322802..2c1c9abf7c 100644
> --- a/doc/device-tree-bindings/sysinfo/smbios.txt
> +++ b/doc/device-tree-bindings/sysinfo/smbios.txt
> @@ -44,6 +44,9 @@ Within each subnode the following tables are recognised:
>  "chassis" subnode optional properties:
>
>    - manufacturer: Product manufacturer for chassis
> +  - asset-tag:    Asset tag for the system enclosure, sometimes used in
> +                      organisations to track devices
> +
>
>
>  Example:
> @@ -72,6 +75,7 @@ sysinfo {
>                 /* Type 3 table */
>                 chassis {
>                         manufacturer = "Google";
> +                       asset-tag = "XYZ789";
>                 };
>         };
>  };
> diff --git a/lib/smbios.c b/lib/smbios.c
> index d7f4999e8b..8f8f160882 100644
> --- a/lib/smbios.c
> +++ b/lib/smbios.c
> @@ -347,6 +347,7 @@ static int smbios_write_type3(ulong *current, int handle,
>         if (!t->manufacturer)
>                 t->manufacturer = smbios_add_string(ctx, "Unknown");
>         t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP;
> +       t->asset_tag_number = smbios_add_prop(ctx, "asset-tag");
>         t->bootup_state = SMBIOS_STATE_SAFE;
>         t->power_supply_state = SMBIOS_STATE_SAFE;
>         t->thermal_state = SMBIOS_STATE_SAFE;
> --
> 2.36.2
>

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  0:09 [PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode Christian Kohlschütter
2022-09-29  2:36 ` Simon Glass

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.