summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/io
diff options
context:
space:
mode:
authorChris Steffen <cwsteffen@us.ibm.com>2017-05-04 09:00:05 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2017-08-30 14:16:45 -0400
commit5c029ee59d7a39e4127d10f25639f2c19858cb1c (patch)
tree5499e39f9ee7a42f3409dd8437a4970550b67ab9 /src/import/chips/p9/procedures/hwp/io
parentfa23b5bed77b93e39178ba3c83f8fd7c867abc2f (diff)
downloadtalos-hostboot-5c029ee59d7a39e4127d10f25639f2c19858cb1c.tar.gz
talos-hostboot-5c029ee59d7a39e4127d10f25639f2c19858cb1c.zip
DMI I/O Scominits
Change-Id: I1bf05adb2f59d7fc281817c113642069a849fdfd Original-Change-Id: I40e794076545a7bdaf00f2b27e2a0e8b82aa30a8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41533 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Gary A. Peterson <garyp@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45331 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/io')
-rw-r--r--src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.C136
-rw-r--r--src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.H75
-rw-r--r--src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.mk27
3 files changed, 238 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.C b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.C
new file mode 100644
index 000000000..6060644c9
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.C
@@ -0,0 +1,136 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,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 */
+///
+/// @file p9_io_dmi_scominit.C
+/// @brief Invoke DMI processor side initfile
+///
+//----------------------------------------------------------------------------
+// *HWP HWP Owner : Chris Steffen <cwsteffen@us.ibm.com>
+// *HWP HWP Backup Owner: Gary Peterson <garyp@us.ibm.com>
+// *HWP FW Owner : Sumit Kumar <sumit_kumar@in.ibm.com>
+// *HWP Team : IO
+// *HWP Level : 2
+// *HWP Consumed by : FSP:HB
+//----------------------------------------------------------------------------
+//
+// @verbatim
+// High-level procedure flow:
+//
+// Invoke DMI scominit file.
+//
+// Procedure Prereq:
+// - System clocks are running.
+// @endverbatim
+//----------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+#include <p9_io_regs.H>
+#include <p9_io_scom.H>
+#include <p9_io_dmi_scominit.H>
+#include <p9c_dmi_io_scom.H>
+
+//------------------------------------------------------------------------------
+// Constant definitions
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Function definitions
+//------------------------------------------------------------------------------
+
+/**
+ * @brief Gets the value of the ATTR_CHIP_UNIT_NUM and passes back by reference
+ * @param[in] i_tgt Fapi2 Target
+ * @param[out] o_chipunitnum Chip Unit Number
+ * @return FAPI2_RC_SUCCESS on success, otherwise error
+ */
+fapi2::ReturnCode p9_dmi_get_chipunit_num(const DMI_TGT& i_tgt, uint8_t& o_chipunitnum)
+{
+ FAPI_IMP("I/O DMI Scominit: Get Chipunit Number Start.");
+
+ // Retrieve chipunitnum attribute
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_tgt, o_chipunitnum ),
+ "Error getting ATTR_CHIP_UNIT_POS, rc = 0x%.8X",
+ (uint64_t)fapi2::current_err );
+
+fapi_try_exit:
+ FAPI_IMP("I/O DMI Scominit: Get Chipunit Number Exit.");
+ return fapi2::current_err;
+}
+
+
+/**
+ * @brief HWP that calls the DMI SCOM initfiles
+ * Should be called for all valid/connected DMI endpoints
+ *
+ * @param[in] i_tgt Reference to DMI chiplet target
+ *
+ * @return FAPI2_RC_SUCCESS on success, error otherwise
+ */
+fapi2::ReturnCode p9_io_dmi_scominit(const DMI_TGT& i_tgt)
+{
+ // mark HWP entry
+ FAPI_INF("p9_io_dmi_scominit: Entering ...");
+ const uint8_t GRP_03 = 3;
+ const uint8_t LANE_00 = 0;
+ fapi2::ReturnCode rc = fapi2::FAPI2_RC_SUCCESS;
+
+ // Get system target
+ const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> sys_tgt;
+
+ // assert IO reset to power-up bus endpoint logic
+ // read-modify-write, set single reset bit (HW auto-clears)
+ // on writeback
+ FAPI_TRY(io::rmw(EDIP_RX_IORESET, i_tgt, GRP_03, LANE_00, 1));
+
+ // Calculated HW Delay needed based on counter size and clock speed.
+ // 50us -- Based on Counter Size, 40us minimum
+ // 1 Million sim cycles -- Based on sim learning
+ FAPI_TRY(fapi2::delay(50000, 1000000));
+
+ FAPI_TRY(io::rmw(EDIP_TX_IORESET, i_tgt, GRP_03, LANE_00, 1));
+
+ // Calculated HW Delay needed based on counter size and clock speed.
+ // 50us -- Based on Counter Size, 40us minimum
+ // 1 Million sim cycles -- Based on sim learning
+ FAPI_TRY(fapi2::delay(50000, 1000000));
+
+ FAPI_INF("Invoke FAPI2 p9c_dmi_scom Procedure");
+ FAPI_EXEC_HWP(rc, p9c_dmi_io_scom, i_tgt, sys_tgt);
+
+ if(rc)
+ {
+ FAPI_ERR("P9 I/O DMI Scominit Failed");
+ fapi2::current_err = rc;
+ }
+
+ // mark HWP exit
+ FAPI_INF("p9_io_dmi_scominit: ... Exiting");
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.H b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.H
new file mode 100644
index 000000000..ff44b9f69
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.H
@@ -0,0 +1,75 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,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 */
+///
+/// @file p9_io_dmi_scominit.H
+/// @brief Invoke DMI processor side initfile (FAPI2)
+///
+//----------------------------------------------------------------------------
+// *HWP HWP Owner : Chris Steffen <cwsteffen@us.ibm.com>
+// *HWP HWP Backup Owner: Gary Peterson <garyp@us.ibm.com>
+// *HWP FW Owner : Sumit Kumar <sumit_kumar@in.ibm.com>
+// *HWP Team : IO
+// *HWP Level : 2
+// *HWP Consumed by : FSP:HB
+//----------------------------------------------------------------------------
+
+
+#ifndef P9_IO_DMI_SCOMINIT_H_
+#define P9_IO_DMI_SCOMINIT_H_
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+#include <fapi2.H>
+
+//------------------------------------------------------------------------------
+// Structure definitions
+//------------------------------------------------------------------------------
+typedef fapi2::Target<fapi2::TARGET_TYPE_DMI> DMI_TGT;
+
+// function pointer typedef definition for HWP call support
+typedef fapi2::ReturnCode (*p9_io_dmi_scominit_FP_t)(const DMI_TGT&);
+
+extern "C" {
+
+//------------------------------------------------------------------------------
+// Function prototypes
+//------------------------------------------------------------------------------
+
+ /**
+ * @brief HWP that calls the DMI SCOM initfiles
+ *
+ * Should be called for all valid/connected DMI endpoints
+ *
+ * @param[in] i_tgt Reference to DMI chiplet target
+ *
+ * @return FAPI2_RC_SUCCESS on success, error otherwise
+ */
+ fapi2::ReturnCode p9_io_dmi_scominit(const DMI_TGT& i_tgt);
+
+
+} // extern "C"
+
+#endif // P9_IO_DMI_SCOMINIT_H_
diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.mk b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.mk
new file mode 100644
index 000000000..96e7a6cc6
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.mk
@@ -0,0 +1,27 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/import/chips/p9/procedures/hwp/io/p9_io_dmi_scominit.mk $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2015,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
+
+PROCEDURE=p9_io_dmi_scominit
+$(call BUILD_PROCEDURE)
OpenPOWER on IntegriCloud