From 395f284926ab9d6e920296d1bbc9d2f734ad284d Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Mon, 4 Feb 2019 03:53:09 -0600 Subject: FAPI_Infra:Add new member to structure ErrorInfoHwCallout 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 Tested-by: Jenkins Server Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Richard J. Knight Tested-by: HWSV CI Reviewed-by: Manish K. Chowdhary Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71313 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes --- src/import/hwpf/fapi2/include/error_info.H | 8 +++++++- src/import/hwpf/fapi2/include/error_info_defs.H | 2 ++ src/import/hwpf/fapi2/src/error_info.C | 14 +++++++++----- src/import/hwpf/fapi2/tools/parseErrorInfo.pl | 23 +++++++++++++++++++++-- 4 files changed, 39 insertions(+), 8 deletions(-) (limited to 'src/import/hwpf') diff --git a/src/import/hwpf/fapi2/include/error_info.H b/src/import/hwpf/fapi2/include/error_info.H index 4fd1af8a1..c6717a3bb 100644 --- a/src/import/hwpf/fapi2/include/error_info.H +++ b/src/import/hwpf/fapi2/include/error_info.H @@ -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& i_refTarget); + const Target& i_refTarget, + const uint8_t i_clkPos = CLOCK_POS_UNDEF); #ifdef FAPI_CUSTOM_MALLOC /// @@ -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 iv_refTarget; + + // Clock position + uint8_t iv_clkPos; }; /// @@ -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 i_info, const void* const* i_object) const; }; diff --git a/src/import/hwpf/fapi2/include/error_info_defs.H b/src/import/hwpf/fapi2/include/error_info_defs.H index 623d83d66..3f8fc9de6 100644 --- a/src/import/hwpf/fapi2/include/error_info_defs.H +++ b/src/import/hwpf/fapi2/include/error_info_defs.H @@ -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 diff --git a/src/import/hwpf/fapi2/src/error_info.C b/src/import/hwpf/fapi2/src/error_info.C index 599983e09..a3ee3c8c6 100644 --- a/src/import/hwpf/fapi2/src/error_info.C +++ b/src/import/hwpf/fapi2/src/error_info.C @@ -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& i_refTarget): + const Target& 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) {} /// @@ -244,10 +247,11 @@ void ErrorInfoEntryHwCallout::addErrorInfo(std::shared_ptr i_info, ErrorInfoHwCallout* ei = new ErrorInfoHwCallout( static_cast(iv_hw), static_cast(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(ei)); } diff --git a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl index 0ebb81bc4..c6044e5b8 100755 --- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl +++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2018 +# Contributors Listed Below - COPYRIGHT 2015,2019 # [+] International Business Machines Corp. # # @@ -66,6 +66,7 @@ my $ffdc_type = "fapi2::ffdc_t"; 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 @@ -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"; @@ -1071,6 +1072,24 @@ foreach my $argnum ( 0 .. $#ARGV ) { $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++; } -- cgit v1.2.1