summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaymond Mao <[email protected]>2024-12-06 14:54:22 -0800
committerTom Rini <[email protected]>2025-01-14 14:29:29 -0600
commit5d38e0d963f704cbad3c0c57a274e191b9f3f44c (patch)
treedc661b17ef2021bfb68351110329dc29082aa682 /include
parentce562b42ce096fabb7800887ec4d0a9e81d7d97b (diff)
smbios: Refactor smbios library
Current smbios library does not fully match to the specification. It hardcodes values instead of exposing values from the device. It does not reserve the space to support dynamic length for contained object handles or elements and misses the handling of a few of fields. The refactoring of this patch includes: 1. Expose values from device via sysinfo interface. 2. Replace smbios_add_prop with smbios_add_prop_si to allow getting string values from sysinfo. 3. Add smbios_get_val_si to get values from sysinfo or device tree. 4. Use sysinfo_get_data to get data area. 5. Reserve the space of contained object handles and elements. 6. Miscellaneous fixes in smbios. Signed-off-by: Raymond Mao <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/smbios.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/smbios.h b/include/smbios.h
index cb4b3e08b3a..18f568f9b0d 100644
--- a/include/smbios.h
+++ b/include/smbios.h
@@ -122,6 +122,8 @@ struct __packed smbios_type1 {
char eos[SMBIOS_STRUCT_EOS_BYTES];
};
+#define SMBIOS_TYPE2_CON_OBJ_HANDLE_SIZE sizeof(u16)
+
struct __packed smbios_type2 {
struct smbios_header hdr;
u8 manufacturer;
@@ -134,6 +136,10 @@ struct __packed smbios_type2 {
u16 chassis_handle;
u8 board_type;
u8 number_contained_objects;
+ /*
+ * Dynamic bytes will be inserted here to store the objects.
+ * length is equal to 'number_contained_objects'.
+ */
char eos[SMBIOS_STRUCT_EOS_BYTES];
};
@@ -153,12 +159,17 @@ struct __packed smbios_type3 {
u8 number_of_power_cords;
u8 element_count;
u8 element_record_length;
+ /*
+ * Dynamic bytes will be inserted here to store the elements.
+ * length is equal to 'element_record_length' * 'element_record_length'
+ */
+ u8 sku_number;
char eos[SMBIOS_STRUCT_EOS_BYTES];
};
struct __packed smbios_type4 {
struct smbios_header hdr;
- u8 socket_designation;
+ u8 socket_design;
u8 processor_type;
u8 processor_family;
u8 processor_manufacturer;
@@ -184,6 +195,7 @@ struct __packed smbios_type4 {
u16 core_count2;
u16 core_enabled2;
u16 thread_count2;
+ u16 thread_enabled;
char eos[SMBIOS_STRUCT_EOS_BYTES];
};