Skip to contentSkip to conversation

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

PATCH In review Christian Kohlschütter 2 participants 2 messages Sep 29, 2022 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smbios: dts: Add "asset-tag" property to "enclosure" subnode

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.

---
 doc/device-tree-bindings/sysinfo/smbios.txt | 4 ++++
 lib/smbios.c                                | 1 +
 2 files changed, 5 insertions(+)
doc/device-tree-bindings/sysinfo/smbios.txt +4 -0
index b522322802..2c1c9abf7c 100644
@@ -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";
 		};
 	};
 };
lib/smbios.c +1 -0
index d7f4999e8b..8f8f160882 100644
@@ -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;
Signature · 1 line
2.36.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · 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.

Quoted 7 lines

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

---
 doc/device-tree-bindings/sysinfo/smbios.txt | 4 ++++
 lib/smbios.c                                | 1 +
 2 files changed, 5 insertions(+)
Quoted 38 lines
doc/device-tree-bindings/sysinfo/smbios.txt +4 -0
index b522322802..2c1c9abf7c 100644
@@ -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";
                };
        };
 };
lib/smbios.c +1 -1
index d7f4999e8b..8f8f160882 100644
@@ -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