PEL: Clock SBE HWP error handling support

-Supporting special error handling for clock related hwp failure
    -For clock hwp failures we need to
        -Callout the planar
    -Using new variable (isPlanarCallout) defined in libekb

Signed-off-by: Rajees P P <rajerpp1@in.ibm.com>
Change-Id: I82b04e110abccf3de8cc97149344c0b54471ce69
diff --git a/extensions/openpower-pels/fapi_data_process.cpp b/extensions/openpower-pels/fapi_data_process.cpp
index a47b7fe..88c869e 100644
--- a/extensions/openpower-pels/fapi_data_process.cpp
+++ b/extensions/openpower-pels/fapi_data_process.cpp
@@ -210,6 +210,31 @@
     return it->second;
 }
 
+/**
+ * @brief addPlanarCallout
+ *
+ * This function will add a json for planar callout in the input json list.
+ * The caller can pass this json list into createErrorPEL to apply the callout.
+ *
+ * @param[in,out] jsonCalloutDataList - json list where callout json will be
+ *                  emplaced
+ * @param[in] priority - string indicating priority.
+ */
+static void addPlanarCallout(json& jsonCalloutDataList,
+                             const std::string& priority)
+{
+    json jsonCalloutData;
+
+    // Inventory path for planar
+    jsonCalloutData["InventoryPath"] =
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard";
+    jsonCalloutData["Deconfigured"] = false;
+    jsonCalloutData["Guarded"] = false;
+    jsonCalloutData["Priority"] = priority;
+
+    jsonCalloutDataList.emplace_back(jsonCalloutData);
+}
+
 void convertFAPItoPELformat(FFDC& ffdc, json& pelJSONFmtCalloutDataList,
                             FFDCData& ffdcUserData)
 {
@@ -266,6 +291,18 @@
                 ffdcUserData.emplace_back(
                     std::string(keyPrefix.str()).append("CLK_POS"),
                     std::to_string(hwCallout.clkPos));
+
+                ffdcUserData.emplace_back(
+                    std::string(keyPrefix.str()).append("CALLOUT_PLANAR"),
+                    (hwCallout.isPlanarCallout == true ? "true" : "false"));
+
+                std::string pelPriority =
+                    getPelPriority(hwCallout.callout_priority);
+
+                if (hwCallout.isPlanarCallout)
+                {
+                    addPlanarCallout(pelJSONFmtCalloutDataList, pelPriority);
+                }
             });
 
         // Adding CDG (callout, deconfigure and guard) targets details