Skip to content

Commit 8fdf501

Browse files
committed
Adding firdata feature to OCC
Adding the fir data collection code to capture FIR information to PNOR upon a runtime checkstop. Change-Id: Ia7d6f9a234ca2c86783f7ac8f51407c15895358e RTC: 115282 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15970 Reviewed-by: Stephan Broyles <[email protected]> Tested-by: Stephan Broyles <[email protected]>
1 parent c473df2 commit 8fdf501

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5409
-286
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ occStringFile
1414
customrc
1515
env.bash
1616
src/build/
17+
*.sw*
1718

src/occ/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
#
66
# OpenPOWER OnChipController Project
77
#
8-
# Contributors Listed Below - COPYRIGHT 2011,2014
9-
# [+] Google Inc.
8+
# Contributors Listed Below - COPYRIGHT 2011,2015
109
# [+] International Business Machines Corp.
1110
#
11+
#
1212
# Licensed under the Apache License, Version 2.0 (the "License");
1313
# you may not use this file except in compliance with the License.
1414
# You may obtain a copy of the License at
1515
#
16-
# http://www.apache.org/licenses/LICENSE-2.0
16+
# http://www.apache.org/licenses/LICENSE-2.0
1717
#
1818
# Unless required by applicable law or agreed to in writing, software
1919
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -49,6 +49,7 @@ APP_INCLUDES += -I.
4949
APP_INCLUDES += -I../occ
5050
APP_INCLUDES += -I../../occ
5151
APP_INCLUDES += -I./timer
52+
APP_INCLUDES += -I./firdata
5253

5354
export APP_INCLUDES
5455

src/occ/app.mk

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
#
66
# OpenPOWER OnChipController Project
77
#
8-
# Contributors Listed Below - COPYRIGHT 2011,2014
9-
# [+] Google Inc.
8+
# Contributors Listed Below - COPYRIGHT 2011,2015
109
# [+] International Business Machines Corp.
1110
#
11+
#
1212
# Licensed under the Apache License, Version 2.0 (the "License");
1313
# you may not use this file except in compliance with the License.
1414
# You may obtain a copy of the License at
1515
#
16-
# http://www.apache.org/licenses/LICENSE-2.0
16+
# http://www.apache.org/licenses/LICENSE-2.0
1717
#
1818
# Unless required by applicable law or agreed to in writing, software
1919
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -107,6 +107,7 @@ LDFLAGS = \
107107
-L $(OCC)/thread \
108108
-L $(OCC)/timer \
109109
-L $(OCC)/trac \
110+
-L $(OCC)/firdata \
110111
-lssx -lppc32 --oformat=elf32-powerpc -melf32ppc
111112

112113
# Added for linking files compiled using gnu assembler

src/occ/cfiles.mk

+13
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,21 @@ occ_CFILES = \
9191
occbuildname.c \
9292
common.c \
9393

94+
occ_CFILES += firdata/ecc.c
95+
occ_CFILES += firdata/fir_data_collect.c
96+
occ_CFILES += firdata/firData.c
97+
occ_CFILES += firdata/fsi.c
98+
occ_CFILES += firdata/lpc.c
99+
occ_CFILES += firdata/native.c
100+
occ_CFILES += firdata/nor_micron.c
101+
occ_CFILES += firdata/pnor_util.c
102+
occ_CFILES += firdata/scom_trgt.c
103+
occ_CFILES += firdata/scom_util.c
104+
occ_CFILES += firdata/sfc_ast2400.c
105+
94106
occ_SFILES = cmdh/ll_ffdc.S
95107

108+
96109
occ_cfiles = ${occ_CFILES:.c=.o}
97110
occ_Sfiles = ${occ_SFILES:.S=.o}
98111

src/occ/cmdh/cmdh_fsp_cmds.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr)
216216
cmdh_poll_resp_v10_fixed_t * l_poll_rsp = (cmdh_poll_resp_v10_fixed_t *) o_rsp_ptr;
217217

218218
// Byte 1
219-
l_poll_rsp->status.word = SMGR_validate_get_valid_states(); //TODO: Do we need to set FIR master?
219+
l_poll_rsp->status.word = SMGR_validate_get_valid_states();
220220
// Byte 2
221-
l_poll_rsp->ext_status.word = 0; //TODO: What values should we set for memthrotOT and n power?
221+
//TODO: What values should we set for memthrotOT and n power?
222+
l_poll_rsp->ext_status.word = 0;
222223

223224
for ( k = 0; k < MAX_NUM_CORES; k++ )
224225
{

src/occ/cmdh/cmdh_fsp_cmds_datacnfg.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,10 @@ errlHndl_t data_store_pstate_super(const cmdh_fsp_cmd_t * i_cmd_ptr,
10731073
//
10741074
// Name: data_store_role
10751075
//
1076-
// Description: TODO Add description
1076+
// Description: Tell the OCC if it should run as a master or slave. HTMGT knows
1077+
// which OCC is the master from the MRW. To be the master OCC
1078+
// requires a connection to the APSS. Until an OCC is told a role
1079+
// it should default to running as a slave
10771080
//
10781081
// End Function Specification
10791082
errlHndl_t data_store_role(const cmdh_fsp_cmd_t * i_cmd_ptr,
@@ -1082,17 +1085,13 @@ errlHndl_t data_store_role(const cmdh_fsp_cmd_t * i_cmd_ptr,
10821085
errlHndl_t l_errlHndl = NULL;
10831086
uint8_t l_old_role = G_occ_role;
10841087
uint8_t l_new_role = OCC_SLAVE;
1085-
uint8_t l_fir_master = 0x00;
10861088
ERRL_RC l_rc = ERRL_RC_SUCCESS;
10871089

10881090
// Cast the command to the struct for this format
10891091
cmdh_set_role_t * l_cmd_ptr = (cmdh_set_role_t *)i_cmd_ptr;
10901092

1091-
// With BMC-based systems, there is a FIR Master bit
1092-
l_fir_master = l_cmd_ptr->role >> 7;
1093-
1094-
// Mask off the FIR Master bit
1095-
l_new_role = l_cmd_ptr->role & 0x7F;
1093+
// Mask off the OCC role
1094+
l_new_role = l_cmd_ptr->role & OCC_ROLE_MASTER_MASK;
10961095

10971096

10981097
// Must be in standby state before we can change roles

src/occ/cmdh/cmdh_fsp_cmds_datacnfg.h

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ typedef enum
8484
DATA_FRU_MAX,
8585
} eConfigDataFruType;
8686

87+
// Set OCC Role Masks
88+
#define OCC_ROLE_MASTER_MASK 0x01
89+
#define OCC_ROLE_FIR_MASTER_MASK 0x40
90+
8791
// Used by TMGT to send OCC the PstateSuperStruct
8892
typedef struct __attribute__ ((packed))
8993
{

src/occ/errl/errl.c

+55-13
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ errlHndl_t G_occErrSlots[ERRL_MAX_SLOTS] = {
5959
};
6060

6161
extern uint8_t G_occ_interrupt_type;
62+
extern bool G_fir_collection_required;
6263

6364
void hexDumpLog( errlHndl_t i_log );
6465

@@ -354,18 +355,30 @@ void addTraceToErrl(
354355
void * l_traceAddr = io_err;
355356
uint16_t l_actualSizeOfUsrDtls = 0;
356357
pore_status_t l_gpe0_status;
358+
ocb_oisr0_t l_oisr0_status;
357359
static bool L_gpe_halt_traced = FALSE;
360+
static bool L_sys_checkstop_traced = FALSE;
358361

359362

360363
// check if GPE was frozen due to a checkstop
361364
l_gpe0_status.value = in64(PORE_GPE0_STATUS);
362365
if(l_gpe0_status.fields.freeze_action && !L_gpe_halt_traced)
363366
{
364367
L_gpe_halt_traced = TRUE;
365-
TRAC_ERR("addTraceToErrl: OCC GPE halted due to checkstop. GPE0 status[0x%08x%08x]",
366-
l_gpe0_status.words.high_order, l_gpe0_status.words.low_order);
368+
TRAC_IMP("addTraceToErrl: Frozen GPE0 detected. GPE0 status[0x%08x%08x]",
369+
l_gpe0_status.words.high_order,
370+
l_gpe0_status.words.low_order);
367371
}
368372

373+
// Check if there is a system checkstop
374+
l_oisr0_status.value = in32(OCB_OISR0);
375+
if (l_oisr0_status.fields.check_stop && !L_sys_checkstop_traced)
376+
{
377+
L_sys_checkstop_traced = TRUE;
378+
TRAC_IMP("addTraceToErrl: System checkstop detected");
379+
}
380+
381+
369382
// 1. Check if error log is not null
370383
// 2. error log is not invalid
371384
// 3. error log has not been commited
@@ -520,16 +533,20 @@ void reportErrorLog( errlHndl_t i_err, uint16_t i_entrySize )
520533
i_err->iv_userDetails.iv_modId, i_err->iv_reasonCode,
521534
i_err->iv_userDetails.iv_userData1, i_err->iv_userDetails.iv_userData2);
522535

523-
// If this system is using PSIHB complex, send an interrupt to Host so that
524-
// Host can inform HTMGT to collect the error log
525-
if (G_occ_interrupt_type == PSIHB_INTERRUPT)
536+
// Defer the interrupt if FIR collection is required
537+
if (!G_fir_collection_required)
526538
{
527-
// From OCC OpenPower Interface v1.1, OCC needs to set bits 0 and 1 of
528-
// the OCB_OCCMISC register
529-
l_reg.fields.core_ext_intr = 1;
530-
l_reg.fields.reason_intr = 1;
539+
// If this system is using PSIHB complex, send an interrupt to Host so that
540+
// Host can inform HTMGT to collect the error log
541+
if (G_occ_interrupt_type == PSIHB_INTERRUPT)
542+
{
543+
// From OCC OpenPower Interface v1.1, OCC needs to set bits 0 and 1 of
544+
// the OCB_OCCMISC register
545+
l_reg.fields.core_ext_intr = 1;
546+
l_reg.fields.reason_intr = 1;
531547

532-
out32(OCB_OCCMISC_OR, l_reg.value);
548+
out32(OCB_OCCMISC_OR, l_reg.value);
549+
}
533550
}
534551
}
535552

@@ -544,16 +561,33 @@ void reportErrorLog( errlHndl_t i_err, uint16_t i_entrySize )
544561
void commitErrl( errlHndl_t *io_err )
545562
{
546563
pore_status_t l_gpe0_status;
564+
ocb_oisr0_t l_oisr0_status;
565+
static bool L_log_commits_suspended_by_safe_mode = FALSE;
547566

548-
if ( io_err != NULL )
567+
if (!L_log_commits_suspended_by_safe_mode && io_err != NULL)
549568
{
550569
// check if handle is valid and is NOT empty
551570
if ((*io_err != NULL ) && ( *io_err != INVALID_ERR_HNDL ))
552571
{
553-
// check if GPE was frozen due to a checkstop
572+
// Check if the GPE is frozen or if a system
573+
// checkstop has occurred
554574
l_gpe0_status.value = in64(PORE_GPE0_STATUS);
555-
if(l_gpe0_status.fields.freeze_action)
575+
l_oisr0_status.value = in32(OCB_OISR0);
576+
577+
if (l_gpe0_status.fields.freeze_action
578+
||
579+
l_oisr0_status.fields.check_stop)
556580
{
581+
if (l_gpe0_status.fields.freeze_action)
582+
{
583+
TRAC_IMP("Frozen GPE0 detected by commitErrl");
584+
}
585+
586+
if (l_oisr0_status.fields.check_stop)
587+
{
588+
TRAC_IMP("System checkstop detected by commitErrl");
589+
}
590+
557591
//Go to the reset state to minimize errors
558592
reset_state_request(RESET_REQUESTED_DUE_TO_ERROR);
559593

@@ -565,6 +599,14 @@ void commitErrl( errlHndl_t *io_err )
565599

566600
//set callouts to 0
567601
(*io_err)->iv_numCallouts = 0;
602+
603+
TRAC_IMP("SAFE mode required, suspending error log commits. FIR capture required.");
604+
605+
// Suspend all error log commits
606+
L_log_commits_suspended_by_safe_mode = TRUE;
607+
608+
// Motivate FIR data collection
609+
G_fir_collection_required = TRUE;
568610
}
569611

570612
// if reset action bit is set force severity to unrecoverable and

0 commit comments

Comments
 (0)