summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/sbeio/runtime')
-rw-r--r--src/usr/sbeio/runtime/makefile3
-rw-r--r--src/usr/sbeio/runtime/rt_sbeio.C9
-rw-r--r--src/usr/sbeio/runtime/sbeio_nvdimm_operation.C64
-rw-r--r--src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H8
-rw-r--r--src/usr/sbeio/runtime/test/sbeiotestRt.H26
5 files changed, 90 insertions, 20 deletions
diff --git a/src/usr/sbeio/runtime/makefile b/src/usr/sbeio/runtime/makefile
index 37792b554..e50153946 100644
--- a/src/usr/sbeio/runtime/makefile
+++ b/src/usr/sbeio/runtime/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2017,2018
+# Contributors Listed Below - COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -37,6 +37,7 @@ include ../common/common.mk
## Objects unique to HBRT
OBJS += rt_sbeio.o
OBJS += sbeio_attr_override.o
+OBJS += sbeio_nvdimm_operation.o
OBJS += sbeio_vital_attn.o
## sbeio_rt's sub directories
diff --git a/src/usr/sbeio/runtime/rt_sbeio.C b/src/usr/sbeio/runtime/rt_sbeio.C
index 3aed96db6..1c95596a5 100644
--- a/src/usr/sbeio/runtime/rt_sbeio.C
+++ b/src/usr/sbeio/runtime/rt_sbeio.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -29,6 +29,7 @@
#include <sys/misc.h>
#include <sbeio/runtime/sbe_msg_passing.H>
#include <sbeio/runtime/sbeio_attr_override.H>
+#include <sbeio/runtime/sbeio_nvdimm_operation.H>
#include <sbeio/sbeioreasoncodes.H>
#include <errno.h>
#include <errl/errlentry.H>
@@ -40,7 +41,7 @@
#include <targeting/common/target.H>
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
-#include <runtime/rt_targeting.H>
+#include <targeting/runtime/rt_targeting.H>
using namespace TARGETING;
@@ -782,6 +783,10 @@ namespace RT_SBEIO
#endif
SBE_MSG::setProcessCmdFunction(PASSTHRU_HBRT_OVERRIDE_ATTR,
sbeApplyAttrOverrides);
+#ifdef CONFIG_NVDIMM
+ SBE_MSG::setProcessCmdFunction(PASSTHRU_HBRT_NVDIMM_OP,
+ sbeNvdimmOperation);
+#endif
}
};
diff --git a/src/usr/sbeio/runtime/sbeio_nvdimm_operation.C b/src/usr/sbeio/runtime/sbeio_nvdimm_operation.C
new file mode 100644
index 000000000..f41cd01a5
--- /dev/null
+++ b/src/usr/sbeio/runtime/sbeio_nvdimm_operation.C
@@ -0,0 +1,64 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/sbeio/runtime/sbeio_nvdimm_operation.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
+/* [+] 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 <sbeio/runtime/sbeio_nvdimm_operation.H>
+
+#include <runtime/interface.h>
+#include <util/runtime/rt_fwnotify.H>
+#include <sbeio/sbeioreasoncodes.H>
+#include <errl/errlentry.H>
+
+extern trace_desc_t* g_trac_sbeio;
+
+using namespace ERRORLOG;
+
+namespace SBE_MSG
+{
+
+//-------------------------------------------------------------------------
+errlHndl_t sbeNvdimmOperation( TARGETING::TargetHandle_t i_procTgt,
+ uint32_t i_reqDataSize,
+ uint8_t * i_reqData,
+ uint32_t * o_rspStatus,
+ uint32_t * o_rspDataSize,
+ uint8_t * o_rspData )
+{
+ errlHndl_t errl{};
+
+ do
+ {
+ *o_rspDataSize = 0; //No return data
+ o_rspData = nullptr;
+
+ // doNvDimmOperation will take care of handling errors it encounters.
+ hostInterfaces::nvdimm_operation_t* l_nvdimmOp =
+ reinterpret_cast<hostInterfaces::nvdimm_operation_t*>(i_reqData);
+ *o_rspStatus = doNvDimmOperation(*l_nvdimmOp);
+ }
+ while(0);
+
+ return errl;
+}
+
+}//End namespace
diff --git a/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H b/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H
index d99acfe8b..5c58078c5 100644
--- a/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H
+++ b/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -27,7 +27,6 @@
#include <cxxtest/TestSuite.H>
#include <runtime/interface.h>
-#include <runtime/rt_targeting.H>
#include <sbeio/runtime/sbe_msg_passing.H>
#include <sbeio/sbeioreasoncodes.H>
#include <secureboot/service.H>
@@ -35,6 +34,7 @@
#include <targeting/common/target.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
+#include <targeting/runtime/rt_targeting.H>
#include <errl/errlmanager.H>
#include <devicefw/userif.H>
@@ -173,8 +173,8 @@ public:
}
l_proc = procList[0];
- RT_TARG::rtChipId_t l_chipId = 0;
- errlHndl_t l_err = RT_TARG::getRtTarget(l_proc, l_chipId);
+ TARGETING::rtChipId_t l_chipId = 0;
+ errlHndl_t l_err = TARGETING::getRtTarget(l_proc, l_chipId);
if(nullptr != l_err)
{
diff --git a/src/usr/sbeio/runtime/test/sbeiotestRt.H b/src/usr/sbeio/runtime/test/sbeiotestRt.H
index a2a4b1996..c91a663bb 100644
--- a/src/usr/sbeio/runtime/test/sbeiotestRt.H
+++ b/src/usr/sbeio/runtime/test/sbeiotestRt.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -35,7 +35,7 @@
#include <runtime/interface.h>
#include <sbeio/runtime/sbe_msg_passing.H>
#include <sbeio/sbeioreasoncodes.H>
-#include <runtime/rt_targeting.H>
+#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/attributes.H>
#include <targeting/common/utilFilter.H>
#include <errl/errlmanager.H>
@@ -88,7 +88,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
*/
int initSbeMessagePassing(sbeMessage_t& o_request,
sbeMessage_t& o_expected_response,
- RT_TARG::rtChipId_t& o_chipId,
+ TARGETING::rtChipId_t& o_chipId,
uint64_t& o_sbeCommAddr,
runtimeInterfaces_t **o_rt_intf)
{
@@ -142,8 +142,8 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
TargetHandle_t proc = procList[0];
// Get the chip ID for the proc
- RT_TARG::rtChipId_t o_chipId = 0;
- errlHndl_t err = RT_TARG::getRtTarget(proc, o_chipId);
+ TARGETING::rtChipId_t o_chipId = 0;
+ errlHndl_t err = TARGETING::getRtTarget(proc, o_chipId);
if(nullptr != err)
{
rc = -1;
@@ -311,7 +311,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
*
* @return Return Code O if Successful, otherwise not 0.
*/
- int checkResetSbeMessagePassingCFAM(RT_TARG::rtChipId_t i_procChipId,
+ int checkResetSbeMessagePassingCFAM(TARGETING::rtChipId_t i_procChipId,
uint32_t i_checkMask = SBE_MSG_MASK)
{
// Test check / reset CFAM entry
@@ -402,7 +402,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
"testSbeMessagePassingVersions");
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -501,7 +501,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -567,7 +567,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -741,7 +741,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -832,7 +832,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -984,7 +984,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
@@ -1142,7 +1142,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
sbeMessage_t l_request;
sbeMessage_t l_expected_response;
uint32_t l_hdrsSize = sizeof(sbeHeader_t) + sizeof(cmdHeader_t);
- RT_TARG::rtChipId_t chipId = 0;
+ TARGETING::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;
OpenPOWER on IntegriCloud