Skip to content

Commit

Permalink
Add support for TOD osc switch interrupt
Browse files Browse the repository at this point in the history
Change-Id: I088f2131372cd74e837bc0dc8f54be875fd052aa
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57624
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Manish K. Chowdhary <manichow@in.ibm.com>
Reviewed-by: James N. Klazynski <jklazyns@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57722
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Ankit Dhingra authored and dcrowell77 committed May 31, 2018
1 parent caa0f8a commit 8a3c629
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
20 changes: 19 additions & 1 deletion src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -94,6 +94,8 @@ fapi2::ReturnCode init_tod_node(
// Timeout counter for bits that are cleared by hardware
uint32_t l_tod_init_pending_count = 0;
fapi2::buffer<uint64_t> l_tod_fsm_reg;
// Flag to check if the TOD FSM is running
bool l_tod_running = false;
FAPI_DBG("Start");

// Sequence details are in TOD Workbook section 1.6.3
Expand Down Expand Up @@ -161,12 +163,28 @@ fapi2::ReturnCode init_tod_node(
if (l_tod_fsm_reg.getBit<PERV_TOD_FSM_REG_IS_RUNNING>())
{
FAPI_DBG("TOD is running!");
l_tod_running = true;
break;
}

++l_tod_init_pending_count;
}

if (l_tod_running == false)
{
FAPI_DBG("TOD FSM failed !");
fapi2::buffer<uint64_t> l_tod_err_reg = 0;
FAPI_TRY(fapi2::getScom(*(i_tod_node->i_target),
PERV_TOD_ERROR_REG,
l_tod_err_reg),
"Error from getScom (PERV_TOD_ERROR_REG)!");

FAPI_ASSERT(!l_tod_err_reg.getBit<PERV_TOD_ERROR_ROUTING_REG_OSCSWITCH_INTERRUPT>(),
fapi2::P9_TOD_MF_CLK_FAILURE()
.set_TARGET(*(i_tod_node->i_target)),
"Interrupt from TOD Oscillator Switch");
}

FAPI_ASSERT((l_tod_init_pending_count < P9_TOD_UTIL_TIMEOUT_COUNT),
fapi2::P9_TOD_INIT_NOT_RUNNING()
.set_TARGET(*(i_tod_node->i_target))
Expand Down
28 changes: 27 additions & 1 deletion src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2017 -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2018 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -243,5 +243,31 @@
<!-- no callout, deconfig, gard tags as FW does not consume -->
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_P9_TOD_MF_CLK_FAILURE</rc>
<description>
Procedure: p9_tod_init
TOD FSM did not reach running state due
to interrupt from TOD Oscillator switch
</description>
<ffdc>TARGET</ffdc>
<collectRegisterFfdc>
<id>REG_FFDC_TOD_STATUS</id>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
<target>TARGET</target>
</collectRegisterFfdc>
<callout>
<hw>
<hwid>PCI_REF_CLOCK</hwid>
<refTarget>TARGET</refTarget>
</hw>
<priority>HIGH</priority>
</callout>
<callout>
<target>TARGET</target>
<priority>LOW</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
</hwpErrors>

0 comments on commit 8a3c629

Please sign in to comment.