From f1074af217829f4a678032f44e5bc29c26298a6a Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Thu, 30 May 2019 12:34:23 -0500 Subject: Fapi_Infra:Add new member to structure ErrorInfoCDG Enabling addition of new member - gardType to the structure to pass on the type of gard when target gets garded. Change-Id: I4c14f8bab585bfbee71b43ee4353b9b243bf7469 CQ: SW462950 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78076 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Tested-by: PPE CI Tested-by: HWSV CI Reviewed-by: Manish K. Chowdhary Reviewed-by: Sumit Kumar Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78093 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M Crowell --- src/import/hwpf/fapi2/include/error_info.H | 8 +++++++- src/import/hwpf/fapi2/include/error_info_defs.H | 23 +++++++++++++++++++++++ src/import/hwpf/fapi2/src/error_info.C | 15 ++++++++++----- src/import/hwpf/fapi2/tools/parseErrorInfo.pl | 12 ++++++++++++ 4 files changed, 52 insertions(+), 6 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 c6717a3bb..e67e376e0 100644 --- a/src/import/hwpf/fapi2/include/error_info.H +++ b/src/import/hwpf/fapi2/include/error_info.H @@ -311,12 +311,14 @@ struct ErrorInfoCDG /// @param[in] i_deconfigure True if Target should be deconfigured /// @param[in] i_gard True if Target should be GARDed /// @param[in] i_priority The priority of any callout + /// @param[in] i_gardType Type of GARD /// ErrorInfoCDG(const Target& i_target, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority); + const CalloutPriorities::CalloutPriority i_priority, + const GardTypes::GardType i_gardType); #ifdef FAPI_CUSTOM_MALLOC /// @@ -348,6 +350,9 @@ struct ErrorInfoCDG // GARD Information bool iv_gard; + + // GARD Type + GardTypes::GardType iv_gardType; }; /// @@ -598,6 +603,7 @@ struct ErrorInfoEntryTargetCDG uint8_t iv_deconfigure; uint8_t iv_gard; uint8_t iv_calloutPriority; + uint8_t iv_gardType; 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 3f8fc9de6..bed1add8e 100644 --- a/src/import/hwpf/fapi2/include/error_info_defs.H +++ b/src/import/hwpf/fapi2/include/error_info_defs.H @@ -278,6 +278,29 @@ enum CollectTrace }; } +/// +/// @enum gardType +/// +/// This enumeration defines the possible gard types +/// NOTE:This gardType is same as the gard types defined in HWAS +/// so they should always be kept in sync. +/// +namespace GardTypes +{ +enum GardType +{ + GARD_NULL = 0x00, + GARD_User_Manual = 0xD2, //Manual Guard. + GARD_Unrecoverable = 0xE2, //TODO:RTC-76814 + GARD_Fatal = 0xE3, //IPL Failures, and others. + GARD_Predictive = 0xE6, //Policy flag to disable. + GARD_Power = 0xE9, //Needed since EID is NOT passed in. + GARD_PHYP = 0xEA, //Needed since EID is NOT passed in. + GARD_Reconfig = 0xEB, //Force deconfig on reconfig loop + GARD_Void = 0xFF, +}; +} + // @brief convert the processor relative sbe target instance into a fapi pos // // @param[in] i_targType - type of target from SBE FFDC buffer diff --git a/src/import/hwpf/fapi2/src/error_info.C b/src/import/hwpf/fapi2/src/error_info.C index a3ee3c8c6..861393eb5 100644 --- a/src/import/hwpf/fapi2/src/error_info.C +++ b/src/import/hwpf/fapi2/src/error_info.C @@ -118,18 +118,21 @@ ErrorInfoBusCallout::ErrorInfoBusCallout( /// @param[in] i_deconfigure True if Target should be deconfigured /// @param[in] i_gard True if Target should be GARDed /// @param[in] i_priority The priority of any callout +/// @param[in] i_gardType Type of GARD /// ErrorInfoCDG::ErrorInfoCDG( const Target& i_target, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority): + const CalloutPriorities::CalloutPriority i_priority, + const GardTypes::GardType i_gardType): iv_target(i_target), iv_callout(i_callout), iv_calloutPriority(i_priority), iv_deconfigure(i_deconfigure), - iv_gard(i_gard) + iv_gard(i_gard), + iv_gardType(i_gardType) {} /// @@ -336,13 +339,15 @@ void ErrorInfoEntryTargetCDG::addErrorInfo( iv_deconfigure, iv_gard, static_cast - (iv_calloutPriority) + (iv_calloutPriority), + static_cast(iv_gardType) ); - FAPI_DBG("addErrorInfo: Adding target 0x%lx cdg (%d:%d:%d), pri: %d", + FAPI_INF("addErrorInfo: Adding target 0x%lx cdg (%d:%d:%d), pri: %d, gtyp: %d", ei->iv_target.get(), ei->iv_callout, ei->iv_deconfigure, - ei->iv_gard, ei->iv_calloutPriority); + ei->iv_gard, ei->iv_calloutPriority, + ei->iv_gardType); // Add the ErrorInfo i_info->iv_CDGs.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 782a5a38a..75c3fe2fd 100755 --- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl +++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl @@ -1267,6 +1267,10 @@ foreach my $argnum ( 0 .. $#ARGV ) # Add the Target to cdgTargetHash to be processed with any # callout and deconfigure requests $cdgTargetHash{ $gard->{target} }{gard} = 1; + if ( exists $gard->{gardType} ) + { + $cdgTargetHash{ $gard->{target} }{gardType} = $gard->{gardType}; + } $elementsFound++; } if ( exists $gard->{childTargets} ) @@ -1324,6 +1328,7 @@ foreach my $argnum ( 0 .. $#ARGV ) my $priority = 'NONE'; my $deconf = 0; my $gard = 0; + my $gardType = 'GARD_Fatal'; if ( exists $cdgTargetHash{$cdg}->{callout} ) { @@ -1340,6 +1345,11 @@ foreach my $argnum ( 0 .. $#ARGV ) if ( exists $cdgTargetHash{$cdg}->{gard} ) { $gard = 1; + + if ( exists $cdgTargetHash{$cdg}->{gardType} ) + { + $gardType = $cdgTargetHash{$cdg}->{gardType}; + } } # Add the Target to the objectlist if it doesn't already exist @@ -1356,6 +1366,8 @@ foreach my $argnum ( 0 .. $#ARGV ) $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_gard = $gard; \\\n"; $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_calloutPriority = fapi2::CalloutPriorities::$priority; \\\n"; + $eiEntryStr .= + " l_entries[$eiEntryCount].target_cdg.iv_gardType = fapi2::GardTypes::$gardType; \\\n"; $eiEntryCount++; } -- cgit v1.2.1