diff options
author | Sangeetha T S <sangeet2@in.ibm.com> | 2016-05-31 04:20:34 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-08-04 03:07:56 -0400 |
commit | 295690f13710b71c871ff09a411895dd88f9a9c7 (patch) | |
tree | a6733b7f4187c4a793189d2fc462abd6d5f2db09 | |
parent | 3f65ff8b44175167f62b80e7c3b8255975269a0a (diff) | |
download | talos-sbe-295690f13710b71c871ff09a411895dd88f9a9c7.tar.gz talos-sbe-295690f13710b71c871ff09a411895dd88f9a9c7.zip |
p9_pm_init: Level 2: Implement functionality
> Transliteration from FAPI 1.0 to FAPI 2.0
> SUET Test
> AWAN Test
> Add fixes to p9_pm_corequad_init, p9_pm_pba_init & p9_pm_ocb_init
Change-Id: I0e29d6aa40b5cee7d993f20ee83dcf69ca6b0aad
RTC: 154516
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25348
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25350
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
-rw-r--r-- | import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C | 54 | ||||
-rw-r--r-- | import/chips/p9/sw_simulation/powermgmt.act | 13 |
2 files changed, 41 insertions, 26 deletions
diff --git a/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C b/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C index d8990ac9..765e3a96 100644 --- a/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C +++ b/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C @@ -218,7 +218,7 @@ fapi2::ReturnCode p9_pm_ocb_init( // ------------------------------------------------------------------------- if (i_mode == p9pm::PM_INIT) { - FAPI_DBG("Functionality not yet defined for Channel Initialization."); + FAPI_DBG(" Channel initialization is a no-op."); } // ------------------------------------------------------------------------- // RESET mode: Change the OCB channel registers to scan-0 flush state @@ -476,80 +476,82 @@ fapi2::ReturnCode pm_ocb_reset( FAPI_IMP("p9_pm_ocb_reset Enter"); fapi2::buffer<uint64_t> l_buf64; - uint8_t i = 0; + // vector of reset channels + std::vector<uint8_t> v_reset_chan; + v_reset_chan.push_back(1); // ------------------------------------------------------------------------- // Loop over PIB Registers // ------------------------------------------------------------------------- - for (i = 0; i <= MAX_OCB_CHANNELS; i++) + for (auto chan : v_reset_chan) { fapi2::buffer<uint64_t> l_data64; // Clear out OCB Channel BAR registers - FAPI_TRY(fapi2::putScom(i_target, OCBARn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBARn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d BAR Register", i); + "Channel %d BAR Register", chan); // Clear out OCB Channel control and status registers l_data64.flush<1>(); - FAPI_TRY(fapi2::putScom(i_target, OCBCSRn_CLEAR[i], l_data64), + FAPI_TRY(fapi2::putScom(i_target, OCBCSRn_CLEAR[chan], l_data64), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Control & Status Register Clear", i); + "Channel %d Control & Status Register Clear", chan); // Put channels in Circular mode // - set bits 4,5 (circular mode) using OR l_data64.flush<0>().setBit<4>().setBit<5>(); - FAPI_TRY(fapi2::putScom(i_target, OCBCSRn_OR[i], l_data64), + FAPI_TRY(fapi2::putScom(i_target, OCBCSRn_OR[chan], l_data64), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Control & Status OR Register Set", i); + "Channel %d Control & Status OR Register Set", chan); // Clear out OCB Channel Error Status registers - FAPI_TRY(fapi2::putScom(i_target, OCBESRn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBESRn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Error Status Register", i); + "Channel %d Error Status Register", chan); } // ------------------------------------------------------------------------- // Loop over OCI Registers // ------------------------------------------------------------------------- - for (i = 0; i <= MAX_OCB_CHANNELS; i++) + for (auto chan : v_reset_chan) { fapi2::buffer<uint64_t> l_data64; // Clear out Pull Base - FAPI_TRY(fapi2::putScom(i_target, OCBSLBRn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBSLBRn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Pull Base Register", i); + "Channel %d Pull Base Register", chan); // Clear out Push Base - FAPI_TRY(fapi2::putScom(i_target, OCBSHBRn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBSHBRn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Push Base Register", i); + "Channel %d Push Base Register", chan); // Clear out Pull Control & Status - FAPI_TRY(fapi2::putScom(i_target, OCBSLCSn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBSLCSn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Pull Control & Status Register", i); + "Channel %d Pull Control & Status Register", chan); // Clear out Push Control & Status - FAPI_TRY(fapi2::putScom(i_target, OCBSHCSn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBSHCSn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Push Control & Status Register", i); + "Channel %d Push Control & Status Register", chan); // Clear out Stream Error Status - FAPI_TRY(fapi2::putScom(i_target, OCBSESn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBSESn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Stream Error Status Register", i); + "Channel %d Stream Error Status Register", chan); // Clear out Linear Window Control - FAPI_TRY(fapi2::putScom(i_target, OCBLWCRn[i], 0), + FAPI_TRY(fapi2::putScom(i_target, OCBLWCRn[chan], 0), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Linear Window Control Register", i); + "Channel %d Linear Window Control Register", chan); // Clear out Linear Window Base // - set bits 3:9 l_data64.setBit<3, 7>(); - FAPI_TRY(fapi2::putScom(i_target, OCBLWSBRn[i], l_data64), + FAPI_TRY(fapi2::putScom(i_target, OCBLWSBRn[chan], l_data64), "**** ERROR : Unexpected error encountered in write to OCB " - "Channel %d Linear Window Base Register", i); + "Channel %d Linear Window Base Register", chan); } // Set Interrupt Source Mask Registers 0 & 1 diff --git a/import/chips/p9/sw_simulation/powermgmt.act b/import/chips/p9/sw_simulation/powermgmt.act index 7692ea6e..0cfd5c41 100644 --- a/import/chips/p9/sw_simulation/powermgmt.act +++ b/import/chips/p9/sw_simulation/powermgmt.act @@ -59,6 +59,19 @@ CAUSE_EFFECT { ELSE: TARGET=[REG(0x01010800)] OP=[EQUALTO,BUF] DATA=[REG(0x01010801)] } +CAUSE_EFFECT { + LABEL=[Clear halt] + WATCH=[REG(0x0006D001)] + CAUSE: TARGET=[REG(0x0006D001)] OP=[BIT,ON] BIT=[10] + EFFECT: TARGET=[REG(0x0006D000)] OP=[BIT,OFF] BIT=[10] +} + +CAUSE_EFFECT { + LABEL=[Clear reset] + WATCH=[REG(0x0006D001)] + CAUSE: TARGET=[REG(0x0006D001)] OP=[BIT,ON] BIT=[0] + EFFECT: TARGET=[REG(0x0006D000)] OP=[BIT,OFF] BIT=[0] +} ## ## Actions for Procedure - p9_pm_occ_gpe_init |