Skip to content

Commit bc04b3a

Browse files
davidduyueop-jenkins
authored andcommitted
PFET: detect bad pfet through cme sgpe plumbling
- checks for PFET Sense enable/disable ever being the same - check at STOP power on and power off - add FIT routine to peform check upon each interval - if checks fail, mark the core in a CME scratch reg and halt - CME halt is noticed by SGPE. SGPE checks the CME scratch reg for either core to be marked. Sets OCC LFIR[61] to id PFET issue. - Use CPMMR bit5:6 instead of scratch1 reg for pfet failure bits OCC LFIR bit will be used by p9_pm_callout to log PFET related errors by core. (not in this commit). Change-Id: I86a06ad951cbe879f06ace10cd40a0a484454f23 CQ:SW508755 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/104675 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: Gregory S Still <stillgs@us.ibm.com> Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com> Reviewed-by: NAREN A DEVAIAH <naren.devaiah@in.ibm.com>
1 parent 071b078 commit bc04b3a

15 files changed

+187
-48
lines changed

import/chips/p9/procedures/hwp/lib/p9_pm_hcd_flags.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ enum PM_GPE_OCC_SCRATCH2_DEFS
102102
PGPE_SAFE_MODE_ERROR = 14,
103103
PM_DEBUG_HALT_ENABLE = 15,
104104
CORE_THROTTLE_CONTINUOUS_CHANGE_ENABLE = 16,
105+
CME_PFET_DELAY_TO_TIMEOUT = 20,
106+
CME_PFET_TIMEOUT_INJECTION = 21,
105107
PGPE_OP_TRACE_DISABLE = 24,
106108
PGPE_OP_TRACE_MEM_MODE = 25
107109

@@ -130,6 +132,8 @@ enum PM_CME_FLAGS_DEFS
130132
CME_FLAGS_SAFE_MODE = 16,
131133
CME_FLAGS_PSTATES_SUSPENDED = 17,
132134
CME_FLAGS_DB0_COMM_RECV_STARVATION_CNT_ENABLED = 18,
135+
CME_FLAGS_PFET_FIT_INJECTION = 20,
136+
CME_FLAGS_PFET_TIMEOUT_INJECTION = 21,
133137
CME_FLAGS_SPWU_CHECK_ENABLE = 22,
134138
CME_FLAGS_BLOCK_ENTRY_STOP11 = 23,
135139
CME_FLAGS_PSTATES_ENABLED = 24,

import/chips/p9/procedures/ppe_closed/cme/cme_panic_codes.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2018 */
8+
/* COPYRIGHT 2016,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -57,7 +57,7 @@ CME_PVREF_FAIL_DETECTED = 0x1c0d,
5757
CME_OCC_HEARTBEAT_LOST_DETECTED = 0x1c1c,
5858
CME_CORE_CHECKSTOP_DETECTED = 0x1c1d,
5959
CME_BAD_DD_LEVEL = 0x1c1e,
60-
//_UNUSED_1c1f = 0x1c1f,
60+
CME_BAD_PFET = 0x1c1f,
6161
//
6262
CME_STOP_EXIT_PHANTOM_WAKEUP = 0x1d00, // Stop Error
6363
CME_STOP_EXIT_BCE_SCOM_FAILED = 0x1d01,
@@ -66,14 +66,14 @@ CME_STOP_EXIT_STARTCLK_FAILED = 0x1d03,
6666
CME_STOP_EXIT_STARTCLK_XSTOP_ERROR = 0x1d04,
6767
CME_STOP_EXIT_SCOM_RES_XSTOP_ERROR = 0x1d05,
6868
CME_STOP_SPWU_PROTOCOL_ERROR = 0x1d06,
69-
//_UNUSED_1d07 = 0x1d07,
69+
CME_PFET_ENTRY_SENSE_TIMEOUT = 0x1d07,
7070
CME_STOP_ENTRY_STOPCLK_FAILED = 0x1d08,
7171
CME_STOP_ENTRY_XSTOP_ERROR = 0x1d09, // NDD1
7272
CME_STOP_ENTRY_TRAP_INJECT = 0x1d0a,
7373
CME_STOP_ENTRY_HANDOFF_LESSTHAN5 = 0x1d0d,
74-
//_UNUSED_1d1c = 0x1d1c,
75-
//_UNUSED_1d1d = 0x1d1d,
76-
//_UNUSED_1d1e = 0x1d1e,
74+
CME_PFET_EXIT_SENSE_TIMEOUT = 0x1d1c,
75+
CME_PFET_EXIT_SENSE_TIMEOUT_INJECT = 0x1d1d,
76+
CME_PFET_EXIT_SENSE_FIT_INJECT = 0x1d1e,
7777
//_UNUSED_1d1f = 0x1d1f,
7878

7979
CME_PSTATE_RESCLK_ENABLED_AT_BOOT = 0x1e00, // Pstate Error

import/chips/p9/procedures/ppe_closed/cme/p9_cme.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2017,2018 */
8+
/* COPYRIGHT 2017,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -42,6 +42,7 @@ extern uint32_t G_CME_LCL_FLAGS;
4242
extern uint32_t G_CME_LCL_FLAGS_CLR;
4343
extern uint32_t G_CME_LCL_FLAGS_OR;
4444
extern uint32_t G_CME_LCL_SRTCH0;
45+
extern uint32_t G_CME_LCL_SRTCH1;
4546
extern uint32_t G_CME_LCL_TSEL;
4647
extern uint32_t G_CME_LCL_TBR;
4748
extern uint32_t G_CME_LCL_DBG;

import/chips/p9/procedures/ppe_closed/cme/p9_cme_iota_main.c

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2017,2019 */
8+
/* COPYRIGHT 2017,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -61,6 +61,7 @@ uint32_t G_CME_LCL_FLAGS = CME_LCL_FLAGS;
6161
uint32_t G_CME_LCL_FLAGS_CLR = CME_LCL_FLAGS_CLR;
6262
uint32_t G_CME_LCL_FLAGS_OR = CME_LCL_FLAGS_OR;
6363
uint32_t G_CME_LCL_SRTCH0 = CME_LCL_SRTCH0;
64+
uint32_t G_CME_LCL_SRTCH1 = CME_LCL_SRTCH1;
6465
uint32_t G_CME_LCL_TSEL = CME_LCL_TSEL;
6566
uint32_t G_CME_LCL_TBR = CME_LCL_TBR;
6667
uint32_t G_CME_LCL_DBG = CME_LCL_DBG;
@@ -88,6 +89,35 @@ void fit_handler()
8889
data64_t scom_data;
8990
scom_data.value = 0;
9091

92+
if( in32(G_CME_LCL_FLAGS) & BIT32(CME_FLAGS_PFET_FIT_INJECTION) )
93+
{
94+
// Inject Core 0 as bad
95+
CME_PUTSCOM_NOP(CPPM_CPMMR_OR, CME_MASK_C0, BIT64(5));
96+
PK_PANIC(CME_PFET_EXIT_SENSE_FIT_INJECT);
97+
}
98+
99+
CME_GETSCOM(PPM_PFSNS, CME_MASK_C0, scom_data);
100+
101+
if( ( ( ( scom_data.words.upper & BIT32(0) ) == 1 ) &&
102+
( ( scom_data.words.upper & BIT32(1) ) == 1 ) ) ||
103+
( ( ( scom_data.words.upper & BIT32(0) ) == 0 ) &&
104+
( ( scom_data.words.upper & BIT32(1) ) == 0 ) ) )
105+
{
106+
CME_PUTSCOM_NOP(CPPM_CPMMR_OR, CME_MASK_C0, BIT64(5));
107+
PK_PANIC(CME_BAD_PFET);
108+
}
109+
110+
CME_GETSCOM(PPM_PFSNS, CME_MASK_C1, scom_data);
111+
112+
if( ( ( ( scom_data.words.upper & BIT32(0) ) == 1 ) &&
113+
( ( scom_data.words.upper & BIT32(1) ) == 1 ) ) ||
114+
( ( ( scom_data.words.upper & BIT32(0) ) == 0 ) &&
115+
( ( scom_data.words.upper & BIT32(1) ) == 0 ) ) )
116+
{
117+
CME_PUTSCOM_NOP(CPPM_CPMMR_OR, CME_MASK_C1, BIT64(6));
118+
PK_PANIC(CME_BAD_PFET);
119+
}
120+
91121
CME_GETSCOM_OR(CPPM_CSAR, CME_MASK_BC, scom_data.value);
92122

93123
if(BIT32(CPPM_CSAR_FIT_HCODE_ERROR_INJECT) & scom_data.words.upper)
@@ -98,7 +128,7 @@ void fit_handler()
98128

99129

100130
mtspr(SPRN_TSR, TSR_FIS);
101-
PK_TRACE("FIT Timer Handler");
131+
//PK_TRACE("FIT Timer Handler");
102132

103133
#if !DISABLE_PERIODIC_CORE_QUIESCE && (NIMBUS_DD_LEVEL == 20 || NIMBUS_DD_LEVEL == 21 || CUMULUS_DD_LEVEL == 10)
104134
p9_cme_core_livelock_buster();
@@ -198,7 +228,7 @@ int main()
198228

199229
pk_trace_set_freq(trace_timebase);
200230

201-
PK_TRACE(">CME MAIN");
231+
// PK_TRACE(">CME MAIN");
202232

203233
// Clear SPRG0
204234
ppe42_app_ctx_set(0);
@@ -212,20 +242,20 @@ int main()
212242
out32(G_CME_LCL_LMCR_OR, BITS32(8, 2));
213243
#endif
214244

215-
PK_TRACE("Set Watch Dog Timer Rate to 6 and FIT Timer Rate to 8");
245+
// PK_TRACE("Set Watch Dog Timer Rate to 6 and FIT Timer Rate to 8");
216246
out32(G_CME_LCL_TSEL, (BITS32(1, 2) | BIT32(4)));
217247

218248
#if (!DISABLE_CME_FIT_TIMER || ENABLE_CME_DEC_TIMER)
219249

220250
uint32_t TCR_VAL = 0;
221251

222252
#if !DISABLE_CME_FIT_TIMER
223-
PK_TRACE("Enable FIT Timer");
253+
// PK_TRACE("Enable FIT Timer");
224254
TCR_VAL |= TCR_FIE;
225255
#endif
226256

227257
#if ENABLE_CME_DEC_TIMER
228-
PK_TRACE("Enable DEC Timer");
258+
// PK_TRACE("Enable DEC Timer");
229259
TCR_VAL |= TCR_DIE;
230260
#endif
231261

import/chips/p9/procedures/ppe_closed/cme/pstate_cme/p9_cme_intercme.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2019 */
8+
/* COPYRIGHT 2016,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -63,7 +63,7 @@ void p9_cme_pstate_intercme_msg_handler(void)
6363

6464
void p9_cme_pstate_sibling_lock_and_intercme_protocol(INTERCME_MSG_LOCK_ACTION intercme_msg_lock_action)
6565
{
66-
PK_TRACE_INF("SIBL: Enter");
66+
PK_TRACE_DBG("SIBL: Enter");
6767
uint32_t msg;
6868

6969
if (intercme_msg_lock_action == INTERCME_MSG_LOCK_WAIT_ON_RECV)
@@ -101,7 +101,7 @@ void p9_cme_pstate_process_db0_sibling()
101101
//writes same value for both cores
102102
CME_GETSCOM(CPPM_CMEDB0, G_cme_pstate_record.firstGoodCoreMask, dbData.value);
103103

104-
PK_TRACE_INF("INTER0: Enter");
104+
PK_TRACE_DBG("INTER0: Enter");
105105

106106
dbQuadInfo = (dbData.value >> (in32(G_CME_LCL_SRTCH0) &
107107
(BITS32(CME_SCRATCH_LOCAL_PSTATE_IDX_START, CME_SCRATCH_LOCAL_PSTATE_IDX_LENGTH)

import/chips/p9/procedures/ppe_closed/cme/pstate_cme/p9_cme_thread_db.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2019 */
8+
/* COPYRIGHT 2016,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -368,7 +368,7 @@ void p9_cme_pstate_db3_handler(void)
368368
}
369369
else if (db3.fields.cme_message_numbern == MSGID_DB3_CLIP_BROADCAST)
370370
{
371-
PK_TRACE_INF("PSTATE: DB3 Clip Enter");
371+
PK_TRACE_DBG("PSTATE: DB3 Clip Enter");
372372

373373
uint32_t dbQuadInfo, dbBit8_15;
374374
cppm_cmedb0_t dbData;
@@ -732,7 +732,7 @@ void p9_cme_pstate_process_db0()
732732
//Clear out db0_pending_tick_count
733733
g_db0_pending_fit_tick_count = 0;
734734

735-
PK_TRACE_INF("PSTATE: Process DB0 Enter");
735+
PK_TRACE_DBG("PSTATE: Process DB0 Enter");
736736

737737
//Clear EISR and read DB0 register
738738
out32_sh(CME_LCL_EISR_CLR, BITS64SH(36, 2));
@@ -942,7 +942,7 @@ inline void p9_cme_pstate_register()
942942
//
943943
void p9_cme_pstate_db0_start()
944944
{
945-
PK_TRACE_INF("PSTATE: DB0 Start Enter");
945+
PK_TRACE_DBG("PSTATE: DB0 Start Enter");
946946

947947
p9_cme_pstate_update();
948948
uint32_t ack;
@@ -989,7 +989,7 @@ void p9_cme_pstate_db0_start()
989989
//
990990
void p9_cme_pstate_db0_glb_bcast()
991991
{
992-
PK_TRACE_INF("PSTATE: DB0 GlbBcast Enter");
992+
PK_TRACE_DBG("PSTATE: DB0 GlbBcast Enter");
993993

994994
p9_cme_pstate_update();
995995
uint32_t ack;
@@ -1015,7 +1015,7 @@ void p9_cme_pstate_db0_glb_bcast()
10151015
//
10161016
inline void p9_cme_pstate_db0_stop()
10171017
{
1018-
PK_TRACE_INF("PSTATE: DB0 Stop Enter");
1018+
PK_TRACE_DBG("PSTATE: DB0 Stop Enter");
10191019

10201020
out32(G_CME_LCL_FLAGS_CLR, BIT32(24));//Set Pstates Disabled
10211021

@@ -1045,7 +1045,7 @@ inline void p9_cme_pstate_db0_stop()
10451045
void p9_cme_pstate_db0_clip_bcast()
10461046
{
10471047

1048-
PK_TRACE_INF("PSTATE: DB0 Clip Enter");
1048+
PK_TRACE_DBG("PSTATE: DB0 Clip Enter");
10491049

10501050

10511051
uint32_t dbBit8_15 = (G_dbData.value & BITS64(8, 8)) >> SHIFT64(15);
@@ -1082,7 +1082,7 @@ void p9_cme_pstate_db0_clip_bcast()
10821082

10831083
inline void p9_cme_pstate_db0_pmsr_updt()
10841084
{
1085-
PK_TRACE_INF("PSTATE: DB0 Pmsr Updt Enter");
1085+
PK_TRACE_DBG("PSTATE: DB0 Pmsr Updt Enter");
10861086

10871087
uint32_t dbBit8_15 = (G_dbData.value & BITS64(8, 8)) >> SHIFT64(15);
10881088

@@ -1129,7 +1129,7 @@ inline void p9_cme_pstate_freq_update(uint32_t cme_flags)
11291129
}
11301130
else
11311131
{
1132-
PK_TRACE_INF("PSTATE: Freq Updt Enter");
1132+
PK_TRACE_DBG("PSTATE: Freq Updt Enter");
11331133
PK_TRACE_DBG("PSTATE: Dpll0=0x%x", G_lppb->dpll_pstate0_value);
11341134

11351135
//Adjust DPLL
@@ -1237,7 +1237,7 @@ void p9_cme_pstate_update()
12371237
{
12381238
PkMachineContext ctx;
12391239

1240-
PK_TRACE_INF("PSTATE: Pstate Updt Enter");
1240+
PK_TRACE_DBG("PSTATE: Pstate Updt Enter");
12411241

12421242
G_cme_pstate_record.nextPstate = (G_dbData.value >> (in32(G_CME_LCL_SRTCH0) &
12431243
(BITS32(CME_SCRATCH_LOCAL_PSTATE_IDX_START,

import/chips/p9/procedures/ppe_closed/cme/pstate_cme/p9_cme_thread_pmcr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2018 */
8+
/* COPYRIGHT 2016,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -94,7 +94,7 @@ void p9_cme_pstate_pmcr_handler(void)
9494
//
9595
void p9_cme_init_done()
9696
{
97-
PK_TRACE_INF("CME INIT DONE: Enter");
97+
PK_TRACE_DBG("CME INIT DONE: Enter");
9898
uint32_t msg;
9999

100100
// Synchronization between QM and Sibling

import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_copy_scan_ring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2015,2018 */
8+
/* COPYRIGHT 2015,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -179,8 +179,8 @@ void bce_irr_run()
179179

180180
if (l_data32 != G_bce_irr.data.word)
181181
{
182-
PKTRACE("miscompare between bce irr read[%x] and cme shadow copy[%x]",
183-
l_data32, G_bce_irr.data.word);
182+
PK_TRACE_DBG("miscompare between bce irr read[%x] and cme shadow copy[%x]",
183+
l_data32, G_bce_irr.data.word);
184184
pk_halt();
185185
}
186186

import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_stop_entry.c

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2015,2019 */
8+
/* COPYRIGHT 2015,2020 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -224,6 +224,8 @@ void p9_cme_pcbmux_savior_epilogue(uint32_t core)
224224
void
225225
p9_cme_stop_entry()
226226
{
227+
int i = 0;
228+
uint32_t timeout = 0;
227229
int catchup_ongoing = 0;
228230
int entry_ongoing = 1;
229231
uint8_t target_level = 0;
@@ -1441,17 +1443,47 @@ p9_cme_stop_entry()
14411443
PK_PANIC(CME_STOP_ENTRY_TRAP_INJECT);
14421444
}
14431445

1446+
//500Mhz gives 2ns per ppe cycle
1447+
//pfet or stop should finish within 1ms
1448+
//set delay to 20ns
1449+
#define PFET_DELAY 20
1450+
#define PFET_TIMEOUT 20000
1451+
1452+
timeout = PFET_TIMEOUT;
1453+
14441454
do
14451455
{
14461456
CME_GETSCOM_AND(PPM_PFSNS, core, scom_data.value);
1457+
1458+
timeout--;
1459+
1460+
if( !timeout )
1461+
{
1462+
CME_PUTSCOM_NOP(CPPM_CPMMR_OR, core, ((uint64_t)(core) << SHIFT64(6)));
1463+
//PK_TRACE_ERR("PFET SENSE TIMED OUT, HALT CME!");
1464+
1465+
// if( in32(G_CME_LCL_FLAGS) & BIT32(CME_FLAGS_PFET_DELAY_TO_TIMEOUT) )
1466+
// {
1467+
PK_PANIC(CME_PFET_ENTRY_SENSE_TIMEOUT);
1468+
// }
1469+
// else
1470+
// {
1471+
// break;
1472+
// }
1473+
}
1474+
1475+
for(i = 0; i < PFET_DELAY; i++)
1476+
{
1477+
asm volatile ("tw 0, 0, 0");
1478+
}
14471479
}
14481480
while(!(scom_data.words.upper & BIT32(1)));
14491481

14501482
PK_TRACE("Turn off force voff via PFCS[0-1]");
14511483
// vdd_pfet_force_state = 00 (Nop)
14521484
CME_PUTSCOM(PPM_PFCS_CLR, core, BITS64(0, 2));
14531485

1454-
PK_TRACE_INF("SE.4A: Core[%d] Powered Off", core);
1486+
PK_TRACE_DBG("SE.4A: Core[%d] Powered Off", core);
14551487

14561488
#endif
14571489

0 commit comments

Comments
 (0)