Add multi-host postcode support
These changes add the multiple host postcode implementation.
In addition to the LPC snoop the postcode can be read via D-Bus
interface.The same is displayed in seven segment display thorough
GPIO lines.
The design can be refered at
https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/35065
Tested:
Verified in Facebook Tiogapass & Yosemitev2 platforms.
1.The postcode displayed in the seven segment corresponding to the
host position selected in the frontpanel of Facebook
yosemitev2(4 host).
2.The postcode history is verified in the respective host directory
"/var/lib/phosphor-post-code-manager/hostX(1,2,3,4)".
Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: Id79ad00652bfedd319d3b8ccf1aafbdc60b33d86
diff --git a/lpcsnoop/snoop.hpp b/lpcsnoop/snoop.hpp
index 34d53b1..dab3334 100644
--- a/lpcsnoop/snoop.hpp
+++ b/lpcsnoop/snoop.hpp
@@ -5,9 +5,9 @@
#include <xyz/openbmc_project/State/Boot/Raw/server.hpp>
/* The LPC snoop on port 80h is mapped to this dbus path. */
-#define SNOOP_OBJECTPATH "/xyz/openbmc_project/state/boot/raw0"
+constexpr char snoopObject[] = "/xyz/openbmc_project/state/boot/raw0";
/* The LPC snoop on port 80h is mapped to this dbus service. */
-#define SNOOP_BUSNAME "xyz.openbmc_project.State.Boot.Raw"
+constexpr char snoopDbus[] = "xyz.openbmc_project.State.Boot.Raw";
template <typename... T>
using ServerObject = typename sdbusplus::server::object::object<T...>;
diff --git a/lpcsnoop/snoop_listen.hpp b/lpcsnoop/snoop_listen.hpp
index 174e664..876c119 100644
--- a/lpcsnoop/snoop_listen.hpp
+++ b/lpcsnoop/snoop_listen.hpp
@@ -30,7 +30,7 @@
using namespace sdbusplus::bus::match::rules;
return type::signal() + interface("org.freedesktop.DBus.Properties") +
- member("PropertiesChanged") + path(SNOOP_OBJECTPATH);
+ member("PropertiesChanged") + path(snoopObject);
}
class SnoopListen
@@ -78,7 +78,7 @@
m.read(messageBusName, messageData);
- if (messageBusName == SNOOP_BUSNAME &&
+ if (messageBusName == snoopDbus &&
messageData.find(propertyKey) != messageData.end())
{
handler(get<postcode_t>(messageData[propertyKey]));