summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-03-08 15:47:05 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-03-21 15:53:53 -0400
commit38f35059b8632d2c7f8a2fa318fb0aaefd9b3229 (patch)
tree507a34cccd3c5ae6ee890030a9d2fee683d07907 /src/usr/sbeio
parentafd8387b9c5f1583046820aba9a632bb4acaf767 (diff)
downloadtalos-hostboot-38f35059b8632d2c7f8a2fa318fb0aaefd9b3229.tar.gz
talos-hostboot-38f35059b8632d2c7f8a2fa318fb0aaefd9b3229.zip
SBE message passing interface - call of HBRT process SBE message
Add the new Host interface for SBE message passing. Change-Id: I220a864a072bcc60cc873cde243a28cc899e2722 RTC:170759 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37694 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio')
-rw-r--r--src/usr/sbeio/makefile5
-rw-r--r--src/usr/sbeio/runtime/makefile39
-rw-r--r--src/usr/sbeio/runtime/rt_sbeio.C148
3 files changed, 190 insertions, 2 deletions
diff --git a/src/usr/sbeio/makefile b/src/usr/sbeio/makefile
index 688d5edc5..2690ec0d7 100644
--- a/src/usr/sbeio/makefile
+++ b/src/usr/sbeio/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2016
+# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
@@ -41,6 +41,7 @@ OBJS += sbe_scomAccess.o
OBJS += sbe_scomAccessdd.o
OBJS += sbe_ffdc_parser.o
-SUBDIRS = test.d
+SUBDIRS += test.d
+SUBDIRS += runtime.d
include ${ROOTPATH}/config.mk
diff --git a/src/usr/sbeio/runtime/makefile b/src/usr/sbeio/runtime/makefile
new file mode 100644
index 000000000..c3a1b24c6
--- /dev/null
+++ b/src/usr/sbeio/runtime/makefile
@@ -0,0 +1,39 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/sbeio/runtime/makefile $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2017
+# [+] 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
+
+HOSTBOOT_RUNTIME = 1
+
+ROOTPATH = ../../../..
+VPATH += ../
+
+MODULE = sbeio_rt
+
+## Objects unique to HBRT
+OBJS += rt_sbeio.o
+
+## Objects common to HBRT and HB IPL
+#include ../sbeio.mk
+
+include ${ROOTPATH}/config.mk
diff --git a/src/usr/sbeio/runtime/rt_sbeio.C b/src/usr/sbeio/runtime/rt_sbeio.C
new file mode 100644
index 000000000..a0737e788
--- /dev/null
+++ b/src/usr/sbeio/runtime/rt_sbeio.C
@@ -0,0 +1,148 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/sbeio/runtime/rt_sbeio.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017 */
+/* [+] 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 <runtime/interface.h>
+#include <kernel/console.H>
+
+#include <vmmconst.h>
+#include <sys/misc.h>
+#include <errno.h>
+#include <errl/errlentry.H>
+#include <errl/errlmanager.H>
+
+// targeting support
+#include <targeting/common/target.H>
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+//#include <targeting/common/targetservice.H>
+//#include <targeting/common/util.H>
+#include <runtime/rt_targeting.H>
+
+// fapi support
+//#include <isteps/hwpf_reasoncodes.H>
+
+
+using namespace TARGETING;
+
+// Trace
+extern trace_desc_t* g_fapiTd; // defined in rt_fapiPlatUtil.C
+
+namespace RT_SBEIO
+{
+ //------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------
+
+ int process_sbe_msg(uint32_t i_procChipId)
+ {
+ int rc = 0;
+ errlHndl_t err = nullptr;
+
+ // Convert chipId to HB target
+ TargetHandle_t l_proc = nullptr;
+ err = RT_TARG::getHbTarget(i_procChipId, l_proc);
+ if(err)
+ {
+ rc = err->reasonCode();
+ if (0 == rc)
+ {
+ // If there was a failure, be sure to return non-zero status
+ rc = -1;
+ }
+
+ TRACFCOMP(g_fapiTd, ERR_MRK"process_sbe_msg: getHbTarget "
+ "returned rc=0x%04X for procChipId: %llx",
+ rc, i_procChipId);
+
+ errlCommit (err, SBE_COMP_ID);
+ }
+
+ /* TODO RTC 170760 process SBE message read command */
+
+ /* TODO RTC 170761 call appropriate command processor */
+
+ /* TODO RTC 170762 process SBE message write response */
+
+ /* TODO RTC 170763 assert CFAM register ??? */
+
+ return rc;
+ }
+
+ //------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------
+
+ struct registerSbeio
+ {
+ registerSbeio()
+ {
+ runtimeInterfaces_t * rt_intf = getRuntimeInterfaces();
+ rt_intf->sbe_message_passing = &process_sbe_msg;
+
+ TargetHandleList procChips;
+ getAllChips(procChips, TYPE_PROC, true);
+ for (const auto & l_procChip: procChips)
+ {
+ uint64_t l_instance = l_procChip->getAttr<ATTR_POSITION>();
+ uint64_t l_sbeCommAddr =
+ g_hostInterfaces->get_reserved_mem("ibm,sbe-comm",
+ l_instance);
+ l_procChip->setAttr<ATTR_SBE_COMM_ADDR>(l_sbeCommAddr);
+
+ /*
+ * TODO RTC 170758
+ *
+ * call performPsuChipOp to tell SBE where to write when SBE is ready
+ *
+ * psuCommand l_psuCommand(
+ * SBE_REQUIRE_RESPONSE,
+ * SBE_PSU_GENERIC_MESSAGE,
+ * SBE_CMD_CONTROL_SYSTEM_CONFIG);
+ *
+ * psuResponse l_psuResponse;
+ *
+ * // Create FFDCPackage struct in psuCommand union
+ * uint64_t cd4_FFDCPackage_MbxReg2reserved = &iv_ffdcPackageBuffer;
+ *
+ * performPsuChipOp(l_procChip,
+ * &l_psuCommand,
+ * &l_psuResponse,
+ * MAX_PSU_SHORT_TIMEOUT_NS,
+ * SBE_SYSTEM_CONFIG_REQ_USED_REGS,
+ * SBE_SYSTEM_CONFIG_RSP_USED_REGS);
+ *
+ */
+ }
+ }
+ };
+
+ registerSbeio g_registerSbeio;
+}
+
OpenPOWER on IntegriCloud