diff options
author | Marty Gloff <mgloff@us.ibm.com> | 2017-03-08 15:47:05 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-03-21 15:53:53 -0400 |
commit | 38f35059b8632d2c7f8a2fa318fb0aaefd9b3229 (patch) | |
tree | 507a34cccd3c5ae6ee890030a9d2fee683d07907 | |
parent | afd8387b9c5f1583046820aba9a632bb4acaf767 (diff) | |
download | talos-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>
-rw-r--r-- | src/include/runtime/interface.h | 15 | ||||
-rw-r--r-- | src/makefile | 1 | ||||
-rw-r--r-- | src/usr/sbeio/makefile | 5 | ||||
-rw-r--r-- | src/usr/sbeio/runtime/makefile | 39 | ||||
-rw-r--r-- | src/usr/sbeio/runtime/rt_sbeio.C | 148 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types_hb.xml | 31 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types_hb.xml | 6 |
7 files changed, 243 insertions, 2 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index 316bd2d03..c141347f7 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -676,6 +676,21 @@ typedef struct runtimeInterfaces const void* i_pHwKeyHash, size_t i_hwKeyHashSize); + /** + * @brief SBE message passing + * + * @details This is a blocking call that will pass an SBE message + * with a pass-through command through HBRT to code that + * will process the command and provide a response. + * + * @param[in] i_procChipId Chip ID of the processor whose SBE is passing + * the message and sent the interrupt + * + * @returns 0 on success, or return code if the command failed + * @platform FSP, OpenPOWER + */ + int (*sbe_message_passing)(uint32_t i_procChipId); + // Reserve some space for future growth. // do NOT ever change this number, even if you add functions. // diff --git a/src/makefile b/src/makefile index fdb6713fe..f1d6fa071 100644 --- a/src/makefile +++ b/src/makefile @@ -295,6 +295,7 @@ RUNTIME_MODULES += fapi2_rt RUNTIME_MODULES += secureboot_rt RUNTIME_MODULES += p9_cpuWkup RUNTIME_MODULES += fsi_rt +RUNTIME_MODULES += sbeio_rt RUNTIME_DATA_MODULES += RUNTIME_TESTCASE_MODULES += cxxtest_rt 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; +} + diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml index 2c6deef69..9dc9ae5f5 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml @@ -482,6 +482,37 @@ <writeable/> <hbOnly/> </attribute> + +<attribute> + <id>SBE_FFDC_ADDR</id> + <description> + Physical address where SBE FFDC is placed in mainstore. + </description> + <simpleType> + <uint64_t></uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>SBE_COMM_ADDR</id> + <description> + Physical address where SBE Communications are placed in mainstore. + This area is used for SBE message passing and may contain an SBE + command or the response to it from HBRT. + </description> + <simpleType> + <uint64_t></uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + <attribute> <id>OPEN_POWER_DIMM_THROTTLE_TEMP_DEG_C</id> <description> diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml index 5fad57c40..7777eb2ce 100755 --- a/src/usr/targeting/common/xmltohb/target_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml @@ -117,6 +117,12 @@ <id>HOMER_VIRT_ADDR</id> </attribute> <attribute> + <id>SBE_FFDC_ADDR</id> + </attribute> + <attribute> + <id>SBE_COMM_ADDR</id> + </attribute> + <attribute> <id>VPD_SWITCHES</id> </attribute> <attribute> |