summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2019-08-30 00:19:19 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2019-09-06 03:12:31 +0300
commitd8cb3d36329c738c0a8c9f2db2d60e0cae00b7dc (patch)
treeb2370d0ae97f674c89f87ce4f0a3e2a7d25afee7
parenta0be84bc6207d6e86f3f4526da4425699ac8533e (diff)
downloadprovingground-d8cb3d36329c738c0a8c9f2db2d60e0cae00b7dc.tar.xz
Add CPU Memory VRHOT monitoring and logging
This adds a monitor for the CPU Memory VRHOT signals. Tested: Used the Wilson City jumper to assert CPU Memory ABCD VRHOT on each CPU and verified that the CPU Memory ABCD VRHOT event was logged. Change-Id: I7a8e4418fc2af80b55ea2880a4be4348c85d454d Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
-rw-r--r--host_error_monitor/src/host_error_monitor.cpp148
1 files changed, 148 insertions, 0 deletions
diff --git a/host_error_monitor/src/host_error_monitor.cpp b/host_error_monitor/src/host_error_monitor.cpp
index e42e5d8..51434f4 100644
--- a/host_error_monitor/src/host_error_monitor.cpp
+++ b/host_error_monitor/src/host_error_monitor.cpp
@@ -66,7 +66,15 @@ static boost::asio::posix::stream_descriptor cpu2ThermtripEvent(io);
static gpiod::line cpu1VRHotLine;
static boost::asio::posix::stream_descriptor cpu1VRHotEvent(io);
static gpiod::line cpu2VRHotLine;
+static boost::asio::posix::stream_descriptor cpu1MemABCDVRHotEvent(io);
+static gpiod::line cpu1MemEFGHVRHotLine;
+static boost::asio::posix::stream_descriptor cpu1MemEFGHVRHotEvent(io);
+static gpiod::line cpu2MemABCDVRHotLine;
static boost::asio::posix::stream_descriptor cpu2VRHotEvent(io);
+static gpiod::line cpu1MemABCDVRHotLine;
+static boost::asio::posix::stream_descriptor cpu2MemABCDVRHotEvent(io);
+static gpiod::line cpu2MemEFGHVRHotLine;
+static boost::asio::posix::stream_descriptor cpu2MemEFGHVRHotEvent(io);
//----------------------------------
// PCH_BMC_THERMTRIP function related definition
//----------------------------------
@@ -755,6 +763,58 @@ static void cpu1VRHotHandler()
});
}
+static void cpu1MemABCDVRHotHandler()
+{
+ if (!hostOff)
+ {
+ gpiod::line_event gpioLineEvent = cpu1MemABCDVRHotLine.event_read();
+
+ bool cpu1MemABCDVRHot =
+ gpioLineEvent.event_type == gpiod::line_event::FALLING_EDGE;
+ if (cpu1MemABCDVRHot)
+ {
+ cpuVRHotLog("CPU 1 Memory ABCD");
+ }
+ }
+ cpu1MemABCDVRHotEvent.async_wait(
+ boost::asio::posix::stream_descriptor::wait_read,
+ [](const boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr << "CPU 1 Memory ABCD VRHot handler error: "
+ << ec.message() << "\n";
+ return;
+ }
+ cpu1MemABCDVRHotHandler();
+ });
+}
+
+static void cpu1MemEFGHVRHotHandler()
+{
+ if (!hostOff)
+ {
+ gpiod::line_event gpioLineEvent = cpu1MemEFGHVRHotLine.event_read();
+
+ bool cpu1MemEFGHVRHot =
+ gpioLineEvent.event_type == gpiod::line_event::FALLING_EDGE;
+ if (cpu1MemEFGHVRHot)
+ {
+ cpuVRHotLog("CPU 1 Memory EFGH");
+ }
+ }
+ cpu1MemEFGHVRHotEvent.async_wait(
+ boost::asio::posix::stream_descriptor::wait_read,
+ [](const boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr << "CPU 1 Memory EFGH VRHot handler error: "
+ << ec.message() << "\n";
+ return;
+ }
+ cpu1MemEFGHVRHotHandler();
+ });
+}
+
static void cpu2VRHotHandler()
{
if (!hostOff)
@@ -780,6 +840,58 @@ static void cpu2VRHotHandler()
});
}
+static void cpu2MemABCDVRHotHandler()
+{
+ if (!hostOff)
+ {
+ gpiod::line_event gpioLineEvent = cpu2MemABCDVRHotLine.event_read();
+
+ bool cpu2MemABCDVRHot =
+ gpioLineEvent.event_type == gpiod::line_event::FALLING_EDGE;
+ if (cpu2MemABCDVRHot)
+ {
+ cpuVRHotLog("CPU 2 Memory ABCD");
+ }
+ }
+ cpu2MemABCDVRHotEvent.async_wait(
+ boost::asio::posix::stream_descriptor::wait_read,
+ [](const boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr << "CPU 2 Memory ABCD VRHot handler error: "
+ << ec.message() << "\n";
+ return;
+ }
+ cpu2MemABCDVRHotHandler();
+ });
+}
+
+static void cpu2MemEFGHVRHotHandler()
+{
+ if (!hostOff)
+ {
+ gpiod::line_event gpioLineEvent = cpu2MemEFGHVRHotLine.event_read();
+
+ bool cpu2MemEFGHVRHot =
+ gpioLineEvent.event_type == gpiod::line_event::FALLING_EDGE;
+ if (cpu2MemEFGHVRHot)
+ {
+ cpuVRHotLog("CPU 2 Memory EFGH");
+ }
+ }
+ cpu2MemEFGHVRHotEvent.async_wait(
+ boost::asio::posix::stream_descriptor::wait_read,
+ [](const boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr << "CPU 2 Memory EFGH VRHot handler error: "
+ << ec.message() << "\n";
+ return;
+ }
+ cpu2MemEFGHVRHotHandler();
+ });
+}
+
static void pchThermtripHandler()
{
if (!hostOff)
@@ -1254,6 +1366,24 @@ int main(int argc, char* argv[])
return -1;
}
+ // Request CPU1_MEM_ABCD_VRHOT GPIO events
+ if (!host_error_monitor::requestGPIOEvents(
+ "CPU1_MEM_ABCD_VRHOT", host_error_monitor::cpu1MemABCDVRHotHandler,
+ host_error_monitor::cpu1MemABCDVRHotLine,
+ host_error_monitor::cpu1MemABCDVRHotEvent))
+ {
+ return -1;
+ }
+
+ // Request CPU1_MEM_EFGH_VRHOT GPIO events
+ if (!host_error_monitor::requestGPIOEvents(
+ "CPU1_MEM_EFGH_VRHOT", host_error_monitor::cpu1MemEFGHVRHotHandler,
+ host_error_monitor::cpu1MemEFGHVRHotLine,
+ host_error_monitor::cpu1MemEFGHVRHotEvent))
+ {
+ return -1;
+ }
+
// Request CPU2_VRHOT GPIO events
if (!host_error_monitor::requestGPIOEvents(
"CPU2_VRHOT", host_error_monitor::cpu2VRHotHandler,
@@ -1263,6 +1393,24 @@ int main(int argc, char* argv[])
return -1;
}
+ // Request CPU2_MEM_ABCD_VRHOT GPIO events
+ if (!host_error_monitor::requestGPIOEvents(
+ "CPU2_MEM_ABCD_VRHOT", host_error_monitor::cpu2MemABCDVRHotHandler,
+ host_error_monitor::cpu2MemABCDVRHotLine,
+ host_error_monitor::cpu2MemABCDVRHotEvent))
+ {
+ return -1;
+ }
+
+ // Request CPU2_MEM_EFGH_VRHOT GPIO events
+ if (!host_error_monitor::requestGPIOEvents(
+ "CPU2_MEM_EFGH_VRHOT", host_error_monitor::cpu2MemEFGHVRHotHandler,
+ host_error_monitor::cpu2MemEFGHVRHotLine,
+ host_error_monitor::cpu2MemEFGHVRHotEvent))
+ {
+ return -1;
+ }
+
// Request PCH_BMC_THERMTRIP GPIO events
if (!host_error_monitor::requestGPIOEvents(
"PCH_BMC_THERMTRIP", host_error_monitor::pchThermtripHandler,