From 397e4a685a0a153e2ebeadd565ff9142215eae77 Mon Sep 17 00:00:00 2001 From: Yue Du Date: Thu, 23 Mar 2017 12:31:37 -0500 Subject: STOP: Conditional compile current error check to save cme size Change-Id: I53449f6d9f5bf75fbf124f54b20773bf820c576b Original-Change-Id: I46f19d388c6fdf16ae6865864cd648ecc707ba20 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38366 Dev-Ready: YUE DU Tested-by: Jenkins Server Reviewed-by: Michael S. Floyd Reviewed-by: Jennifer A. Stofer --- .../ppe_closed/cme/stop_cme/p9_cme_stop_entry.c | 53 ++++++++++++++++++++++ .../ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c | 8 ++++ 2 files changed, 61 insertions(+) diff --git a/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c b/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c index c0c0d3d1..9be3f7ab 100755 --- a/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c +++ b/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c @@ -1172,6 +1172,33 @@ p9_cme_stop_entry() scom_data.words.upper = SSH_ACT_LV5_COMPLETE; CME_PUTSCOM(PPM_SSHSRC, core, scom_data.value); +#if DEBUG_RUNTIME_STATE_CHECK + + if (core & CME_MASK_C0) + { + CME_GETSCOM(CPPM_CPMMR, CME_MASK_C0, CME_SCOM_AND, scom_data.value); + + if ((scom_data.words.upper & BIT32(13))) + { + PKTRACE("ERROR: C0 notify was already set?"); + pk_halt(); + + } + } + + if (core & CME_MASK_C1) + { + CME_GETSCOM(CPPM_CPMMR, CME_MASK_C1, CME_SCOM_AND, scom_data.value); + + if ((scom_data.words.upper & BIT32(13))) + { + PKTRACE("ERROR: C1 notify was already set?"); + pk_halt(); + } + } + +#endif + PK_TRACE("Send PCB interrupt per core via PIG, select irq type via CPMMR[10]"); for (core_mask = 2; core_mask; core_mask--) @@ -1201,6 +1228,32 @@ p9_cme_stop_entry() PK_TRACE("Switch Core%d PPM wakeup to STOP-GPE via CPMMR[13]", core); CME_PUTSCOM(CPPM_CPMMR_OR, core, BIT64(13)); +#if DEBUG_RUNTIME_STATE_CHECK + + if (core & CME_MASK_C0) + { + CME_GETSCOM(CPPM_CPMMR, CME_MASK_C0, CME_SCOM_AND, scom_data.value); + + if (!(scom_data.words.upper & BIT32(13))) + { + PKTRACE("ERROR: C0 notify fail to set"); + pk_halt(); + + } + } + + if (core & CME_MASK_C1) + { + CME_GETSCOM(CPPM_CPMMR, CME_MASK_C1, CME_SCOM_AND, scom_data.value); + + if (!(scom_data.words.upper & BIT32(13))) + { + PKTRACE("ERROR: C1 notify fail to set"); + pk_halt(); + } + } + +#endif PK_TRACE_INF("SE5.B: Handed off to SGPE"); diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c index a8ecfe19..ed055ab5 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c @@ -327,6 +327,8 @@ p9_sgpe_stop_entry() continue; } +#if DEBUG_RUNTIME_STATE_CHECK + GPE_GETSCOM(GPE_SCOM_ADDR_CORE(CPPM_CPMMR, ((qloop << 2) + cloop)), scom_data.value); @@ -336,6 +338,8 @@ p9_sgpe_stop_entry() pk_halt(); } +#endif + PK_TRACE("Update STOP history on core[%d]: in transition of entry", ((qloop << 2) + cloop)); scom_data.words.lower = 0; @@ -472,6 +476,8 @@ p9_sgpe_stop_entry() continue; } +#if DEBUG_RUNTIME_STATE_CHECK + GPE_GETSCOM(GPE_SCOM_ADDR_CORE(CPPM_CPMMR, ((qloop << 2) + cloop)), scom_data.value); @@ -481,6 +487,8 @@ p9_sgpe_stop_entry() pk_halt(); } +#endif + // request levle already set by CME // shift by 2 == times 4, which is cores per quad PK_TRACE("Update STOP history on core[%d]: in stop level 8", -- cgit v1.2.3