From 29dc73e65524295f14b624fdb86c2f0de5875ad2 Mon Sep 17 00:00:00 2001 From: Joachim Fenkes Date: Tue, 7 Feb 2017 16:37:44 +0100 Subject: p9_fastarray: Fix scanning after dump, make dump repeatable Change the cleanup code to let the ABIST run to completion and deassert ABIST mode, so that the ABIST engines end up in a clean state, enabling repeated dumps of the same core. Also leaving ABIST mode asserted caused scan access to ec_abst to fail -- this is fixed now too. Plus add an option to the wrapper to force non-sparse scanning. Change-Id: I3eac75878e589e13a506eb67031778964e6770ab Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36029 Reviewed-by: NAGENDRA K. GURRAM Reviewed-by: Sachin Gupta Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36045 Reviewed-by: Hostboot Team Tested-by: FSP CI Jenkins --- .../procedures/hwp/perv/p9_sbe_fastarray_cleanup.C | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/import/chips/p9/procedures') diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_cleanup.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_cleanup.C index 311ef67a..c0b18fcd 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_cleanup.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_cleanup.C @@ -38,7 +38,8 @@ //----------------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------------- -#include +#include "p9_sbe_fastarray_cleanup.H" +#include "p9_sbe_fastarray_abist_catchup.H" #include #include @@ -50,11 +51,25 @@ fapi2::ReturnCode p9_sbe_fastarray_cleanup( const fapi2::Target& i_target_chiplet) { - /* Clean up clock controller */ - fapi2::buffer buf = 0; - FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_CLK_REGION, buf), "Failed to clear clock regions"); - FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT1, buf), "Failed to clear OPCG_CAPT1"); - FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT2, buf), "Failed to clear OPCG_CAPT2"); + fapi2::buffer l_buf; + + /* Let ABIST engines run to completion */ + do + { + FAPI_TRY(p9_sbe_fastarray_abist_catchup(i_target_chiplet, 0xFFF), "Failed to clock ABIST to completion"); + FAPI_TRY(fapi2::getScom(i_target_chiplet, PERV_CPLT_STAT0, l_buf), "Failed to read Chiplet Status 0 Register"); + } + while (!l_buf.getBit()); + + /* Disable ABIST and clock engines so they can cleanly reset */ + l_buf = 0; + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_BIST, l_buf), "Failed to clear BIST reg"); + FAPI_TRY(p9_sbe_fastarray_abist_catchup(i_target_chiplet, 0xFF), "Failed to clock ABIST engine reset"); + + /* Clean up the clock controller */ + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_CLK_REGION, l_buf), "Failed to clear clock regions"); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT1, l_buf), "Failed to clear OPCG_CAPT1"); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT2, l_buf), "Failed to clear OPCG_CAPT2"); return fapi2::FAPI2_RC_SUCCESS; -- cgit v1.2.1