summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp
diff options
context:
space:
mode:
authorMatt Derksen <v2cibmd@us.ibm.com>2016-03-04 10:45:33 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-04-04 09:09:35 -0400
commit287d15e08990eb8ad9892ca94ac38ebe35f9229e (patch)
treef2e0b3d9c559d3db9b156ff3f84a6783b1764d26 /src/usr/hwpf/hwp
parent4b4772ef8b18f2e9c80795c47b3a5f81b3521c1f (diff)
downloadblackbird-hostboot-287d15e08990eb8ad9892ca94ac38ebe35f9229e.tar.gz
blackbird-hostboot-287d15e08990eb8ad9892ca94ac38ebe35f9229e.zip
ISTEP08 HWP enablement
Change-Id: Id999da8e97c0bcd5cefabdeb2fe7c80d1efbf5da RTC: 146576 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21463 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r--src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C259
-rw-r--r--src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H131
2 files changed, 0 insertions, 390 deletions
diff --git a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C b/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C
deleted file mode 100644
index 5c40c091a..000000000
--- a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C
+++ /dev/null
@@ -1,259 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C $ */
-/* */
-/* OpenPOWER HostBoot 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 "pbusLinkSvc.H"
-#include <isteps/hwpf_reasoncodes.H>
-
-namespace EDI_EI_INITIALIZATION
-{
-
-using namespace TARGETING;
-using namespace fapi;
-
-PbusLinkSvc & PbusLinkSvc::getTheInstance()
-{
- return Singleton<PbusLinkSvc>::instance();
-}
-
-PbusLinkSvc::PbusLinkSvc()
-{
- mutex_init(&iv_mutex);
-}
-
-PbusLinkSvc::~PbusLinkSvc()
-{
- mutex_destroy(&iv_mutex);
-}
-
-errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections,
- TYPE i_busType, bool i_noDuplicate )
-{
- errlHndl_t l_errl = NULL;
- TargetPairs_t * l_PbusConnections = NULL;
- o_PbusConnections.clear();
-
- mutex_lock(&iv_mutex);
-
- if (i_busType == TYPE_ABUS)
- {
- if (iv_abusConnections.size() == 0)
- {
- l_errl = collectPbusConections( TYPE_ABUS );
- }
- if (l_errl == NULL)
- {
- l_PbusConnections = i_noDuplicate ? &iv_abusUniqueConnections :
- &iv_abusConnections;
- }
- }
- else
- {
- if (iv_xbusConnections.size() == 0)
- {
- l_errl = collectPbusConections( TYPE_XBUS );
- }
- if (l_errl == NULL)
- {
- l_PbusConnections = i_noDuplicate ? &iv_xbusUniqueConnections :
- &iv_xbusConnections;
- }
- }
-
- if (l_errl == NULL)
- {
- o_PbusConnections.insert( (*l_PbusConnections).begin(),
- (*l_PbusConnections).end() );
- }
-
- mutex_unlock(&iv_mutex);
-
- return l_errl;
-}
-
-
-errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType )
-{
- errlHndl_t l_errl = NULL;
-
- // Get all functional i_busType chiplets
- TARGETING::TargetHandleList l_busTargetList;
- getAllChiplets(l_busTargetList, i_busType);
-
- // select the appropriate maps to work with
- TargetPairs_t & l_PbusConnections = (i_busType == TYPE_ABUS) ?
- iv_abusConnections : iv_xbusConnections;
- TargetPairs_t & l_PbusUniqueConnections = (i_busType == TYPE_ABUS) ?
- iv_abusUniqueConnections : iv_xbusUniqueConnections;
-
- // Collect all functional i_busType pbus connections
- for (TargetHandleList::iterator l_bus_iter = l_busTargetList.begin();
- (l_errl == NULL) && (l_bus_iter != l_busTargetList.end());
- ++l_bus_iter)
- {
- // get two endpoint targets
- const TARGETING::Target * l_pTarget = *l_bus_iter;
- const TARGETING::Target * l_dstTgt =
- l_pTarget->getAttr<ATTR_PEER_TARGET>();
-
- // connection is existing, not to itself and is a real target
- if ((l_dstTgt != NULL) && (l_dstTgt != l_pTarget))
- {
- TYPE l_dstType = l_dstTgt->getAttr<ATTR_TYPE>();
- if (l_dstType != i_busType)
- {
- TRACFCOMP(TARGETING::g_trac_targeting,
- "Both endpoints' bus type mismatch; "
- "target HUID %.8X dest HUID",
- TARGETING::get_huid(l_pTarget),
- TARGETING::get_huid(l_dstTgt));
-
- // Mixed bus type connection
- /*@
- * @errortype ERRL_SEV_UNRECOVERABLE
- * @moduleid MOD_EDI_EI_IO_RUN_TRAINING
- * @reasoncode RC_MIXED_PBUS_CONNECTION
- * @userdata1 Endpoint1 bus type
- * @userdata2 Endpoint2 bus type
- * @devdesc Platform generated error. See User Data.
- */
- l_errl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_EDI_EI_IO_RUN_TRAINING,
- RC_MIXED_PBUS_CONNECTION,
- i_busType,
- l_dstType );
- continue;
- }
-
- // Get the chip parents of endpoints
- const TARGETING::Target * l_endp1Parent = getParentChip(l_pTarget);
- const TARGETING::Target * l_endp2Parent = getParentChip(l_dstTgt);
-
- if (l_endp1Parent == l_endp2Parent)
- {
- TRACFCOMP(TARGETING::g_trac_targeting,
- "Both endpoints from same chip; "
- "target HUID %.8X dest HUID %.8X",
- TARGETING::get_huid(l_pTarget),
- TARGETING::get_huid(l_dstTgt));
-
- // connection of same chip
- /*@
- * @errortype ERRL_SEV_UNRECOVERABLE
- * @moduleid MOD_EDI_EI_IO_RUN_TRAINING
- * @reasoncode RC_SAME_CHIP_PBUS_CONNECTION
- * @devdesc Platform generated error.
- */
- l_errl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_EDI_EI_IO_RUN_TRAINING,
- RC_SAME_CHIP_PBUS_CONNECTION );
- continue;
- }
-
- for (TargetHandleList::iterator l_dst_iter = l_busTargetList.begin();
- l_dst_iter != l_busTargetList.end();
- ++l_dst_iter)
- {
- // l_dstTgt is functional
- if (l_dstTgt == *l_dst_iter)
- {
- // save the pair if not yet done so
- l_PbusConnections[l_pTarget] = l_dstTgt;
- l_PbusUniqueConnections[l_pTarget] = l_dstTgt;
- break;
- }
- }
- }
- } // for l_bus_iter
-
- // Validate pbus connections are valid and strike out
- // duplicates for the Unique connection map
- TargetPairs_t::iterator l_itr, l_jtr;
- for (l_itr = l_PbusUniqueConnections.begin();
- (l_errl == NULL) && (l_itr != l_PbusUniqueConnections.end());
- ++l_itr)
- {
- const TARGETING::Target *l_ptr1 = l_itr->first;
- const TARGETING::Target *l_ptr2 = l_itr->second;
- l_jtr = l_PbusUniqueConnections.find(l_ptr2);
- if ((l_jtr == l_PbusUniqueConnections.end())
- || (l_jtr->second != l_ptr1))
- {
- // Connection is conflicting, e.g.
- // endp1 -> endp2 but endp2 -> endp3.
- // endp1 -> endp2 but endp2 -> endp2 (itself) or not existing
- EntityPath l_path;
- l_path = l_itr->second->getAttr<ATTR_PHYS_PATH>();
- char *l_pathString = l_path.toString();
- TARG_ERR( "First endpoint's PEER_TARGET is %s", l_pathString );
- free (l_pathString);
- if (l_jtr != l_PbusUniqueConnections.end())
- {
- l_path = l_jtr->second->getAttr<ATTR_PHYS_PATH>();
- l_pathString = l_path.toString();
- TARG_ERR("Second endpoint's PEER_TARGET is %s", l_pathString);
- free (l_pathString);
- }
- else
- {
- if (l_ptr2)
- {
- l_path = l_ptr2->getAttr<ATTR_PHYS_PATH>();
- l_pathString = l_path.toString();
- TARG_ERR("Second endpoint's PEER_TARGET is itself, %s",
- l_pathString);
- free (l_pathString);
- }
- else
- {
- TARG_ERR("Second endpoint's PEER_TARGET is not existing");
- }
- }
-
- /*@
- * @errortype ERRL_SEV_UNRECOVERABLE
- * @moduleid MOD_EDI_EI_IO_RUN_TRAINING
- * @reasoncode RC_CONFLICT_PBUS_CONNECTION
- * @userdata1 Bus endpoint target pointer1
- * @userdata2 Bus endpoint target pointer2
- * @devdesc Platform generated error. See User Data.
- */
- l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_EDI_EI_IO_RUN_TRAINING,
- RC_CONFLICT_PBUS_CONNECTION,
- reinterpret_cast<uint64_t>(l_ptr1),
- reinterpret_cast<uint64_t>(l_ptr2));
- break;
- }
- else
- {
- l_PbusUniqueConnections.erase(l_jtr);
- }
- }
-
- return l_errl;
-}
-
-}
diff --git a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H b/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H
deleted file mode 100644
index 141c1007f..000000000
--- a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H
+++ /dev/null
@@ -1,131 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
-/* */
-/* 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 pbusLinkSvc.H
- *
- * Singleton service to provide validation of pbus connections and
- * return validated valid connections
- *
- */
-
-#ifndef __PBUSLINKSVC_H
-#define __PBUSLINKSVC_H
-
-#include <stdint.h>
-#include <util/singleton.H>
-#include <map>
-
-#include <errl/errlentry.H>
-
-// targeting support
-#include <targeting/common/commontargeting.H>
-#include <targeting/common/utilFilter.H>
-#include <targeting/common/trace.H>
-
-// fapi support
-#include <fapi.H>
-
-namespace EDI_EI_INITIALIZATION
-{
-
-using namespace TARGETING;
-using namespace fapi;
-
-typedef std::map<const TARGETING::Target*,
- const TARGETING::Target*> TargetPairs_t;
-
-class PbusLinkSvc
-{
-
-public:
-
- /**
- * @brief Get singleton instance of this class.
- *
- * @return the (one and only) instance of PbusLinkSvc
- */
- static PbusLinkSvc& getTheInstance();
-
- /**
- * @brief getPbusConnections() will collect all pbus connections of
- * the specified bus type. If this is the first time collection,
- * it will perform the collection and save them into the vectors
- * within the singleton. Then, it will make a copy into the
- * caller's map whose reference is passed to this function.
- *
- * @parm[out] o_PbusConnections, reference of a map for getting a copy
- * of the map of specified bus connections
- * @parm[in] i_busType, type of bus connection, TYPE_XBUS or TYPE_ABUS
- * @parm[in] i_noDuplicate, set to true to eliminate duplicates, i.e.
- * only (endpoint1,endpoint2) or (endpoint2,endpoint1) will
- * be in the present in the map
- * @return errlHndl_t if encountering an error, or NULL (no error)
- *
- */
-
- errlHndl_t getPbusConnections( TargetPairs_t & o_PbusConnections,
- TYPE i_busType, bool i_noDuplicate = true );
-
-protected:
- /**
- * @brief Constructor for the PbusLinkSvc object.
- */
- PbusLinkSvc();
-
- /**
- * @brief Destructor for the PbusLinkSvc object.
- */
- ~PbusLinkSvc();
-
-private:
- /**
- * @note Disable copy constructor and assignment operator
- */
- PbusLinkSvc(const PbusLinkSvc& i_right);
- PbusLinkSvc& operator=(const PbusLinkSvc& i_right);
-
- TargetPairs_t iv_abusUniqueConnections;
- TargetPairs_t iv_abusConnections;
- TargetPairs_t iv_xbusUniqueConnections;
- TargetPairs_t iv_xbusConnections;
-
- // Mutex serializing changes to the above four maps
- mutex_t iv_mutex;
-
- /**
- * @brief collectPbusConections() will collect all pbus connections of
- * the specified bus type. It checks for mixed-type connection,
- * conflicting connection, and invalid-same-chip connection.
- * The connections are saved within the singleton.
- *
- * @parm[in] i_busType, type of bus connection, TYPE_XBUS or TYPE_ABUS
- * @return errlHndl_t if encountering an error, or NULL (no error)
- *
- */
- errlHndl_t collectPbusConections( TYPE i_busType );
-
-};
-
-}
-
-#endif
OpenPOWER on IntegriCloud