Add pfr postcode feature

Add PfrPostcode object to read platformState mailbox register.
Add dbus object to PFR manager service so current platform state
value can be read by interested application like Redfish.
PfrPostcode object is added only when system is pfr provisioned.

Tested:
Manually verified dbus object properties as below -

busctl introspect xyz.openbmc_project.PFR.Manager /xyz/openbmc_project/pfr
NAME                                    TYPE      SIGNATURE  RESULT/VALUE  FLAGS
xyz.openbmc_project.State.Boot.Platform interface -          -                  -
.Data                                   property  y          14                 emits-change writable
.PlatformState                          property  s          "T0 boot complete" emits-change

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: I3f3581af23c2656523ee975b2aab9ba15078c934
diff --git a/service/src/mainapp.cpp b/service/src/mainapp.cpp
index 0a986f5..65bea78 100644
--- a/service/src/mainapp.cpp
+++ b/service/src/mainapp.cpp
@@ -39,6 +39,7 @@
 std::unique_ptr<boost::asio::steady_timer> pfrObjTimer = nullptr;
 std::vector<std::unique_ptr<PfrVersion>> pfrVersionObjects;
 std::unique_ptr<PfrConfig> pfrConfigObject;
+std::unique_ptr<PfrPostcode> pfrPostcodeObject;
 
 // List holds <ObjPath> <ImageType> <VersionPurpose>
 static std::vector<std::tuple<std::string, ImageType, std::string>>
@@ -689,6 +690,16 @@
             std::get<2>(entry)));
     }
 
+    if (pfr::pfrConfigObject)
+    {
+        pfr::pfrConfigObject->updateProvisioningStatus();
+        if (pfr::pfrConfigObject->getPfrProvisioned())
+        {
+            pfr::pfrPostcodeObject =
+                std::make_unique<pfr::PfrPostcode>(server, conn);
+        }
+    }
+
     conn->request_name("xyz.openbmc_project.PFR.Manager");
     phosphor::logging::log<phosphor::logging::level::INFO>(
         "Intel PFR service started successfully");