Make libpeci dependency optional
This option is disabled by default as libpeci uses the old out-of-tree
PECI driver's API and is thus incompatible with current OpenBMC kernels.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I3516b6937a4da3d64e700eb727d67bdb4b8e8fee
diff --git a/include/host_error_monitor.hpp b/include/host_error_monitor.hpp
index d13202c..c28576f 100644
--- a/include/host_error_monitor.hpp
+++ b/include/host_error_monitor.hpp
@@ -14,7 +14,11 @@
// limitations under the License.
*/
#pragma once
+#ifdef LIBPECI
#include <peci.h>
+#else
+#define MAX_CPUS 8
+#endif
#include <sdbusplus/asio/object_server.hpp>
@@ -97,6 +101,7 @@
"com.intel.crashdump.Stored", "GenerateStoredLog", triggerType);
}
+#ifdef LIBPECI
static inline bool peciError(EPECIStatus peciStatus, uint8_t cc)
{
return (
@@ -111,6 +116,7 @@
<< addr << ". Error: " << peciStatus << ": cc: 0x" << std::hex
<< cc << "\n";
}
+#endif
static void beep(std::shared_ptr<sdbusplus::asio::connection> conn,
const uint8_t& beepPriority)
@@ -133,6 +139,7 @@
std::bitset<MAX_CPUS>& errPinCPUs)
{
errPinCPUs.reset();
+#ifdef LIBPECI
for (size_t cpu = 0, addr = MIN_CLIENT_ADDR; addr <= MAX_CLIENT_ADDR;
cpu++, addr++)
{
@@ -194,6 +201,7 @@
}
}
}
+#endif
}
} // namespace host_error_monitor