Skip to content

Commit

Permalink
p9_pm_pstate_gpe_init and p9_pm_pba_init updates for PGPE booting
Browse files Browse the repository at this point in the history
- Allocated PBA Slave 2 to PGPE for both booting and runtime.
- Setup PBA Slave 1 for GPE1 for use by OCC FW during run-time
- Added debug halt detection for lab use
- Typos from comments
- Made stand-alone with p9_hcd_common.H updates

Change-Id: I6c7513c0dff9d4fb53c8320f1ed78cf7fdbe0fc8
Original-Change-Id: I9df3676c9f58cbced49f0a5605be0d787fa930c7
RTC: 168104
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35547
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: AMIT KUMAR <akumar3@us.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Reviewed-by: Sangeetha T S <sangeet2@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37045
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
stillgs authored and dcrowell77 committed Feb 27, 2017
1 parent 36168f2 commit d9739e6
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 10 deletions.
11 changes: 10 additions & 1 deletion src/import/chips/p9/procedures/hwp/lib/p9_hcd_common.H
Expand Up @@ -234,7 +234,16 @@ enum P9_HCD_SCAN0_CONSTANTS
// XSR defines
enum XSR_DEFS
{
HALTED_STATE = 0
HALTED_STATE = 0,
HALT_CONDITION_START = 1,
HALT_CONDITION_LEN = 3,
XCR_CMD_HALT = 1,
WDT_HALT = 2,
UMI_HALT = 3,
DEBUG_HALT = 4,
DBCR_HALT = 5,
INPUT_HALT = 6,
HW_FAILURE = 7
};

// XCR defines
Expand Down
29 changes: 22 additions & 7 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_pstate_gpe_init.C
Expand Up @@ -71,7 +71,8 @@ fapi2::ReturnCode pstate_gpe_init(
fapi2::buffer<uint64_t> l_xcr;
fapi2::buffer<uint64_t> l_xsr;
fapi2::buffer<uint64_t> l_ivpr;
uint32_t l_ivpr_offset;
uint32_t l_ivpr_offset = 0;
uint32_t l_xsr_halt_condition = 0;
uint32_t l_timeout_counter = TIMEOUT_COUNT;

FAPI_IMP(">> pstate_gpe_init......");
Expand Down Expand Up @@ -120,13 +121,22 @@ fapi2::ReturnCode pstate_gpe_init(
(l_xsr.getBit<p9hcd::HALTED_STATE>() != 1) &&
(--l_timeout_counter != 0));

if(( 1 == l_occ_scratch2.getBit<p9hcd::PGPE_ACTIVE>() ))
{
FAPI_INF("PGPE was activated successfully!!!!");
}
// Extract the halt condition
l_xsr.extractToRight<uint32_t>(l_xsr_halt_condition,
p9hcd::HALT_CONDITION_START,
p9hcd::HALT_CONDITION_LEN);
FAPI_DBG("halt state: XSR: 0x%016lx condition: %d",
l_xsr, l_xsr_halt_condition);

// Check for a debug halt condition
FAPI_ASSERT(!((l_xsr.getBit<p9hcd::HALTED_STATE>() == 1) &&
((l_xsr_halt_condition == p9hcd::DEBUG_HALT ||
l_xsr_halt_condition == p9hcd::DBCR_HALT) )),
fapi2::PSTATE_GPE_INIT_DEBUG_HALT(),
"Pstate GPE Debug Halt detected");

// @todo 146665 Need to collect PGPE state. Operations to PPEs should
// use a p9ppe namespace clase when created
// use a p9ppe namespace class when created

// When PGPE fails to boot, assert out
FAPI_ASSERT((l_timeout_counter != 0 &&
Expand All @@ -135,6 +145,11 @@ fapi2::ReturnCode pstate_gpe_init(
fapi2::PSTATE_GPE_INIT_TIMEOUT(),
"Pstate GPE Init timeout");

if(( 1 == l_occ_scratch2.getBit<p9hcd::PGPE_ACTIVE>() ))
{
FAPI_INF(" PGPE was activated successfully!!!!");
}

fapi_try_exit:
FAPI_IMP("<< pstate_gpe_init......");
return fapi2::current_err;
Expand Down Expand Up @@ -248,6 +263,6 @@ fapi2::ReturnCode p9_pm_pstate_gpe_init(
}

fapi_try_exit:
FAPI_INF("< p9_pm_pstate_gpe_init");
FAPI_IMP("< p9_pm_pstate_gpe_init");
return fapi2::current_err;
}
Expand Up @@ -39,36 +39,78 @@
<description>Unknown mode passed to p9_pm_pstate_gpe_init.
</description>
<ffdc>BADMODE</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_PSTATE_GPE_INIT_TIMEOUT</rc>
<description> Pstate GPE init timedout while waiting for PGPE ACtive in OCCFLG register.
<description> Pstate GPE init timed out while waiting for PGPE ACtive in OCC
SCRATCH2.
</description>
<collectRegisterFfdc>
<id>ERROR_STATUS_OF_PGPE</id>
<target>CHIP</target>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
</collectRegisterFfdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_PSTATE_GPE_INIT_DEBUG_HALT</rc>
<description> Pstate GPE init detected a Debug Halt condition. This should only
assert in a development debug environment.
</description>
<collectRegisterFfdc>
<id>ERROR_STATUS_OF_PGPE</id>
<target>CHIP</target>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
</collectRegisterFfdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_PSTATE_GPE_RESET_TIMEOUT</rc>
<description> Pstate GPE init timedout while waiting for HALT status in XSR register.
<description> Pstate GPE init timed out while waiting for HALT status in XSR register.
</description>
<collectRegisterFfdc>
<id>ERROR_STATUS_OF_PGPE</id>
<target>CHIP</target>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
</collectRegisterFfdc>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
<callout>
<target>TARGET</target>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_PSTATE_GPE_PBA_INIT_FAILED</rc>
<description> Pstate GPE called to p9_pm_pba_init failed.
</description>
<!-- @todo RTC 168127 Create a PBA collectRegister Ffdc element to call -->
<ffdc>TARGET</ffdc>
<ffdc>MODE</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
<callout>
<target>TARGET</target>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- ******************************************************************** -->
</hwpErrors>

0 comments on commit d9739e6

Please sign in to comment.