summaryrefslogtreecommitdiffstats
path: root/src/ppe/hwpf/plat/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppe/hwpf/plat/src')
-rw-r--r--src/ppe/hwpf/plat/src/Makefile45
-rw-r--r--src/ppe/hwpf/plat/src/array.C145
-rw-r--r--src/ppe/hwpf/plat/src/error_info.C412
-rw-r--r--src/ppe/hwpf/plat/src/fapi2ppefiles.mk51
-rw-r--r--src/ppe/hwpf/plat/src/ffdc.C59
-rw-r--r--src/ppe/hwpf/plat/src/plat_utils.C137
-rw-r--r--src/ppe/hwpf/plat/src/target.C35
7 files changed, 884 insertions, 0 deletions
diff --git a/src/ppe/hwpf/plat/src/Makefile b/src/ppe/hwpf/plat/src/Makefile
new file mode 100644
index 0000000..926aabc
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/Makefile
@@ -0,0 +1,45 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/ppe/hwpf/plat/src/Makefile $
+#
+# OpenPOWER OnChipController Project
+#
+# Contributors Listed Below - COPYRIGHT 2015
+# [+] International Business Machines Corp.
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+# This Makefile is designed to be invoked with the -I argument set to
+# the location of the "pk.mk" for the build
+
+include img_defs.mk
+include fapi2ppefiles.mk
+
+
+OBJS := $(addprefix $(OBJDIR)/, $(FAPI2LIB_OBJECTS))
+
+all: $(OBJS)
+
+
+$(OBJS) $(OBJS:.o=.d): | $(OBJDIR)
+
+$(OBJDIR):
+ mkdir -p $(OBJDIR)
+
+ifneq ($(MAKECMDGOALS),clean)
+include $(OBJS:.o=.d)
+endif
+
diff --git a/src/ppe/hwpf/plat/src/array.C b/src/ppe/hwpf/plat/src/array.C
new file mode 100644
index 0000000..7bb142b
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/array.C
@@ -0,0 +1,145 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/ppe/hwpf/plat/src/array.C $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file array.C
+ * @brief fapi2 arrays
+ */
+
+#include <stdint.h>
+#include <array.H>
+
+namespace fapi2
+{
+ /// @brief Create an array
+ array::array(const uint32_t i_size, element_type* i_data):
+ iv_size(i_size),
+ iv_data(i_data)
+ {
+#ifdef GREG
+ assert(iv_size <= size_limit);
+ if (iv_data == nullptr)
+ {
+ iv_data = new element_type[iv_size]();
+ iv_size |= delete_bit;
+ }
+#endif
+ // If the caller passed in a pointer, leave it be. Don't
+ // initialize it or anything. That will allow a placement
+ // operation where generic memory can use fapi2::array
+ // methods without much overhead.
+ }
+
+ /// @brief Destroy an array
+ array::~array(void)
+ {
+ if ((iv_size & delete_bit) != 0)
+ {
+#ifdef GREG
+ delete[] iv_data;
+#endif
+ }
+ }
+
+ /// @brief operator[]
+ array::element_type& array::operator[](const uint32_t i_index)
+ {
+#ifdef GREG
+ assert(i_index < size());
+#endif
+ return iv_data[i_index];
+ }
+
+ /// @brief operator=()
+ array& array::operator=(const array& i_other)
+ {
+#ifdef GREG
+ // Check to make sure it'll fit.
+ assert(i_other.size() <= size());
+#endif
+ // Our new size will be the other's size.
+ // Save of whether we should delete our iv_data ...
+ uint64_t l_our_delete_state = iv_size | delete_bit;
+
+ // ... our new size is the size (minus the delete state) of i_other
+ iv_size = i_other.size();
+
+ // ... do the copy ...
+#ifdef GREG
+ memcpy(iv_data, i_other.iv_data, iv_size * sizeof(element_type));
+#else
+ for(size_t i = 0; i < iv_size * sizeof(element_type); ++i)
+ {
+ iv_data[i] = i_other.iv_data[i];
+ }
+#endif
+
+ // ... and record our old delete state.
+ iv_size |= l_our_delete_state;
+
+ return *this;
+ }
+
+ /// @brief move operator=()
+ array& array::operator=(array&& i_other)
+ {
+ iv_size = i_other.iv_size;
+
+ // Make sure to clear the delete bit in the other. We
+ // don't want our memory to be deleted.
+ i_other.iv_size = i_other.size();
+
+ iv_data = std::move(i_other.iv_data);
+ return *this;
+ }
+
+ /// @brief operator==()
+ bool array::operator==(const array& i_other)
+ {
+ // If they're not the same size, they're not the same
+ if (size() != i_other.size())
+ {
+ return false;
+ }
+
+ // If they're the same size and point to the same memory, they're the same.
+ if (iv_data == i_other.iv_data)
+ {
+ return true;
+ }
+
+ auto oitr = i_other.begin();
+ auto iter = begin();
+
+ for(; iter != end(); ++iter, ++oitr)
+ {
+ if (*iter != *oitr)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/ppe/hwpf/plat/src/error_info.C b/src/ppe/hwpf/plat/src/error_info.C
new file mode 100644
index 0000000..08cfcb3
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/error_info.C
@@ -0,0 +1,412 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/ppe/hwpf/plat/src/error_info.C $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file error_info.C
+ * @brief Implements the error information classes
+ */
+
+#include <stdint.h>
+#include <string.h>
+#include <plat_trace.H>
+#include <error_info.H>
+#include <buffer.H>
+
+namespace fapi2
+{
+ ///
+ /// @brief Constructor
+ ///
+ /// @param[in] i_ffdcId FFDC Identifier (used to decode FFDC)
+ /// @param[in] i_pFfdc Pointer to the FFDC to copy
+ /// @param[in] i_size Size of the FFDC to copy
+ ///
+ ErrorInfoFfdc::ErrorInfoFfdc(const uint32_t i_ffdcId,
+ const void* i_pFfdc,
+ const uint32_t i_size):
+ iv_ffdcId(i_ffdcId),
+ iv_size(i_size)
+ {
+ iv_pFfdc = std::shared_ptr<uint8_t>(new uint8_t[i_size]());
+
+ // If they passed us a NULL pointer they want to fill
+ // in the data themselves later.
+ if (i_pFfdc != nullptr)
+ {
+ memcpy(iv_pFfdc.get(), i_pFfdc, i_size);
+ }
+ }
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_hw Hardware to callout
+ /// @param[in] i_calloutPriority Priority of callout
+ /// @param[in] i_refTarget Reference to reference target
+ ///
+ ErrorInfoHwCallout::ErrorInfoHwCallout(
+ const HwCallouts::HwCallout i_hw,
+ const CalloutPriorities::CalloutPriority i_calloutPriority,
+ const Target<TARGET_TYPE_ALL> & i_refTarget):
+ iv_hw(i_hw),
+ iv_calloutPriority(i_calloutPriority),
+ iv_refTarget(i_refTarget)
+ {}
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_procedure Procedure to callout
+ /// @param[in] i_calloutPriority Priority of callout
+ ///
+ ErrorInfoProcedureCallout::ErrorInfoProcedureCallout(
+ const ProcedureCallouts::ProcedureCallout i_procedure,
+ const CalloutPriorities::CalloutPriority i_calloutPriority):
+ iv_procedure(i_procedure),
+ iv_calloutPriority(i_calloutPriority)
+ {}
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_target1 Reference to target on one end of the bus
+ /// @param[in] i_target2 Reference to target on other end of the bus
+ /// @param[in] i_calloutPriority Priority of callout
+ ///
+ ErrorInfoBusCallout::ErrorInfoBusCallout(
+ const Target<TARGET_TYPE_ALL> & i_target1,
+ const Target<TARGET_TYPE_ALL> & i_target2,
+ const CalloutPriorities::CalloutPriority i_calloutPriority):
+ iv_target1(i_target1),
+ iv_target2(i_target2),
+ iv_calloutPriority(i_calloutPriority)
+ {}
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_target Reference to the target to c/d/g
+ /// @param[in] i_callout True if Target should be called out
+ /// @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
+ ///
+ ErrorInfoCDG::ErrorInfoCDG(
+ const Target<TARGET_TYPE_ALL> & i_target,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority):
+ iv_target(i_target),
+ iv_callout(i_callout),
+ iv_calloutPriority(i_priority),
+ iv_deconfigure(i_deconfigure),
+ iv_gard(i_gard)
+ {}
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_parent Reference to the parent target
+ /// @oaram[in] i_childType Child target type to c/d/g
+ /// @param[in] i_callout True if Target should be called out
+ /// @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_childPort Child Port
+ /// For DIMM children, the MBA port number
+ /// @param[in] i_childNum Child Number
+ /// For DIMM children, the dimm socket number
+ /// For Chip children, the chip position
+ /// For Chiplet children, the chiplet unit pos
+ ///
+ ErrorInfoChildrenCDG::ErrorInfoChildrenCDG(
+ const Target<TARGET_TYPE_ALL> & i_parentChip,
+ const TargetType i_childType,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority,
+ const uint8_t i_childPort, const uint8_t i_childNum):
+ iv_parent(i_parentChip),
+ iv_childType(i_childType),
+ iv_callout(i_callout),
+ iv_calloutPriority(i_priority),
+ iv_deconfigure(i_deconfigure),
+ iv_gard(i_gard),
+ iv_childPort(i_childPort),
+ iv_childNumber(i_childNum)
+ {}
+
+ ///
+ /// @brief Constructor.
+ ///
+ /// @param[in] i_trace
+ ///
+ ErrorInfoCollectTrace::ErrorInfoCollectTrace(
+ CollectTraces::CollectTrace i_traceId):
+ iv_eiTraceId(i_traceId)
+ {}
+
+
+ ///
+ /// @brief Collect target, buffer or generic FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryFfdc::addErrorInfo(std::shared_ptr<ErrorInfo> i_info,
+ const void* const* i_objects) const
+ {
+ // "variable buffer ffdc not yet implemented");
+ assert(iv_ffdcSize != EI_FFDC_SIZE_VBUF);
+
+ switch(iv_ffdcSize)
+ {
+ case EI_FFDC_SIZE_BUF:
+ {
+ const buffer<uint64_t>* object =
+ static_cast<const buffer<uint64_t>*>(i_objects[iv_ffdcObjIndex]);
+
+ i_info->iv_ffdcs.push_back(std::shared_ptr<ErrorInfoFfdc>(
+ new ErrorInfoFfdc(iv_ffdcId, object,
+ sizeof(object))));
+
+ FAPI_DBG("addErrorInfo: Adding buffer id: 0x%x size: %lu buf: 0x%lx",
+ iv_ffdcId, sizeof(object), uint64_t(*object));
+ }
+ break;
+
+ case EI_FFDC_SIZE_TARGET:
+ {
+ Target<TARGET_TYPE_ALL> object =
+ *(static_cast<const Target<TARGET_TYPE_ALL>*>
+ (i_objects[iv_ffdcObjIndex]));
+
+ // Allocate an ErrorInfoFfdc but don't copy anything in to it.
+ // We can copy the target string once if we copy directly into
+ // the error info
+ ErrorInfoFfdc* e =
+ new ErrorInfoFfdc(iv_ffdcId, nullptr, MAX_ECMD_STRING_LEN);
+
+ toString(object, static_cast<char*>(e->getData()),
+ MAX_ECMD_STRING_LEN);
+ i_info->iv_ffdcs.push_back(std::shared_ptr<ErrorInfoFfdc>(e));
+
+ FAPI_DBG("addErrorInfo: Adding target ffdc id: 0x%x %s",
+ iv_ffdcId, static_cast<char*>(e->getData()));
+ }
+ break;
+
+ default:
+ i_info->iv_ffdcs.push_back(std::shared_ptr<ErrorInfoFfdc>(
+ new ErrorInfoFfdc(
+ iv_ffdcId,
+ i_objects[iv_ffdcObjIndex],
+ iv_ffdcSize)));
+ FAPI_DBG("addErrorInfo: Adding ffdc id 0x%x size: %d",
+ iv_ffdcId, iv_ffdcSize);
+ break;
+
+ };
+
+ return;
+ }
+
+ ///
+ /// @brief Collect h/w callout FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryHwCallout::addErrorInfo(std::shared_ptr<ErrorInfo> i_info,
+ const void* const* i_object) const
+ {
+ // If the index is 0xFF, we use an empty target. Otherwise the
+ // target is taken from the object arrary with the given index.
+ const fapi2::Target<TARGET_TYPE_ALL> target =
+ iv_refObjIndex == 0xFF ?
+ fapi2::Target<TARGET_TYPE_ALL>() :
+ *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*>
+ (i_object[iv_refObjIndex]));
+
+ ErrorInfoHwCallout* ei = new ErrorInfoHwCallout(
+ static_cast<HwCallouts::HwCallout>(iv_hw),
+ static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority),
+ target);
+
+ FAPI_DBG("addErrorInfo: Adding hw callout target: 0x%lx hw: %d, pri: %d",
+ ei->iv_refTarget.get(), ei->iv_hw, ei->iv_calloutPriority);
+
+ i_info->iv_hwCallouts.push_back(std::shared_ptr<ErrorInfoHwCallout>(ei));
+ }
+
+ ///
+ /// @brief Collect proc callout FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryProcCallout::addErrorInfo(
+ std::shared_ptr<ErrorInfo> i_info,
+ const void* const* ) const
+ {
+ ErrorInfoProcedureCallout* ei = new ErrorInfoProcedureCallout(
+ static_cast<ProcedureCallouts::ProcedureCallout>(iv_procedure),
+ static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority));
+
+ // Add the ErrorInfo
+ FAPI_DBG("addErrorInfo: Adding proc callout, proc: %d, pri: %d",
+ ei->iv_procedure, ei->iv_calloutPriority);
+
+ i_info->iv_procedureCallouts.push_back(
+ std::shared_ptr<ErrorInfoProcedureCallout>(ei));
+ }
+
+ ///
+ /// @brief Collect bus callout FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryBusCallout::addErrorInfo(
+ std::shared_ptr<ErrorInfo> i_info,
+ const void* const* i_object) const
+ {
+ // We need to add a procedure callout as well as a bus callout
+ ErrorInfoEntryProcCallout(ProcedureCallouts::BUS_CALLOUT,
+ iv_calloutPriority).addErrorInfo(i_info,
+ i_object);
+
+ // Now add our bus callout, but drop the priority by one.
+ ErrorInfoBusCallout* ei = new ErrorInfoBusCallout(
+ // First target
+ *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*>
+ (i_object[iv_endpoint1ObjIndex])),
+
+ // Second target
+ *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*>
+ (i_object[iv_endpoint2ObjIndex])),
+
+ // Priority, one lower.
+ (iv_calloutPriority == CalloutPriorities::HIGH) ?
+ CalloutPriorities::MEDIUM : CalloutPriorities::LOW);
+
+ FAPI_DBG("addErrorInfo: Adding bus callout t1: 0x%lx t2: 0x%lx, pri: %d",
+ ei->iv_target1.get(), ei->iv_target2.get(),
+ ei->iv_calloutPriority);
+
+ i_info->iv_busCallouts.push_back(
+ std::shared_ptr<ErrorInfoBusCallout>(ei));
+ }
+
+ ///
+ /// @brief Collect h/w target cdg FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryTargetCDG::addErrorInfo(
+ std::shared_ptr<ErrorInfo> i_info,
+ const void* const* i_object) const
+ {
+ ErrorInfoCDG* ei = new
+ ErrorInfoCDG(
+ *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*>
+ (i_object[iv_targetObjIndex])),
+ iv_callout,
+ iv_deconfigure,
+ iv_gard,
+ static_cast<CalloutPriorities::CalloutPriority>
+ (iv_calloutPriority)
+ );
+
+ FAPI_DBG("addErrorInfo: Adding target 0x%lx cdg (%d:%d:%d), pri: %d",
+ ei->iv_target.get(),
+ ei->iv_callout, ei->iv_deconfigure,
+ ei->iv_gard, ei->iv_calloutPriority);
+
+ // Add the ErrorInfo
+ i_info->iv_CDGs.push_back(std::shared_ptr<ErrorInfoCDG>(ei));
+ }
+
+ ///
+ /// @brief Collect h/w children cdg FFDC information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryChildrenCDG::addErrorInfo(
+ std::shared_ptr<ErrorInfo> i_info,
+ const void* const* i_object) const
+ {
+ ErrorInfoChildrenCDG* ei = new ErrorInfoChildrenCDG(
+ *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*>
+ (i_object[iv_parentObjIndex])),
+ static_cast<fapi2::TargetType>(iv_childType),
+ iv_callout,
+ iv_deconfigure,
+ iv_gard,
+ static_cast<CalloutPriorities::CalloutPriority>
+ (iv_calloutPriority),
+ iv_childPort,
+ iv_childNumber);
+
+ FAPI_DBG("addErrorInfo: Adding children cdg (%d:%d:%d), type:"
+ " 0x%08x, pri: %d",
+ ei->iv_callout, ei->iv_deconfigure, ei->iv_gard,
+ ei->iv_childType, ei->iv_calloutPriority);
+
+ // Add the ErrorInfo
+ i_info->iv_childrenCDGs.push_back(
+ std::shared_ptr<ErrorInfoChildrenCDG>(ei));
+ }
+
+ ///
+ /// @brief Collect trace information to this ffdc
+ /// object
+ /// @param[in] A pointer to the error info we're collecting
+ /// @param[in] A pointer to the objects
+ /// @return void
+ ///
+ void ErrorInfoEntryCollectTrace::addErrorInfo(
+ std::shared_ptr<ErrorInfo> i_info,
+ const void* const* ) const
+ {
+ ErrorInfoCollectTrace* ei = new ErrorInfoCollectTrace(
+ static_cast<CollectTraces::CollectTrace>(iv_eieTraceId));
+
+ FAPI_DBG("addErrorInfo: Adding trace: 0x%x", ei->iv_eiTraceId);
+
+ // Add the ErrorInfo
+ i_info->iv_traces.push_back(std::shared_ptr<ErrorInfoCollectTrace>(ei));
+ }
+
+};
diff --git a/src/ppe/hwpf/plat/src/fapi2ppefiles.mk b/src/ppe/hwpf/plat/src/fapi2ppefiles.mk
new file mode 100644
index 0000000..3adeec6
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/fapi2ppefiles.mk
@@ -0,0 +1,51 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/ppe/hwpf/plat/src/fapi2ppefiles.mk $
+#
+# OpenPOWER OnChipController Project
+#
+# Contributors Listed Below - COPYRIGHT 2015
+# [+] International Business Machines Corp.
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+# @file fapi2ppefiles.mk
+#
+# @brief mk for including fapi2 object files
+#
+# @page ChangeLogs Change Logs
+# @section fapi2ppefiles.mk
+# @verbatim
+#
+#
+# Change Log ******************************************************************
+# Flag Defect/Feature User Date Description
+# ------ -------------- ---------- ------------ -----------
+#
+# @endverbatim
+#
+##########################################################################
+# Object Files
+##########################################################################
+
+
+FAPI2-C-SOURCES += fapi2PlatAttributeService.C \
+ plat_utils.C
+
+FAPI2-S-SOURCES =
+
+FAPI2LIB_OBJECTS += $(FAPI2-C-SOURCES:.C=.o) $(FAPI2-S-SOURCES:.S=.o)
+
diff --git a/src/ppe/hwpf/plat/src/ffdc.C b/src/ppe/hwpf/plat/src/ffdc.C
new file mode 100644
index 0000000..d200e4f
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/ffdc.C
@@ -0,0 +1,59 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/ppe/hwpf/plat/src/ffdc.C $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file ffdc.C
+ * @brief Implements the FirstFailureData class
+ */
+
+#include <plat_trace.H>
+#include <ffdc.H>
+#include <error_info.H>
+
+namespace fapi2
+{
+
+ ///
+ /// @brief Add error information to this ffdc object
+ /// @param[in] A pointer to a list of objects
+ /// @param[in] A pointer to the list of entries
+ /// @param[in] The count of how many entries there are
+ /// @return void
+ ///
+ template<>
+ void FirstFailureData<ReturnCode>::addErrorInfo(
+ const void* const* i_pObjects,
+ const ErrorInfoEntry* i_pEntries,
+ const uint8_t i_count)
+ {
+ FAPI_DBG("%d entries", i_count);
+ for (uint32_t i = 0; i < i_count; i++)
+ {
+ i_pEntries[i].addErrorInfo(iv_info, i_pObjects);
+ }
+ }
+
+
+
+};
diff --git a/src/ppe/hwpf/plat/src/plat_utils.C b/src/ppe/hwpf/plat/src/plat_utils.C
new file mode 100644
index 0000000..2b6773a
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/plat_utils.C
@@ -0,0 +1,137 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/ppe/hwpf/plat/src/plat_utils.C $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file plat_utils.C
+ * @brief Implements fapi2 common utilities
+ */
+
+#include <stdint.h>
+#include <plat_trace.H>
+#include <return_code.H>
+#include <error_info.H>
+
+namespace fapi2
+{
+ ///
+ /// @brief Log an error.
+ ///
+ void logError(
+ fapi2::ReturnCode & io_rc,
+ fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE,
+ bool i_unitTestError = false )
+ {
+ // To keep the compiler from complaing about i_sevbeing unused.
+ static_cast<void>(i_sev);
+ static_cast<void>(i_unitTestError);
+
+ FAPI_DBG("logging 0x%lx.", uint64_t(io_rc));
+
+ // Iterate over the vectors and output what is in them.
+ const ErrorInfo* ei = io_rc.getErrorInfo();
+
+ FAPI_DBG("ffdcs: %lu", ei->iv_ffdcs.size());
+ for( auto i = ei->iv_ffdcs.begin(); i != ei->iv_ffdcs.end(); ++i )
+ {
+ uint32_t sz;
+ (*i)->getData(sz);
+ FAPI_DBG("\tid: 0x%x size %d", (*i)->getFfdcId(), sz);
+ }
+
+ FAPI_DBG("hwCallouts: %lu", ei->iv_hwCallouts.size());
+ for( auto i = ei->iv_hwCallouts.begin(); i != ei->iv_hwCallouts.end();
+ ++i )
+ {
+ FAPI_DBG("\thw: %d pri %d target: 0x%lx",
+ (*i)->iv_hw, (*i)->iv_calloutPriority,
+ (*i)->iv_refTarget.get());
+ }
+
+ FAPI_DBG("procedureCallouts: %lu", ei->iv_procedureCallouts.size());
+ for( auto i = ei->iv_procedureCallouts.begin();
+ i != ei->iv_procedureCallouts.end(); ++i )
+ {
+ FAPI_DBG("\tprocedure: %d pri %d",
+ (*i)->iv_procedure, (*i)->iv_calloutPriority);
+ }
+
+ FAPI_DBG("busCallouts: %lu", ei->iv_busCallouts.size());
+ for( auto i = ei->iv_busCallouts.begin(); i != ei->iv_busCallouts.end();
+ ++i )
+ {
+ FAPI_DBG("\tbus: t1: 0x%lx t2: 0x%lx pri: %d",
+ (*i)->iv_target1.get(), (*i)->iv_target2.get(),
+ (*i)->iv_calloutPriority);
+ }
+
+
+ FAPI_DBG("cdgs: %lu", ei->iv_CDGs.size());
+ for( auto i = ei->iv_CDGs.begin(); i != ei->iv_CDGs.end(); ++i )
+ {
+ FAPI_DBG("\ttarget: 0x%lx co: %d dc: %d gard: %d pri: %d",
+ (*i)->iv_target.get(),
+ (*i)->iv_callout,
+ (*i)->iv_deconfigure,
+ (*i)->iv_gard,
+ (*i)->iv_calloutPriority);
+
+ }
+
+ FAPI_DBG("childrenCDGs: %lu", ei->iv_childrenCDGs.size());
+ for( auto i = ei->iv_childrenCDGs.begin();
+ i != ei->iv_childrenCDGs.end(); ++i )
+ {
+ FAPI_DBG("\tchildren: parent 0x%lx co: %d dc: %d gard: %d pri: %d",
+ (*i)->iv_parent.get(),
+ (*i)->iv_callout,
+ (*i)->iv_deconfigure,
+ (*i)->iv_gard,
+ (*i)->iv_calloutPriority);
+ }
+
+ FAPI_DBG("traces: %lu", ei->iv_traces.size());
+ for( auto i = ei->iv_traces.begin(); i != ei->iv_traces.end(); ++i )
+ {
+ FAPI_DBG("\ttraces: 0x%x", (*i)->iv_eiTraceId);
+ }
+
+ // Release the ffdc information now that we're done with it.
+ io_rc.forgetData();
+
+ }
+
+ ///
+ /// @brief Delay this thread.
+ ///
+ ReturnCode delay(uint64_t i_nanoSeconds, uint64_t i_simCycles)
+ {
+ // void statements to keep the compiler from complaining
+ // about unused variables.
+ static_cast<void>(i_nanoSeconds);
+ static_cast<void>(i_simCycles);
+
+ // replace with platform specific implementation
+ return FAPI2_RC_SUCCESS;
+ }
+};
diff --git a/src/ppe/hwpf/plat/src/target.C b/src/ppe/hwpf/plat/src/target.C
new file mode 100644
index 0000000..2439a3f
--- /dev/null
+++ b/src/ppe/hwpf/plat/src/target.C
@@ -0,0 +1,35 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/ppe/hwpf/plat/src/target.C $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#include <target.H>
+
+namespace fapi2
+{
+ std::vector Target::getChildren(void) const
+
+};
+
+
+
OpenPOWER on IntegriCloud