summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2013-11-12 09:51:59 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-11-14 17:11:17 -0600
commit9bb07555178282e4c608adfa6bf617409a3f6856 (patch)
tree14c682e8d598955efdd47b411de35c36fef05045 /src/usr/hwpf/hwp
parent931ed57963b8f63c67dc45144c2bb65b3f014a56 (diff)
downloadtalos-hostboot-9bb07555178282e4c608adfa6bf617409a3f6856.tar.gz
talos-hostboot-9bb07555178282e4c608adfa6bf617409a3f6856.zip
Bulk OCC HWP UPdate
Change-Id: I2450d4e64be8374545ecdc4d716e147cf89da7b6 CQ: SW231071 CQ: SW207160 CQ: SW232282 CQ: SW224492 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/7184 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C53
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H57
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_poreslw_init.C26
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_firinit.C27
-rw-r--r--[-rwxr-xr-x]src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C524
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.C2
-rw-r--r--[-rwxr-xr-x]src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.H0
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_prep_for_reset.C318
8 files changed, 582 insertions, 425 deletions
diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C
index cac327961..3e41680bb 100644
--- a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C
+++ b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pfet_control.C,v 1.10 2013/08/02 19:05:03 stillgs Exp $
+// $Id: p8_pfet_control.C,v 1.11 2013/10/29 21:53:32 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pfet_control.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -802,6 +802,9 @@ p8_pfet_off( const fapi::Target& i_target,
uint64_t address;
bool b_core = false;
bool b_eco = false;
+
+ uint8_t core_vret_voff_value;
+ uint8_t eco_vret_voff_value;
do
{
@@ -863,12 +866,53 @@ p8_pfet_off( const fapi::Target& i_target,
address,
data.getDoubleWord(0));
- // VDD ---------------------
- FAPI_INF("Turning off VDD");
+ // As we need to turn the PFETs off, ensure the stage pointers to the
+ // OFF value are in place (and not assumed).
+ core_vret_voff_value = 0xBB;
+ eco_vret_voff_value = 0xBB;
+
+ // -------------------------------------------------------------
+ FAPI_DBG("\tSetting Core Voff Settings");
+ e_rc |= data.insertFromRight(core_vret_voff_value, 0, 8);
+ if (e_rc)
+ {
+ FAPI_ERR("Error (0x%x) setting up ecmdDataBufferBase", e_rc);
+ l_rc.setEcmdError(e_rc);
+ break;
+ }
+
+ address = EX_CorePFVRET_REG_0x100F0130 + (0x01000000 * i_ex_number);
+ l_rc=fapiPutScom(i_target, address, data );
+ if (l_rc)
+ {
+ FAPI_ERR("PutScom error 0x%08llu", address);
+ break;
+ }
+
+ // -------------------------------------------------------------
+ FAPI_DBG("\tSetting ECO Voff Settings");
+ e_rc |= data.insertFromRight(eco_vret_voff_value, 0, 8);
+ if (e_rc)
+ {
+ FAPI_ERR("Error (0x%x) setting up ecmdDataBufferBase", e_rc);
+ l_rc.setEcmdError(e_rc);
+ break;
+ }
+
+ address = EX_ECOPFVRET_REG_0x100F0150 + (0x01000000 * i_ex_number);
+ l_rc=fapiPutScom(i_target, address, data );
+ if (l_rc)
+ {
+ FAPI_ERR("PutScom error 0x%08llu", address);
+ break;
+ }
+ // VDD ---------------------
+ FAPI_INF("Turning off VDD");
+
address = EX_PFET_CTL_REG_0x100F0106 + (0x01000000 * i_ex_number);
l_rc=fapiGetScom( i_target, address, data );
if(!l_rc.ok())
@@ -881,8 +925,6 @@ p8_pfet_off( const fapi::Target& i_target,
address,
data.getDoubleWord(0));
-
-
if (b_core)
{
FAPI_DBG("\tClearing overrides to enable turn off of Core VDD");
@@ -1030,7 +1072,6 @@ p8_pfet_off( const fapi::Target& i_target,
break;
}
-
// Read to allow for Cronus 5.1 or 5.6 to look at the resultant setting
l_rc=fapiGetScom( i_target, address, data );
if(!l_rc.ok())
diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H
index 5a26c3ce1..d64272adb 100644
--- a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H
+++ b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pm.H,v 1.7 2013/08/02 19:02:43 stillgs Exp $
+// $Id: p8_pm.H,v 1.9 2013/10/30 17:13:12 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm.H,v $
//------------------------------------------------------------------------------
// *|
@@ -57,18 +57,49 @@ extern "C" {
#ifndef _P8_PM_FLOW_MODE
#define _P8_PM_FLOW_MODE
-enum p8_PM_FLOW_MODE {
- PM_CONFIG = 0x1,
- PM_RESET = 0x2,
- PM_INIT = 0x3,
- PM_SETUP = 0x4,
- PM_SETUP_PIB = 0x5,
- PM_SETUP_ALL = 0x6,
- PM_RESET_SOFT = 0x7,
- PM_CONFIG_SOFT = PM_CONFIG,
- PM_INIT_SOFT = 0x8,
- PM_INIT_SPECIAL = 0x9
- };
+enum p8_PM_FLOW_MODE
+{
+ PM_CONFIG = 0x1,
+ PM_RESET = 0x2,
+ PM_INIT = 0x3,
+ PM_SETUP = 0x4,
+ PM_SETUP_PIB = 0x5,
+ PM_SETUP_ALL = 0x6,
+ PM_RESET_SOFT = 0x7,
+ PM_CONFIG_SOFT = PM_CONFIG,
+ PM_INIT_SOFT = 0x8,
+ PM_INIT_SPECIAL = 0x9,
+ PM_INIT_PMC = 0xA
+};
+
+// This storage is contained in p8_pm_utils.C which must be included
+// in the compilation of all procs that use the PM_MODE_NAME macro
+extern const char * p8_PM_FLOW_MODE_NAME[];
+
+#define PM_FLOW_MODE_NAME \
+{ \
+ "PM_CONFIG", \
+ "PM_RESET", \
+ "PM_INIT", \
+ "PM_SETUP", \
+ "PM_SETUP_PIB", \
+ "PM_SETUP_ALL", \
+ "PM_RESET_SOFT", \
+ "PM_INIT_SOFT", \
+ "PM_INIT_SPECIAL", \
+ "PM_INIT_PMC", \
+ "PM_CONFIG_SOFT" \
+}
+
+// Necessary definition to allocated enum string array storage.
+// Typical declaration:
+// const char * PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME
+#define PM_MODE_NAME_VAR p8_PM_FLOW_MODE_NAME[] = PM_FLOW_MODE_NAME
+
+#define PM_MODE_NAME(_mi_mode)( \
+ p8_PM_FLOW_MODE_NAME[_mi_mode-1] \
+)
+
#endif // _P8_PM_FLOW_MODE
diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_poreslw_init.C b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_poreslw_init.C
index 4d7040605..97ffd3b74 100644
--- a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_poreslw_init.C
+++ b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_poreslw_init.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_poreslw_init.C,v 1.16 2013/09/25 22:36:39 stillgs Exp $
+// $Id: p8_poreslw_init.C,v 1.18 2013/10/30 17:13:11 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_poreslw_init.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -85,7 +85,7 @@ using namespace fapi;
// Function prototypes
// ----------------------------------------------------------------------
-fapi::ReturnCode poreslw_init(const Target& i_target);
+fapi::ReturnCode poreslw_init(const Target& i_target, uint32_t i_mode);
fapi::ReturnCode poreslw_reset(const Target& i_target);
fapi::ReturnCode poreslw_ex_setup(const Target& i_target);
@@ -108,8 +108,9 @@ fapi::ReturnCode
p8_poreslw_init(const Target& i_target, uint32_t mode)
{
fapi::ReturnCode rc;
+ const char * PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME
- FAPI_INF("Executing p8_poreslw_init in mode %x ....", mode);
+ FAPI_INF("Executing p8_poreslw_init in mode %s", PM_MODE_NAME(mode));
/// -------------------------------
/// Configuration: perform translation of any Platform Attributes
@@ -123,9 +124,9 @@ p8_poreslw_init(const Target& i_target, uint32_t mode)
/// -------------------------------
/// Initialization: perform order or dynamic operations to initialize
/// the SLW using necessary Platform or Feature attributes.
- else if (mode == PM_INIT)
+ else if (mode == PM_INIT || mode == PM_INIT_PMC )
{
- rc = poreslw_init(i_target);
+ rc = poreslw_init(i_target, mode);
}
/// -------------------------------
@@ -161,7 +162,7 @@ p8_poreslw_init(const Target& i_target, uint32_t mode)
* @retval ERROR defined in xml
*/
fapi::ReturnCode
-poreslw_init(const Target& i_target)
+poreslw_init(const Target& i_target, uint32_t i_mode)
{
fapi::ReturnCode rc;
uint32_t e_rc = 0;
@@ -207,12 +208,15 @@ poreslw_init(const Target& i_target)
FAPI_DBG("Activate the PMC Idle seequencer by making sure the Halt bit is clear");
- // Setup up each of the EX chiplets
- rc = poreslw_ex_setup(i_target);
- if(!rc.ok())
+ if (i_mode == PM_INIT)
{
- FAPI_ERR("Error from poreslw_ex_setup n");
- break;
+ // Setup up each of the EX chiplets
+ rc = poreslw_ex_setup(i_target);
+ if(!rc.ok())
+ {
+ FAPI_ERR("Error from poreslw_ex_setup n");
+ break;
+ }
}
} while(0);
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_firinit.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_firinit.C
index 5355cd822..e4b3d1dd9 100644
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_firinit.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_firinit.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pm_firinit.C,v 1.12 2013-09-25 21:26:09 dcrowell Exp $
+// $Id: p8_pm_firinit.C,v 1.14 2013/10/30 17:13:05 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_firinit.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -109,11 +109,12 @@ using namespace fapi;
fapi::ReturnCode
p8_pm_firinit(const fapi::Target &i_target , uint32_t i_mode)
{
- fapi::ReturnCode rc;
- ecmdDataBufferBase data(64);
- uint64_t any_error = 0;
+ fapi::ReturnCode rc;
+ ecmdDataBufferBase data(64);
+ uint64_t any_error = 0;
+ const char * PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME
- FAPI_INF("p8_pm_firinit start for mode %x", i_mode);
+ FAPI_INF("p8_pm_firinit start for mode %s", PM_MODE_NAME(i_mode));
do
{
@@ -205,15 +206,15 @@ p8_pm_firinit(const fapi::Target &i_target , uint32_t i_mode)
}
// ******************************************************************
- // OHA
+ // OHA - Removed as the values are part of the winkle image
// ******************************************************************
- FAPI_EXEC_HWP(rc, p8_pm_oha_firinit , i_target , i_mode );
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_oha_firinit detected failed result");
- break;
- }
+ // FAPI_EXEC_HWP(rc, p8_pm_oha_firinit , i_target , i_mode );
+ // if (rc)
+ // {
+ // FAPI_ERR("ERROR: p8_pm_oha_firinit detected failed result");
+ // break;
+ // }
// ******************************************************************
// PCBS
@@ -239,7 +240,7 @@ p8_pm_firinit(const fapi::Target &i_target , uint32_t i_mode)
} while(0);
- FAPI_INF("p8_pm_firinit end for mode %x", i_mode);
+ FAPI_INF("p8_pm_firinit end for mode %s", PM_MODE_NAME(i_mode));
return rc;
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C
index 0964a1698..14576257d 100755..100644
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pm_init.C,v 1.20 2013/08/02 19:07:22 stillgs Exp $
+// $Id: p8_pm_init.C,v 1.22 2013/10/30 17:13:08 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_init.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -28,6 +28,7 @@
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! OWNER NAME: Ralf Maier Email: ralf.maier@de.ibm.com
+// *! BACKUP NAME: Greg Still Email: stillgs@us.ibm.com
// *!
/// \file p8_pm_init.C
/// \brief Calls each PM unit initialization procedures with the control
@@ -54,6 +55,10 @@
/// High-level procedure flow:
///
/// \verbatim
+/// - call p8_pm_prep_for_reset to prepare and perform getting the PM function
+/// able to be be (re)initialized
+///
+/// - call pm_list() to process the individual units in turn
/// - call p8_pcbs_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
/// - evaluate RC
///
@@ -89,6 +94,7 @@
#include "p8_pm.H"
#include "p8_pm_init.H"
+#include "p8_pm_prep_for_reset.H"
extern "C" {
@@ -98,22 +104,23 @@ using namespace fapi;
// Constant definitions
// ----------------------------------------------------------------------
-
// ----------------------------------------------------------------------
// Global variables
// ----------------------------------------------------------------------
-
// ----------------------------------------------------------------------
// Function prototypes
// ----------------------------------------------------------------------
-
// ----------------------------------------------------------------------
// Function definitions
// ----------------------------------------------------------------------
- fapi::ReturnCode p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode);
+fapi::ReturnCode
+pm_list(const Target& i_target, const Target& i_target2, uint32_t i_mode);
+fapi::ReturnCode
+clear_occ_special_wakeups (const fapi::Target &i_target);
+
// ----------------------------------------------------------------------
// p8_pm_init
// ----------------------------------------------------------------------
@@ -122,71 +129,147 @@ fapi::ReturnCode
p8_pm_init(const fapi::Target &i_target1 ,const fapi::Target &i_target2 , uint32_t mode)
{
- fapi::ReturnCode l_fapi_rc;
+ fapi::ReturnCode rc;
+ uint32_t int_mode;
do
{
+ int_mode = PM_RESET;
+ FAPI_EXEC_HWP(rc, p8_pm_prep_for_reset, i_target1, i_target2, int_mode);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_init detected failed p8_pm_prep_for_reset result");
+ break;
+ }
+
+ int_mode = PM_CONFIG;
+ rc = pm_list(i_target1, i_target2, mode);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_list detected failed ");
+ break;
+ }
+
+ int_mode = PM_INIT;
+ rc = pm_list(i_target1, i_target2, mode);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_list detected failed ");
+ break;
+ }
+
+ } while(0);
+
+ return rc;
+}
+
+// ----------------------------------------------------------------------
+// ocb_channel_reset - Reset each of the OCB channels on the passed target
+// ----------------------------------------------------------------------
- if (mode == PM_INIT)
+fapi::ReturnCode
+ocb_channel_reset(const Target& i_target, uint32_t i_mode)
+{
+ fapi::ReturnCode rc;
+
+ do
+ {
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN0,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
+ if (rc)
{
- FAPI_INF("Executing p8_pm_init in mode = PM_INIT ....\n") ;
+ FAPI_ERR("ERROR: p8_p8_pm_init detected failed OCB result on channel 0");
+ break;
}
- if (mode == PM_CONFIG)
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN1,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
+ if (rc)
{
- FAPI_INF("Executing p8_pm_init in mode = PM_CONFIG ....\n") ;
+ FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 1");
+ break;
}
- /// -------------------------------
- /// Configuration/Initialation
- if (mode == PM_CONFIG ||
- mode == PM_INIT ||
- mode == PM_RESET ||
- mode == PM_RESET_SOFT)
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN2,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
+ if (rc)
{
- l_fapi_rc = p8_pm_list(i_target1, i_target2, mode);
- if (l_fapi_rc)
- {
- FAPI_ERR("ERROR: p8_pm_list detected failed ");
- break;
- }
+ FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 2");
+ break;
}
- /// -------------------------------
- /// Unsupported Mode
- else
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode,OCB_CHAN3,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
+ if (rc)
{
- FAPI_ERR("Unknown mode passed to p8_pm_init. Mode %x ....\n", mode);
- uint32_t & MODE = mode;
- FAPI_SET_HWP_ERROR(l_fapi_rc, RC_PROCPM_PMC_CODE_BAD_MODE); // proc_pmc_errors.xml
+ FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 3");
break;
}
} while(0);
-
- return l_fapi_rc;
+ return rc;
}
+// ----------------------------------------------------------------------
+// ocb_channel_init - Initialize the OCB channels as TGMT expects them ---
+// ----------------------------------------------------------------------
+
+fapi::ReturnCode
+ocb_channel_init(const Target& i_target)
+{
+ fapi::ReturnCode rc;
+
+ do
+ {
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN0, OCB_TYPE_LINSTR, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
+ if (rc)
+ {
+ FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 0");
+ break;
+ }
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN1, OCB_TYPE_PUSHQ, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
+ if (rc)
+ {
+ FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 1");
+ break;
+ }
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN2, OCB_TYPE_LIN, 0, 0, OCB_Q_OUFLOW_NULL, OCB_Q_ITPTYPE_NULL );
+ if (rc)
+ {
+ FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 2");
+ break;
+ }
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN3, OCB_TYPE_LINSTR, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
+ if (rc)
+ {
+ FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 3");
+ break;
+ }
+ } while(0);
+ return rc;
+
+}
// ----------------------------------------------------------------------
-// p8_pm_list - process the underlying routines in the prescribed order
+// pm_list - process the underlying routines in the prescribed order
// ----------------------------------------------------------------------
fapi::ReturnCode
-p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
+pm_list(const Target& i_target, const Target& i_target2, uint32_t i_mode)
{
fapi::ReturnCode rc;
- uint64_t SP_WKUP_REG_ADDRS;
- uint8_t l_ex_number = 0;
ecmdDataBufferBase data(64);
uint32_t effective_mode = 0;
+ const char * PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME
std::vector<fapi::Target> l_exChiplets;
- FAPI_INF("Executing p8_pm_list in mode %x start", mode);
+ FAPI_INF("p8_pm_list start in mode %s", PM_MODE_NAME(i_mode));
+
do
{
- if (mode == PM_RESET_SOFT || mode == PM_RESET)
+ if (i_mode == PM_RESET_SOFT || i_mode == PM_RESET)
{
effective_mode = PM_RESET;
FAPI_DBG("A Reset mode is detected. Setting effective reset for non-PMC procedures to PM_RESET (mode %x)",
@@ -194,7 +277,7 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
}
else
{
- effective_mode = mode;
+ effective_mode = i_mode;
}
@@ -202,7 +285,7 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// PCBS_PM
// ******************************************************************
- FAPI_INF("Executing: p8_pcbs_init.C in mode %x", mode);
+ FAPI_INF("Executing: p8_pcbs_init.C in mode %s", PM_MODE_NAME(effective_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
@@ -228,9 +311,9 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// PMC
// ******************************************************************
- FAPI_INF("Executing: p8_pmc_init in mode %x", mode);
+ FAPI_INF("Executing: p8_pmc_init in mode %s", PM_MODE_NAME(i_mode));
- FAPI_EXEC_HWP(rc, p8_pmc_init, i_target, i_target2, mode);
+ FAPI_EXEC_HWP(rc, p8_pmc_init, i_target, i_target2, i_mode);
if (rc)
{
FAPI_ERR("ERROR: p8_pm_init detected failed PMC result");
@@ -243,33 +326,33 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// Run SLW for hard reset and hard init and any config. So as to not
// touch the hardware, skip for soft reset and soft init.
- if (!(mode == PM_INIT_SOFT || mode == PM_RESET_SOFT ))
- {
- FAPI_INF("Executing: p8_poreslw_init in mode %x", mode);
- if ( i_target.getType() != TARGET_TYPE_NONE )
- {
- FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target, mode);
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
- break;
- }
- }
-
- if ( i_target2.getType() != TARGET_TYPE_NONE )
- {
- FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target2, mode);
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
- break;
- }
- }
- }
- else
- {
- FAPI_INF("Skipping p8_poreslw_init for mode %x - either soft init or soft reset", mode);
- }
+ // if (!(mode == PM_INIT_SOFT || mode == PM_RESET_SOFT ))
+// {
+// FAPI_INF("Executing: p8_poreslw_init in mode %x", mode);
+// if ( i_target.getType() != TARGET_TYPE_NONE )
+// {
+// FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target, mode);
+// if (rc)
+// {
+// FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
+// break;
+// }
+// }
+//
+// if ( i_target2.getType() != TARGET_TYPE_NONE )
+// {
+// FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target2, mode);
+// if (rc)
+// {
+// FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
+// break;
+// }
+// }
+// }
+// else
+// {
+// FAPI_INF("Skipping p8_poreslw_init for mode %x - either soft init or soft reset", mode);
+// }
// ******************************************************************
// PORE General Purpose Engines
// ******************************************************************
@@ -299,34 +382,34 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// OHA
// ******************************************************************
- FAPI_INF("Executing: p8_oha_init in mode %x", effective_mode);
-
- if ( i_target.getType() != TARGET_TYPE_NONE )
- {
- FAPI_EXEC_HWP(rc, p8_oha_init, i_target, effective_mode);
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
- break;
- }
- }
-
- if ( i_target2.getType() != TARGET_TYPE_NONE )
- {
- FAPI_EXEC_HWP(rc, p8_oha_init, i_target2, effective_mode);
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
- break;
- }
- }
+ // FAPI_INF("Executing: p8_oha_init in mode %s", PM_MODE_NAME(effective_mode));
+ //
+ // if ( i_target.getType() != TARGET_TYPE_NONE )
+ // {
+ // FAPI_EXEC_HWP(rc, p8_oha_init, i_target, effective_mode);
+ // if (rc)
+ // {
+ // FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
+ // break;
+ // }
+ // }
+ //
+ // if ( i_target2.getType() != TARGET_TYPE_NONE )
+ // {
+ // FAPI_EXEC_HWP(rc, p8_oha_init, i_target2, effective_mode);
+ // if (rc)
+ // {
+ // FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
+ // break;
+ // }
+ // }
// ******************************************************************
// OCC-SRAM
// ******************************************************************
- FAPI_INF("Executing: p8_occ_sram_init in mode %x", effective_mode);
+ FAPI_INF("Executing: p8_occ_sram_init in mode %s", PM_MODE_NAME(effective_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
@@ -352,70 +435,48 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// OCB
// ******************************************************************
- FAPI_INF("Executing: p8_ocb_init in mode %x", effective_mode);
+ FAPI_INF("Executing: p8_ocb_init in mode %s", PM_MODE_NAME(effective_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, effective_mode,OCB_CHAN0,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 0");
- break;
- }
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, effective_mode,OCB_CHAN1,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 1");
- break;
- }
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, effective_mode,OCB_CHAN2,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
+ if (effective_mode == PM_RESET)
{
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 2");
- break;
+ rc = ocb_channel_reset(i_target, effective_mode);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_reset error");
+ break;
+ }
}
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, effective_mode,OCB_CHAN3,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
+ else if (effective_mode == PM_INIT)
{
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 0");
- break;
+ rc = ocb_channel_init(i_target);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_init error");
+ break;
+ }
}
-
}
if ( i_target2.getType() != TARGET_TYPE_NONE )
{
-
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target2, effective_mode,OCB_CHAN0,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 0");
- break;
- }
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target2, effective_mode,OCB_CHAN1,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
+ if (effective_mode == PM_RESET)
{
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 1");
- break;
- }
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target2, effective_mode,OCB_CHAN2,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
- {
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 2");
- break;
+ rc = ocb_channel_reset(i_target, effective_mode);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_reset error");
+ break;
+ }
}
-
- FAPI_EXEC_HWP(rc, p8_ocb_init, i_target2, effective_mode,OCB_CHAN3,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL );
- if (rc)
+ else if (effective_mode == PM_INIT)
{
- FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 0");
- break;
+ rc = ocb_channel_init(i_target);
+ if (rc)
+ {
+ FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_init error");
+ break;
+ }
}
}
@@ -424,7 +485,7 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// PSS
// ******************************************************************
- FAPI_INF("Executing:p8_pss_init in effective_mode %x", effective_mode);
+ FAPI_INF("Executing:p8_pss_init in effective_mode %s", PM_MODE_NAME(effective_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
@@ -451,7 +512,7 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// PBA
// ******************************************************************
- FAPI_INF("Executing: p8_pba_init in effective_mode %x", effective_mode);
+ FAPI_INF("Executing: p8_pba_init in effective_mode %s", PM_MODE_NAME(effective_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_pba_init, i_target, effective_mode );
@@ -479,12 +540,12 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
// ******************************************************************
- FAPI_INF("Executing:p8_pm_firinit in effective_mode %x", mode);
+ FAPI_INF("Executing:p8_pm_firinit in effective_mode %s", PM_MODE_NAME(i_mode));
if ( i_target.getType() != TARGET_TYPE_NONE )
{
- FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target , mode );
+ FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target , i_mode );
if (rc)
{
FAPI_ERR("ERROR: p8_pm_firinit detected failed result");
@@ -495,13 +556,13 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
if ( i_target2.getType() != TARGET_TYPE_NONE )
{
- FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target2 , mode );
+ FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target2 , i_mode );
if (rc)
{
FAPI_ERR("ERROR: p8_pm_firinit detected failed result");
break;
}
- }
+ }
// ******************************************************************
// CPU_SPECIAL_WAKEUP switch off
@@ -509,116 +570,105 @@ p8_pm_list(const Target& i_target, const Target& i_target2, uint32_t mode)
if ( i_target.getType() != TARGET_TYPE_NONE )
{
- rc = fapiGetChildChiplets ( i_target,
- TARGET_TYPE_EX_CHIPLET,
- l_exChiplets,
- TARGET_STATE_FUNCTIONAL);
- if (rc)
+ rc = clear_occ_special_wakeups (i_target);
+ if (!rc.ok())
{
- FAPI_ERR("Error from fapiGetChildChiplets!");
break;
}
+ }
- FAPI_DBG("\tChiplet vector size => %u ", l_exChiplets.size());
-
- // Iterate through the returned chiplets
- for (uint8_t j=0; j < l_exChiplets.size(); j++)
- {
-
- // Build the SCOM address
- rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
- FAPI_DBG("Running special wakeup on ex chiplet %d ", l_ex_number);
-
- // Set special wakeup for EX
- // Commented due to attribute errors
- SP_WKUP_REG_ADDRS = PM_SPECIAL_WKUP_OCC_0x100F010C + (l_ex_number * 0x01000000) ;
- rc=fapiGetScom(i_target, SP_WKUP_REG_ADDRS , data);
- if(rc)
- {
- break;
- }
- FAPI_DBG(" Before clear of SPWKUP_REG PM_SPECIAL_WKUP_OCC_(0x%08llx) => =>0x%16llx", SP_WKUP_REG_ADDRS, data.getDoubleWord(0));
-
- if (data.isBitSet(0))
- {
- rc = fapiSpecialWakeup(l_exChiplets[j], false);
- if (rc)
- {
- FAPI_ERR("p8_cpu_special_wakeup: Failed to put CORE into special wakeup. With rc = 0x%x", (uint32_t)rc);
- break;
- }
- }
- } // chiplet loop
+ if ( i_target2.getType() != TARGET_TYPE_NONE )
+ {
+ rc = clear_occ_special_wakeups (i_target2);
if (!rc.ok())
{
break;
- }
- } // Master target
+ }
+ }
+ } // PM_INIT special stuff
+ } while(0);
- ///////////////////////////////////////////// SLAVE TARGET /////////////////////////////////////////////////
+ FAPI_INF("p8_pm_list end in mode %s", PM_MODE_NAME(i_mode));
+ return rc;
+}
- if ( i_target2.getType() != TARGET_TYPE_NONE )
- {
- rc = fapiGetChildChiplets ( i_target2,
- TARGET_TYPE_EX_CHIPLET,
- l_exChiplets,
- TARGET_STATE_FUNCTIONAL);
- if (rc)
- {
- FAPI_ERR("Error from fapiGetChildChiplets!");
- break;
- }
+/**
+ * clear_occ_special_wakeups - clears OCC special wake-up on all configured EXs
+ *
+ * @param[in] i_target Chip target w
+ *
+ * @retval ECMD_SUCCESS
+ * @retval ERROR defined in xml
+ */
+fapi::ReturnCode
+clear_occ_special_wakeups (const fapi::Target &i_target)
+{
+ fapi::ReturnCode rc;
+ uint64_t SP_WKUP_REG_ADDRS;
+ ecmdDataBufferBase data(64);
+ std::vector<fapi::Target> l_exChiplets;
+ uint8_t l_ex_number = 0;
+
+ do
+ {
+
+ rc = fapiGetChildChiplets ( i_target,
+ TARGET_TYPE_EX_CHIPLET,
+ l_exChiplets,
+ TARGET_STATE_FUNCTIONAL);
+ if (rc)
+ {
+ FAPI_ERR("Error from fapiGetChildChiplets!");
+ break;
+ }
- FAPI_DBG("\tChiplet vector size => %u ", l_exChiplets.size());
+ FAPI_DBG("\tChiplet vector size => %u ", l_exChiplets.size());
- // Iterate through the returned chiplets
- for (uint8_t j=0; j < l_exChiplets.size(); j++)
- {
+ // Iterate through the returned chiplets
+ for (uint8_t j=0; j < l_exChiplets.size(); j++)
+ {
- // Build the SCOM address
- rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
- if (rc)
- {
- FAPI_ERR("Error from ATTR_GET for chip position!");
- break;
- }
- FAPI_DBG("Running special wakeup on ex chiplet %d ", l_ex_number);
-
- // Set special wakeup for EX
- // Commented due to attribute errors
- SP_WKUP_REG_ADDRS = PM_SPECIAL_WKUP_OCC_0x100F010C + (l_ex_number * 0x01000000) ;
- rc=fapiGetScom(i_target2, SP_WKUP_REG_ADDRS , data);
- if(rc)
- {
- FAPI_ERR("Error from GetScom of OCC SPWKUP");
- break;
- }
- FAPI_DBG(" Before clear of SPWKUP_REG PM_SPECIAL_WKUP_OCC_(0x%08llx) => =>0x%16llx", SP_WKUP_REG_ADDRS, data.getDoubleWord(0));
-
- if (data.isBitSet(0))
- {
- rc = fapiSpecialWakeup(l_exChiplets[j], false);
- if (rc)
- {
- FAPI_ERR("p8_cpu_special_wakeup: Failed to put CORE into special wakeup. With rc = 0x%x", (uint32_t)rc);
- break;
- }
- }
- } // chiplet loop
- if (!rc.ok())
+ // Build the SCOM address
+ rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
+ if (rc)
+ {
+ FAPI_ERR("Error from ATTR_GET for chip position!");
+ break;
+ }
+ FAPI_DBG("Running special wakeup on ex chiplet %d ", l_ex_number);
+
+ // Set special wakeup for EX
+ // Commented due to attribute errors
+ SP_WKUP_REG_ADDRS = PM_SPECIAL_WKUP_OCC_0x100F010C + (l_ex_number * 0x01000000) ;
+ rc=fapiGetScom(i_target, SP_WKUP_REG_ADDRS , data);
+ if(rc)
+ {
+ FAPI_ERR("Error from GetScom of OCC SPWKUP");
+ break;
+ }
+ FAPI_DBG(" Before clear of SPWKUP_REG PM_SPECIAL_WKUP_OCC_(0x%08llx) => =>0x%16llx",
+ SP_WKUP_REG_ADDRS,
+ data.getDoubleWord(0));
+
+ if (data.isBitSet(0))
+ {
+ rc = fapiSpecialWakeup(l_exChiplets[j], false);
+ if (rc)
{
+ FAPI_ERR("p8_cpu_special_wakeup: Failed to put CORE into special wakeup. With rc = 0x%x", (uint32_t)rc);
break;
}
- } // Slave target
- } // PM_INIT special stuff
+ }
+ } // chiplet loop
+ if (!rc.ok())
+ {
+ break;
+ }
} while(0);
-
- FAPI_INF("Executing p8_pm_list in mode %x end", mode);
-
return rc;
-
}
+
} //end extern C
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.C
index 9a2d6625d..d78607b56 100644
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pm_occ_firinit.C,v 1.15 2013-10-28 13:35:49 stillgs Exp $
+// $Id: p8_pm_occ_firinit.C,v 1.15 2013/10/28 13:35:49 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_occ_firinit.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.H b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.H
index d3f23b76f..d3f23b76f 100755..100644
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.H
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_occ_firinit.H
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_prep_for_reset.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_prep_for_reset.C
index d114e29bc..aca25038f 100644
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_prep_for_reset.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_prep_for_reset.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: p8_pm_prep_for_reset.C,v 1.22 2013/09/25 22:36:37 stillgs Exp $
+// $Id: p8_pm_prep_for_reset.C,v 1.25 2013/10/30 17:13:09 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_prep_for_reset.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -37,22 +37,6 @@
// *!
//------------------------------------------------------------------------------
///
-/// \version --------------------------------------------------------------------------
-/// \version 1.5 rmaier 09/19/12 Added review feedback
-/// \version --------------------------------------------------------------------------
-/// \version 1.4 rmaier 09/17/12 Fixed error when calling p8_ocb_init.C.
-/// \version --------------------------------------------------------------------------
-/// \version 1.1 rmaier 08/23/12 Renaming proc_ to p8_
-/// \version --------------------------------------------------------------------------
-/// \version 1.3 rmaier 2012/07/17 Added review feedback
-/// \version --------------------------------------------------------------------------
-/// \version 1.2 rmaier 2012/03/13 Added return code handling
-/// \version --------------------------------------------------------------------------
-/// \version 1.1 rmaier 2012/02/28 Added calls to subroutines
-/// \version --------------------------------------------------------------------------
-/// \version 1.0 rmaier 2012/02/01 Initial Version
-/// \version ---------------------------------------------------------------------------
-///
/// High-level procedure flow:
///
/// \verbatim
@@ -71,17 +55,18 @@
/// - call p8_pmc_init.C *chiptarget, ENUM:PMC_RESET
/// - Issue reset to the PMC
///
-/// - call p8_poreslw_init.C *chiptarget, ENUM:PORESLW_RESET
-///
/// - call p8_poregpe_init.C *chiptarget, ENUM:POREGPE_RESET
///
-///
/// - call p8_pba_init.C *chiptarget, ENUM:PBA_RESET
///
/// - call p8_occ_sram_init.C *chiptarget, ENUM:OCC_SRAM_RESET
///
/// - call p8_ocb_init .C *chiptarget, ENUM:OCC_OCB_RESET
///
+/// SLW engine reset is not done here as this will blow away all setup
+/// in istep 15. Thus, ALL manipulation of this is done there or by
+/// p8_poreslw_recovery.
+///
/// \endverbatim
///
@@ -108,10 +93,14 @@ using namespace fapi;
// Function prototypes
// ----------------------------------------------------------------------
+fapi::ReturnCode
+special_wakeup_all (const fapi::Target &i_target, bool i_action);
+
// ----------------------------------------------------------------------
// Function definitions
// ----------------------------------------------------------------------
+
//------------------------------------------------------------------------------
/**
* p8_pm_prep_for_reset Call underlying unit procedure to perform readiness for
@@ -134,19 +123,20 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
{
fapi::ReturnCode rc;
- uint8_t l_ex_number = 0;
std::vector<fapi::Target> l_exChiplets;
ecmdDataBufferBase data(64);
ecmdDataBufferBase mask(64);
+ const char * PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME
+
fapi::Target dummy;
do
{
-
+
FAPI_INF("p8_pm_prep_for_reset start ....");
-
+
if (i_mode == PM_RESET)
{
FAPI_INF("Hard reset detected");
@@ -159,17 +149,17 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
{
FAPI_ERR("Mode parameter value not supported: %u", i_mode);
uint32_t & MODE = i_mode;
- FAPI_SET_HWP_ERROR(rc, RC_PROCPM_PREP_UNSUPPORTED_MODE_ERR);
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_PREP_UNSUPPORTED_MODE_ERR);
break;
}
-
+
if ( i_secondary_chip_target.getType() == TARGET_TYPE_NONE )
{
if ( i_primary_chip_target.getType() == TARGET_TYPE_NONE )
{
FAPI_ERR("Set primay target properly for SCM " );
const fapi::Target PRIMARY_TARGET = i_primary_chip_target;
- FAPI_SET_HWP_ERROR(rc, RC_PROCPM_PREP_TARGET_ERR);
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_PREP_TARGET_ERR);
break;
}
FAPI_DBG("Running on SCM");
@@ -178,7 +168,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
{
FAPI_DBG("Running on DCM");
}
-
+
// ******************************************************************
// Put OCC PPC405 into reset
// ******************************************************************
@@ -210,81 +200,25 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
// ******************************************************************
// Put all EX chiplet special wakeup
// *****************************************************************
- // - call proc_cpu_special_wakeup.C *chiptarget, ENUM:OCC_SPECIAL_WAKEUP
- // - For each chiplet, put into Special Wake-up via the OCC special wake-up bit
-
- //////////////////////// PRIMARY TARGET ////////////////////////////////
- rc = fapiGetChildChiplets ( i_primary_chip_target,
- TARGET_TYPE_EX_CHIPLET,
- l_exChiplets,
- TARGET_STATE_FUNCTIONAL);
+
+ // Primary
+ rc = special_wakeup_all (i_primary_chip_target, true);
if (rc)
{
- FAPI_ERR("Error from fapiGetChildChiplets!");
- break;
- }
-
- FAPI_DBG("Number of EX chiplet on primary => %u ", l_exChiplets.size());
-
- // Iterate through the returned chiplets
- for (uint8_t j=0; j < l_exChiplets.size(); j++)
- {
-
- // Build the SCOM address
- rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
- FAPI_DBG("Running special wakeup on ex chiplet %d ", l_ex_number);
-
- // Set special wakeup for EX
- rc = fapiSpecialWakeup(l_exChiplets[j], true);
- if (rc)
- {
- FAPI_ERR("fapiSpecialWakeup: Failed to put CORE %d into special wakeup. With rc = 0x%x", l_ex_number, (uint32_t)rc);
- break;
- }
-
- } // chiplet loop
-
- // Exit if error
- if (!rc.ok())
- {
+ FAPI_ERR("special_wakeup_all - Enable: Failed for Target %s",
+ i_primary_chip_target.toEcmdString());
break;
}
+
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
- rc = fapiGetChildChiplets ( i_secondary_chip_target,
- TARGET_TYPE_EX_CHIPLET,
- l_exChiplets,
- TARGET_STATE_FUNCTIONAL);
+ rc = special_wakeup_all (i_secondary_chip_target, true);
if (rc)
{
- FAPI_ERR("Error from fapiGetChildChiplets!");
- break;
- }
-
- FAPI_DBG("Number of EX chiplet on secondary => %u ", l_exChiplets.size());
-
- // Iterate through the returned chiplets
- for (uint8_t j=0; j < l_exChiplets.size(); j++)
- {
-
- rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
- FAPI_DBG("Running special wakeup on EX chiplet %d ", l_ex_number);
-
- // Set special wakeup for EX
- rc = fapiSpecialWakeup(l_exChiplets[j], true);
- if (rc)
- {
- FAPI_ERR("fapiSpecialWakeup: Failed to put CORE %d into special wakeup. With rc = 0x%x", l_ex_number, (uint32_t)rc);
- break;
- }
-
- } // chiplet loop
-
- // Exit if error
- if (!rc.ok())
- {
+ FAPI_ERR("special_wakeup_all - Enable: Failed for Target %s",
+ i_secondary_chip_target.toEcmdString());
break;
}
@@ -324,23 +258,23 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Force Vsafe value into voltage controller");
FAPI_DBG("Executing: p8_pmc_force_vsafe.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_pmc_force_vsafe, i_primary_chip_target);
if (rc)
{
FAPI_ERR("Failed to force Vsafe value into voltage controller. With rc = 0x%x", (uint32_t)rc);
- FAPI_ERR("Continiing with reset of Power Management functions");
+ break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_pmc_force_vsafe, i_secondary_chip_target);
if (rc)
{
FAPI_ERR("Failed to force Vsafe value into voltage controller. With rc = 0x%x", (uint32_t)rc);
- FAPI_ERR("Contining with reset of Power Management functions");
+ break;
}
}
@@ -354,15 +288,15 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Prepare PCBSLV_PM for RESET");
FAPI_DBG("Executing: p8_pcbs_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_pcbs_init, i_primary_chip_target, PM_RESET);
if (rc)
{
FAPI_ERR("p8_pcbs_init: Failed to prepare PCBSLV_PM for RESET. With rc = 0x%x", (uint32_t)rc);
break;
}
-
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
@@ -381,7 +315,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
//
FAPI_INF("Issue reset to PMC");
- FAPI_DBG("Executing: p8_pmc_init.C");
+ FAPI_DBG("Executing: p8_pmc_init");
FAPI_EXEC_HWP(rc, p8_pmc_init, i_primary_chip_target, i_secondary_chip_target, i_mode);
if (rc)
@@ -389,69 +323,71 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_ERR("p8_pmc_init: Failed to issue PMC reset. With rc = 0x%x", (uint32_t)rc);
break;
}
-
+
// ******************************************************************
- // Issue reset to PSS macro
+ // As the PMC reset kills ALL of the configuration, the idle portion
+ // must be reestablished to allow that portion to operate. This is
+ // what p8_poreslw_init -init does. Additionally, this lets us drop
+ // special wake-up before exiting.
// ******************************************************************
- // - call p8_pss_init.C *chiptarget, ENUM:PM_RESET
+ // - call p8_poreslw_init.C *chiptarget, ENUM:PM_INIT
//
- FAPI_INF("Issue reset to PSS macro");
- FAPI_DBG("Executing: p8_pss_init.C");
-
- //////////////////////// PRIMARY TARGET ////////////////////////////////
- FAPI_EXEC_HWP(rc, p8_pss_init, i_primary_chip_target, PM_RESET);
+ FAPI_INF("Re-establish PMC Idle configuration");
+ FAPI_DBG("Executing: p8_poreslw_init in mode %s", PM_MODE_NAME(PM_INIT_PMC));
+
+ // Primary
+ FAPI_EXEC_HWP(rc, p8_poreslw_init, i_primary_chip_target, PM_INIT_PMC);
if (rc)
{
- FAPI_ERR("p8_pss_init: Failed to issue reset to PSS macro. With rc = 0x%x", (uint32_t)rc);
+ FAPI_ERR("p8_poreslw_init: Failed to to reinialize the idle portion of the PMC. With rc = 0x%x", (uint32_t)rc);
break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
- FAPI_DBG("FAPI_EXEC_HWP(rc, p8_pss_init, i_secondary_chip_target, PM_RESET);");
-
- FAPI_EXEC_HWP(rc, p8_pss_init, i_secondary_chip_target, PM_RESET);
+ FAPI_EXEC_HWP(rc, p8_poreslw_init, i_secondary_chip_target, PM_INIT_PMC);
if (rc)
{
- FAPI_ERR("p8_pss_init: Failed to issue reset to PSS macro. With rc = 0x%x", (uint32_t)rc);
+ FAPI_ERR("p8_poreslw_init: Failed to to reinialize the idle portion of the PMC. With rc = 0x%x", (uint32_t)rc);
break;
}
+
}
- if (i_mode == PM_RESET)
- {
- FAPI_INF("Hard reset detected...");
- // ******************************************************************
- // Issue reset to PORE Sleep/Winkle engine
- // ******************************************************************
- // - call p8_poreslw_init.C *chiptarget, ENUM:PORESLW_RESET
+ // ******************************************************************
+ // Issue reset to PSS macro
+ // ******************************************************************
+ // - call p8_pss_init.C *chiptarget, ENUM:PM_RESET
+ //
- FAPI_INF("Issue reset to PORE Sleep/Winkle engine.");
- FAPI_DBG("Executing: p8_poreslw_init.C");
+ FAPI_INF("Issue reset to PSS macro");
+ FAPI_DBG("Executing: p8_pss_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
- FAPI_EXEC_HWP(rc, p8_poreslw_init, i_primary_chip_target, PM_RESET);
- if (rc)
- {
- FAPI_ERR("p8_poreslw_init: Failed to issue reset to PORE Sleep/Winkle engine. With rc = 0x%x", (uint32_t)rc);
- break;
- }
+ // Primary
+ FAPI_EXEC_HWP(rc, p8_pss_init, i_primary_chip_target, PM_RESET);
+ if (rc)
+ {
+ FAPI_ERR("p8_pss_init: Failed to issue reset to PSS macro. With rc = 0x%x", (uint32_t)rc);
+ break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
- FAPI_EXEC_HWP(rc, p8_poreslw_init, i_secondary_chip_target, PM_RESET);
+
+ FAPI_DBG("FAPI_EXEC_HWP(rc, p8_pss_init, i_secondary_chip_target, PM_RESET);");
+
+ FAPI_EXEC_HWP(rc, p8_pss_init, i_secondary_chip_target, PM_RESET);
if (rc)
{
- FAPI_ERR("p8_poreslw_init: Failed to issue reset to PORE Sleep/Winkle engine. With rc = 0x%x", (uint32_t)rc);
+ FAPI_ERR("p8_pss_init: Failed to issue reset to PSS macro. With rc = 0x%x", (uint32_t)rc);
break;
}
}
-
+
// ******************************************************************
// Issue reset to PORE General Purpose Engine
// ******************************************************************
@@ -460,7 +396,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Issue reset to PORE General Purpose Engine");
FAPI_DBG("Executing: p8_poregpe_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_poregpe_init, i_primary_chip_target, PM_RESET, GPEALL );
if (rc)
{
@@ -468,7 +404,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_poregpe_init, i_secondary_chip_target, PM_RESET, GPEALL );
@@ -488,7 +424,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Issue reset to PBA");
FAPI_DBG("Executing: p8_pba_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_pba_init, i_primary_chip_target, PM_RESET );
if (rc)
{
@@ -496,7 +432,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_pba_init, i_secondary_chip_target, PM_RESET );
@@ -516,7 +452,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Issue reset to OCC-SRAM");
FAPI_DBG("Executing: p8_occ_sram_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_occ_sram_init, i_primary_chip_target, PM_RESET );
if (rc)
{
@@ -524,7 +460,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_occ_sram_init, i_secondary_chip_target, PM_RESET );
@@ -543,7 +479,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
FAPI_INF("Issue reset to OCB");
FAPI_DBG("Executing: p8_ocb_init.C");
- //////////////////////// PRIMARY TARGET ////////////////////////////////
+ // Primary
FAPI_EXEC_HWP(rc, p8_ocb_init, i_primary_chip_target, PM_RESET,0 , 0, 0, 0, 0, 0 );
if (rc)
{
@@ -551,7 +487,7 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
break;
}
- //////////////////////// SECONDARY TARGET ////////////////////////////////
+ // Secondary
if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
{
FAPI_EXEC_HWP(rc, p8_ocb_init, i_secondary_chip_target, PM_RESET,0 , 0, 0, 0, 0, 0 );
@@ -561,14 +497,108 @@ p8_pm_prep_for_reset( const fapi::Target &i_primary_chip_target,
break;
}
}
+
+ // ******************************************************************
+ // Remove the EX chiplet special wakeups
+ // *****************************************************************
+
+ // Primary
+ rc = special_wakeup_all (i_primary_chip_target, false);
+ if (rc)
+ {
+ FAPI_ERR("special_wakeup_all - Enable: Failed for Target %s",
+ i_primary_chip_target.toEcmdString());
+ break;
+ }
+
+
+ // Secondary
+ if ( i_secondary_chip_target.getType() != TARGET_TYPE_NONE )
+ {
+ rc = special_wakeup_all (i_secondary_chip_target, false);
+ if (rc)
+ {
+ FAPI_ERR("special_wakeup_all - Enable: Failed for Target %s",
+ i_secondary_chip_target.toEcmdString());
+ break;
+ }
+
+ }
+
} while(0);
FAPI_INF("p8_pm_prep_for_reset start ....");
-
+
return rc;
} // Procedure
+
+/**
+ * special_wakeup_all - Sets or clears special wake-up on all configured EX on a
+ * target
+ *
+ * @param[in] i_target Chip target w
+ * @param[in] i_action true - ENABLE; false - DISABLE
+ *
+ * @retval ECMD_SUCCESS
+ * @retval ERROR defined in xml
+ */
+fapi::ReturnCode
+special_wakeup_all (const fapi::Target &i_target, bool i_action)
+{
+ fapi::ReturnCode rc;
+ std::vector<fapi::Target> l_exChiplets;
+ uint8_t l_ex_number = 0;
+
+ do
+ {
+
+ rc = fapiGetChildChiplets ( i_target,
+ TARGET_TYPE_EX_CHIPLET,
+ l_exChiplets,
+ TARGET_STATE_FUNCTIONAL);
+ if (rc)
+ {
+ FAPI_ERR("Error from fapiGetChildChiplets!");
+ break;
+ }
+
+ // Iterate through the returned chiplets
+ for (uint8_t j=0; j < l_exChiplets.size(); j++)
+ {
+
+ FAPI_INF("\t%s special wake-up on %s",
+ i_action ? "Setting" : "Clearing",
+ l_exChiplets[j].toEcmdString());
+
+ // Build the SCOM address
+ rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[j], l_ex_number);
+ FAPI_DBG("Running special wakeup on ex chiplet %d ", l_ex_number);
+
+ // Set special wakeup for EX
+ rc = fapiSpecialWakeup(l_exChiplets[j], i_action);
+ if (rc)
+ {
+ FAPI_ERR("fapiSpecialWakeup: Failed to put CORE %d into special wakeup. With rc = 0x%x",
+ l_ex_number, (uint32_t)rc);
+ break;
+ }
+
+ } // chiplet loop
+
+ // Exit if error
+ if (!rc.ok())
+ {
+ break;
+ }
+
+ } while(0);
+ return rc;
+}
+
+
+
} //end extern C
OpenPOWER on IntegriCloud