summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2011-07-07 17:11:24 -0500
committerMIKE J. JONES <mjjones@us.ibm.com>2011-07-14 10:18:09 -0500
commitb9558dcb65612b60a20719ea489dadda4776e1e4 (patch)
treed0f074f95d473fdaa5ebc29dfae27b21770a9f32 /src/usr
parent038a9a46895333b86da8ca83c8effd29ff3e76e9 (diff)
downloadtalos-hostboot-b9558dcb65612b60a20719ea489dadda4776e1e4.tar.gz
talos-hostboot-b9558dcb65612b60a20719ea489dadda4776e1e4.zip
HW Procedure Compile Support
- New .tcl scripts to be used to do the compiling - New hw procedure function for hw procedure writers to overload for their testing Change-Id: I90af3f4d7aea07f63ec7f52daf224070c944ccee Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/190 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwp.C29
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C38
-rw-r--r--src/usr/hwpf/test/hwpftest.H15
3 files changed, 81 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/fapiTestHwp.C b/src/usr/hwpf/hwp/fapiTestHwp.C
index 14292864f..2a7e2fae7 100644
--- a/src/usr/hwpf/hwp/fapiTestHwp.C
+++ b/src/usr/hwpf/hwp/fapiTestHwp.C
@@ -11,6 +11,7 @@
* mjjones 04/21/2011 Created.
* mjjones 06/02/2011 Use ecmdDataBufferBase
* mjjones 06/28/2011 Removed attribute tests
+ * andrewg 07/07/2011 Added test for hw team to fill in
*
*/
@@ -67,4 +68,32 @@ fapi::ReturnCode hwpIsP7EM0ChipletClockOn(const fapi::Target & i_chip,
return l_rc;
}
+//******************************************************************************
+// hwpInitialTest function - Override with whatever you want here
+//******************************************************************************
+fapi::ReturnCode hwpInitialTest(const fapi::Target & i_chip)
+{
+ fapi::ReturnCode l_rc;
+
+ // Figure out the scom address and create a 64 bit data buffer
+ ecmdDataBufferBase l_data(64);
+
+ const uint64_t l_addr = 0x0201240B;
+
+ // Perform a GetScom operation on the chip
+ l_rc = GetScom(i_chip, l_addr, l_data);
+
+ if (l_rc != fapi::FAPI_RC_SUCCESS)
+ {
+ FAPI_ERR("hwpInitialTest: Error from GetScomChip");
+ }
+ else
+ {
+ FAPI_INF("hwpInitialTest: Data from SCOM:0x%X 0x%16X",l_data.getDoubleWord(0));
+
+ }
+
+ return l_rc;
+}
+
} // extern "C"
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index d6d8cbaad..44455a130 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -81,4 +81,42 @@ errlHndl_t invokeHwpIsP7EM0ChipletClockOn(TARGETING::Target* i_target,
return l_err;
}
+//******************************************************************************
+// invokeHwpInitial function
+//******************************************************************************
+errlHndl_t invokeHwpInitialTest(TARGETING::Target* i_target)
+{
+
+ FAPI_DBG(ENTER_MRK "invokeHwpInitialTest");
+
+ errlHndl_t l_err = NULL;
+
+ // Create a generic Target object
+ Target l_target(TARGET_TYPE_PROC_CHIP, reinterpret_cast<void *> (i_target));
+
+ //@todo
+ // Double check to see if any locking is needed here.
+ // Lower XSCOM already has a mutex lock.
+
+ // Call the HWP executor macro
+ ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, hwpInitialTest, l_target);
+
+ if (l_rc != FAPI_RC_SUCCESS)
+ {
+ FAPI_ERR("invokeHwpInitialTest: Error (0x%x) from "
+ "exechwpInitialTest",
+ static_cast<uint32_t> (l_rc));
+ l_err = rcToErrl(l_rc);
+ }
+ else
+ {
+ FAPI_INF("Success in call to exechwpInitialTest");
+ }
+
+ FAPI_DBG(EXIT_MRK "invokeHwpInitialTest");
+
+ return l_err;
+}
+
} // End namespace
diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H
index fa9a1c555..2bfd6734d 100644
--- a/src/usr/hwpf/test/hwpftest.H
+++ b/src/usr/hwpf/test/hwpftest.H
@@ -70,7 +70,7 @@ public:
l_err = invokeHwpIsP7EM0ChipletClockOn(l_testTarget, l_clocksOn);
if (l_err)
{
- TS_FAIL("testHwpf2: Unit Test failed. HWP failed. Error logged");
+ TS_FAIL("testHwpf2: Unit Test failed. invokeHwpIsP7EM0ChipletClockOn failed. Error logged");
// Commit/delete error
errlCommit(l_err);
}
@@ -86,6 +86,19 @@ public:
}
}
+ // Call test procedure too
+ l_err = invokeHwpInitialTest(l_testTarget);
+ if (l_err)
+ {
+ TS_FAIL("testHwpf2: Unit Test failed. invokeHwpInitialTest failed. Error logged");
+ // Commit/delete error
+ errlCommit(l_err);
+ }
+ else
+ {
+ TS_TRACE("testHwpf2: Unit test passed! invokeHwpInitialTest");
+ }
+
return;
}
OpenPOWER on IntegriCloud