Skip to content

Commit

Permalink
STOP: Clear CPPM_PECES on entry during power save cycle to prevent wa…
Browse files Browse the repository at this point in the history
…keup events

During the power save cycle, clear stop exit enables to prevent a hw generated
wakeup pig from overwriting the stop entry request.    In this mode, SGPE will
read the per thread PSCR information and restore the PECE Shadow

Key_Cronus_Test=PM_REGRESS

Change-Id: I2521b38918f23c5dac4aefc59968ead05ad29b4d
CQ: SW433304
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60975
Tested-by: Jenkins Server <[email protected]>
Reviewed-by: Gregory S. Still <[email protected]>
Tested-by: FSP CI Jenkins <[email protected]>
Tested-by: Cronus HW CI <[email protected]>
Reviewed-by: YUE DU <[email protected]>
Reviewed-by: Jennifer A. Stofer <[email protected]>
  • Loading branch information
vanderp authored and op-jenkins committed Jun 29, 2018
1 parent 016a745 commit e3d105d
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,15 @@ p9_cme_stop_entry()

pig.fields.req_intr_payload = G_cme_stop_record.req_level[core_index];


// If in block wakeup mode, disable all interrupts so the PPM PIG doesn't
// send one that could overwrite the stop entry request
// The SGPE will restore the CPPM PECE Shadow
if (G_cme_stop_record.core_blockwu & core_mask)
{
CME_PUTSCOM(CPPM_PECES, core_mask, BITS64(32, 4));
}

// put PIG and Wakeup_Notify_Select back to back as possible
send_pig_packet(pig.value, core_mask);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,125 @@ p9_sgpe_stop_entry()
}
}

for (qloop = 0; qloop < MAX_QUADS; qloop++)
{
// if this ex is not up to entry, skip
if (!(ex = G_sgpe_stop_record.group.ex01[qloop]))
{
continue;
}

// If this quad is in block exit, copy the PSCR information back to the CPPM PECE Shadow
// Bit 8:13 correspond to 0:5, 8:13, 16:21, and 24:29. Bit 3 corresponds to 32,33,34,35
if (G_sgpe_stop_record.group.quad[VECTOR_BLOCKX] & BIT32(qloop))
{
if (G_sgpe_stop_record.group.ex01[qloop] & FST_EX_IN_QUAD)
{

cindex = qloop << 2;

if (G_sgpe_stop_record.group.core[VECTOR_CONFIG] & BIT32(cindex))
{
temp_data.value = 0;
GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS00, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) << 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 3;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS01, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6));
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 2;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS02, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 1;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS03, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 16;
temp_data.words.lower = (scom_data.words.upper & BIT32(3));

GPE_PUTSCOM(GPE_SCOM_ADDR_CORE(CPPM_PECES, cindex), temp_data.value);
}

cindex = (qloop << 2) + 1;

if (G_sgpe_stop_record.group.core[VECTOR_CONFIG] & BIT32(cindex))
{
temp_data.value = 0;
GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS10, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) << 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 3;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS11, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6));
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 2;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS12, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 1;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS13, qloop, 0), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 16;
temp_data.words.lower = (scom_data.words.upper & BIT32(3));

GPE_PUTSCOM(GPE_SCOM_ADDR_CORE(CPPM_PECES, cindex), temp_data.value);
}
}

if (G_sgpe_stop_record.group.ex01[qloop] & SND_EX_IN_QUAD)
{
cindex = (qloop << 2) + 2;

if (G_sgpe_stop_record.group.core[VECTOR_CONFIG] & BIT32(cindex))
{
temp_data.value = 0;
GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS00, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) << 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 3;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS01, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6));
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 2;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS02, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 1;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS03, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 16;
temp_data.words.lower = (scom_data.words.upper & BIT32(3));

GPE_PUTSCOM(GPE_SCOM_ADDR_CORE(CPPM_PECES, cindex), temp_data.value);
}

cindex = (qloop << 2) + 3;

if (G_sgpe_stop_record.group.core[VECTOR_CONFIG] & BIT32(cindex))
{
temp_data.value = 0;
GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS10, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) << 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 3;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS11, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6));
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 2;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS12, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 8;
temp_data.words.lower = (scom_data.words.upper & BIT32(3)) << 1;

GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_PSCRS13, qloop, 1), scom_data.value);
temp_data.words.upper = (scom_data.words.upper & BITS32(8, 6)) >> 16;
temp_data.words.lower = (scom_data.words.upper & BIT32(3));

GPE_PUTSCOM(GPE_SCOM_ADDR_CORE(CPPM_PECES, cindex), temp_data.value);
}
}

PK_TRACE("Restored PECES due to block wakeup being active");

}
}


// Permanent workaround to save cme image size
Expand Down

0 comments on commit e3d105d

Please sign in to comment.