From 9e489a4e55630ff825726262406d394da68f2626 Mon Sep 17 00:00:00 2001 From: Prachi Gupta Date: Wed, 25 Apr 2018 14:23:36 -0500 Subject: wrap_test: OBUS deconfiguration Due to fabric limitations, we can only have 2 OBUSes enabled at a time. This commit deconfigures the OBUSes that do not belong the set of links to enable in this boot based on attributes. Change-Id: I15f5e9f3ea186367b9c4d55f4dc2e9b32b251f6d Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57836 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Elizabeth K. Liner Reviewed-by: Roland Veloz Reviewed-by: Martin Gloff Reviewed-by: William G. Hoffa --- src/usr/hwas/common/hwas.C | 113 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) (limited to 'src/usr/hwas/common/hwas.C') diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index 17c6b5b49..9bac35eb3 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -193,6 +193,104 @@ bool allCoresBad(const uint8_t & i_firstCore, return coresBad; } +#ifdef CONFIG_SMP_WRAP_TEST +/** + * @brief disable obuses in wrap config. + * Due to fabric limitations, we can only have 2 parallel OBUS + * connections at a time in wrap config.So, deconfigure appropriate + * OBUSes using the following rule. If the value of + * MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE (on the system target) does + * not match with the value of MFG_WRAP_TEST_ABUS_LINKS_SET (on the + * OBUS target), then deconfigure the OBUSes. + * @return errlHndl_t + * + */ +errlHndl_t disableOBUSes() +{ + errlHndl_t l_err = nullptr; + + do + { + //get system target and figure out which links to enable + Target* pSys; + targetService().getTopLevelTarget(pSys); + auto l_links_set_enable = + pSys->getAttr(); + + //get all OBUS chiplets + TargetHandleList l_obusList; + getAllChiplets(l_obusList, TYPE_OBUS); + for (const auto & l_obus : l_obusList) + { + //It fails to compile if you compare two different enum types + //That's why, typecasting here. The underlying enum value + //should be the same. + ATTR_MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE_type l_link_set = + (ATTR_MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE_type) + l_obus->getAttr(); + + if (l_links_set_enable != l_link_set) + { + //deconfigure + l_err = HWAS::theDeconfigGard().deconfigureTarget( + *l_obus, + HWAS::DeconfigGard::DECONFIGURED_BY_NO_MATCHING_LINK_SET); + if (l_err) + { + HWAS_ERR("disableOBUSes: Unable to deconfigure %x OBUS", + get_huid(l_obus)); + break; + } + } + } + + if (l_err) + { + break; + } + + //Sanity Check to make sure each proc only has a max of 2 OBUSes + //only if MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE was overidden + //because that means we are trying to run in wrap mode. + //Otherwise, it will be defaulted to SET_NONE + if (l_links_set_enable != MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE_SET_NONE) + { + TargetHandleList l_procList; + getAllChips(l_procList, TYPE_PROC); + for (const auto & l_proc : l_procList) + { + getChildChiplets(l_obusList, l_proc, TYPE_OBUS, true); + if (l_obusList.size() > 2) + { + HWAS_ERR("disableOBUSes: Only 2 BUSes should be functional" + " under %x, found %d", + get_huid(l_proc), l_obusList.size()); + /*@ + * @errortype + * @severity ERRL_SEV_UNRECOVERABLE + * @moduleid MOD_DISABLE_OBUS + * @reasoncode RC_ONLY_TWO_OBUS_SHOULD_BE_CONFIGURED + * @devdesc Due to fabric limitations, only 2 + * OBUSes should be configured, we found + * too many + * @custdesc A problem occurred during the IPL of + * the system: Found too many obus links + * @userdata1 HUID of proc + * @userdata2 number of functional OBUSes + */ + l_err = hwasError(ERRL_SEV_UNRECOVERABLE, + MOD_DISABLE_OBUS, + RC_ONLY_TWO_OBUS_SHOULD_BE_CONFIGURED, + get_huid(l_proc), l_obusList.size()); + break; + } + } + } + } while (0); + return l_err; +} +#endif + errlHndl_t discoverTargets() { HWAS_DBG("discoverTargets entry"); @@ -484,6 +582,21 @@ errlHndl_t discoverTargets() // targets that need to be deconfigured invokePresentByAssoc(); +#ifdef CONFIG_SMP_WRAP_TEST + //Due to fabric limitations, we can only have 2 parallel OBUS + //connections at a time in wrap config. So, deconfigure appropriate + //OBUSes using the following rule. If the value of + //MFG_WRAP_TEST_ABUS_LINKS_SET_ENABLE (on the system target) does + //not match with the value of MFG_WRAP_TEST_ABUS_LINKS_SET (on the + //OBUS target), then deconfigure the OBUSes. + errl = disableOBUSes(); + if (errl) + { + HWAS_ERR ("discoverTargets:: disableOBUSes failed"); + break; + } +#endif + } while (0); if (errl) -- cgit v1.2.1