summaryrefslogtreecommitdiffstats
path: root/src/import/hwpf
diff options
context:
space:
mode:
authorPrasad Bg Ranganath <prasadbgr@in.ibm.com>2017-10-02 12:41:43 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2017-10-09 16:01:31 -0400
commitfb91c96d1158b58a698615e2bdef1217e39ea0e0 (patch)
tree3bf1a781fca891f38651fd00cbd0db19a474d888 /src/import/hwpf
parent6072cd8cb0f8eed933ec35aca419166f76e2d79a (diff)
downloadtalos-hostboot-fb91c96d1158b58a698615e2bdef1217e39ea0e0.tar.gz
talos-hostboot-fb91c96d1158b58a698615e2bdef1217e39ea0e0.zip
PM Recovery FFDC: Added support to collect Register data for PPM
Change-Id: I841cf840c8df49640b7612832960f56a59419ad7 RTC:179598 RTC:179602 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47011 Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> Reviewed-by: PARVATHI RACHAKONDA <prachako@in.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47051 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>
Diffstat (limited to 'src/import/hwpf')
-rw-r--r--src/import/hwpf/fapi2/include/collect_reg_ffdc.H41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/import/hwpf/fapi2/include/collect_reg_ffdc.H b/src/import/hwpf/fapi2/include/collect_reg_ffdc.H
index 8a281acdd..3e96bfe14 100644
--- a/src/import/hwpf/fapi2/include/collect_reg_ffdc.H
+++ b/src/import/hwpf/fapi2/include/collect_reg_ffdc.H
@@ -35,6 +35,7 @@
#include <return_code.H>
#include <fapi2_attribute_service.H>
#include <plat_trace.H>
+#include <endian.h>
namespace fapi2
@@ -393,7 +394,47 @@ ReturnCode collectRegisterData(std::vector<T>& i_addresses, U& i_reader,
return l_rc;
}
+template< typename T, class U>
+ReturnCode collectRegisterAndAddressData(std::vector<T>& i_addresses, U& i_reader,
+ uint32_t i_offset, uint8_t*& o_pData)
+{
+ FAPI_DBG("collectRegisterAndAddressData -> address count: 0x%lx", i_addresses.size());
+
+ T l_data = 0;
+
+ ReturnCode l_rc = FAPI2_RC_SUCCESS;
+
+ for( auto address : i_addresses )
+ {
+ fapi2::buffer<T> l_buf;
+
+ T l_address = address + i_offset;
+
+ l_rc = i_reader.read_register(l_address, l_buf);
+
+ if(l_rc)
+ {
+ l_data = 0xbaddbadd;
+ }
+ else
+ {
+ l_data = l_buf();
+ }
+
+ l_address = htobe32(l_address);
+ l_data = htobe64(l_data);
+
+ memcpy(o_pData, &l_address, sizeof(uint32_t));
+ o_pData += sizeof(uint32_t);
+ memcpy(o_pData, &l_data, sizeof(T));
+
+ o_pData += sizeof(T);
+
+ }
+
+ return l_rc;
+}
///
/// @brief readRegisters
OpenPOWER on IntegriCloud