summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/nest
diff options
context:
space:
mode:
authormanichow <manichow@in.ibm.com>2017-12-06 11:32:44 -0600
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-01-18 13:32:22 -0500
commit198f186b138f39a2cb906c1f40df577d3db2ec82 (patch)
treeb17f4b4551bfe5020cbac12c0745b61ae9582bec /src/import/chips/p9/procedures/hwp/nest
parente029420eaf65a2ab3408e66e7e9fab90ddaae3ff (diff)
downloadtalos-hostboot-198f186b138f39a2cb906c1f40df577d3db2ec82.tar.gz
talos-hostboot-198f186b138f39a2cb906c1f40df577d3db2ec82.zip
Changes for TOD support in MPIPL.
Change-Id: Ia7b18c125b4e01f9788125b639ea3123d1a0a34c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50588 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: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50636 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/nest')
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_tod_setup.C122
1 files changed, 90 insertions, 32 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_tod_setup.C b/src/import/chips/p9/procedures/hwp/nest/p9_tod_setup.C
index 8b809dcb4..507f6349e 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_tod_setup.C
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_tod_setup.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -43,10 +43,80 @@
#include <p9_tod_setup.H>
-/// @brief Clear any previous topology that may have been set
+/// @brief MPIPL specific steps to clear the previous topology, this should be
+// called only during MPIPL
+/// @param[in] i_tod_node Reference to TOD topology (including FAPI targets)
+/// @param[in] i_tod_sel Specifies the topology to clear
+/// @return FAPI_RC_SUCCESS if TOD topology is successfully cleared, else error
+fapi2::ReturnCode mpipl_clear_tod_node(
+ tod_topology_node* i_tod_node,
+ const p9_tod_setup_tod_sel i_tod_sel)
+{
+ uint32_t l_port_ctrl_check_reg = 0;
+ char l_targetStr[fapi2::MAX_ECMD_STRING_LEN];
+
+ fapi2::toString(*(i_tod_node->i_target),
+ l_targetStr,
+ fapi2::MAX_ECMD_STRING_LEN);
+
+ FAPI_INF("MPIPL-Clearing previous %s topology from %s",
+ (i_tod_sel == TOD_PRIMARY) ? "Primary" : "Secondary", l_targetStr);
+
+
+ fapi2::buffer<uint64_t> l_rx_ttype_ctrl_reg = 0;
+ fapi2::buffer<uint64_t> l_tx_ttype5_reg = 0;
+ fapi2::buffer<uint64_t> l_tod_load_reg = 0;
+
+ FAPI_INF("MPIPL: stop step checkers");
+ //Stop step checkers
+ FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
+ PERV_TOD_PSS_MSS_CTRL_REG,
+ 0x0ULL),
+ "Error from putScom (0x%08X)!", l_port_ctrl_check_reg);
+
+ FAPI_INF("MPIPL: switch TOD to 'Not Set' state");
+ // Generate TType#5 (formats defined in section "TType Fabric Interface"
+ // in the TOD workbook)
+ l_rx_ttype_ctrl_reg.setBit<5>().setBit<56>();
+ FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
+ PERV_TOD_RX_TTYPE_CTRL_REG,
+ l_rx_ttype_ctrl_reg),
+ "Error from putScom (PERV_TOD_RX_TTYPE_CTRL_REG)");
+
+ FAPI_INF("MPIPL: switch all other TODs to 'Not Set' state");
+ l_tx_ttype5_reg.setBit<PERV_TOD_TX_TTYPE_5_REG_TRIGGER>();
+ FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
+ PERV_TOD_TX_TTYPE_5_REG,
+ l_tx_ttype5_reg),
+ "Error from putScom (PERV_TOD_TX_TTYPE_5_REG)");
+
+ //PUT TOD in stop state
+ FAPI_INF("MPIPL: put TOD to stop state");
+ l_tod_load_reg.setBit<63>();
+ FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
+ PERV_TOD_LOAD_TOD_REG,
+ l_tod_load_reg),
+ "Error from putScom (PERV_TOD_TX_TTYPE_5_REG)");
+
+ for(auto l_child = (i_tod_node->i_children).begin();
+ l_child != (i_tod_node->i_children).end();
+ ++l_child)
+ {
+ FAPI_INF("Going to sleep for 1 second ");
+ FAPI_TRY(mpipl_clear_tod_node(*l_child,
+ i_tod_sel),
+ "Failure clearing downstream TOD node!");
+ }
+
+fapi_try_exit:
+ FAPI_INF("Exiting...");
+ return fapi2::current_err;
+}
+
+
+/// @brief Specific steps to clear the previous topology.
/// @param[in] i_tod_node Reference to TOD topology (including FAPI targets)
/// @param[in] i_tod_sel Specifies the topology to clear
-/// @param[in] i_is_mpipl Indicates if this IPL is an MPIPL
/// @return FAPI_RC_SUCCESS if TOD topology is successfully cleared, else error
fapi2::ReturnCode clear_tod_node(
tod_topology_node* i_tod_node,
@@ -86,31 +156,6 @@ fapi2::ReturnCode clear_tod_node(
0x0ULL),
"Error from putScom (0x%08X)!", l_port_ctrl_check_reg);
- if (i_is_mpipl)
- {
- fapi2::buffer<uint64_t> l_rx_ttype_ctrl_reg = 0;
- fapi2::buffer<uint64_t> l_tx_ttype5_reg = 0;
- FAPI_INF("MPIPL: switch TOD to 'Not Set' state");
-
- // Generate TType#5 (formats defined in section "TType Fabric Interface"
- // in the TOD workbook)
- l_rx_ttype_ctrl_reg.setBit<5>().setBit<56>();
- FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
- PERV_TOD_RX_TTYPE_CTRL_REG,
- l_rx_ttype_ctrl_reg),
- "Error from putScom (PERV_TOD_RX_TTYPE_CTRL_REG)");
-
- FAPI_INF("MPIPL: switch all other TODs to 'Not Set' state");
- l_tx_ttype5_reg.setBit<PERV_TOD_TX_TTYPE_5_REG_TRIGGER>();
- FAPI_TRY(fapi2::putScom(*(i_tod_node->i_target),
- PERV_TOD_TX_TTYPE_5_REG,
- l_tx_ttype5_reg),
- "Error from putScom (PERV_TOD_TX_TTYPE_5_REG)");
- }
- else
- {
- FAPI_INF("Normal IPL: Bypass TTYPE#5");
- }
// TOD is cleared for this node; if it has children, start clearing
// their registers
@@ -1454,16 +1499,29 @@ fapi2::ReturnCode p9_tod_setup(
i_osc_sel == TOD_OSC_0_AND_1_SEL_0 ||
i_osc_sel == TOD_OSC_0_AND_1_SEL_1) ? "connected" : "not connected");
- FAPI_TRY(calculate_node_delays(i_tod_node),
- "Error from calculate_node_delays!");
-
- display_tod_nodes(i_tod_node, 0);
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IS_MPIPL,
fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
l_is_mpipl),
"Error from FAPI_ATTR_GET (ATTR_IS_MPIPL)!");
+ if ( l_is_mpipl && ( i_tod_sel == TOD_PRIMARY))
+ {
+ // Put the TOD in reset state, and clear the register
+ // PERV_TOD_PSS_MSS_CTRL_REG, we do it before the primary
+ // topology is configured and not repeat it to prevent overwriting
+ // the configuration.
+ FAPI_TRY(mpipl_clear_tod_node(i_tod_node, i_tod_sel),
+ "Error from clear_tod_node!");
+ }
+
+ // Start configuring each node
+ // configure_tod_node will recurse on each child
+ FAPI_TRY(calculate_node_delays(i_tod_node),
+ "Error from calculate_node_delays!");
+
+ display_tod_nodes(i_tod_node, 0);
+
// If there is a previous topology, it needs to be cleared
FAPI_TRY(clear_tod_node(i_tod_node, i_tod_sel, l_is_mpipl),
"Error from clear_tod_node!");
OpenPOWER on IntegriCloud