Add CPU functional property
ProcessorSummary in bmcweb always shows disable. Because bmcweb depends
on `xyz.openbmc_project.State.Decorator.OperationalStatus` interface
and `Functional` property to return CPU functional state.
In this change, include the interface into smbios-mdr and re-add the
property `Functional` removed by smbios-mdr/+/36177
Tested:
```
GET /redfish/v1/Systems/system/
"ProcessorSummary": {
"CoreCount": 112,
"Count": 2,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
busctl introspect xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
xyz.openbmc_project.State.Decorator.OperationalStatus interface - - -
.Functional property b true emits-change writable
```
Change-Id: I1b4d239ce02d2634a54afb98e4b5e72923fda4fb
Signed-off-by: David Wang <davidwang@quantatw.com>
diff --git a/src/cpu.cpp b/src/cpu.cpp
index d9fd212..3a586a2 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -152,13 +152,23 @@
socket(cpuInfo->socketDesignation, cpuInfo->length, dataIn); // offset 4h
constexpr uint32_t socketPopulatedMask = 1 << 6;
+ constexpr uint32_t statusMask = 0x07;
if ((cpuInfo->status & socketPopulatedMask) == 0)
{
// Don't attempt to fill in any other details if the CPU is not present.
present(false);
+ functional(false);
return;
}
present(true);
+ if ((cpuInfo->status & statusMask) == 1)
+ {
+ functional(true);
+ }
+ else
+ {
+ functional(false);
+ }
// this class is for type CPU //offset 5h
family(cpuInfo->family, cpuInfo->family2); // offset 6h and 28h