Skip to content

Commit

Permalink
p9_common_poweronoff: delay 10us/40k simcycles between FSM idle polling
Browse files Browse the repository at this point in the history
Change-Id: I296ffb4520f276fc0ed8594122b59367c5b3e04e
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28271
Reviewed-by: Kevin F. Reick <reick@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: YUE DU <daviddu@us.ibm.com>
Reviewed-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36095
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Joe Dery authored and dcrowell77 committed Feb 11, 2017
1 parent c912e95 commit fc98a85
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/import/chips/p9/procedures/hwp/lib/p9_common_poweronoff.C
Expand Up @@ -67,8 +67,8 @@ const uint64_t PPM_PFSNS[2] = { C_PPM_PFSNS,
EQ_PPM_PFSNS
};

enum { CYCLES_PER_MS = 500000,
INST_PER_LOOP = 8,
enum { FSM_IDLE_POLLING_HW_NS_DELAY = 10000,
FSM_IDLE_POLLING_SIM_CYCLE_DELAY = 40000,
PFET_STATE_LENGTH = 2,
VXX_PG_SEL_LEN = 4
};
Expand Down Expand Up @@ -158,11 +158,14 @@ p9_common_poweronoff(
// Poll for PFETCNTLSTAT_REG[VDD_PG_STATE] for 0b1000 (FSM idle)
// – Timeout value = 1ms
FAPI_DBG("Polling for power gate sequencer state: FSM idle");
l_loopsPerMs = CYCLES_PER_MS / INST_PER_LOOP;
l_loopsPerMs = 1E6 / FSM_IDLE_POLLING_HW_NS_DELAY;

// Note that the Lamda assumes that l_data already contains the
do
{
fapi2::delay(FSM_IDLE_POLLING_HW_NS_DELAY,
FSM_IDLE_POLLING_SIM_CYCLE_DELAY);

FAPI_TRY(fapi2::getScom(i_target, PPM_PFCS[l_type], l_data),
"getScom failed for address PPM_PFCS"); // poll
}
Expand Down Expand Up @@ -200,13 +203,16 @@ p9_common_poweronoff(
// Poll for PFETCNTLSTAT_REG[VDD_PG_STATE] for 0b1000 (FSM idle)
// – Timeout value = 1ms
FAPI_DBG("Polling for power gate sequencer state: FSM idle");
l_loopsPerMs = CYCLES_PER_MS / INST_PER_LOOP;
l_loopsPerMs = 1E6 / FSM_IDLE_POLLING_HW_NS_DELAY;

do
{
fapi2::delay(FSM_IDLE_POLLING_HW_NS_DELAY,
FSM_IDLE_POLLING_SIM_CYCLE_DELAY);

FAPI_TRY(fapi2::getScom(i_target, PPM_PFCS[l_type], l_data),
"getScom failed for address PPM_PFCS"); // poll
FAPI_DBG("timeout l_loopsPerMs. %x", l_loopsPerMs);
//FAPI_DBG("timeout l_loopsPerMs. %x", l_loopsPerMs);
}
while ((l_data.getBit < VCS_PG_STATE_BIT + PG_STATE_IDLE_OFFSET > ()
== 0 ) && (--l_loopsPerMs != 0));
Expand Down

0 comments on commit fc98a85

Please sign in to comment.