Skip to content

Commit

Permalink
CME/SGPE: STOP Images functional bug fix collection
Browse files Browse the repository at this point in the history
Change-Id: I2bd4631c5bdff525fcd28dd26b7cc3faf7f758d7
Original-Change-Id: I3858a93ade6f21c006c980a497f58d6dafd9b628
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27000
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
  • Loading branch information
davidduyue authored and op-jenkins committed Aug 22, 2018
1 parent bc9bb57 commit 79e84aa
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 62 deletions.
131 changes: 70 additions & 61 deletions import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,75 +505,79 @@ p9_cme_stop_entry()
//----------------------------------------------------------------------
// STOP LEVEL 3
//----------------------------------------------------------------------
/*
if (target_level == 3)
{

//==========================
MARK_TAG(SE_CORE_VMIN, core)
//==========================
if (target_level == 3)
{

PK_TRACE("SE3.a");
// Enable IVRM if not already
//==========================
MARK_TAG(SE_CORE_VMIN, core)
//==========================

PK_TRACE("SE3.b");
// Drop to Vmin
PK_TRACE("SE3.a");
// Enable IVRM if not already

if(core & CME_MASK_C0)
{
G_cme_stop_record.act_level_c0 = STOP_LEVEL_3;
}
PK_TRACE("SE3.b");

if(core & CME_MASK_C1)
{
G_cme_stop_record.act_level_c1 = STOP_LEVEL_3;
}
// Drop to Vmin
/*
if(core & CME_MASK_C0)
{
G_cme_stop_record.act_level_c0 = STOP_LEVEL_3;
}
//===========================
MARK_TAG(SE_STOP3_DONE, core)
//===========================
PK_TRACE("SE3.c");
// Update Stop History: In Core Stop Level 3
CME_STOP_UPDATE_HISTORY(core,
STOP_CORE_IS_GATED,
STOP_TRANS_COMPLETE,
target_level,
STOP_LEVEL_3,
STOP_REQ_DISABLE,
STOP_ACT_ENABLE);
// If both cores targeting different levels
// deeper core should have at least deeper stop level than 3
// only need to modify deeper core history if another one was done
if (deeper_core)
{
CME_STOP_UPDATE_HISTORY(deeper_core,
if(core & CME_MASK_C1)
{
G_cme_stop_record.act_level_c1 = STOP_LEVEL_3;
}
//===========================
MARK_TAG(SE_STOP3_DONE, core)
//===========================
PK_TRACE("SE3.c");
// Update Stop History: In Core Stop Level 3
CME_STOP_UPDATE_HISTORY(core,
STOP_CORE_IS_GATED,
STOP_TRANS_ENTRY,
deeper_level,
STOP_LEVEL_2,
STOP_TRANS_COMPLETE,
target_level,
STOP_LEVEL_3,
STOP_REQ_DISABLE,
STOP_ACT_ENABLE);
// from now on, proceed with only deeper core
core = deeper_core;
target_level = deeper_level;
deeper_level = 0;
deeper_core = 0;
entry_ongoing = 1;
}
else
{
entry_ongoing = 0;
}
*/
// If both cores targeting different levels
// deeper core should have at least deeper stop level than 3
// only need to modify deeper core history if another one was done
if (deeper_core)
{
/*
CME_STOP_UPDATE_HISTORY(deeper_core,
STOP_CORE_IS_GATED,
STOP_TRANS_ENTRY,
deeper_level,
STOP_LEVEL_2,
STOP_REQ_DISABLE,
STOP_ACT_ENABLE);
*/
// from now on, proceed with only deeper core
core = deeper_core;
target_level = deeper_level;
deeper_level = 0;
deeper_core = 0;
entry_ongoing = 1;
}
else
{
entry_ongoing = 0;
}

// If we are done at STOP level 3
if (!entry_ongoing)
{
break;
}
}

// If we are done at STOP level 3
if (!entry_ongoing)
{
break;
}
}
*/
//----------------------------------------------------------------------
// STOP LEVEL 4
//----------------------------------------------------------------------
Expand Down Expand Up @@ -748,12 +752,14 @@ p9_cme_stop_entry()
if (!core_aborted &&
(in32(CME_LCL_EINR) & BITS32(12, 6)))
{
if (in32(CME_LCL_EINR) & IRQ_VEC_WAKE_C0)
if (in32(CME_LCL_EINR) &
(((core & CME_MASK_C0) ? BIT32(12) : 0) | BIT32(14) | BIT32(16)))
{
core_aborted |= CME_MASK_C0;
}

if (in32(CME_LCL_EINR) & IRQ_VEC_WAKE_C1)
if (in32(CME_LCL_EINR) &
(((core & CME_MASK_C1) ? BIT32(13) : 0) | BIT32(15) | BIT32(17)))
{
core_aborted |= CME_MASK_C1;
}
Expand All @@ -780,6 +786,9 @@ p9_cme_stop_entry()
MARK_TAG(SE_PURGE_L2_DONE, core_aborted ? core_aborted : CME_MASK_BC)
//===============================================================

// if core = 3 aborted = 1, core = 2(sgpe handoff) aborted (cme wakeup)
// if core = 1 aborted = 1, core = 0(break) aborted (cme wakeup)
// if core = 1 aborted = 2, core = 1(sgpe handoff) aborted (sgpe wakeup)
if (core != core_aborted)
{
core &= ~core_aborted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

/// Macro to update STOP History
#define SGPE_STOP_UPDATE_HISTORY(id,base,gated,trans,req_l,act_l,req_e,act_e) \
hist.value = 0; \
hist.fields.stop_gated = gated; \
hist.fields.stop_transition = trans; \
hist.fields.req_stop_level = req_l; \
Expand All @@ -132,7 +133,7 @@ enum SGPE_STOP_IRQ_PAYLOAD_MASKS
TYPE2_PAYLOAD_EXIT_EVENT = 0xC00,
TYPE2_PAYLOAD_STOP_LEVEL = 0xF,
TYPE3_PAYLOAD_EXIT_EVENT = 0xC00,
TYPE6_PAYLOAD_EXIT_EVENT = 0xC00
TYPE6_PAYLOAD_EXIT_EVENT = 0xF
};

enum SGPE_STOP_EVENT_LEVELS
Expand All @@ -141,6 +142,15 @@ enum SGPE_STOP_EVENT_LEVELS
LEVEL_EQ_BASE = 11
};

enum SGPE_STOP_CME_FLAGS
{
CME_CORE0_ENTRY_FIRST = BIT64(28),
CME_CORE1_ENTRY_FIRST = BIT64(29),
CME_CORE0_ENABLE = BIT64(30),
CME_CORE1_ENABLE = BIT64(31),
CME_EX1_INDICATOR = BIT64(26)
};

enum SGPE_STOP_PSCOM_MASK
{
PSCOM_MASK_ALL_L2 = BITS64(2, 2) | BITS64(10, 2),
Expand Down

0 comments on commit 79e84aa

Please sign in to comment.