summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2015-02-06 13:39:37 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-24 11:37:53 -0600
commita626d52d904c4440530f0fc9adc8a7f72fdb9460 (patch)
tree90c00aab9de7265a5c6ef161219146e9d79fdae0 /src
parent14c99ac3fa5dfd721d7fd214a7cd0f17deaa2c46 (diff)
downloadtalos-hostboot-a626d52d904c4440530f0fc9adc8a7f72fdb9460.tar.gz
talos-hostboot-a626d52d904c4440530f0fc9adc8a7f72fdb9460.zip
Added support for core scoms special wakeup in HBRT
Change-Id: Iab301d045c389d30fa860fd9b148eed6b2df52e0 RTC:88347 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15732 Tested-by: Jenkins Server Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/hwpf/plat/fapiPlatUtil.C17
-rw-r--r--src/usr/hwpf/plat/runtime/makefile5
-rw-r--r--src/usr/scom/runtime/handleSpecialWakeup.C90
-rw-r--r--src/usr/scom/runtime/handleSpecialWakeup.H45
-rw-r--r--src/usr/scom/runtime/makefile11
-rw-r--r--src/usr/scom/scomtrans.C56
6 files changed, 219 insertions, 5 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C
index 5e08ece80..64df4d33a 100644
--- a/src/usr/hwpf/plat/fapiPlatUtil.C
+++ b/src/usr/hwpf/plat/fapiPlatUtil.C
@@ -39,12 +39,15 @@
#include <vfs/vfs.H>
#include <initservice/initsvcbreakpoint.H>
#include <errl/errlentry.H>
+#include <initservice/initserviceif.H>
+
#ifdef __HOSTBOOT_RUNTIME
#include <runtime/interface.h>
#include <targeting/common/targetservice.H>
#include <runtime/rt_targeting.H>
#include <hwpf/hwpf_reasoncodes.H>
+#include "handleSpecialWakeup.H"
#endif
//******************************************************************************
@@ -258,7 +261,19 @@ fapi::ReturnCode fapiSpecialWakeup(const fapi::Target & i_target,
fapi::ReturnCode fapi_rc = fapi::FAPI_RC_SUCCESS;
FAPI_INF("fapiSpecialWakeup");
#ifdef __HOSTBOOT_RUNTIME
- if(g_hostInterfaces && g_hostInterfaces->wakeup)
+ if(!INITSERVICE::spBaseServicesEnabled())
+ {
+ TARGETING::Target* l_EXtarget =
+ reinterpret_cast<TARGETING::Target*>(i_target.get());
+
+ errlHndl_t err_SW = handleSpecialWakeup(l_EXtarget,i_enable);
+ if(err_SW)
+ {
+ fapi_rc.setPlatError(reinterpret_cast<void *>(err_SW));
+ }
+
+ }
+ else if(g_hostInterfaces && g_hostInterfaces->wakeup)
{
TARGETING::Target* target =
reinterpret_cast<TARGETING::Target*>(i_target.get());
diff --git a/src/usr/hwpf/plat/runtime/makefile b/src/usr/hwpf/plat/runtime/makefile
index 176d51d3c..76e324d85 100644
--- a/src/usr/hwpf/plat/runtime/makefile
+++ b/src/usr/hwpf/plat/runtime/makefile
@@ -5,7 +5,8 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2011,2014
+# Contributors Listed Below - COPYRIGHT 2013,2015
+# [+] 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.
@@ -26,7 +27,7 @@ MODULE = plat_rt
VPATH += ../
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/pll_accessors/
-
+EXTRAINCDIR += ${ROOTPATH}/src/usr/scom/runtime
# include common fapi OBJs
include ../plat.mk
diff --git a/src/usr/scom/runtime/handleSpecialWakeup.C b/src/usr/scom/runtime/handleSpecialWakeup.C
new file mode 100644
index 000000000..e62721d5b
--- /dev/null
+++ b/src/usr/scom/runtime/handleSpecialWakeup.C
@@ -0,0 +1,90 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/scom/disableSW.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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 <stdint.h>
+#include <errl/errlentry.H>
+#include <errl/errludtarget.H>
+
+#include <trace/interface.H>
+
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/targetservice.H>
+#include <targeting/common/utilFilter.H>
+#include <targeting/common/util.H>
+
+#include <fapi.H>
+#include <fapiPlatHwpInvoker.H>
+#include "p8_cpu_special_wakeup.H"
+
+extern "C"
+{
+
+// Trace definition
+extern trace_desc_t* g_trac_scom;
+
+using namespace TARGETING;
+using namespace fapi;
+
+errlHndl_t handleSpecialWakeup(TARGETING::Target* i_exTarget,
+ bool i_enableDisable)
+{
+ errlHndl_t l_errl = NULL;
+
+ fapi::Target l_fapi_ex_target(TARGET_TYPE_EX_CHIPLET,
+ (const_cast<TARGETING::Target*>(i_exTarget)) );
+
+ PROC_SPCWKUP_OPS l_spcwkupType;
+ if(i_enableDisable)
+ {
+ l_spcwkupType = SPCWKUP_ENABLE;
+ }
+ else
+ {
+ l_spcwkupType = SPCWKUP_DISABLE;
+ }
+
+ //Using the FSP bit so it doesn't collide with Sapphire.
+ //There are 3 independent registers used to trigger a special wakeup
+ //(FSP,HOST,OCC). Since this is in HBRT, Opal already owns the HOST
+ //register, so we're using the FSP bit here.
+ FAPI_INVOKE_HWP(l_errl,
+ p8_cpu_special_wakeup,
+ l_fapi_ex_target,
+ l_spcwkupType,
+ FSP);
+
+ if(l_errl)
+ {
+ TRACFCOMP( g_trac_scom,
+ "Disable p8_cpu_special_wakeup ERROR :"
+ " Returning errorlog, reason=0x%x",
+ l_errl->reasonCode() );
+
+ // capture the target data in the elog
+ ERRORLOG::ErrlUserDetailsTarget(i_exTarget).addToLog( l_errl );
+ }
+
+ return l_errl;
+}
+}
diff --git a/src/usr/scom/runtime/handleSpecialWakeup.H b/src/usr/scom/runtime/handleSpecialWakeup.H
new file mode 100644
index 000000000..3090fa4d1
--- /dev/null
+++ b/src/usr/scom/runtime/handleSpecialWakeup.H
@@ -0,0 +1,45 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/scom/disableSW.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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 */
+#ifndef __HANDLESPECIALWAKEUP_H
+#define __HANDLESPECIALWAKEUP_H
+
+#include <stdint.h>
+
+extern "C"
+{
+/**
+ * @brief This function handles the enable and disable of the special
+ * wakeup that allows scom operations on idle cores.
+ *
+ * @param[in] i_exTarget - EX Target core
+ * @param[in] i_enableDisable - enable (true), disable (false)
+ *
+ * @return errlHndl_t - error handle
+ */
+errlHndl_t handleSpecialWakeup(TARGETING::Target* i_exTarget,
+ bool i_enableDisable);
+}
+
+#endif
diff --git a/src/usr/scom/runtime/makefile b/src/usr/scom/runtime/makefile
index 27cd6d94e..60f86d7d4 100644
--- a/src/usr/scom/runtime/makefile
+++ b/src/usr/scom/runtime/makefile
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2015
+# [+] 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.
@@ -29,6 +31,13 @@ include ../scom.mk
#include unique object modules - currently none
# OBJS +=
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures/
+
+OBJS += handleSpecialWakeup.o
SUBDIRS += test.d
diff --git a/src/usr/scom/scomtrans.C b/src/usr/scom/scomtrans.C
index 84e5b0abb..f9ee8536b 100644
--- a/src/usr/scom/scomtrans.C
+++ b/src/usr/scom/scomtrans.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] 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. */
@@ -41,6 +43,11 @@
#include "scomtrans.H"
#include <scom/scomreasoncodes.H>
#include <errl/errludtarget.H>
+#include <initservice/initserviceif.H>
+
+#if __HOSTBOOT_RUNTIME
+ #include "handleSpecialWakeup.H"
+#endif
// Trace definition
extern trace_desc_t* g_trac_scom;
@@ -48,6 +55,7 @@ extern trace_desc_t* g_trac_scom;
namespace SCOM
{
+bool g_wakeupInProgress = false;
DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
DeviceFW::SCOM,
@@ -90,7 +98,13 @@ errlHndl_t scomTranslate(DeviceFW::OperationType i_opType,
uint64_t l_instance = 0;
uint64_t i_addr = va_arg(i_args,uint64_t);
+#if __HOSTBOOT_RUNTIME
+ static const uint64_t l_lowerBound = 0x0000000010000000;
+ static const uint64_t l_upperBound = 0x00000000100F0000;
+ //true => FSP present, false =>OP HBRT
+ bool isFSP_HBRT = INITSERVICE::spBaseServicesEnabled();
+#endif
// Get the attribute type.
TARGETING::TYPE l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();
@@ -101,6 +115,24 @@ errlHndl_t scomTranslate(DeviceFW::OperationType i_opType,
{
if (l_type == TARGETING::TYPE_EX)
{
+#if __HOSTBOOT_RUNTIME
+ if(i_addr >= l_lowerBound && i_addr < l_upperBound
+ && !g_wakeupInProgress && !isFSP_HBRT)
+ {
+ g_wakeupInProgress = true;
+
+ l_err = handleSpecialWakeup(i_target,true);
+ if(l_err)
+ {
+ TRACFCOMP(g_trac_scom,
+ "Enable p8_cpu_special_wakeup ERROR");
+
+ //capture the target data in the elog
+ ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_err);
+ }
+ g_wakeupInProgress = false;
+ }
+#endif
// Below are the assumptions used for the EX translate
// EX
@@ -560,6 +592,28 @@ errlHndl_t scomTranslate(DeviceFW::OperationType i_opType,
i_accessType,
i_addr);
}
+
+ // @todo RTC:124196 need to move this to a more general location so that
+ // the disable occurs after the HBRT is complete.
+#if __HOSTBOOT_RUNTIME
+ if(l_type == TARGETING::TYPE_EX &&
+ (i_addr >= l_lowerBound && i_addr < l_upperBound)
+ && !g_wakeupInProgress && !isFSP_HBRT)
+ {
+ g_wakeupInProgress = true;
+
+ l_err = handleSpecialWakeup(i_target,false);
+
+ if(l_err)
+ {
+ TRACFCOMP(g_trac_scom,"Disable p8_cpu_special_wakeup ERROR");
+
+ // capture the target data in the elog
+ ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_err);
+ }
+ g_wakeupInProgress = false;
+ }
+#endif
return l_err;
}
OpenPOWER on IntegriCloud