From 7ee601b23595c384dcd8dfc061c9621d538a1750 Mon Sep 17 00:00:00 2001 From: nagurram-in Date: Thu, 8 Dec 2016 08:55:48 -0600 Subject: L2 fast array procedure Change-Id: Ibce0d60d85f8d26a42fef85c8f3b71b42f252363 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33589 Tested-by: Jenkins Server Reviewed-by: Shakeeb A. Pasha B K Reviewed-by: Johannes Koesters Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35793 Tested-by: FSP CI Jenkins Reviewed-by: Sachin Gupta --- .../hwp/perv/p9_sbe_fastarray_abist_catchup.C | 25 +++++++++++- .../procedures/hwp/perv/p9_sbe_fastarray_setup.C | 44 +++++++++++++++++++++- 2 files changed, 65 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_abist_catchup.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_abist_catchup.C index af0e267b..097f4d7e 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_abist_catchup.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_abist_catchup.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -39,14 +40,34 @@ // Includes //----------------------------------------------------------------------------------- #include +#include +#include fapi2::ReturnCode p9_sbe_fastarray_abist_catchup( const fapi2::Target& i_target_chiplet, const uint32_t i_clockCycles) { - FAPI_INF("Start"); - FAPI_INF("End"); + fapi2::buffer l_cc_buf = i_clockCycles; + + l_cc_buf.setBit(); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_REG0, l_cc_buf), "Failed to clock %d array cycle(s)", + i_clockCycles + 1); + + /* If we clocked more than a single cycle, do due diligence and wait for OPCG_DONE */ + if( i_clockCycles ) + { + do + { + FAPI_TRY(fapi2::getScom(i_target_chiplet, PERV_CPLT_STAT0, l_cc_buf), "Failed to read Chiplet Status 0 Register"); + } + while (!l_cc_buf.getBit()); + } + + return fapi2::FAPI2_RC_SUCCESS; + +fapi_try_exit: return fapi2::current_err; + } diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_setup.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_setup.C index 2754f0e0..56f07948 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_setup.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_fastarray_setup.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -39,13 +40,52 @@ // Includes //----------------------------------------------------------------------------------- #include +#include +#include fapi2::ReturnCode p9_sbe_fastarray_setup( const fapi2::Target& i_target_chiplet, const uint64_t i_clock_regions) { - FAPI_INF("Start"); - FAPI_INF("End"); + fapi2::buffer buf; + + /* Set up ABIST engine */ + /* TODO: currently set up from the outside */ + + /* Set up clock controller to do single BIST pulses */ + FAPI_TRY(fapi2::getScom(i_target_chiplet, PERV_OPCG_ALIGN, buf), "Failed to read OPCG_ALIGN register"); + buf.insertFromRight(5) + .insertFromRight(7); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_ALIGN, buf), "Failed to update OPCG_ALIGN register"); + + buf = i_clock_regions; + buf.setBit() + .setBit() + .setBit(); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_CLK_REGION, buf), "Failed to set up clock regions"); + + buf = i_clock_regions; + buf.setBit() + .setBit(); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_BIST, buf), "Failed to set up BIST register"); + + buf.flush<0>(); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_REG1, buf), "Failed to clear OPCG_REG1"); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_REG2, buf), "Failed to clear OPCG_REG2"); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT3, buf), "Failed to clear OPCG_CAPT3"); + + buf.flush<0>() + .insertFromRight(1) + .insertFromRight(0x1C); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT1, buf), "Failed to set up OPCG_CAPT1"); + + buf.flush<0>() + .insertFromRight(0x1C); + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_OPCG_CAPT2, buf), "Failed to set up OPCG_CAPT2"); + + return fapi2::FAPI2_RC_SUCCESS; + +fapi_try_exit: return fapi2::current_err; } -- cgit v1.2.1