From a1ae2a2a50b16d5cb1f45d61b571994de6cb3065 Mon Sep 17 00:00:00 2001 From: Corey Swenson Date: Fri, 28 Mar 2014 15:53:00 -0500 Subject: INITPROC: fixes reset of OCC for MPIPL Change-Id: I942773bcfe9a9879b391e228d92d70a3c3ca2009 CQ: SW254023 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9996 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- .../p8_set_pore_bar/p8_pba_init.H | 16 +- src/usr/hwpf/hwp/occ/occ_procedures/p8_pba_init.C | 251 ++++++++++++++++----- .../hwpf/hwp/runtime_errors/p8_pba_init_errors.xml | 198 +++++++++------- 3 files changed, 322 insertions(+), 143 deletions(-) (limited to 'src/usr/hwpf/hwp') diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pba_init.H b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pba_init.H index 116bf0ee5..df8986ef7 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pba_init.H +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pba_init.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* COPYRIGHT International Business Machines Corp. 2012,2014 */ /* */ /* p1 */ /* */ @@ -20,7 +20,8 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_pba_init.H,v 1.6 2013/06/01 03:26:29 dcrowell Exp $ + +// $Id: p8_pba_init.H,v 1.8 2014/03/17 23:16:35 stillgs Exp $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2011 @@ -104,6 +105,10 @@ const uint64_t PBA_SLVRESETs[4] = #define MAX_PBA_RESET_POLLS 16 #define PBA_RESET_POLL_DELAY 1 // in microseconds +// Maximum number of Polls for PBA Block Copy Stopping - 500ms timeout +#define MAX_PBA_BC_STOP_POLLS 256 +#define PBA_BC_STOP_POLL_DELAY 10 // in microseconds + // bar mask is valid for bits 23 to 43, in a 64bit value this is // 1 2 3 4 5 6 // 0123456789012345678901234567890123456789012345678901234567890123 @@ -198,7 +203,11 @@ typedef union pbaxcfg_typ{ } fields; } pbaxcfg_t; - +// BCDE and BCUE Status registers bits +#define PBA_BC_STAT_RUNNING 0 +#define PBA_BC_STAT_STOPPED 29 +#define PBA_BC_STAT_ERROR 30 +#define PBA_BC_STAT_DONE 31 // ---------------------------------------------------------------------- @@ -220,4 +229,3 @@ p8_pba_init (const fapi::Target& i_target, #endif // _P8_PBAINITQ_H_ - diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pba_init.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pba_init.C index e2a699900..38bf33c6b 100644 --- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pba_init.C +++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pba_init.C @@ -20,8 +20,9 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_pba_init.C,v 1.16 2014/02/17 02:36:40 stillgs Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pba_init.C,v $ + +// $Id: p8_pba_init.C,v 1.18 2014/03/17 23:16:22 stillgs Exp $ +// $Source: /archive/shadow/ekb/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pba_init.C,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2011 // *! All Rights Reserved -- Property of IBM @@ -50,14 +51,7 @@ // *! FAPI_SET_HWP_ERROR(rc,RC_PMPROC_PBA_INIT_INCORRECT_MODE); // *! } // *! -// *! list of changes -// *! 2012/10/11 applied changes and error corrections according to Terry Opie and reformatting if-else -// *! 2012/10/11 applied changes according to Terry Opie -// *! 2012/07/26 applied the changes as recommended by Greg's second review, pbax attributes included, -// *! 2012/07/18 applied the changes as recommended by Greg, attribute coding, TODO: correct constants -// *! 2012/05/09 global variables removed, "mode" used according to common rules. -// *! 2012/05/17 temporary commented out the accesses assumed wrong address -// *! +// *! buildfapiprcd -e "../../xml/error_info/p8_pba_init_errors.xml" p8_pba_init.C //------------------------------------------------------------------------------ @@ -98,6 +92,8 @@ fapi::ReturnCode pba_slave_setup_init ( const Target& i_target ); fapi::ReturnCode pba_slave_setup_reset ( const Target& i_target ); fapi::ReturnCode pba_slave_reset(const Target& i_target); +fapi::ReturnCode pba_bc_stop(const Target& i_target); + // ********************************************************************************************** // ----------------------------------------------- p8_pba_init -------------------------------- @@ -179,52 +175,14 @@ pba_init_reset(const Target& i_target) FAPI_INF("pba_init_reset start ..."); do { - // Stop the BCDE and BCUE - address = PBA_BCDE_CTL_0x00064010; - - l_rc |= data.flushTo0(); - l_rc |= data.setBit(0); // Bit 0: BCDE_CTL_STOP - if (l_rc) - { - rc.setEcmdError(l_rc); - break; - } - FAPI_INF("\tStopping BCDE addr=0x%08llX, value=0x%16llX, Target = %s", - address, - data.getDoubleWord(0), - i_target.toEcmdString()); - rc = fapiPutScom(i_target, address, data); - if (!rc.ok()) - { - FAPI_ERR("fapiPutScom(addr=0x%08llX) failed, Target = %s", - address, - i_target.toEcmdString()); - break; - } - - address = PBA_BCUE_CTL_0x00064015; - - l_rc |= data.flushTo0(); - l_rc |= data.setBit(0); // Bit 0: BCUE_CTL_STOP - if (l_rc) - { - rc.setEcmdError(l_rc); - break; - } - FAPI_INF("\tStopping BCUE addr=0x%08llX, value=0x%16llX, Target = %s", - address, - data.getDoubleWord(0), - i_target.toEcmdString()); - rc = fapiPutScom(i_target, address, data); + // Stop the BCDE and BCUE + rc = pba_bc_stop(i_target); if (!rc.ok()) { - FAPI_ERR("fapiPutScom(addr=0x%08llX) failed, Target = %s", - address, - i_target.toEcmdString()); + FAPI_ERR("pba_bc_stop detected an error"); break; } - - + // Reset each slave and wait for completion. rc = pba_slave_reset(i_target); if (rc) @@ -508,7 +466,7 @@ pba_slave_setup_init(const Target& i_target) ec_allows_pba_prefetch_enable); if(rc) { - FAPI_ERR("Error querying Chip EC feature: " + FAPI_ERR("Error querying Chip EC feature: " "ATTR_PROC_EC_PBA_PREFETCH_ENABLE"); break; } @@ -722,9 +680,29 @@ pba_slave_reset(const Target& i_target) ecmdDataBufferBase data(64); bool poll_failure = false; uint32_t p; + + uint8_t ec_has_pba_slvrest_bug = 0; + uint8_t attr_mpipl = 0; do { + rc = FAPI_ATTR_GET(ATTR_CHIP_EC_FEATURE_HW_BUG_PBASLVRESET, + &i_target, + ec_has_pba_slvrest_bug); + if(rc) + { + FAPI_ERR("Error querying Chip EC feature: " + "ATTR_CHIP_EC_FEATURE_HW_BUG_PBASLVRESET"); + break; + } + + rc = FAPI_ATTR_GET(ATTR_IS_MPIPL, NULL, attr_mpipl); + if(rc) + { + FAPI_ERR("Error querying attribute ATTR_IS_MPIPL"); + break; + } + for (int s=0; s<= 3; s++) { @@ -749,7 +727,17 @@ pba_slave_reset(const Target& i_target) FAPI_ERR("fapiPutScom( PBA_SLVRST_0x00064001 ) failed. With rc = 0x%x", (uint32_t)rc); break ; } - + + // Due to HW228485, skip the check of the in-progress bits for MPIPL + // (after the PBA channels have been used at runtime) as they + // are unreliable in Murano 1.x. + if (attr_mpipl && ec_has_pba_slvrest_bug) + { + FAPI_INF("PBA Reset Polling being skipped due to MPIPL on a chip with PBA reset bug"); + poll_failure = false; + continue; + } + // Read the reset register to check for reset completion rc = fapiGetScom(i_target, PBA_SLVRST_0x00064001 , data); if (rc) @@ -762,6 +750,7 @@ pba_slave_reset(const Target& i_target) // If slave reset in progress, wait and then poll if (data.isBitClear(4+s)) { + FAPI_INF("PBA Reset complete for Slave %d", s); poll_failure = false; break; } @@ -811,6 +800,158 @@ pba_slave_reset(const Target& i_target) } // end pba_slave_setup_reset +// ************************************************************************************************ +// **************************************************** pba_bc_stop ******************************* +// Stop the BCDE and BCUE and then poll for respective completion +fapi::ReturnCode +pba_bc_stop(const Target& i_target) +{ + fapi::ReturnCode rc; + uint32_t e_rc = 0; + ecmdDataBufferBase data(64); + uint64_t address = 0; + bool bcde_stop_complete = false; + bool bcue_stop_complete = false; + uint32_t p; + + + do + { + + FAPI_INF("Stop the BCDE and BCUE"); + address = PBA_BCDE_CTL_0x00064010; -} //end extern C + e_rc |= data.flushTo0(); + e_rc |= data.setBit(0); // Bit 0: BCDE_CTL_STOP + if (e_rc) + { + rc.setEcmdError(e_rc); + break; + } + FAPI_INF("\tStopping BCDE addr=0x%08llX, value=0x%16llX, Target = %s", + address, + data.getDoubleWord(0), + i_target.toEcmdString()); + rc = fapiPutScom(i_target, address, data); + if (!rc.ok()) + { + FAPI_ERR("fapiPutScom(addr=0x%08llX) failed, Target = %s", + address, + i_target.toEcmdString()); + break; + } + + address = PBA_BCUE_CTL_0x00064015; + e_rc |= data.flushTo0(); + e_rc |= data.setBit(0); // Bit 0: BCUE_CTL_STOP + if (e_rc) + { + rc.setEcmdError(e_rc); + break; + } + FAPI_INF("\tStopping BCUE addr=0x%08llX, value=0x%16llX, Target = %s", + address, + data.getDoubleWord(0), + i_target.toEcmdString()); + rc = fapiPutScom(i_target, address, data); + if (!rc.ok()) + { + FAPI_ERR("fapiPutScom(addr=0x%08llX) failed, Target = %s", + address, + i_target.toEcmdString()); + break; + } + + // Stopped for the BC engines is defined as the Running bit is clear + // + // The Stopped, Done and Error bits may also be on if the BCE happened + // stop before the requested transfer was complete. However, done of + // these indicators are relevent as the OCC is being reset anyway. + + for (p=0; p - + + - - REG_FFDC_PROC_PBA_REGISTERS - PBA_MODE_0x00064000 - PBA_CONFIG_0x0201084B - PBA_SLVCTL2_0x00064006 - PBA_SLVCTL0_0x00064004 - PBA_SLVCTL1_0x00064005 - PBA_SLVCTL2_0x00064006 - PBA_SLVCTL3_0x00064007 - PBA_FIR_0x02010840 - PBA_ERR_RPT0_0x0201084C - PBA_ERR_RPT1_0x0201084D - PBA_ERR_RPT2_0x0201084E - PBA_BCDE_CTL_0x00064010 - PBA_BCDE_SET_0x00064011 - PBA_BCDE_STAT_0x00064012 - PBA_BCDE_PBADR_0x00064013 - PBA_BCDE_OCIBAR_0x00064014 - PBA_BCUE_CTL_0x00064015 - PBA_BCUE_SET_0x00064016 - PBA_BCUE_STAT_0x00064017 - PBA_BCUE_PBADR_0x00064018 - PBA_BCUE_OCIBAR_0x00064019 - PBA_PBOCR0_0x00064020 - PBA_PBOCR1_0x00064021 - PBA_PBOCR2_0x00064022 - PBA_PBOCR3_0x00064023 - PBA_PBOCR4_0x00064024 - PBA_PBOCR5_0x00064025 - PBA_BAR0_0x02013F00 - PBA_BARMSK0_0x02013F04 - PBA_BAR1_0x02013F01 - PBA_BARMSK1_0x02013F05 - PBA_BAR2_0x02013F02 - PBA_BARMSK2_0x02013F06 - PBA_BAR3_0x02013F03 - PBA_BARMSK3_0x02013F07 - PBA_TRUSTMODE_0x02013F08 - - - - RC_PMPROC_PBA_INIT_INCORRECT_MODE - pba init procedure incorrect mode by calling function - PM_MODE - - CODE - HIGH - - - - - RC_PMPROC_PBA_SLAVE_RESET_TIMEOUT - pba_init timed out waited for the PBA slave to reset. - POLLCOUNT - SLAVENUM - PBASLVREG - - REG_FFDC_PROC_PBA_REGISTERS - CHIP - - - CHIP - HIGH - - - - - RC_PMPROC_PBA_SLAVE_BUSY_AFTER_RESET - pba_init detected a busy PBA slave after the slave was reset. - POLLCOUNT - SLAVENUM - PBASLVREG - - REG_FFDC_PROC_PBA_REGISTERS - CHIP - - - CHIP - HIGH - - - - + + REG_FFDC_PROC_PBA_REGISTERS + PBA_MODE_0x00064000 + PBA_CONFIG_0x0201084B + PBA_SLVCTL2_0x00064006 + PBA_SLVCTL0_0x00064004 + PBA_SLVCTL1_0x00064005 + PBA_SLVCTL2_0x00064006 + PBA_SLVCTL3_0x00064007 + PBA_FIR_0x02010840 + PBA_ERR_RPT0_0x0201084C + PBA_ERR_RPT1_0x0201084D + PBA_ERR_RPT2_0x0201084E + PBA_BCDE_CTL_0x00064010 + PBA_BCDE_SET_0x00064011 + PBA_BCDE_STAT_0x00064012 + PBA_BCDE_PBADR_0x00064013 + PBA_BCDE_OCIBAR_0x00064014 + PBA_BCUE_CTL_0x00064015 + PBA_BCUE_SET_0x00064016 + PBA_BCUE_STAT_0x00064017 + PBA_BCUE_PBADR_0x00064018 + PBA_BCUE_OCIBAR_0x00064019 + PBA_PBOCR0_0x00064020 + PBA_PBOCR1_0x00064021 + PBA_PBOCR2_0x00064022 + PBA_PBOCR3_0x00064023 + PBA_PBOCR4_0x00064024 + PBA_BAR0_0x02013F00 + PBA_BARMSK0_0x02013F04 + PBA_BAR1_0x02013F01 + PBA_BARMSK1_0x02013F05 + PBA_BAR2_0x02013F02 + PBA_BARMSK2_0x02013F06 + PBA_BAR3_0x02013F03 + PBA_BARMSK3_0x02013F07 + PBA_TRUSTMODE_0x02013F08 + + + + RC_PMPROC_PBA_INIT_INCORRECT_MODE + pba init procedure incorrect mode by calling function + PM_MODE + + CODE + HIGH + + + + + RC_PMPROC_PBA_SLAVE_RESET_TIMEOUT + pba_init timed out waited for the PBA slave to reset. + POLLCOUNT + SLAVENUM + PBASLVREG + + REG_FFDC_PROC_PBA_REGISTERS + CHIP + + + CHIP + HIGH + + + + + RC_PMPROC_PBA_SLAVE_BUSY_AFTER_RESET + pba_init detected a busy PBA slave after the slave was reset. + POLLCOUNT + SLAVENUM + PBASLVREG + + REG_FFDC_PROC_PBA_REGISTERS + CHIP + + + CHIP + HIGH + + + + + RC_PROCPM_PBA_BCDE_STOP_TIMEOUT + pba_init timed out waiting to stop the Block Copy Download Engine. + POLLCOUNT + POLLVALUE + + REG_FFDC_PROC_PBA_REGISTERS + CHIP + + + CHIP + HIGH + + + + + RC_PROCPM_PBA_BCUE_STOP_TIMEOUT + pba_init timed out waiting to stop the Block Copy Upload Engine. + POLLCOUNT + POLLVALUE + + REG_FFDC_PROC_PBA_REGISTERS + CHIP + + + CHIP + HIGH + + + + \ No newline at end of file -- cgit v1.2.1