summaryrefslogtreecommitdiffstats
path: root/src/import/hwpf
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2018-08-21 22:39:07 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2018-09-06 06:34:05 -0500
commita2fae5c9cbeb30af911e26413ca21268562b26cf (patch)
tree7d463db194324570e9c510441703be058313cfa3 /src/import/hwpf
parentab21d9215c0ecf9b018470a63700d32e102501d3 (diff)
downloadtalos-sbe-a2fae5c9cbeb30af911e26413ca21268562b26cf.tar.gz
talos-sbe-a2fae5c9cbeb30af911e26413ca21268562b26cf.zip
Modify the getFfdc routine to consider the SBE proc
-The SBE returns target instance numbers associated with the proc, not the system. This commit adds a translation to map the instance number to the FAPI_FAPI position based on the proc number. Change-Id: I9b296142cd977dee8c1f390f48abfd4b0cb0abe8 CQ:SW442966 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64995 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+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: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64996 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/hwpf')
-rw-r--r--src/import/hwpf/fapi2/include/error_info_defs.H58
-rwxr-xr-xsrc/import/hwpf/fapi2/tools/parseErrorInfo.pl8
2 files changed, 56 insertions, 10 deletions
diff --git a/src/import/hwpf/fapi2/include/error_info_defs.H b/src/import/hwpf/fapi2/include/error_info_defs.H
index 2f6db98c..66e8a83a 100644
--- a/src/import/hwpf/fapi2/include/error_info_defs.H
+++ b/src/import/hwpf/fapi2/include/error_info_defs.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -160,6 +160,24 @@ enum ErrorInfoType
EI_LAST_TYPE = EI_TYPE_COLLECT_TRACE + 1,
};
+// @brief used when translating the SBE targets instance into a fapi pos.
+enum maxTargetsPerProc : uint16_t
+{
+ MAX_MCBIST_PER_PROC = 2,
+ MAX_MC_PER_PROC = 2,
+ MAX_MI_PER_PROC = 4,
+ MAX_MCS_PER_PROC = 4,
+ MAX_EQ_PER_PROC = 6,
+ MAX_MCA_PER_PROC = 8,
+ MAX_PHB_PER_PROC = 6,
+ MAX_EX_PER_PROC = 12,
+ MAX_CORE_PER_PROC = 24,
+ MAX_PERV_PER_PROC = 56,
+ INVALID_TARGET_COUNT = 0xFFFF,
+ INVALID_FAPI_POS = INVALID_TARGET_COUNT,
+};
+
+
#ifndef MINIMUM_FFDC
///
/// @enum HwCallout
@@ -251,10 +269,21 @@ enum CollectTrace
};
}
+// @brief convert the processor relative sbe target instance into a fapi pos
+//
+// @param[in] i_targType - type of target from SBE FFDC buffer
+// @param[in] i_proc - current SBE processor number
+// @param[in] i_instance - instance of i_targType relitive to the processor
+// number i_proc.
+//
+uint16_t convertSbeTargInstanceToFapiPos(fapi2::TargetType i_targType,
+ fapi2::Target<TARGET_TYPE_PROC_CHIP>& i_proc, uint16_t i_instance);
+
// NOTE - this assumes no buffer_t or variable_buffers are passed
// data is converted to a uint64_t when placed into the sbe ffdc
// buffer
-inline fapi2::ffdc_t getFfdcData( sbeFfdc_t& i_sbeFfdc, bool& invalid_data )
+inline fapi2::ffdc_t getFfdcData( sbeFfdc_t& i_sbeFfdc, uint8_t i_proc_instance,
+ bool& invalid_data )
{
fapi2::ffdc_t l_ffdc;
@@ -264,15 +293,32 @@ inline fapi2::ffdc_t getFfdcData( sbeFfdc_t& i_sbeFfdc, bool& invalid_data )
{
#ifdef FAPI2_ENABLE_PLATFORM_GET_TARGET
uint64_t targetData = i_sbeFfdc.data;
+ // get a fapi target for the passed in proc instance
+ auto l_proc =
+ getTarget<TARGET_TYPE_PROC_CHIP>(i_proc_instance);
+
fapi2::TargetType type = static_cast<fapi2::TargetType>(targetData >> 32);
- uint8_t instance = static_cast<uint8_t>(targetData & 0xFFFFFFFF);
- // call hostboot to get the fapi2 target reference
- l_ffdc.ptr() = static_cast<void*>(getTarget<TARGET_TYPE_ALL>(type, instance));
- if(l_ffdc.ptr() == nullptr )
+ // sbe returns the target instance based on processor scope,
+ // we will need to convert that number to system scope (FAPI_POS)
+ uint16_t instance = static_cast<uint16_t>(targetData & 0xFFFFFFFF);
+
+ uint16_t fapi_pos = convertSbeTargInstanceToFapiPos(type, l_proc, instance);
+
+ if( fapi_pos == INVALID_FAPI_POS )
{
invalid_data = true;
}
+ else
+ {
+ // call hostboot to get the fapi2 target pointer
+ l_ffdc.ptr() = static_cast<void*>(getTarget<TARGET_TYPE_ALL>(type, fapi_pos));
+
+ if(l_ffdc.ptr() == nullptr )
+ {
+ invalid_data = true;
+ }
+ }
#endif
}
diff --git a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
index 833a94a1..b4dc1949 100755
--- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
+++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
@@ -303,7 +303,7 @@ sub addFfdcMethod
$method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n return *this;\n }\n\n";
$methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
$methods->{$objectNumber}{localvar} =
- "$ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],invalid_data);";
+ "$ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],proc_instance,invalid_data);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
else
@@ -336,7 +336,7 @@ sub addFfdcMethod
$method_body .= " }\n\n";
$methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
$methods->{$objectNumber}{localvar} =
- "$buffer_ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],invalid_data);";
+ "$buffer_ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],proc_instance,invalid_data);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
@@ -373,7 +373,7 @@ sub addFfdcMethod
$methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
$methods->{$objectNumber}{localvar} =
- "$ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],invalid_data);";
+ "$ffdc_type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],proc_instance,invalid_data);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc=$ffdc_uc;";
}
elsif ( $type eq $scom_addr_type )
@@ -394,7 +394,7 @@ sub addFfdcMethod
$method_body .= " return *this;}\n\n";
$methods->{$key}{member} = "$type $ffdc_uc;";
$methods->{$objectNumber}{localvar} =
- "$type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],invalid_data);";
+ "$type $ffdc_uc = fapi2::getFfdcData(i_ebuf[$objectNumber],proc_instance,invalid_data);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
else
OpenPOWER on IntegriCloud