summaryrefslogtreecommitdiffstats
path: root/src/import/chips
diff options
context:
space:
mode:
authorJoe McGill <jmcgill@us.ibm.com>2018-07-27 15:08:53 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-08-20 12:33:27 -0500
commitb407cfc0f32596d52af87e43267f3befba2c7317 (patch)
treeef77d915c1d0f168fa88935f2d521b56928781fc /src/import/chips
parentb265c68d057a1e9175cdc97268d940b95a219245 (diff)
downloadtalos-hostboot-b407cfc0f32596d52af87e43267f3befba2c7317.tar.gz
talos-hostboot-b407cfc0f32596d52af87e43267f3befba2c7317.zip
Updates to permit synchronized SS PLL spreading via TOD
Create EC feature attribute and user override attribute to control application of synchronized spreading. Default to enable synchronized spreading on Axone only. p9_sbe_npll_setup Conditionally skip existing unsynchronized spread enablement p9_tod_init Conditionally invoke spread sync routine after TOD network is running p9_ss_pll_sync Remove from repository, shift code into p9_tod_init to prevent need for mirroring into downstream repositories for FW consumption Change-Id: Ic32c800d58c260136b45fe9561989987d0a97ceb Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63494 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> Reviewed-by: Joachim Fenkes <fenkes@de.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63505 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips')
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C145
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_tod_utils.H5
-rw-r--r--src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml17
-rwxr-xr-xsrc/import/chips/p9/procedures/xml/attribute_info/pervasive_attributes.xml14
-rw-r--r--src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml25
5 files changed, 203 insertions, 3 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C b/src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C
index 29400f3ad..2791ab8d6 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_tod_init.C
@@ -43,6 +43,18 @@
#include <p9_tod_init.H>
//------------------------------------------------------------------------------
+// Constant definitions
+//------------------------------------------------------------------------------
+
+// in TOD counts; needs to account for SCOM latency and number of chips to be
+// started in sync
+const uint64_t C_SSCG_START_DELAY = 0x100000;
+// 31.25 rounded up
+const uint64_t C_SSCG_NS_PER_TOD_COUNT = 32;
+const uint32_t C_SSCG_START_POLL_DELAY = C_SSCG_START_DELAY * C_SSCG_NS_PER_TOD_COUNT;
+const uint32_t C_SSCG_START_POLL_COUNT = 10;
+
+//------------------------------------------------------------------------------
// Function definitions
//------------------------------------------------------------------------------
@@ -78,6 +90,135 @@ fapi_try_exit:
return fapi2::current_err;
}
+/// @brief Retrieves targets in the TOD topology
+/// @param[in] i_tod_node Reference to TOD topology
+/// @param[in] i_depth Current depth into TOD topology network
+/// @param[in] o_targets Vector of targets, to be appended
+/// @return void
+void get_targets(
+ const tod_topology_node* i_tod_node,
+ const uint32_t i_depth,
+ std::vector<fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>>& o_targets)
+{
+ char l_targetStr[fapi2::MAX_ECMD_STRING_LEN];
+
+ if (i_tod_node == NULL || i_tod_node->i_target == NULL)
+ {
+ FAPI_INF("NULL tod_node or target parameter!");
+ goto fapi_try_exit;
+ }
+
+ fapi2::toString(i_tod_node->i_target,
+ l_targetStr,
+ fapi2::MAX_ECMD_STRING_LEN);
+
+ FAPI_INF("%s (Depth = %d)",
+ l_targetStr, i_depth);
+
+ o_targets.push_back(*(i_tod_node->i_target));
+
+ for (auto& l_child : i_tod_node->i_children)
+ {
+ get_targets(l_child, i_depth + 1, o_targets);
+ }
+
+fapi_try_exit:
+ return;
+}
+
+/// @brief Distribute synchronization signal to SS PLL using
+/// TOD network
+/// @param[in] i_tod_node Reference to TOD topology
+/// @return FAPI_RC_SUCCESS if TOD sync is succesful else error
+fapi2::ReturnCode sync_spread(
+ const tod_topology_node* i_tod_node)
+{
+ FAPI_DBG("Start");
+
+ std::vector<fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>> l_targets;
+ get_targets(i_tod_node, 0, l_targets);
+ fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_master_chip;
+ fapi2::buffer<uint64_t> l_tod_value_data;
+ fapi2::buffer<uint64_t> l_tod_timer_data;
+ uint8_t l_sync_spread = 0;
+
+ FAPI_ASSERT(l_targets.size(),
+ fapi2::P9_TOD_SETUP_NULL_NODE(),
+ "Null node or target passed into function!");
+ l_master_chip = l_targets.front();
+
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_FORCE_SYNC_SS_PLL_SPREAD,
+ fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
+ l_sync_spread),
+ "Error from FAPI_ATTR_GET (ATTR_FORCE_SYNC_SS_PLL_SPREAD)");
+
+ if (!l_sync_spread)
+ {
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_SYNC_SS_PLL_SPREAD,
+ l_master_chip,
+ l_sync_spread),
+ "Error from FAPI_ATTR_GET (ATTR_CHIP_EC_FEATURE_SYNC_SS_PLL_SPREAD)");
+ }
+
+ if (!l_sync_spread)
+ {
+ goto fapi_try_exit;
+ }
+
+ // Read tod_value from TOD Value Register
+ FAPI_TRY(fapi2::getScom(l_master_chip,
+ PERV_TOD_VALUE_REG,
+ l_tod_value_data),
+ "Error reading TOD_VALUE_REG");
+
+ l_tod_timer_data = (l_tod_value_data + (C_SSCG_START_DELAY << 4)) &
+ 0xFFFFFFFFFFFFFFF0ULL;
+
+ // Write value > tod_value to TOD Timer Register
+ for (auto l_chip : l_targets)
+ {
+ FAPI_TRY(fapi2::putScom(l_chip,
+ PERV_TOD_TIMER_REG,
+ l_tod_timer_data),
+ "Error writing to TOD_TIMER_REG");
+ }
+
+ // Wait for SSCG start signal
+ for (uint32_t i = 0;
+ (i < C_SSCG_START_POLL_COUNT) && !l_targets.empty();
+ i++)
+ {
+ fapi2::delay(C_SSCG_START_POLL_DELAY, C_SSCG_START_POLL_DELAY);
+
+ for (auto l_chip_it = l_targets.begin();
+ l_chip_it != l_targets.end();
+ )
+ {
+ FAPI_TRY(fapi2::getScom(*l_chip_it,
+ PERV_TOD_TIMER_REG,
+ l_tod_timer_data),
+ "Error polling TOD_TIMER_REG");
+
+ if (l_tod_timer_data.getBit<PERV_TOD_TIMER_REG_STATUS>())
+ {
+ l_chip_it = l_targets.erase(l_chip_it);
+ }
+ else
+ {
+ l_chip_it++;
+ }
+ }
+ }
+
+ FAPI_ASSERT(l_targets.empty(),
+ fapi2::P9_TOD_TIMER_START_SIGNAL_ERROR().
+ set_TARGET(l_targets.front()),
+ "Spread spectrum operation did not start on all processors; the SMP fabric might be dead now!");
+
+fapi_try_exit:
+ FAPI_DBG("End");
+ return fapi2::current_err;
+}
/// @brief Helper function for p9_tod_init
/// @param[in] i_tod_node Pointer to TOD topology (including FAPI targets)
@@ -277,6 +418,10 @@ fapi2::ReturnCode p9_tod_init(
FAPI_TRY(init_tod_node(i_tod_node, o_failingTodProc),
"Error from init_tod_node!");
+ // sync spread across chips in topology
+ FAPI_TRY(sync_spread(i_tod_node),
+ "Error from sync_spread!");
+
fapi_try_exit:
FAPI_DBG("Exiting...");
return fapi2::current_err;
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_tod_utils.H b/src/import/chips/p9/procedures/hwp/nest/p9_tod_utils.H
index c72989aeb..96f8c271d 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_tod_utils.H
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_tod_utils.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -269,8 +269,7 @@ extern "C" {
TOD_CLEANUP,
TOD_CHECK_OSC,
TOD_MOVE_TOD_TO_TB,
- TOD_SAVE_CONFIG,
- SS_PLL_SYNC
+ TOD_SAVE_CONFIG
};
// Input which determines the master oscillator to use
diff --git a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml
index 41ece1c23..0dcabedbb 100644
--- a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml
+++ b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml
@@ -7741,4 +7741,21 @@
</chipEcFeature>
</attribute>
<!-- ******************************************************************** -->
+ <attribute>
+ <id>ATTR_CHIP_EC_FEATURE_SYNC_SS_PLL_SPREAD</id>
+ <targetType>TARGET_TYPE_PROC_CHIP</targetType>
+ <description>
+ Use TOD to synchronize SS filter PLL spreading across system
+ </description>
+ <chipEcFeature>
+ <chip>
+ <name>ENUM_ATTR_NAME_AXONE</name>
+ <ec>
+ <value>0x10</value>
+ <test>GREATER_THAN_OR_EQUAL</test>
+ </ec>
+ </chip>
+ </chipEcFeature>
+ </attribute>
+ <!-- ******************************************************************** -->
</attributes>
diff --git a/src/import/chips/p9/procedures/xml/attribute_info/pervasive_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/pervasive_attributes.xml
index d752eedb3..fdb2b91f1 100755
--- a/src/import/chips/p9/procedures/xml/attribute_info/pervasive_attributes.xml
+++ b/src/import/chips/p9/procedures/xml/attribute_info/pervasive_attributes.xml
@@ -165,6 +165,20 @@
</attribute>
<attribute>
+ <id>ATTR_FORCE_SYNC_SS_PLL_SPREAD</id>
+ <targetType>TARGET_TYPE_SYSTEM</targetType>
+ <description>
+ Use TOD to synchronize SS filter PLL spreading across system,
+ overriding ATTR_CHIP_EC_FEATURE_SYNC_SS_PLL_SPREAD
+ </description>
+ <valueType>uint8</valueType>
+ <persistRuntime/>
+ <platInit/>
+ <initToZero/>
+ <overrideOnly/>
+</attribute>
+
+<attribute>
<id>ATTR_OB0_PLL_BUCKET</id>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
<description>Select OBUS0 pll setting from one of the supported frequencies</description>
diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml b/src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml
index bd7022fe3..3e333588b 100644
--- a/src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml
+++ b/src/import/chips/p9/procedures/xml/error_info/p9_tod_errors.xml
@@ -269,5 +269,30 @@
</callout>
</hwpError>
<!-- ******************************************************************** -->
+ <hwpError>
+ <rc>RC_P9_TOD_TIMER_START_SIGNAL_ERROR</rc>
+ <description>
+ Procedure: p9_tod_init
+ The tod timer start signal did not go high as expected
+ </description>
+ <ffdc>TARGET</ffdc>
+ <collectRegisterFfdc>
+ <id>REG_FFDC_TOD_STATUS</id>
+ <targetType>TARGET_TYPE_PROC_CHIP</targetType>
+ <target>TARGET</target>
+ </collectRegisterFfdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+ <callout>
+ <target>TARGET</target>
+ <priority>MEDIUM</priority>
+ </callout>
+ <deconfigure>
+ <target>TARGET</target>
+ </deconfigure>
+ </hwpError>
+ <!-- ******************************************************************** -->
</hwpErrors>
OpenPOWER on IntegriCloud