summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaymond Mao <[email protected]>2026-02-13 17:52:50 -0500
committerTom Rini <[email protected]>2026-02-18 08:27:51 -0600
commit41b7a09d24d878f748eba87ae85575043224148b (patch)
treecbc5e407ee7c91d97618d1fd70b0644b6b131c8a /include
parent23674dee60240393dd17836c05df5b4f4aa01e5c (diff)
smbios: add support for dynamic generation of Type 19 table
This commit implements SMBIOS Type 19 (Memory Array Mapped Address) generation with a hybrid approach supporting both: 1. Explicit definition via Device Tree 'smbios' node: Child node under '/smbios/smbios/memory-array-mapped-address' will be used to populate as individual Type 19 structure directly. - Properties follow SMBIOS field names with lowercase letters and hyphen-separated words (e.g., 'starting-address', 'ending-address', 'partition-width', etc.). - This method supports precise platform-defined overrides and system descriptions. 2. Fallback to automatic DT-based discovery: If child node under '/smbios/smbios/memory-array-mapped-address' does not exist, the implementation will: - Scan all top-level 'memory@' nodes to populate Type 19 structure with inferred size and location data. - Scan nodes named or marked as 'memory-controller' and parse associated 'dimm@' subnodes (if present) to extract DIMM sizes and map them accordingly. This dual-mode support enables flexible firmware SMBIOS reporting while aligning with spec-compliant naming and runtime-detected memory topology. Type 19 support is under GENERATE_SMBIOS_TABLE_VERBOSE to avoid increasing rom size for those platforms which only require basic SMBIOS support. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/smbios.h11
-rw-r--r--include/smbios_def.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/include/smbios.h b/include/smbios.h
index 2deafea9aa1..e4b5ff314d9 100644
--- a/include/smbios.h
+++ b/include/smbios.h
@@ -372,6 +372,17 @@ struct __packed smbios_type17 {
char eos[SMBIOS_STRUCT_EOS_BYTES];
};
+struct __packed smbios_type19 {
+ struct smbios_header hdr;
+ u32 start_addr;
+ u32 end_addr;
+ u16 mem_array_hdl;
+ u8 partition_wid;
+ u64 ext_start_addr;
+ u64 ext_end_addr;
+ char eos[SMBIOS_STRUCT_EOS_BYTES];
+};
+
struct __packed smbios_type32 {
u8 type;
u8 length;
diff --git a/include/smbios_def.h b/include/smbios_def.h
index ce913f2f32a..ae50e1a808e 100644
--- a/include/smbios_def.h
+++ b/include/smbios_def.h
@@ -436,4 +436,9 @@
#define SMBIOS_MD_ERRINFO_NONE 0xFFFE
#define SMBIOS_MD_ERRINFO_NOERR 0xFFFF
+/* Memory Array Mapped Address */
+
+/* Partition Width */
+#define SMBIOS_MAMA_PW_DEF 1 /* not partitioned */
+
#endif /* _SMBIOS_DEF_H_ */