Skip to content

Commit

Permalink
Centaur Channel Checkstop (runtime)
Browse files Browse the repository at this point in the history
This story covers when a DMI channel gets checkstopped at runtime
and how to service the subsequent SCOM operations that PRD
requests to diagnose the issue.  At runtime, PRD makes all of
its SCOM requests to HBRT which passes them on to PHYP for
in-band access.  The checkstop blocks in-band access, so HBRT
must fail-over to messaging the FSP to do FSI accesses.

To reduce the number of SCOM calls to the FSP, HBRT makes
a "multi-SCOM read" call for all the common SCOMs that
PRD will request after a checkstop, and caches the results.

Two new calls (MBOX, generic messaging interface) to the FSP
were added in a previous commit to allow FSI SCOM operations
through the FSP:
- MSG_SINGLE_SCOM_OP
- MSG_MULTI_SCOM_OP

Also, a new map, chnlFailScomList, was added in a previous
commit.  chnlFailScomList contains a list of target types
and associated SCOM addresses that PRD is likely want to
read after a checkstop.  PRD is responsible for maintaining
the contents.

Change-Id: I829a72067007ac8a61d80caa690d8eedee0f08cc
RTC:189294
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59197
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
rward15 authored and wghoffa committed Jun 5, 2018
1 parent 41f3aa6 commit b364d7b
Show file tree
Hide file tree
Showing 12 changed files with 938 additions and 25 deletions.
5 changes: 3 additions & 2 deletions src/include/runtime/generic_hbrt_fsp_message.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct TargetDeconfigHbrtFspData_t
*/
struct SingleScomOpHbrtFspData_t
{
uint8_t scom_op; // 0 == read, 1 == write
uint8_t scom_op; // DeviceFW::READ, DeviceFW::WRITE
uint32_t huid; // hardware target
uint64_t scom_addr;
uint64_t scom_data; // SCOM value read by FSP, or
Expand All @@ -92,11 +92,12 @@ struct MultiScomReadHbrtFspData_t
uint8_t scom_num; // number of SCOMs to read
uint64_t scom_data; // addresses of SCOMs to read, or
// values of SCOMs in FSP response
//
// ** if a SCOM cannot be read, its value **
// ** should be returned as DEADBEEF **
//
// placeholder that can be cast to an array
// of values (or addresses)
// of SCOM addresses (or values)
// uint64_t* mydata =
// (uint64_t*)&(l_generic_msg.data);
// more than 8 bytes of data is possible
Expand Down
17 changes: 11 additions & 6 deletions src/include/usr/fsiscom/fsiscom_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
Expand All @@ -29,19 +31,22 @@ namespace FSISCOM
{
enum FSISCOMModuleId
{
MOD_FSISCOM_INVALID = 0x00, /**< Zero is an invalid module id */
MOD_FSISCOM_PERFORMOP = 0x01, /**< fsiscom.C : fsiScomPerformOp */

MOD_FSISCOM_INVALID = 0x00, // Zero is an invalid module id
MOD_FSISCOM_PERFORM_OP = 0x01, // fsiscom.C : fsiScomPerformOp
MOD_FSISCOM_RT_SEND_SCOM_TO_FSP = 0x02,
MOD_FSISCOM_RT_SEND_MULTI_SCOM_TO_FSP = 0x03,
};

enum FSISCOMReasonCode
{
RC_INVALID = FSISCOM_COMP_ID | 0x00,
RC_WRITE_ERROR = FSISCOM_COMP_ID | 0x01,
RC_INVALID = FSISCOM_COMP_ID | 0x00,
RC_WRITE_ERROR = FSISCOM_COMP_ID | 0x01,
RC_READ_ERROR = FSISCOM_COMP_ID | 0x02,
RC_INVALID_LENGTH = FSISCOM_COMP_ID | 0x03,
RC_INVALID_ADDRESS = FSISCOM_COMP_ID | 0x04,
RC_INVALID_OPTYPE = FSISCOM_COMP_ID | 0x05,
RC_RT_INTERFACE_ERR = FSISCOM_COMP_ID | 0x06,
RC_RT_NULL_FW_MSG_PTR = FSISCOM_COMP_ID | 0x07,
};
};

Expand Down
42 changes: 41 additions & 1 deletion src/include/usr/scom/runtime/rt_scomif.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace SCOM
* @param[in] i_target Scom target
* @param[in] i_scomAddr Scom address
* @param[in|out] io_buffer Pointer to scom data
* @return errlHndl_t
* @return errlHndl_t
*/
errlHndl_t sendScomToHyp(DeviceFW::OperationType i_opType,
TARGETING::Target * i_target,
Expand All @@ -46,4 +46,44 @@ errlHndl_t sendScomToHyp(DeviceFW::OperationType i_opType,

}; // end namespace SCOM

namespace FSISCOM
{

/**
* @brief DMI channel has checkstopped. Mark it bad and switch to FSP access.
*
* @param[in] i_target SCOM target
* @return None
*/
void switchToFspScomAccess(TARGETING::TargetHandle_t i_target);

/**
* @brief This function sends the scom op to the FSP
*
* @param[in] i_opType Scom operation type, see driverif.H
* @param[in] i_target Scom target
* @param[in] i_scomAddr Scom address
* @param[in/out] io_buffer Read: Pointer to output data storage
* Write: Pointer to input data storage
* @return errlHndl_t
*/
errlHndl_t sendScomOpToFsp(DeviceFW::OperationType i_opType,
TARGETING::TargetHandle_t i_target,
uint64_t i_scomAddr,
void * io_buffer);

/**
* @brief Ask FSP to read list of SCOMs
*
* @param[in] i_target Scom target
* @param[in] i_scomAddr Scom addresses to read
* @param[out] o_scomValue Scom values read (0xDEADBEEF for errors)
* @return errlHndl_t
*/
errlHndl_t sendMultiScomReadToFsp(TARGETING::TargetHandle_t i_target,
std::vector<uint64_t> & i_scomAddr,
std::vector<uint64_t> & o_scomValue);

}; // end namespace FSISCOM

#endif // end __RT_SCOMIF_H
1 change: 1 addition & 0 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ RUNTIME_MODULES += targeting_rt
RUNTIME_MODULES += util_rt
RUNTIME_MODULES += devicefw_rt
RUNTIME_MODULES += xscom_rt
RUNTIME_MODULES += fsiscom_rt
RUNTIME_MODULES += ibscom_rt
RUNTIME_MODULES += scom_rt
RUNTIME_MODULES += vpd_rt
Expand Down
22 changes: 11 additions & 11 deletions src/usr/fsiscom/fsiscom.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -200,7 +200,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
TRACFCOMP( g_trac_fsiscom, ERR_MRK "fsiScomPerformOp> Invalid data length : io_buflen=%d", io_buflen );
/*@
* @errortype
* @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP
* @moduleid FSISCOM::MOD_FSISCOM_PERFORM_OP
* @reasoncode FSISCOM::RC_INVALID_LENGTH
* @userdata1 SCOM Address
* @userdata2 Data Length
Expand All @@ -209,7 +209,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
* Invalid data length for a SCOM operation.
*/
l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSISCOM::MOD_FSISCOM_PERFORMOP,
FSISCOM::MOD_FSISCOM_PERFORM_OP,
FSISCOM::RC_INVALID_LENGTH,
l_scomAddr,
TO_UINT64(io_buflen));
Expand All @@ -225,7 +225,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
TRACFCOMP( g_trac_fsiscom, ERR_MRK "fsiScomPerformOp> Address contains more than 31 bits : l_scomAddr=0x%.16X", l_scomAddr );
/*@
* @errortype
* @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP
* @moduleid FSISCOM::MOD_FSISCOM_PERFORM_OP
* @reasoncode FSISCOM::RC_INVALID_ADDRESS
* @userdata1 SCOM Address
* @userdata2 Target HUID
Expand All @@ -235,7 +235,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
* Invalid address on a SCOM operation.
*/
l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSISCOM::MOD_FSISCOM_PERFORMOP,
FSISCOM::MOD_FSISCOM_PERFORM_OP,
FSISCOM::RC_INVALID_ADDRESS,
l_scomAddr,
TARGETING::get_huid(i_target));
Expand Down Expand Up @@ -322,7 +322,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
TRACFCOMP( g_trac_fsiscom, ERR_MRK"fsiScomPerformOp:Write: PCB/PIB error received: l_status=0x%X)", l_status);
/*@
* @errortype
* @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP
* @moduleid FSISCOM::MOD_FSISCOM_PERFORM_OP
* @reasoncode FSISCOM::RC_WRITE_ERROR
* @userdata1 SCOM Addr
* @userdata2[00:31] Target HUID
Expand All @@ -334,7 +334,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
*/
l_err = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSISCOM::MOD_FSISCOM_PERFORMOP,
FSISCOM::MOD_FSISCOM_PERFORM_OP,
FSISCOM::RC_WRITE_ERROR,
l_scomAddr,
TWO_UINT32_TO_UINT64(
Expand Down Expand Up @@ -389,7 +389,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,

/*@
* @errortype
* @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP
* @moduleid FSISCOM::MOD_FSISCOM_PERFORM_OP
* @reasoncode FSISCOM::RC_READ_ERROR
* @userdata1 SCOM Addr
* @userdata2[00:31] Target HUID
Expand All @@ -399,7 +399,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
* Error returned from SCOM engine after read.
*/
l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSISCOM::MOD_FSISCOM_PERFORMOP,
FSISCOM::MOD_FSISCOM_PERFORM_OP,
FSISCOM::RC_READ_ERROR,
l_scomAddr,
TWO_UINT32_TO_UINT64(
Expand Down Expand Up @@ -448,7 +448,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,

/*@
* @errortype
* @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP
* @moduleid FSISCOM::MOD_FSISCOM_PERFORM_OP
* @reasoncode FSISCOM::RC_INVALID_OPTYPE
* @userdata1[0:31] Operation Type (i_opType) : 0=READ, 1=WRITE
* @userdata1[32:64] Input scom address
Expand All @@ -458,7 +458,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
* Unsupported SCOM operation type.
*/
l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSISCOM::MOD_FSISCOM_PERFORMOP,
FSISCOM::MOD_FSISCOM_PERFORM_OP,
FSISCOM::RC_INVALID_OPTYPE,
TWO_UINT32_TO_UINT64(i_opType,
l_scomAddr),
Expand Down
5 changes: 4 additions & 1 deletion src/usr/fsiscom/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
# COPYRIGHT International Business Machines Corp. 2011,2014
# Contributors Listed Below - COPYRIGHT 2011,2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -26,5 +28,6 @@ MODULE = fsiscom
OBJS += fsiscom.o

SUBDIRS += test.d
SUBDIRS += runtime.d

include ${ROOTPATH}/config.mk
33 changes: 33 additions & 0 deletions src/usr/fsiscom/runtime/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/fsiscom/runtime/makefile $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
HOSTBOOT_RUNTIME = 1
ROOTPATH = ../../../..
MODULE = fsiscom_rt

OBJS += rt_fsiscom.o

EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/prdf/
VPATH += ..
include $(ROOTPATH)/config.mk

0 comments on commit b364d7b

Please sign in to comment.