summaryrefslogtreecommitdiffstats
path: root/src/usr/expaccess/test/exptest_utils.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/expaccess/test/exptest_utils.C')
-rw-r--r--src/usr/expaccess/test/exptest_utils.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/usr/expaccess/test/exptest_utils.C b/src/usr/expaccess/test/exptest_utils.C
index 46421fc4a..01096716f 100644
--- a/src/usr/expaccess/test/exptest_utils.C
+++ b/src/usr/expaccess/test/exptest_utils.C
@@ -103,4 +103,34 @@ namespace exptest
mutex_unlock(l_mutex);
};
+ void disableInbandScomsOcmb(const TARGETING::TargetHandle_t i_ocmbTarget)
+ {
+ mutex_t* l_mutex = nullptr;
+
+ assert((i_ocmbTarget != nullptr),
+ "disableInbandScomsOcmb: target is NULL!");
+
+ // Verify that the target is of type OCMB_CHIP
+ TARGETING::ATTR_TYPE_type l_targetType =
+ i_ocmbTarget->getAttr<TARGETING::ATTR_TYPE>();
+ assert((l_targetType == TARGETING::TYPE_OCMB_CHIP),
+ "disableInbandScomsOcmb: target is not an OCMB chip!");
+
+ TS_INFO("disableInbandScomsOcmb: switching to use i2c on OCMB 0x%08x",
+ TARGETING::get_huid(i_ocmbTarget));
+
+ //don't mess with attributes without the mutex (just to be safe)
+ l_mutex = i_ocmbTarget->getHbMutexAttr<TARGETING::ATTR_IBSCOM_MUTEX>();
+ mutex_lock(l_mutex);
+
+ TARGETING::ScomSwitches l_switches =
+ i_ocmbTarget->getAttr<TARGETING::ATTR_SCOM_SWITCHES>();
+ l_switches.useInbandScom = 0;
+ l_switches.useI2cScom = 1;
+
+ // Modify attribute
+ i_ocmbTarget->setAttr<TARGETING::ATTR_SCOM_SWITCHES>(l_switches);
+ mutex_unlock(l_mutex);
+ };
+
}
OpenPOWER on IntegriCloud