summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2018-03-27 13:37:14 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-04-18 14:51:27 -0400
commit48b001dafc539b10ac830cb82dad59875419b66b (patch)
treeb9aab8162823d215f5cbe624d6b8b39e02d06eca /src/import/chips/p9/procedures/hwp
parent3a445dabb535d8b29e53e0bf2aab9dcf28608327 (diff)
downloadtalos-hostboot-48b001dafc539b10ac830cb82dad59875419b66b.tar.gz
talos-hostboot-48b001dafc539b10ac830cb82dad59875419b66b.zip
Adding changes to handle core checkstops
At certain points during the IPL, we need to turn off unit checkstops and switch them to system checkstops. This HWP saves off the original value, turns unit to system checkstops, and then later restores them. Change-Id: I2f4137ca0f429b8e3d7b9047412a4e743324adbf Original-Change-Id: Iebd1d4c5b69eae04f05b890c879d8dd88f0655d3 RTC:147565 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56331 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57375 Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp')
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.C86
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.H50
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk26
3 files changed, 162 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.C b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.C
new file mode 100644
index 000000000..d8e9bd996
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.C
@@ -0,0 +1,86 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] 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 "p9_core_checkstop_handler.H"
+
+#include "p9_const_common.H"
+#include <p9_quad_scom_addresses.H>
+fapi2::ReturnCode p9_core_checkstop_handler(
+ const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target_core,
+ bool i_override_restore)
+{
+ FAPI_INF("Entering ...");
+
+ fapi2::buffer<uint64_t> l_action0;
+ fapi2::buffer<uint64_t> l_action1;
+ const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
+
+ //if true, save off the original action, and turn local xstops into system xstops.
+ if(i_override_restore)
+ {
+ // Getting ACTION0
+ FAPI_TRY(fapi2::getScom(i_target_core, C_CORE_ACTION0, l_action0),
+ "Error from getScom (C_CORE_ACTION0)");
+
+ // Getting ACTION1
+ FAPI_TRY(fapi2::getScom(i_target_core, C_CORE_ACTION1, l_action1),
+ "Error from getScom (C_CORE_ACTION1");
+
+ // We want to save the original actions into an attribute for a save-restore
+ FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_ORIG_FIR_SETTINGS_ACTION0, FAPI_SYSTEM, l_action0),
+ "Error from FAPI_ATTR_SET (ATTR_ORIG_FIR_SETTINGS_ACTION0)");
+
+ FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_ORIG_FIR_SETTINGS_ACTION1, FAPI_SYSTEM, l_action1),
+ "Error from FAPI_ATTR_SET (ATTR_ORIG_FIR_SETTINGS_ACTION1)");
+
+ // For every bit, turn every local xstop (0b11) into system xstops (0b00)
+ uint64_t l_local_xstop = l_action0 & l_action1; //gets bits that are both set to 1
+ l_action0 &= ~l_local_xstop;
+ l_action1 &= ~l_local_xstop;
+ }
+ else
+ {
+ // We want to pull out the original actions, and restore them
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_ORIG_FIR_SETTINGS_ACTION0, FAPI_SYSTEM, l_action0),
+ "Error from FAPI_ATTR_SET (ATTR_ORIG_FIR_SETTINGS_ACTION0)");
+
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_ORIG_FIR_SETTINGS_ACTION1, FAPI_SYSTEM, l_action1),
+ "Error from FAPI_ATTR_SET (ATTR_ORIG_FIR_SETTINGS_ACTION1)");
+
+ }
+
+ // Save off the current values of actions into the register
+ FAPI_TRY(fapi2::putScom(i_target_core, C_CORE_ACTION0, l_action0),
+ "Error from putScom (C_CORE_ACTION0");
+
+ FAPI_TRY(fapi2::putScom(i_target_core, C_CORE_ACTION1, l_action1),
+ "Error from putScrom (C_CORE_ACTION1)");
+
+ FAPI_INF("Exiting ...");
+
+fapi_try_exit:
+ return fapi2::current_err;
+
+}
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.H b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.H
new file mode 100644
index 000000000..4b9435c79
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.H
@@ -0,0 +1,50 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] 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 _P9_CORE_CHECKSTOP_HANDLER_H_
+#define _P9_CORE_CHECKSTOP_HANDLER_H_
+
+#include <fapi2.H>
+
+typedef fapi2::ReturnCode (*p9_core_checkstop_handler_FP_t)(
+ const fapi2::Target<fapi2::TARGET_TYPE_CORE>&, bool);
+
+// @brief Handles core checkstops for P9 when we want to switch between
+// unit and system checkstops.
+//
+// @param[in] i_target_core Reference to TARGET_TYPE_CORE target
+// @param[in] i_override_restore Boolean to switch between override and restore modes.
+// If true, we save off the original register and turn
+// local xstops into system xstops.
+// If false, we restore the original register.
+// @return FAPI2_RC_SUCCESS if success, else error code.
+//
+extern "C"
+{
+ fapi2::ReturnCode p9_core_checkstop_handler(
+ const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target_core,
+ bool i_override_restore);
+}
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk
new file mode 100644
index 000000000..4b1caf742
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk
@@ -0,0 +1,26 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2018
+# [+] 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
+PROCEDURE=p9_core_checkstop_handler
+$(call BUILD_PROCEDURE)
OpenPOWER on IntegriCloud