summaryrefslogtreecommitdiffstats
path: root/src/usr/mmio/test
diff options
context:
space:
mode:
authorGlenn Miles <milesg@ibm.com>2019-06-25 15:41:27 -0500
committerNicholas E. Bofferding <bofferdn@us.ibm.com>2019-07-09 08:50:35 -0500
commit4e69f8fe6542a0db74b3ed017ce623bf6ac8bfed (patch)
treec0805c0bf039c908508a8af42cab206d7d4d5fae /src/usr/mmio/test
parent66de4e82cbb659d98291e3c2799eabeea43b9c46 (diff)
downloadblackbird-hostboot-4e69f8fe6542a0db74b3ed017ce623bf6ac8bfed.tar.gz
blackbird-hostboot-4e69f8fe6542a0db74b3ed017ce623bf6ac8bfed.zip
Fix intermittent testExplrMMIO failure in CI
Added code to force using MMIO for doing SCOMs before running the test. Change-Id: I57ef764a5e86634224852b8496faec1eca2f1a8c RTC:211487 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/79486 Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/usr/mmio/test')
-rw-r--r--src/usr/mmio/test/mmiotest.H135
1 files changed, 79 insertions, 56 deletions
diff --git a/src/usr/mmio/test/mmiotest.H b/src/usr/mmio/test/mmiotest.H
index 9987b50ee..984e94925 100644
--- a/src/usr/mmio/test/mmiotest.H
+++ b/src/usr/mmio/test/mmiotest.H
@@ -47,6 +47,7 @@ static const uint64_t EXPLR_IB_MMIO_OFFSET = 0x0000000100000000ull; // 4GB
static const uint64_t EXPLR_INVALID_SCOM_ADDR =
EXPLR_TP_MB_UNIT_TOP_TRACE_TRDATA_CONFIG_0;
+using namespace TARGETING;
class MmioTest : public CxxTest::TestSuite
{
@@ -65,7 +66,7 @@ class MmioTest : public CxxTest::TestSuite
uint64_t l_buffer64;
// Needed since the device operations could be using inband communication in error path
- TARGETING::HB_MUTEX_SERIALIZE_TEST_LOCK_ATTR l_mutex = exptest::getTestMutex();
+ HB_MUTEX_SERIALIZE_TEST_LOCK_ATTR l_mutex = exptest::getTestMutex();
if (l_mutex == nullptr)
{
TS_FAIL("testExplrMMIO: unable to get test mutex");
@@ -75,25 +76,29 @@ class MmioTest : public CxxTest::TestSuite
// >> atomic section
mutex_lock(l_mutex);
+ TargetHandle_t explr_target = nullptr;
+
do {
// Get OCMB target, return if there is no OCMB
- TARGETING::TargetHandle_t explr_target = nullptr;
- TARGETING::TargetHandleList ocmb_target_list;
- TARGETING::getAllChips(ocmb_target_list, TARGETING::TYPE_OCMB_CHIP);
+ TargetHandleList ocmb_target_list;
+ getAllChips(ocmb_target_list, TYPE_OCMB_CHIP);
if (ocmb_target_list.size() == 0)
{
TS_INFO("testExplrMMIO> No OCMB targets found. Exiting.");
break;
}
explr_target = ocmb_target_list[0];
- if(explr_target->getAttr<TARGETING::ATTR_CHIP_ID>() !=
+ if(explr_target->getAttr<ATTR_CHIP_ID>() !=
POWER_CHIPID::EXPLORER_16)
{
TS_INFO("testExplrMMIO> No explorer targets found. Exiting.");
break;
}
+ // Make sure we're using MMIO to this explorer chip
+ exptest::enableInbandScomsOcmb(explr_target);
+
// valid read from config space register
op_size = sizeof(regdata4);
l_err = DeviceFW::deviceRead(
@@ -180,60 +185,78 @@ class MmioTest : public CxxTest::TestSuite
break;
}
-#if 0 //@fixme - RTC:211487
- // Write to an "invalid" scom address. Should
- // return with failure (now that we've set up the error regs).
- // NOTE: Also, writing MMIO_OCMB_UE_DETECTED to this register
- // sets up the following read to the same register
- // to fail.
- l_buffer64 = MMIO_OCMB_UE_DETECTED;
- op_size = sizeof(l_buffer64);
- l_err = DeviceFW::deviceWrite(
- explr_target,
- &l_buffer64,
- op_size,
- DEVICE_MMIO_ADDRESS(
- SCOM2MMIO_ADDR(EXPLR_INVALID_SCOM_ADDR),
- op_size));
- if(l_err == nullptr)
- {
- TS_FAIL("testExplrMMIO> "
- "did not recieve expected failure on mmio write");
- break;
- }
- else
- {
- TS_INFO("testExplrMMIO> received expected failure on mmio write");
- errlCommit(l_err, CXXTEST_COMP_ID);
- }
-
- // Read from an "invalid" scom address. Should
- // return with failure (now that we've se up the error regs).
- op_size = sizeof(l_buffer64);
- l_err = DeviceFW::deviceRead(
- explr_target,
- &l_buffer64,
- op_size,
- DEVICE_MMIO_ADDRESS(
- SCOM2MMIO_ADDR(EXPLR_INVALID_SCOM_ADDR),
- op_size));
-
- if(l_err == nullptr)
- {
- TS_INFO("testExplrMMIO> data read from invalid address: 0x%016llx",
- l_buffer64);
- TS_FAIL("testExplrMMIO> "
- "did not recieve expected failure on mmio read");
- }
- else
- {
- TS_INFO("testExplrMMIO> received expected failure on mmio read");
- errlCommit(l_err, CXXTEST_COMP_ID);
- }
-#endif //@fixme - RTC:211487
+ // Write to an "invalid" scom address. Should
+ // return with failure (now that we've set up the error regs).
+ // NOTE: Also, writing MMIO_OCMB_UE_DETECTED to this register
+ // sets up the following read to the same register
+ // to fail.
+ l_buffer64 = MMIO_OCMB_UE_DETECTED;
+ op_size = sizeof(l_buffer64);
+ l_err = DeviceFW::deviceWrite(
+ explr_target,
+ &l_buffer64,
+ op_size,
+ DEVICE_MMIO_ADDRESS(
+ SCOM2MMIO_ADDR(EXPLR_INVALID_SCOM_ADDR),
+ op_size));
+ if(l_err == nullptr)
+ {
+ ScomSwitches l_switches =
+ explr_target->getAttr<ATTR_SCOM_SWITCHES>();
+ TS_INFO("testExplrMMIO: Current SCOM mode: %s",
+ (l_switches.useInbandScom)? "MMIO": "I2C");
+ TS_FAIL("testExplrMMIO> "
+ "did not recieve expected failure on mmio write");
+ break;
+ }
+ else
+ {
+ TS_INFO("testExplrMMIO> "
+ "received expected failure on mmio write");
+ errlCommit(l_err, CXXTEST_COMP_ID);
+ }
+
+ // Re-enable inband scoms after failure disables it
+ exptest::enableInbandScomsOcmb(explr_target);
+
+ // Read from an "invalid" scom address. Should
+ // return with failure (now that we've set up the error regs).
+ op_size = sizeof(l_buffer64);
+ l_err = DeviceFW::deviceRead(
+ explr_target,
+ &l_buffer64,
+ op_size,
+ DEVICE_MMIO_ADDRESS(
+ SCOM2MMIO_ADDR(EXPLR_INVALID_SCOM_ADDR),
+ op_size));
+
+ if(l_err == nullptr)
+ {
+ ScomSwitches l_switches =
+ explr_target->getAttr<ATTR_SCOM_SWITCHES>();
+ TS_INFO("testExplrMMIO> "
+ "data read from invalid address: 0x%016llx",
+ l_buffer64);
+ TS_INFO("testExplrMMIO: Current SCOM mode: %s",
+ (l_switches.useInbandScom)? "MMIO": "I2C");
+ TS_FAIL("testExplrMMIO> "
+ "did not recieve expected failure on mmio read");
+ }
+ else
+ {
+ TS_INFO("testExplrMMIO> "
+ "received expected failure on mmio read");
+ errlCommit(l_err, CXXTEST_COMP_ID);
+ }
} while (0);
+ // Re-enable inband scoms after failure disables it
+ if(explr_target != nullptr)
+ {
+ exptest::enableInbandScomsOcmb(explr_target);
+ }
+
// << atomic section
mutex_unlock(l_mutex);
TS_INFO("testExplrMMIO> Done");
OpenPOWER on IntegriCloud