PFR: Setting BMC boot finished checkpoint

Adding support to monitor the StartupFinished systemd
signal and setting the "bmc boot finished" checkpoint
to cpld.

Tested:
Did BMC reset and cross verified bmc boot finished
check-point properly set or not.

Change-Id: I14e6aa8b364b28da6cd6b2473cde8502d1ebd77c
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/libpfr/inc/file.hpp b/libpfr/inc/file.hpp
index c7ef58c..1fbc62a 100644
--- a/libpfr/inc/file.hpp
+++ b/libpfr/inc/file.hpp
@@ -89,6 +89,25 @@
         return value;
     }
 
+    /** @brief Writes the byte data to I2C dev
+     *
+     *  @param[in] Offset       -  Offset value
+     *  @param[in] Byte data    -  Data
+     */
+    void i2cWriteByteData(const uint8_t offset, const uint8_t value)
+    {
+        int retries = 3;
+        while (i2c_smbus_write_byte_data(fd, offset, value) < 0)
+        {
+            if (!retries--)
+            {
+                throw std::runtime_error("i2c_smbus_write_byte_data() failed");
+            }
+            std::this_thread::sleep_for(std::chrono::milliseconds(10));
+        }
+        return;
+    }
+
     ~I2CFile()
     {
         if (!(fd < 0))
diff --git a/libpfr/inc/pfr.hpp b/libpfr/inc/pfr.hpp
index 012c647..cd1b4f2 100644
--- a/libpfr/inc/pfr.hpp
+++ b/libpfr/inc/pfr.hpp
@@ -44,6 +44,7 @@
 std::string getVersionInfoCPLD(ImageType &imgType);
 int getProvisioningStatus(bool &ufmLocked, bool &ufmProvisioned);
 int readCpldReg(const ActionType &action, uint8_t value);
+int setBMCBootCheckpoint(const uint8_t checkPoint);
 
 } // namespace pfr
 } // namespace intel