Skip to content

Commit f52ed17

Browse files
davidduyueop-jenkins
authored andcommitted
PM: Handle PIB Reset with data check handler on all GPEs
Key_Cronus_Test=PM_REGRESS Change-Id: I121aaf5efb579fde88829f2ef5354ad4c8b6d77b CQ:SW447494 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68622 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> Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
1 parent d088814 commit f52ed17

File tree

10 files changed

+119
-9
lines changed

10 files changed

+119
-9
lines changed

import/chips/p9/procedures/ppe/pk/ppe42/pk_panic_codes.h

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,2017 */
8+
/* COPYRIGHT 2016,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -49,7 +49,7 @@ typedef enum
4949
PK_DEFAULT_SPECIAL_HANDLER = 0x0007,
5050
PPE42_PHANTOM_INTERRUPT = 0x0008,
5151
PPE42_ILLEGAL_INSTRUCTION = 0x0009,
52-
PK_UNUSED_000a = 0x000a,
52+
PPE42_PIB_RESET_NOT_RECOVER = 0x000a,
5353
PK_UNUSED_000d = 0x000d,
5454
PK_UNUSED_001c = 0x001c,
5555
PK_UNUSED_001d = 0x001d,

import/chips/p9/procedures/ppe/pk/ppe42/ppe42_exceptions.S

Lines changed: 46 additions & 1 deletion
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,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -583,4 +583,49 @@ ctx_pop:
583583

584584
rfi
585585

586+
__special_machine_check_handler:
587+
588+
stwu %r1, -PK_CTX_SIZE(%r1)
589+
stw %r0, PK_CTX_GPR0(%r1)
590+
stvd %d3, PK_CTX_GPR3(%r1)
591+
stvd %d5, PK_CTX_GPR5(%r1)
592+
stvd %d7, PK_CTX_GPR7(%r1)
593+
stvd %d9, PK_CTX_GPR9(%r1)
594+
stvd %d28, PK_CTX_GPR28(%r1)
595+
stvd %d30, PK_CTX_GPR30(%r1)
596+
mflr %r3
597+
stw %r3, PK_CTX_LR(%r1)
598+
mfcr %r3
599+
mfsprg0 %r4
600+
stvd %d3, PK_CTX_CR(%r1)
601+
mfxer %r3
602+
mfctr %r4
603+
stvd %d3, PK_CTX_XER(%r1)
604+
mfsrr0 %r3
605+
mfsrr1 %r4
606+
stvd %d3, PK_CTX_SRR0(%r1)
607+
#if defined(__PPE__)
608+
bl __ppe42_pib_reset_handler
609+
#endif
610+
lwz %r0, PK_CTX_GPR0(%r1)
611+
lvd %d7, PK_CTX_SRR0(%r1)
612+
mtsrr1 %r8
613+
mtsrr0 %r7
614+
lvd %d5, PK_CTX_XER(%r1)
615+
mtctr %r6
616+
mtxer %r5
617+
lvd %d30, PK_CTX_GPR30(%r1)
618+
lvd %d28, PK_CTX_GPR28(%r1)
619+
lvd %d9, PK_CTX_GPR9(%r1)
620+
lvd %d7, PK_CTX_GPR7(%r1)
621+
lvd %d5, PK_CTX_GPR5(%r1)
622+
lvd %d3, PK_CTX_CR(%r1) ## CR,SPRG0
623+
mtcr0 %r3
624+
lwz %r4, PK_CTX_LR(%r1)
625+
mtlr %r4
626+
lvd %d3, PK_CTX_GPR3(%r1)
627+
addi %r1, %r1, PK_CTX_SIZE
628+
629+
rfi
630+
586631
/// \endcond

import/chips/p9/procedures/ppe/pk/ppe42/ppe42_irq_core.c

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2015,2017 */
8+
/* COPYRIGHT 2015,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -34,8 +34,50 @@
3434

3535
#define __PPE42_IRQ_CORE_C__
3636

37+
3738
#include "pk.h"
3839

40+
uint32_t G_pib_reset_flag = 0;
41+
42+
#ifdef __PPE__
43+
44+
void
45+
__ppe42_pib_reset_handler()
46+
{
47+
//PK_TRACE("Entered 1 ppe42_pib_reset_handler");
48+
uint32_t srr1 = mfspr(SPRN_SRR1);
49+
50+
// assuming pib is being reset thus give timeout error
51+
if (((srr1 & MSR_SIBRC) == MSR_SIBRC))
52+
{
53+
// if already waited for pib to reset, panic as still fail
54+
if (G_pib_reset_flag == 10 )
55+
{
56+
G_pib_reset_flag = 0;
57+
PK_PANIC(PPE42_PIB_RESET_NOT_RECOVER);
58+
}
59+
60+
// note pib reset is being detected
61+
// this flag will be cleared by fit timer if pib reset recovers
62+
G_pib_reset_flag++;
63+
64+
// DELAY to wait pib reset to complete
65+
volatile uint32_t loop;
66+
67+
for(loop = 0; loop < 6400; loop++);
68+
69+
PK_TRACE_INF("PIB reset flag value %x", G_pib_reset_flag);
70+
71+
}
72+
else
73+
{
74+
// panic for all other pib return codes
75+
PK_PANIC(PPE42_MACHINE_CHECK_PANIC);
76+
}
77+
}
78+
#endif
79+
80+
3981
#ifndef STATIC_IRQ_TABLE
4082
Ppe42IrqHandler __ppe42_irq_handlers[EXTERNAL_IRQS + 1];
4183
#endif

import/chips/p9/procedures/ppe/pk/ppe42/ppe42_scom.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2015,2017 */
8+
/* COPYRIGHT 2015,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -49,6 +49,7 @@ extern "C" {
4949
#endif
5050

5151

52+
5253
/// PPE Load Virtual Double operation
5354
#define PPE_LVD(_m_address, _m_data) \
5455
asm volatile \
@@ -149,6 +150,9 @@ extern inline uint32_t getscom(const uint32_t i_chiplet, const uint32_t i_addres
149150
extern inline void putscom_norc(const uint32_t i_address, uint64_t i_data)
150151
{
151152
PPE_STVD(i_address, i_data);
153+
#ifdef PK_MACHINE_HANDLER_SUPPPORT
154+
asm volatile ("sync");
155+
#endif
152156
}
153157

154158
#ifdef __cplusplus

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

Lines changed: 3 additions & 1 deletion
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,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -104,6 +104,8 @@
104104
#error "USE_PPE_IMPRECISE_MODE must be defined in order to enable USE_CME_QUEUED_SCOM or USE_CME_QUEUED_SCAN"
105105
#endif
106106

107+
#define PK_MACHINE_HANDLER_SUPPORT 0
108+
107109
// --------------------
108110

109111
#if NIMBUS_DD_LEVEL == 10

import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_fit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ __attribute__((always_inline)) inline void handle_fit_timebase_sync()
382382
G_tb_sync_count++;
383383
}
384384
}
385+
extern uint32_t G_pib_reset_flag;
385386

386387
//
387388
// handle_undervolt
@@ -409,6 +410,8 @@ void p9_pgpe_fit_handler(void* arg, PkIrqId irq)
409410
{
410411

411412
mtmsr(PPE42_MSR_INITIAL);
413+
PK_TRACE_DBG("IPB reset flag value %x", G_pib_reset_flag);
414+
G_pib_reset_flag = 0;
412415
handle_occ_beacon();
413416
handle_core_throttle();
414417
handle_occflg_requests();

import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pk_app_cfg.h

Lines changed: 6 additions & 1 deletion
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,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -107,6 +107,11 @@
107107
/// using the table defined in pk_app_irq_table.c.
108108
#define STATIC_IRQ_TABLE
109109

110+
#define PK_MACHINE_HANDLER_SUPPORT 1
111+
112+
#define PPE42_MACHINE_CHECK_HANDLER \
113+
b __special_machine_check_handler
114+
110115

111116
/// Static configuration data for external interrupts:
112117
///

import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_common.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ PSTATE_COMMONFLAGS+= -DPK_THREAD_SUPPORT=1
9090
PSTATE_COMMONFLAGS+= -DPK_TRACE_SUPPORT=1
9191
PSTATE_COMMONFLAGS+= -DUSE_PK_APP_CFG_H=1
9292
PSTATE_COMMONFLAGS+= -D__PPE_PLAT
93+
PSTATE_COMMONFLAGS+= -D__PPE__
9394
PSTATE_COMMONFLAGS+= -D__PK__=1
9495
PSTATE_COMMONFLAGS+= -DPK_TRACE_SZ=2048
9596
PSTATE_COMMONFLAGS+= -DPSTATE_GPE

import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c

Lines changed: 4 additions & 1 deletion
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,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -71,13 +71,16 @@ SgpeStopRecord G_sgpe_stop_record __attribute__((section (".dump_ptrs"))) =
7171
{{0, 0, 0}}
7272
};
7373

74+
extern uint32_t G_pib_reset_flag;
7475

7576

7677
void
7778
p9_sgpe_fit_handler()
7879
{
7980
PK_TRACE("FIT: Handler Fired");
8081

82+
PK_TRACE_DBG("IPB reset flag value %x", G_pib_reset_flag);
83+
G_pib_reset_flag = 0;
8184
uint32_t tpending = in32(G_OCB_OPIT0PRA) |
8285
in32(G_OCB_OPIT3PRA) |
8386
in32(G_OCB_OPIT6PRB);

import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/pk_app_cfg.h

Lines changed: 6 additions & 1 deletion
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,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -156,4 +156,9 @@
156156
/// This file provides platform specific panic codes
157157
#define PLATFORM_PANIC_CODES_H "sgpe_panic_codes.h"
158158

159+
#define PK_MACHINE_HANDLER_SUPPORT 1
160+
161+
#define PPE42_MACHINE_CHECK_HANDLER \
162+
b __special_machine_check_handler
163+
159164
#endif /*__PK_APP_CFG_H__*/

0 commit comments

Comments
 (0)