summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C
diff options
context:
space:
mode:
authorSangeetha T S <sangeet2@in.ibm.com>2016-04-22 08:20:35 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-10 15:12:39 -0400
commite44b7b61706b190be09649b6656357c8cf05272d (patch)
tree881cd0a9a783edff9071124a06a83f1873f928ab /src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C
parent3b98533e96b051b911f1e9b4715d77166434a2bf (diff)
downloadtalos-hostboot-e44b7b61706b190be09649b6656357c8cf05272d.tar.gz
talos-hostboot-e44b7b61706b190be09649b6656357c8cf05272d.zip
p9_pm_firinit L2: PM FIR setup
Change-Id: I080543b4480ed40fd58c7ae34bd4c5e6d6e1ad16 RTC:136654 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23566 Tested-by: Jenkins Server Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25642 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C91
1 files changed, 85 insertions, 6 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C
index 46868f973..ded861445 100644
--- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C
+++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.C
@@ -7,7 +7,7 @@
/* */
/* EKB Project */
/* */
-/* COPYRIGHT 2015 */
+/* COPYRIGHT 2015,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -24,17 +24,23 @@
// *HWP Backup HWP Owner: Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner: Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team: PM
-// *HWP Level: 1
+// *HWP Level: 2
// *HWP Consumed by: FSP:HS
///
/// High-level procedure flow:
///
/// \verbatim
-/// - call p8_pm_pmc_firinit.C *chiptarget
+/// - call p9_pm_occ_firinit.C
/// - evaluate RC
///
-/// - call p8_pm_pba_firinit.C *chiptarget
+/// - call p9_pm_pba_firinit.C
+/// - evaluate RC
+///
+/// - call p9_pm_ppm_firinit.C
+/// - evaluate RC
+///
+/// - call p9_pm_cme_firinit.C
/// - evaluate RC
///
/// \endverbatim
@@ -47,8 +53,10 @@
// Includes
// ----------------------------------------------------------------------
#include <p9_pm_firinit.H>
-// Need to include the headers for all the procedures to be invoked
-// Need to include the header containing the necessary scom addresses
+#include <p9_pm_occ_firinit.H>
+#include <p9_pm_pba_firinit.H>
+#include <p9_pm_ppm_firinit.H>
+#include <p9_pm_cme_firinit.H>
// ----------------------------------------------------------------------
// Function definitions
@@ -59,6 +67,77 @@ fapi2::ReturnCode p9_pm_firinit(
{
FAPI_IMP("p9_pm_firinit start");
+ fapi2::ReturnCode l_rc;
+ uint8_t l_pm_firinit_flag;
+ fapi2::buffer<uint64_t> l_data64;
+
+ // CHECKING FOR FIRS BEFORE RESET and INIT
+
+ FAPI_DBG("Checking OCC FIRs");
+ FAPI_TRY(fapi2::getScom(i_target, PERV_TP_OCC_SCOM_OCCLFIR, l_data64),
+ "ERROR: Failed to fetch OCC FIR");
+
+ if(l_data64)
+ {
+ FAPI_INF("WARNING: OCC has active errors");
+ }
+
+ FAPI_DBG("Checking PBA FIRs");
+ FAPI_TRY(fapi2::getScom(i_target, PU_PBAFIR , l_data64),
+ "ERROR: Failed to fetch PBA FIR");
+
+ if(l_data64)
+ {
+ FAPI_INF("WARNING: PBA has active error(s)");
+ }
+
+ // Handle OCC FIRs, Masks and actions
+ FAPI_DBG("Calling OCC firinit ...");
+ FAPI_EXEC_HWP(l_rc, p9_pm_occ_firinit, i_target, i_mode);
+ FAPI_TRY(l_rc);
+
+ // Handle PBA FIRs, Masks and actions
+ FAPI_DBG("Calling PBA firinit ...");
+ FAPI_EXEC_HWP(l_rc, p9_pm_pba_firinit, i_target, i_mode);
+ FAPI_TRY(l_rc);
+
+ // Handle Core and Quad errors
+ FAPI_DBG("Calling PPM firinit ...");
+ FAPI_EXEC_HWP(l_rc, p9_pm_ppm_firinit, i_target, i_mode);
+ FAPI_TRY(l_rc);
+
+ // Handle CME FIRs, Masks and actions
+ FAPI_DBG("Calling CME firinit ...");
+ FAPI_EXEC_HWP(l_rc, p9_pm_cme_firinit, i_target, i_mode);
+ FAPI_TRY(l_rc);
+
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PM_FIRINIT_DONE_ONCE_FLAG, i_target,
+ l_pm_firinit_flag),
+ "ERROR: Failed to fetch the firinit call status flag");
+
+ // Set the ATTR_PM_FIRINIT_DONE_ONCE_FLAG attribute
+ if (i_mode == p9pm::PM_INIT)
+ {
+ if (l_pm_firinit_flag != 1)
+ {
+ l_pm_firinit_flag = 1;
+ FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_PM_FIRINIT_DONE_ONCE_FLAG,
+ i_target, l_pm_firinit_flag),
+ "ERROR: Failed to set firinit call status after init");
+ }
+ }
+ else if (i_mode == p9pm::PM_RESET)
+ {
+ if (l_pm_firinit_flag != 1)
+ {
+ l_pm_firinit_flag = 2;
+ FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_PM_FIRINIT_DONE_ONCE_FLAG,
+ i_target, l_pm_firinit_flag),
+ "ERROR: Failed to set firinit call status after reset");
+ }
+ }
+
+fapi_try_exit:
FAPI_INF("p9_pm_firinit end");
return fapi2::current_err;
} // END p9_pm_firinit
OpenPOWER on IntegriCloud