From c964a864cd5954e251a00271a12fe71b9d7dc9f0 Mon Sep 17 00:00:00 2001 From: crgeddes Date: Thu, 20 Jul 2017 16:18:01 -0500 Subject: [PATCH] Clear out OCC Flag register during pm_reset Following a powman_suspend we were seeing issues where the OCC was resetting itself up in runtime because the pgpe still had the flags set to put itself in suspend. So when PHYP started the GPEs PGPE went into suspend and caused the OCC to reset into Safe mode. Clearing this register will avoid the pgpe going into suspend. Change-Id: Id0c64007ccfbbb8441f28fef543f6d232c06ffc1 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43399 Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Sachin Gupta Reviewed-by: Michael S. Floyd Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43404 Reviewed-by: Hostboot Team Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes --- src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C index 77e8308dd47..143e7797d86 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C @@ -109,11 +109,14 @@ fapi2::ReturnCode p9_pm_reset( FAPI_TRY(l_rc, "ERROR: Failed to mask OCC FIRs."); FAPI_TRY(p9_pm_glob_fir_trace(i_target, "After masking FIRs")); - // Clear the OCC's PIB I2C engine locks. - // All other OCC owned flag bits are retained. - l_data64.setBit<17>().setBit<19>().setBit<21>(); - FAPI_TRY(fapi2::putScom(i_target, PU_OCB_OCI_OCCFLG_SCOM1, l_data64), - "ERROR: Failed to write to OCC FLAG"); + // Clear the OCC Flag and Scratch2 registers + // which contain runtime settings and modes for PM GPEs (Pstate and Stop functions) + l_data64.flush<0>(); + FAPI_TRY(fapi2::putScom(i_target, PU_OCB_OCI_OCCFLG_SCOM, l_data64), + "ERROR: Failed to write to OCC Flag Register"); + + FAPI_TRY(fapi2::putScom(i_target, PU_OCB_OCI_OCCS2_SCOM, l_data64), + "ERROR: Failed to write to OCC Scratch2 Register"); // ************************************************************************ // Halt the OCC PPC405 and reset it safely