[PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode

Christian Kohlschütter christian at kohlschutter.com
Thu Sep 29 02:09:14 CEST 2022


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 at 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



More information about the U-Boot mailing list