Skip to content

Commit

Permalink
FAPI_Infra:Add new member to structure ErrorInfoHwCallout
Browse files Browse the repository at this point in the history
Enabling new member addition to the structure ErrorInfoHwCallout
to pass on the clock position wrt target.

Change-Id: I9501a418945143fbdb49519644cecdc31edaf04d
CQ:SW449714
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71281
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
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: Richard J. Knight <rjknight@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Manish K. Chowdhary <manichow@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71313
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
sumitk56 authored and crgeddes committed Mar 16, 2019
1 parent 4d983e4 commit 395f284
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/import/hwpf/fapi2/include/error_info.H
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ struct ErrorInfoHwCallout
/// @param[in] i_hw Hardware to callout
/// @param[in] i_calloutPriority Priority of callout
/// @param[in] i_refTarget Reference to reference target
/// @param[in] i_clkPos Clock position
///
ErrorInfoHwCallout(
const HwCallouts::HwCallout i_hw,
const CalloutPriorities::CalloutPriority i_calloutPriority,
const Target<TARGET_TYPE_ALL>& i_refTarget);
const Target<TARGET_TYPE_ALL>& i_refTarget,
const uint8_t i_clkPos = CLOCK_POS_UNDEF);

#ifdef FAPI_CUSTOM_MALLOC
///
Expand Down Expand Up @@ -202,6 +204,9 @@ struct ErrorInfoHwCallout
// The reference target (needed for some HW callouts to identify what to
// callout). The target handle is NULL if there is no reference target.
Target<TARGET_TYPE_ALL> iv_refTarget;

// Clock position
uint8_t iv_clkPos;
};

///
Expand Down Expand Up @@ -548,6 +553,7 @@ struct ErrorInfoEntryHwCallout
uint8_t iv_hw;
uint8_t iv_calloutPriority;
uint8_t iv_refObjIndex;
uint8_t iv_clkPos;
void addErrorInfo(std::shared_ptr<ErrorInfo> i_info,
const void* const* i_object) const;
};
Expand Down
2 changes: 2 additions & 0 deletions src/import/hwpf/fapi2/include/error_info_defs.H
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#endif
namespace fapi2
{
// For HW callout - Clock position undefined to 0xFF(default)
#define CLOCK_POS_UNDEF 0xFF

///
/// @brief Type to hold the ffdc data to be sent to hostboot
Expand Down
14 changes: 9 additions & 5 deletions src/import/hwpf/fapi2/src/error_info.C
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ ErrorInfoFfdc::ErrorInfoFfdc(const uint32_t i_ffdcId,
/// @param[in] i_hw Hardware to callout
/// @param[in] i_calloutPriority Priority of callout
/// @param[in] i_refTarget Reference to reference target
/// @param[in[ i_clkPos Clock position
///
ErrorInfoHwCallout::ErrorInfoHwCallout(
const HwCallouts::HwCallout i_hw,
const CalloutPriorities::CalloutPriority i_calloutPriority,
const Target<TARGET_TYPE_ALL>& i_refTarget):
const Target<TARGET_TYPE_ALL>& i_refTarget,
const uint8_t i_clkPos):
iv_hw(i_hw),
iv_calloutPriority(i_calloutPriority),
iv_refTarget(i_refTarget)
iv_refTarget(i_refTarget),
iv_clkPos(i_clkPos)
{}

///
Expand Down Expand Up @@ -244,10 +247,11 @@ void ErrorInfoEntryHwCallout::addErrorInfo(std::shared_ptr<ErrorInfo> i_info,
ErrorInfoHwCallout* ei = new ErrorInfoHwCallout(
static_cast<HwCallouts::HwCallout>(iv_hw),
static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority),
target);
target,
iv_clkPos);

FAPI_DBG("addErrorInfo: Adding hw callout target: 0x%lx hw: %d, pri: %d",
ei->iv_refTarget.get(), ei->iv_hw, ei->iv_calloutPriority);
FAPI_DBG("addErrorInfo: Adding hw callout target: 0x%lx hw: %d, pri: %d, pos: %d",
ei->iv_refTarget.get(), ei->iv_hw, ei->iv_calloutPriority, ei->iv_clkPos);

i_info->iv_hwCallouts.push_back(std::shared_ptr<ErrorInfoHwCallout>(ei));
}
Expand Down
23 changes: 21 additions & 2 deletions src/import/hwpf/fapi2/tools/parseErrorInfo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2018
# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -66,6 +66,7 @@
my $mcast_type = "fapi2::mcast_t";
my $scom_addr_type = "uint64_t";
my $ffdc_count = 0;
my $clock_ffdc_type = "uint8_t";

# There are some names used in the XML files which exist in either
# c++ keywords (case, for example) or macros (DOMAIN). The one's which
Expand Down Expand Up @@ -292,7 +293,7 @@ sub addFfdcMethod
# If we're generating empty classes, not using an argument name will avoid the unused parameter warnings
my $param = ( $arg_empty_ffdc eq undef ) ? "i_value" : "";

if ( $type eq $ffdc_type )
if ( $type eq $ffdc_type || $type eq $clock_ffdc_type )
{
$method = " template< typename T >\n";
$method .= " inline $class_name& set_$ffdc_uc(const T& $param)\n";
Expand Down Expand Up @@ -1071,6 +1072,24 @@ sub addFfdcMethod
{
$eiEntryStr .= " l_entries[$eiEntryCount].hw_callout.iv_refObjIndex = 0xff; \\\n";
}

# HW Callout - Clock position
if ( exists $callout->{hw}->{clkPos} )
{
# Add the Targets to the objectlist if they don't already exist
my $objNum1 = addEntryToArray( \@eiObjects, $callout->{hw}->{clkPos} );

$eiEntryStr .=
" l_entries[$eiEntryCount].hw_callout.iv_clkPos = $callout->{hw}->{clkPos}; \\\n";

# Add a method to the ffdc-gathering class
addFfdcMethod( \%methods, $callout->{hw}->{clkPos}, $err->{rc}, $clock_ffdc_type, $objNum1 );
}
else
{
$eiEntryStr .= " l_entries[$eiEntryCount].hw_callout.iv_clkPos = 0xff; \\\n";
}

$eiEntryCount++;
$elementsFound++;
}
Expand Down

0 comments on commit 395f284

Please sign in to comment.