summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/tod_init
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2015-01-20 10:44:57 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-01-22 16:37:56 -0600
commitf5adc2b3f80e8434a6db7ae571aad680a03986fc (patch)
treef6687224fb6b93e15b33eddd723862c930aa0c24 /src/usr/hwpf/hwp/tod_init
parent8ff361f83f059c5e9f0918332e0cf5d0dda6e38e (diff)
downloadtalos-hostboot-f5adc2b3f80e8434a6db7ae571aad680a03986fc.tar.gz
talos-hostboot-f5adc2b3f80e8434a6db7ae571aad680a03986fc.zip
SW291236: Add the ability for HWSV to select which TOD path to use in the case b
Change-Id: I370a116b22e82bdf30fbdd82f70ee9a647bbd8b4 CQ:SW291236 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15068 Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: James N. Klazynski <jklazyns@us.ibm.com> Reviewed-by: Manish K. Chowdhary <manichow@in.ibm.com> Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com> Tested-by: PRACHI GUPTA <pragupta@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15257 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/tod_init')
-rw-r--r--src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.C184
-rw-r--r--src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.H87
-rw-r--r--src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_setup.C96
-rw-r--r--src/usr/hwpf/hwp/tod_init/proc_tod_utils/proc_tod_utils.H18
4 files changed, 346 insertions, 39 deletions
diff --git a/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.C b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.C
new file mode 100644
index 000000000..a6d471281
--- /dev/null
+++ b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.C
@@ -0,0 +1,184 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/tod_init/proc_tod_setup//proc_tod_check_osc.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 */
+// $Id: proc_tod_check_osc.C,v 1.1 2014/12/11 17:01:53 jklazyns Exp $
+//------------------------------------------------------------------------------
+// *! (C) Copyright International Business Machines Corp. 2012
+// *! All Rights Reserved -- Property of IBM
+// *! *** ***
+// *!
+// *! TITLE : proc_tod_check_osc.C
+// *!
+// *! DESCRIPTION : Checks the validity of TOD oscillators connected to a target
+// *!
+// *! OWNER NAME : Nick Klazynski Email: jklazyns@us.ibm.com
+// *! BACKUP NAME : Email:
+// *!
+// *! ADDITIONAL COMMENTS :
+// *!
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+#include "proc_tod_utils.H"
+#include "proc_tod_check_osc.H"
+#include "p8_scom_addresses.H"
+
+extern "C"
+{
+
+//------------------------------------------------------------------------------
+// Function definitions
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// function: proc_tod_check_osc
+// parameters:
+// i_target FAPI target which will have its oscillator validity checked
+// o_osc_stat Oscillator(s) which passed the validity check
+//
+// returns: FAPI_RC_SUCCESS if the oscillators were successfully tested
+// (o_osc_stat will have the check's result)
+// else FAPI or ECMD error is sent through
+//------------------------------------------------------------------------------
+fapi::ReturnCode proc_tod_check_osc(const fapi::Target* i_target,
+ proc_tod_setup_osc_sel* o_osc_stat)
+{
+ fapi::ReturnCode rc;
+ ecmdDataBufferBase m_path_ctrl_reg_save_data(64);
+ ecmdDataBufferBase data(64);
+ uint32_t rc_ecmd = 0;
+
+ FAPI_INF("proc_tod_check_osc: Start");
+ do
+ {
+ // Read TOD_M_PATH_CTRL_REG_00040000 to be restored at the end of the procedure
+ rc=fapiGetScom(*i_target,TOD_M_PATH_CTRL_REG_00040000,m_path_ctrl_reg_save_data);
+ if (!rc.ok())
+ {
+ FAPI_ERR("proc_tod_check_osc: Error from fapiGetScom when retrieving TOD_M_PATH_CTRL_REG_00040000!");
+ break;
+ }
+
+ FAPI_DBG("proc_tod_check_osc: Configuring Master OSC paths in TOD_M_PATH_CTRL_REG_00040000 for oscillator testing.");
+
+ // OSC0 is connected
+ rc_ecmd |= data.clearBit(TOD_M_PATH_CTRL_REG_M_PATH_0_OSC_NOT_VALID);
+
+ // OSC0 step alignment enabled
+ rc_ecmd |= data.clearBit(TOD_M_PATH_CTRL_REG_M_PATH_0_STEP_ALIGN_DIS);
+
+ // Set 512 steps per sync for path 0
+ rc_ecmd |= data.insertFromRight(TOD_M_PATH_CTRL_REG_M_PATH_SYNC_FREQ_SEL_512,
+ TOD_M_PATH_CTRL_REG_M_PATH_0_SYNC_FREQ_SEL,
+ TOD_M_PATH_CTRL_REG_M_PATH_SYNC_FREQ_SEL_LEN);
+
+ // Set step check CPS deviation to 50%
+ rc_ecmd |= data.insertFromRight(STEP_CHECK_CPS_DEVIATION_50_00_PCENT,
+ TOD_M_PATH_CTRL_REG_M_PATH_0_STEP_CHECK_CPS_DEVIATION,
+ STEP_CHECK_CPS_DEVIATION_LEN);
+
+ // 8 valid steps are required before step check is enabled
+ rc_ecmd |= data.insertFromRight(STEP_CHECK_VALIDITY_COUNT_8,
+ TOD_M_PATH_CTRL_REG_M_PATH_0_STEP_CHECK_VALIDITY_COUNT,
+ STEP_CHECK_VALIDITY_COUNT_LEN);
+
+ // OSC1 is connected
+ rc_ecmd |= data.clearBit(TOD_M_PATH_CTRL_REG_M_PATH_1_OSC_NOT_VALID);
+
+ // OSC1 step alignment enabled
+ rc_ecmd |= data.clearBit(TOD_M_PATH_CTRL_REG_M_PATH_1_STEP_ALIGN_DIS);
+
+ // Set 512 steps per sync for path 1
+ rc_ecmd |= data.insertFromRight(TOD_M_PATH_CTRL_REG_M_PATH_SYNC_FREQ_SEL_512,
+ TOD_M_PATH_CTRL_REG_M_PATH_1_SYNC_FREQ_SEL,
+ TOD_M_PATH_CTRL_REG_M_PATH_SYNC_FREQ_SEL_LEN);
+
+ // Set step check CPS deviation to 50%
+ rc_ecmd |= data.insertFromRight(STEP_CHECK_CPS_DEVIATION_50_00_PCENT,
+ TOD_M_PATH_CTRL_REG_M_PATH_1_STEP_CHECK_CPS_DEVIATION,
+ STEP_CHECK_CPS_DEVIATION_LEN);
+
+ // 8 valid steps are required before step check is enabled
+ rc_ecmd |= data.insertFromRight(STEP_CHECK_VALIDITY_COUNT_8,
+ TOD_M_PATH_CTRL_REG_M_PATH_1_STEP_CHECK_VALIDITY_COUNT,
+ STEP_CHECK_VALIDITY_COUNT_LEN);
+
+ // CPS deviation factor configures both path-0 and path-1
+ rc_ecmd |= data.insertFromRight(STEP_CHECK_CPS_DEVIATION_FACTOR_1,
+ TOD_M_PATH_CTRL_REG_M_PATH_STEP_CHECK_DEVIATION_FACTOR,
+ STEP_CHECK_CPS_DEVIATION_FACTOR_LEN);
+
+ if (rc_ecmd)
+ {
+ FAPI_ERR("proc_tod_check_osc: Error 0x%08X in ecmdDataBuffer setup for TOD_M_PATH_CTRL_REG_00040000 SCOM.", rc_ecmd);
+ rc.setEcmdError(rc_ecmd);
+ break;
+ }
+ rc = fapiPutScom(*i_target,TOD_M_PATH_CTRL_REG_00040000,data);
+ if (!rc.ok())
+ {
+ FAPI_ERR("proc_tod_check_osc: fapiPutScom error for TOD_M_PATH_CTRL_REG_00040000 SCOM.");
+ break;
+ }
+
+ FAPI_DBG("proc_tod_check_osc: Checking oscillator validity.");
+ rc=fapiGetScom(*i_target,TOD_PSS_MSS_STATUS_REG_00040008,data);
+ if (!rc.ok())
+ {
+ FAPI_ERR("proc_tod_check_osc: Error from fapiGetScom when retrieving TOD_PSS_MSS_STATUS_REG_00040008!");
+ break;
+ }
+
+ *o_osc_stat = TOD_OSC_NONE;
+ if (data.isBitSet(TOD_PSS_MSS_STATUS_REG_M_PATH_0_STEP_CHECK_VALID) &&
+ data.isBitSet(TOD_PSS_MSS_STATUS_REG_M_PATH_1_STEP_CHECK_VALID)) {
+ FAPI_DBG("proc_tod_check_osc: both master path-0 and path-1 are valid! (TOD_PSS_MSS_STATUS_REG = 0x%016llX)",data.getDoubleWord(0));
+ *o_osc_stat = TOD_OSC_0_AND_1;
+ }
+ else if (data.isBitSet(TOD_PSS_MSS_STATUS_REG_M_PATH_0_STEP_CHECK_VALID)) {
+ FAPI_DBG("proc_tod_check_osc: master path-0 is valid; path-1 is not! (TOD_PSS_MSS_STATUS_REG = 0x%016llX)",data.getDoubleWord(0));
+ *o_osc_stat = TOD_OSC_0;
+ }
+ else if (data.isBitSet(TOD_PSS_MSS_STATUS_REG_M_PATH_1_STEP_CHECK_VALID)) {
+ FAPI_DBG("proc_tod_check_osc: master path-1 is valid; path-0 is not! (TOD_PSS_MSS_STATUS_REG = 0x%016llX)",data.getDoubleWord(0));
+ *o_osc_stat = TOD_OSC_1;
+ }
+
+ FAPI_DBG("proc_tod_check_osc: Restoring previous TOD_M_PATH_CTRL_REG_00040000 value.");
+ rc = fapiPutScom(*i_target,TOD_M_PATH_CTRL_REG_00040000,m_path_ctrl_reg_save_data);
+ if (!rc.ok())
+ {
+ FAPI_ERR("proc_tod_check_osc: fapiPutScom error for TOD_M_PATH_CTRL_REG_00040000 SCOM.");
+ break;
+ }
+
+ } while (0);
+
+ FAPI_INF("proc_tod_check_osc: End");
+ return rc;
+}
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.H b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.H
new file mode 100644
index 000000000..f2aec381e
--- /dev/null
+++ b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_check_osc.H
@@ -0,0 +1,87 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/tod_init/proc_tod_setup//proc_tod_check_osc.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 */
+// $Id: proc_tod_check_osc.H,v 1.1 2014/12/11 17:01:53 jklazyns Exp $
+//------------------------------------------------------------------------------
+// *! (C) Copyright International Business Machines Corp. 2012
+// *! All Rights Reserved -- Property of IBM
+// *! *** ***
+// *!
+// *! TITLE : proc_tod_check_osc.H
+// *!
+// *! DESCRIPTION : Header for proc_tod_check_osc.C
+// *!
+// *! OWNER NAME : Nick Klazynski Email: jklazyns@us.ibm.com
+// *! BACKUP NAME : Email:
+// *!
+// *! ADDITIONAL COMMENTS :
+// *!
+//------------------------------------------------------------------------------
+
+#ifndef PROC_TOD_CHECK_OSC_H_
+#define PROC_TOD_CHECK_OSC_H_
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+#include <fapi.H>
+#include "proc_tod_utils.H"
+
+//------------------------------------------------------------------------------
+// Constant definitions
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Structure definitions
+//------------------------------------------------------------------------------
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*proc_tod_check_osc_FP_t) (const fapi::Target*,
+ proc_tod_setup_osc_sel*);
+
+//------------------------------------------------------------------------------
+// Function prototypes
+//------------------------------------------------------------------------------
+
+extern "C"
+{
+
+/**
+ * @brief Checks oscillator validality for a given target
+ *
+ * @param[in] i_target FAPI target which will have its oscillator
+ * validity checked
+ *
+ * @param[out] o_osc_stat Oscillator(s) which passed the validity check
+ *
+ * @return FAPI_RC_SUCCESS if the oscillators were successfully tested
+ * (o_osc_stat will have the check's result)
+ * else FAPI or ECMD error is sent through
+ */
+fapi::ReturnCode proc_tod_check_osc(const fapi::Target* i_target,
+ proc_tod_setup_osc_sel* o_osc_stat);
+
+} // extern "C"
+
+#endif // PROC_TOD_CHECK_OSC_H_
diff --git a/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_setup.C b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_setup.C
index 2fcae0881..bb1a0c85c 100644
--- a/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_setup.C
+++ b/src/usr/hwpf/hwp/tod_init/proc_tod_setup/proc_tod_setup.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,7 +22,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: proc_tod_setup.C,v 1.22 2014/10/22 17:11:05 jklazyns Exp $
+// $Id: proc_tod_setup.C,v 1.23 2015/01/08 19:50:38 jklazyns Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2012
// *! All Rights Reserved -- Property of IBM
@@ -101,8 +101,14 @@ fapi::ReturnCode proc_tod_setup(tod_topology_node* i_tod_node,
FAPI_INF("proc_tod_setup: Configuring %s topology (OSC0 is %s, OSC1 is %s)",
(i_tod_sel==TOD_PRIMARY)?"Primary":"Secondary",
- (i_osc_sel==TOD_OSC_0 || i_osc_sel==TOD_OSC_0_AND_1)?"connected":"not connected",
- (i_osc_sel==TOD_OSC_1 || i_osc_sel==TOD_OSC_0_AND_1)?"connected":"not connected");
+ (i_osc_sel==TOD_OSC_0 ||
+ i_osc_sel==TOD_OSC_0_AND_1 ||
+ i_osc_sel==TOD_OSC_0_AND_1_SEL_0 ||
+ i_osc_sel==TOD_OSC_0_AND_1_SEL_1)?"connected":"not connected",
+ (i_osc_sel==TOD_OSC_1 ||
+ i_osc_sel==TOD_OSC_0_AND_1 ||
+ i_osc_sel==TOD_OSC_0_AND_1_SEL_0 ||
+ i_osc_sel==TOD_OSC_0_AND_1_SEL_1)?"connected":"not connected");
// calculate_node_delays populates o_int_path_delay for each node
rc = calculate_node_delays(i_tod_node);
@@ -147,7 +153,7 @@ fapi::ReturnCode proc_tod_setup(tod_topology_node* i_tod_node,
//
// parameters: i_tod_node Reference to TOD topology (FAPI targets included within)
// i_tod_sel Specifies the topology to clear
-// i_is_mpipl if this IPL is an MPIPL, additional setup is needed;
+// i_is_mpipl if this IPL is an MPIPL, additional setup is needed;
// determined via an attribute
//
// returns: FAPI_RC_SUCCESS if TOD topology is successfully cleared
@@ -279,17 +285,22 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
if (is_mdmt)
{
rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_PRI_M_S_TOD_SEL);
- if (i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0)
{
- rc_ecmd |= data.clearBit(TOD_PSS_MSS_CTRL_REG_PRI_M_PATH_SEL);
+ rc_ecmd |= data.clearBit(TOD_PSS_MSS_CTRL_REG_PRI_M_PATH_SEL);
}
- else if (i_osc_sel == TOD_OSC_0)
+ else if (i_osc_sel == TOD_OSC_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
- rc_ecmd |= data.clearBit(TOD_PSS_MSS_CTRL_REG_PRI_M_PATH_SEL);
+ rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_PRI_M_PATH_SEL);
}
- else // i_osc_sel == TOD_OSC_1
+ else // i_osc_sel == TOD_OSC_NONE
{
- rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_PRI_M_PATH_SEL);
+ FAPI_ERR("configure_tod_node: Invalid oscillator configuration!");
+ FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_SETUP_INVALID_TOPOLOGY);
+ break;
}
}
else // Slave nodes (Drawer master is still a slave)
@@ -306,17 +317,22 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
if (is_mdmt)
{
rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_SEC_M_S_TOD_SEL);
- if (i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
- rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_SEC_M_PATH_SEL);
+ rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_SEC_M_PATH_SEL);
}
- else if (i_osc_sel == TOD_OSC_0)
+ else if (i_osc_sel == TOD_OSC_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0)
{
- rc_ecmd |= data.clearBit(TOD_PSS_MSS_CTRL_REG_SEC_M_PATH_SEL);
+ rc_ecmd |= data.clearBit(TOD_PSS_MSS_CTRL_REG_SEC_M_PATH_SEL);
}
- else // i_osc_sel == TOD_OSC_1
+ else // i_osc_sel == TOD_OSC_NONE
{
- rc_ecmd |= data.setBit(TOD_PSS_MSS_CTRL_REG_SEC_M_PATH_SEL);
+ FAPI_ERR("configure_tod_node: Invalid oscillator configuration!");
+ FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_SETUP_INVALID_TOPOLOGY);
+ break;
}
}
else // Slave nodes (Drawer master is still a slave)
@@ -460,32 +476,42 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
{
if (i_tod_sel==TOD_PRIMARY)
{
- if (i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0)
{
path_sel = TOD_PORT_CTRL_REG_M_PATH_0;
}
- else if (i_osc_sel == TOD_OSC_0)
+ else if (i_osc_sel == TOD_OSC_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
- path_sel = TOD_PORT_CTRL_REG_M_PATH_0;
+ path_sel = TOD_PORT_CTRL_REG_M_PATH_1;
}
- else // i_osc_sel == TOD_OSC_1
+ else // i_osc_sel == TOD_OSC_NONE
{
- path_sel = TOD_PORT_CTRL_REG_M_PATH_1;
+ FAPI_ERR("configure_tod_node: Invalid oscillator configuration!");
+ FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_SETUP_INVALID_TOPOLOGY);
+ break;
}
}
- else
+ else // i_tod_sel==TOD_SECONDARY
{
- if (i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
path_sel = TOD_PORT_CTRL_REG_M_PATH_1;
}
- else if (i_osc_sel == TOD_OSC_0)
+ else if (i_osc_sel == TOD_OSC_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0)
{
path_sel = TOD_PORT_CTRL_REG_M_PATH_0;
}
- else // i_osc_sel == TOD_OSC_1
+ else // i_osc_sel == TOD_OSC_NONE
{
- path_sel = TOD_PORT_CTRL_REG_M_PATH_1;
+ FAPI_ERR("configure_tod_node: Invalid oscillator configuration!");
+ FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_SETUP_INVALID_TOPOLOGY);
+ break;
}
}
}
@@ -568,7 +594,10 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
{
FAPI_DBG("configure_tod_node: Configuring Master OSC path in TOD_M_PATH_CTRL_REG_00040000");
- if (i_osc_sel == TOD_OSC_0 || i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
FAPI_DBG("configure_tod_node: OSC0 is valid; master path-0 will be configured.");
@@ -600,7 +629,10 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
// OSC0 is not connected; any previous path-0 settings will be ignored
rc_ecmd |= data.setBit(TOD_M_PATH_CTRL_REG_M_PATH_0_OSC_NOT_VALID);
}
- if (i_osc_sel == TOD_OSC_1 || i_osc_sel == TOD_OSC_0_AND_1)
+ if (i_osc_sel == TOD_OSC_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_0 ||
+ i_osc_sel == TOD_OSC_0_AND_1_SEL_1)
{
FAPI_DBG("configure_tod_node: OSC1 is valid; master path-1 will be configured.");
@@ -632,7 +664,7 @@ fapi::ReturnCode configure_tod_node(tod_topology_node* i_tod_node,
// OSC1 is not connected; any previous path-1 settings will be ignored
rc_ecmd |= data.setBit(TOD_M_PATH_CTRL_REG_M_PATH_1_OSC_NOT_VALID);
}
-
+
// CPS deviation factor configures both path-0 and path-1
rc_ecmd |= data.insertFromRight(STEP_CHECK_CPS_DEVIATION_FACTOR_1,
TOD_M_PATH_CTRL_REG_M_PATH_STEP_CHECK_DEVIATION_FACTOR,
@@ -1066,7 +1098,7 @@ fapi::ReturnCode set_topology_delays(tod_topology_node* i_tod_node,
//
// parameters: o_chic_ctrlReg_val => ecmdDataBuffer containing the
// Chip Control Status Register configuration
-//
+//
// returns: FAPI_RC_SUCCESS if TOD_CHIP_CTRL_REG_00040010's value was successfully
// calculated else ECMD error is sent back
//
@@ -1114,7 +1146,7 @@ fapi::ReturnCode init_chip_ctrl_reg (ecmdDataBufferBase& o_chic_ctrlReg_val)
}
} while(0);
-
+
FAPI_INF("init_chip_ctrl_reg: End");
return rc;
}
diff --git a/src/usr/hwpf/hwp/tod_init/proc_tod_utils/proc_tod_utils.H b/src/usr/hwpf/hwp/tod_init/proc_tod_utils/proc_tod_utils.H
index a166aa65b..464136f9a 100644
--- a/src/usr/hwpf/hwp/tod_init/proc_tod_utils/proc_tod_utils.H
+++ b/src/usr/hwpf/hwp/tod_init/proc_tod_utils/proc_tod_utils.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,10 +22,11 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: proc_tod_utils.H,v 1.15 2014/10/14 15:07:54 jklazyns Exp $
+// $Id: proc_tod_utils.H,v 1.17 2015/01/08 19:50:37 jklazyns Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2012
// *! All Rights Reserved -- Property of IBM
+// *! *** ***
// *!
// *! TITLE : proc_tod_utils.H
// *!
@@ -390,7 +391,8 @@ enum tod_action
TOD_SETUP,
TOD_INIT,
TOD_STATUS,
- TOD_CLEANUP
+ TOD_CLEANUP,
+ TOD_CHECK_OSC
};
// Input which determines the topology being configured
@@ -403,10 +405,12 @@ enum proc_tod_setup_tod_sel
// Input which determines the master oscillator to use
enum proc_tod_setup_osc_sel
{
- TOD_OSC_0, // oscillator connected to OSC0 and not OSC1
- TOD_OSC_1, // oscillator connected to OSC1 and not OSC0
- TOD_OSC_0_AND_1 // oscillators connected to both OSC0 and OSC1
-
+ TOD_OSC_0, // oscillator connected to OSC0 and not OSC1
+ TOD_OSC_1, // oscillator connected to OSC1 and not OSC0
+ TOD_OSC_0_AND_1, // oscillators connected to both OSC0 and OSC1
+ TOD_OSC_0_AND_1_SEL_0, // oscillators connected to both OSC0 and OSC1, but OSC0 will always be selected
+ TOD_OSC_0_AND_1_SEL_1, // oscillators connected to both OSC0 and OSC1, but OSC1 will always be selected
+ TOD_OSC_NONE // No oscillators connected
};
// Defines the upstream connection for the given node
OpenPOWER on IntegriCloud