smbios-mdr: Change MemoryInfo.attributes type to uint8_t
PDI changed the type of `attributes` from uint8_t to size_t.
However the SMBIOS spec only reserved 1 byte for this field.
So we need to keep `attribute` in 1 byte otherwise the field after
`attribute` will be shifted.
Tested:
Before
.MemorySizeInKB property u 1258291200
After
.MemorySizeInKB property u 33554432
Patch Tracking Bug: b/296189510
Upstream info / review:
https://gerrit.openbmc.org/c/openbmc/smbios-mdr/+/66040
Upstream-Status: Submitted
Justification: Pending upstream review
Google-Bug-Id: b/296115559
Change-Id: I35551fd251d97a18d7529e581e2ef3b570dd20f7
Signed-off-by: Michael Shen <gpgpgp@google.com>
diff --git a/recipes-phosphor/smbios/smbios-mdr/0004-Change-MemoryInfo.attributes-type-to-uint8_t.patch b/recipes-phosphor/smbios/smbios-mdr/0004-Change-MemoryInfo.attributes-type-to-uint8_t.patch
new file mode 100644
index 0000000..1fba096
--- /dev/null
+++ b/recipes-phosphor/smbios/smbios-mdr/0004-Change-MemoryInfo.attributes-type-to-uint8_t.patch
@@ -0,0 +1,39 @@
+From 94cf582c895f3765a3976efcd293834b96e0b6d6 Mon Sep 17 00:00:00 2001
+From: Michael Shen <gpgpgp@google.com>
+Date: Wed, 16 Aug 2023 09:26:05 +0000
+Subject: [PATCH] Change MemoryInfo.attributes type to uint8_t
+
+PDI changed the type of `attributes` from uint8_t to size_t.
+However the SMBIOS spec only reserved 1 byte for this field.
+So we need to keep `attribute` in 1 byte otherwise the field after
+`attribute` will be shifted.
+
+Tested:
+Before
+ .MemorySizeInKB property u 1258291200
+
+After
+ .MemorySizeInKB property u 33554432
+
+Change-Id: I1e2bfa78d4259c7b86a471ed880f2c5ca923bc66
+Signed-off-by: Michael Shen <gpgpgp@google.com>
+---
+ include/dimm.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/dimm.hpp b/include/dimm.hpp
+index 6be5644..a3a48be 100644
+--- a/include/dimm.hpp
++++ b/include/dimm.hpp
+@@ -168,7 +168,7 @@ struct MemoryInfo
+ uint8_t serialNum;
+ uint8_t assetTag;
+ uint8_t partNum;
+- size_t attributes;
++ uint8_t attributes;
+ uint32_t extendedSize;
+ uint16_t confClockSpeed;
+ uint16_t minimumVoltage;
+--
+2.35.1
+
diff --git a/recipes-phosphor/smbios/smbios-mdr_%.bbappend b/recipes-phosphor/smbios/smbios-mdr_%.bbappend
index ca44aa3..3819687 100644
--- a/recipes-phosphor/smbios/smbios-mdr_%.bbappend
+++ b/recipes-phosphor/smbios/smbios-mdr_%.bbappend
@@ -4,6 +4,7 @@
file://0001-Add-gRPC-protobuf-for-SmbiosTransfer-service.patch\
file://0002-Add-gRPC-support-for-receiving-SMBIOS-from-remote.patch\
file://0003-Add-GRPC_BLOB-option-to-CMakeLists-and-mdrv2_main.patch\
+ file://0004-Change-MemoryInfo.attributes-type-to-uint8_t.patch\
"
EXTRA_OECMAKE:append:gbmc = " -DDIMM_ONLY_LOCATOR=ON"