summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwpf/hwp/dram_training/memory_mss_termination_control.xml127
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/memory_mss_draminit_training_advanced.xml68
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H171
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.C1108
-rwxr-xr-xsrc/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.H19
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.C2454
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.H51
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_termination_control.C99
-rw-r--r--src/usr/hwpf/hwp/dram_training/mss_termination_control.H568
-rwxr-xr-xsrc/usr/hwpf/hwp/initfiles/cen_ddrphy.initfile9
-rw-r--r--src/usr/hwpf/hwp/mc_config/mss_eff_config/memory_mss_bulk_pwr_throttles.xml19
-rw-r--r--src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_bulk_pwr_throttles.C6
12 files changed, 2815 insertions, 1884 deletions
diff --git a/src/usr/hwpf/hwp/dram_training/memory_mss_termination_control.xml b/src/usr/hwpf/hwp/dram_training/memory_mss_termination_control.xml
index 05b2091cc..98979f9e1 100644
--- a/src/usr/hwpf/hwp/dram_training/memory_mss_termination_control.xml
+++ b/src/usr/hwpf/hwp/dram_training/memory_mss_termination_control.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- IBM CONFIDENTIAL -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2013 -->
+<!-- COPYRIGHT International Business Machines Corp. 2013,2014 -->
<!-- -->
<!-- p1 -->
<!-- -->
@@ -21,34 +21,125 @@
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
<hwpErrors>
-<!-- $Id: memory_mss_termination_control.xml,v 1.1 2013/06/19 18:28:31 bellows Exp $ -->
+<!-- $Id: memory_mss_termination_control.xml,v 1.3 2014/01/22 15:39:32 mjjones Exp $ -->
<!-- For file ../../ipl/fapi/mss_termination_control.C -->
<!-- // *! OWNER NAME : Saravanan Sethuraman email ID:saravanans@in.ibm.com -->
<!-- // *! BACKUP NAME: Menlo Wuu email ID:menlowuu@us.ibm.com -->
-<!-- Original Source for RC_MSS_IMP_INPUT_ERROR memory_errors.xml -->
- <hwpError>
- <rc>RC_MSS_IMP_INPUT_ERROR</rc>
- <description>Impedance is invalid for driver/receiver type.</description>
+<hwpError>
+ <rc>RC_CONFIG_DRV_IMP_INVALID_INPUT</rc>
+ <description>
+ The config_drv_imp utility function received a bad parameter
+ </description>
+ <ffdc>PORT_PARAM</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
</hwpError>
-<!-- Original Source for RC_MSS_INVALID_DRAM_GEN memory_errors.xml -->
- <hwpError>
- <rc>RC_MSS_INVALID_DRAM_GEN</rc>
- <description>DRAM_GEN attribute is not valid; equals 0 for empty.</description>
+<hwpError>
+ <rc>RC_CONFIG_RCV_IMP_INVALID_INPUT</rc>
+ <description>
+ The config_rcv_imp utility function received a bad parameter
+ </description>
+ <ffdc>PORT_PARAM</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
</hwpError>
-<!-- Original Source for RC_MSS_INVALID_FREQ memory_errors.xml -->
- <hwpError>
- <rc>RC_MSS_INVALID_FREQ</rc>
- <description>MSS_FREQ attribute equals 0.</description>
+<hwpError>
+ <rc>RC_CONFIG_SLEW_RATE_INVALID_INPUT</rc>
+ <description>
+ The config_slew_rate utility function received a bad parameter
+ </description>
+ <ffdc>PORT_PARAM</ffdc>
+ <ffdc>SLEW_TYPE_PARAM</ffdc>
+ <ffdc>SLEW_IMP_PARAM</ffdc>
+ <ffdc>SLEW_RATE_PARAM</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
</hwpError>
-<!-- Original Source for RC_MSS_SLEW_CAL_ERROR memory_errors.xml -->
- <hwpError>
- <rc>RC_MSS_SLEW_CAL_ERROR</rc>
- <description>Slew calibration error occurred.</description>
+<hwpError>
+ <rc>RC_CONFIG_WR_DRAM_VREF_INVALID_INPUT</rc>
+ <description>
+ The config_wr_dram_vref utility function received a bad parameter
+ </description>
+ <ffdc>PORT_PARAM</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
</hwpError>
+<hwpError>
+ <rc>RC_CONFIG_RD_CEN_VREF_INVALID_INPUT</rc>
+ <description>
+ The config_rd_cen_vref utility function received a bad parameter
+ </description>
+ <ffdc>PORT_PARAM</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_MSS_SLEW_CAL_INVALID_DRAM_GEN</rc>
+ <description>
+ mss_slew_cal found an invalid DRAM type in ATTR_EFF_DRAM_GEN (not DDR3/4)
+ </description>
+ <ffdc>DRAM_GEN</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_MSS_SLEW_CAL_INVALID_FREQ</rc>
+ <description>
+ mss_slew_cal found a zero frequency in ATTR_MSS_FREQ
+ </description>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_MSS_SLEW_CAL_ERROR</rc>
+ <description>
+ mss_slew_cal for slew calibration error
+ </description>
+ <ffdc>DATA_ADR</ffdc>
+ <ffdc>IMP</ffdc>
+ <ffdc>SLEW</ffdc>
+ <callout>
+ <target>MBA_IN_ERROR</target>
+ <priority>HIGH</priority>
+ </callout>
+ <deconfigure>
+ <target>MBA_IN_ERROR</target>
+ </deconfigure>
+ <gard>
+ <target>MBA_IN_ERROR</target>
+ </gard>
+</hwpError>
+
+<hwpError>
+ <rc>RC_MSS_IMP_INPUT_ERROR</rc>
+ <!-- TODO Remove when all HWPs using it are using their own Error XML file -->
+ <description>Impedance is invalid for driver/receiver type.</description>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
</hwpErrors>
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/memory_mss_draminit_training_advanced.xml b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/memory_mss_draminit_training_advanced.xml
index 84515a9be..cc0c648b5 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/memory_mss_draminit_training_advanced.xml
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/memory_mss_draminit_training_advanced.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- IBM CONFIDENTIAL -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2013 -->
+<!-- COPYRIGHT International Business Machines Corp. 2013,2014 -->
<!-- -->
<!-- p1 -->
<!-- -->
@@ -21,10 +21,74 @@
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
<hwpErrors>
-<!-- $Id: memory_mss_draminit_training_advanced.xml,v 1.1 2013/06/19 18:27:51 bellows Exp $ -->
+<!-- $Id: memory_mss_draminit_training_advanced.xml,v 1.2 2014/01/23 17:11:14 sasethur Exp $ -->
<!-- For file ../../ipl/fapi/mss_draminit_training_advanced.C -->
<!-- // *! OWNER NAME : Saravanan Sethuraman email ID:saravanans@in.ibm.com -->
<!-- // *! BACKUP NAME: Mark D Bellows email ID:bellows@us.ibm.com -->
+<hwpError>
+ <rc>RC_DRV_IMPED_SHMOO_INVALID_MARGIN_DATA</rc>
+ <description>
+ The drv_imped_shmoo utility function got bad margin data from the
+ find_best_margin function
+ </description>
+ <ffdc>COUNT_DATA</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_SLEW_RATE_SHMOO_INVALID_MARGIN_DATA</rc>
+ <description>
+ The slew_rate_shmoo utility function got bad margin data from the
+ find_best_margin function
+ </description>
+ <ffdc>COUNT_DATA</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_WR_VREF_SHMOO_INVALID_MARGIN_DATA</rc>
+ <description>
+ The wr_vref_shmoo utility function got bad margin data from the
+ find_best_margin function
+ </description>
+ <ffdc>COUNT_DATA</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_RD_VREF_SHMOO_INVALID_MARGIN_DATA</rc>
+ <description>
+ The rd_vref_shmoo utility function got bad margin data from the
+ find_best_margin function
+ </description>
+ <ffdc>COUNT_DATA</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
+
+<hwpError>
+ <rc>RC_RCV_IMP_SHMOO_INVALID_MARGIN_DATA</rc>
+ <description>
+ The rcv_imp_shmoo utility function got bad margin data from the
+ find_best_margin function
+ </description>
+ <ffdc>COUNT_DATA</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+</hwpError>
</hwpErrors>
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H
index c74e4dbfe..2bb4657ff 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-//$Id: mss_access_delay_reg.H,v 1.11 2013/12/16 10:15:30 sasethur Exp $
+//$Id: mss_access_delay_reg.H,v 1.12 2014/01/24 17:22:16 sasethur Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
// *! All Rights Reserved -- Property of IBM
@@ -40,6 +40,7 @@
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
+// 1.12 | mjjones |20-Jan-14| RAS Review Updates
// 1.1 | sauchadh |15-Oct-12| First Draft.
//------------------------------------------------------------------------------
@@ -179,29 +180,173 @@ struct scom_location {
uint64_t scom_addr;
uint8_t start_bit;
uint8_t bit_length;
-};
-
-
-typedef fapi::ReturnCode (*mss_access_delay_reg_FP_t)(const fapi::Target & i_target_mba, access_type_t i_access_type_e, uint8_t i_port_u8, uint8_t i_rank_u8, input_type_t i_input_type_e, uint8_t i_input_index_u8,uint8_t i_verbose, uint32_t &io_value_u32);
+};
+typedef fapi::ReturnCode (*mss_access_delay_reg_FP_t)(const fapi::Target &,
+ access_type_t,
+ uint8_t,
+ uint8_t,
+ input_type_t,
+ uint8_t,
+ uint8_t,
+ uint32_t &);
extern "C" {
-//------------------------------------------------------------------------------
-fapi::ReturnCode mss_access_delay_reg_schmoo(const fapi::Target & i_target_mba, access_type_t i_access_type_e, uint8_t i_port_u8, uint8_t i_rank_u8, input_type_t i_input_type_e, uint8_t i_input_index_u8,uint8_t i_verbose, uint16_t &io_value_u32);
+/**
+ * @brief Reads or Writes delay values
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_access_type_e Access type (READ or WRITE)
+ * @param[in] i_port_u8 Port number
+ * @param[in] i_rank_u8 Rank number
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_input_index_u8 Input index
+ * @param[in] i_verbose 1 = Verbose tracing
+ * @param[io] io_value_u32 READ=input, WRITE=output
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode mss_access_delay_reg_schmoo(const fapi::Target & i_target_mba,
+ access_type_t i_access_type_e,
+ uint8_t i_port_u8,
+ uint8_t i_rank_u8,
+ input_type_t i_input_type_e,
+ uint8_t i_input_index_u8,
+ uint8_t i_verbose,
+ uint16_t &io_value_u32);
+
+/**
+ * @brief Reads or Writes delay values
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_access_type_e Access type (READ or WRITE)
+ * @param[in] i_port_u8 Port number
+ * @param[in] i_rank_u8 Rank number
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_input_index_u8 Input index
+ * @param[in] i_verbose 1 = Verbose tracing
+ * @param[io] io_value_u32 READ=input, WRITE=output
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode mss_access_delay_reg(const fapi::Target & i_target_mba,
+ access_type_t i_access_type_e,
+ uint8_t i_port_u8,
+ uint8_t i_rank_u8,
+ input_type_t i_input_type_e,
+ uint8_t i_input_index_u8,
+ uint8_t i_verbose,
+ uint32_t &io_value_u32);
-fapi::ReturnCode mss_access_delay_reg(const fapi::Target & i_target_mba, access_type_t i_access_type_e, uint8_t i_port_u8, uint8_t i_rank_u8, input_type_t i_input_type_e, uint8_t i_input_index_u8,uint8_t i_verbose, uint32_t &io_value_u32);
+/**
+ * @brief cross_coupled
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port Port number
+ * @param[in] i_rank_pair Rank pair
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_input_index Input index
+ * @param[in] i_verbose 1 = Verbose tracing
+ * @param[out] out Output
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode cross_coupled(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_rank_pair,
+ input_type_t i_input_type_e,
+ uint8_t i_input_index,
+ uint8_t i_verbose,
+ scom_location& out);
-fapi::ReturnCode cross_coupled(const fapi::Target & i_target_mba,uint8_t i_port, uint8_t i_rank_pair,input_type_t i_input_type_e,uint8_t i_input_index,uint8_t i_verbose,scom_location& out);
+/**
+ * @brief mss_c4_phy
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port Port number
+ * @param[in] i_rank_pair Rank pair
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_input_index Input index
+ * @param[in] i_verbose 1 = Verbose tracing
+ * @param[io] phy_lane PHY Lane
+ * @param[io] phy_block PHY Block
+ * @param[in] flag Flag
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode mss_c4_phy(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_rank_pair,
+ input_type_t i_input_type_e,
+ uint8_t &i_input_index,
+ uint8_t i_verbose,
+ uint8_t &phy_lane,
+ uint8_t &phy_block,
+ uint8_t flag);
-fapi::ReturnCode mss_c4_phy(const fapi::Target & i_target_mba,uint8_t i_port, uint8_t i_rank_pair,input_type_t i_input_type_e,uint8_t &dq_lane,uint8_t i_verbose,uint8_t &phy_lane,uint8_t &phy_block,uint8_t flag);
+/**
+ * @brief get_address
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port Port number
+ * @param[in] i_rank_pair Rank pair
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_block Block
+ * @param[in] i_lane Lane
+ * @param[out] o_scom_address_64 Output scom address
+ * @param[out] o_start_bit Output Start bit
+ * @param[out] o_len Output length
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode get_address(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_rank_pair,
+ ip_type_t i_input_type_e,
+ uint8_t i_block,
+ uint8_t i_lane,
+ uint64_t &o_scom_address_64,
+ uint8_t &o_start_bit,
+ uint8_t &o_len);
-fapi::ReturnCode get_address(const fapi::Target & i_target_mba,uint8_t i_port, uint8_t i_rank_pair,ip_type_t i_input_type_e,uint8_t i_block,uint8_t i_lane,uint64_t &o_scom_address_64,uint8_t &o_start_bit,uint8_t &o_len);
+/**
+ * @brief Returns C4 bit for the corresponding ISDIMM bit
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port Port number
+ * @param[in] i_input_type_e Input type (from input_type_t)
+ * @param[in] i_input_index Input index
+ * @param[in] i_verbose 1 = Verbose tracing
+ * @param[out] o_value Output C4 bit
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode rosetta_map(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ input_type i_input_type_e,
+ uint8_t i_input_index,
+ uint8_t i_verbose,
+ uint8_t &o_value);
-fapi::ReturnCode rosetta_map(const fapi::Target & i_target_mba,uint8_t i_port, input_type i_input_type_e ,uint8_t i_input_index,uint8_t i_verbose,uint8_t &o_value);
+/**
+ * @brief Gets the rank pair
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port Port
+ * @param[in] i_rank Rank
+ * @param[out] o_rank_pair Output rank pair
+ * @param[out] o_rankpair_table Output rank pair table
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode mss_getrankpair(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_rank,
+ uint8_t *o_rank_pair,
+ uint8_t o_rankpair_table[]);
-fapi::ReturnCode mss_getrankpair(const fapi::Target & i_target_mba,uint8_t i_port,uint8_t i_rank,uint8_t *o_rank_pair,uint8_t o_rankpair_table[8]);
} // extern "C"
#endif // MSS_ACCESS_DELAY_REG_H
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.C b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.C
index 8ceeba238..965247244 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.C
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_draminit_training_advanced.C,v 1.41 2014/01/16 17:22:58 sasethur Exp $
+// $Id: mss_draminit_training_advanced.C,v 1.42 2014/01/23 17:09:52 sasethur Exp $
/* File is created by SARAVANAN SETHURAMAN on Thur 29 Sept 2011. */
//------------------------------------------------------------------------------
@@ -80,7 +80,8 @@
// 1.38 | bellows |19-SEP-13| fixed possible buffer overrun found by stradale
// 1.39 | abhijsau |17-OCT-13| fixed a logical bug
// 1.40 | abhijsau |17-DEC-13| added creation and deletion of schmoo object
-// 1.41 | abhijsau |16-JAN-14| removed EFF_DIMM_TYPE attribute
+// 1.41 | abhijsau |16-JAN-14| removed EFF_DIMM_TYPE attribute
+// 1.42 | mjjones |17-Jan-14| Fixed layout and error handling for RAS Review
// This procedure Schmoo's DRV_IMP, SLEW, VREF (DDR, CEN), RCV_IMP based on attribute from effective config procedure
// DQ & DQS Driver impedance, Slew rate, WR_Vref shmoo would call only write_eye shmoo for margin calculation
@@ -206,18 +207,14 @@ fapi::ReturnCode mss_draminit_training_advanced_cloned(const fapi::Target & i_ta
//const fapi::Target is centaur.mba
fapi::ReturnCode rc;
- const char* procedure_name = "mss_draminit_training_advanced";
-
- FAPI_INF("+++++++ Executing %s +++++++", procedure_name);
+ FAPI_INF("+++++++ Executing mss_draminit_training_advanced +++++++");
// Define attribute variables
uint32_t l_attr_mss_freq_u32 = 0;
uint32_t l_attr_mss_volt_u32 = 0;
uint8_t l_num_drops_per_port_u8 = 2;
uint8_t l_num_ranks_per_dimm_u8array[MAX_PORT][MAX_DIMM] = {{0}};
- //nuint8_t l_actual_dimm_size_u8 = 0;
uint8_t l_port = 0;
- // uint8_t l_dimm_type_u8 = 0; //default is set to CDIMM
uint32_t l_left_margin=0;
uint32_t l_right_margin=0;
uint32_t l_shmoo_param=0;
@@ -236,8 +233,6 @@ fapi::ReturnCode mss_draminit_training_advanced_cloned(const fapi::Target & i_ta
if(rc) return rc;
//const fapi::Target is centaur.mba
- //rc = FAPI_ATTR_GET(ATTR_EFF_DIMM_TYPE, &i_target_mba, l_dimm_type_u8);
- //if(rc) return rc;
rc = FAPI_ATTR_GET(ATTR_EFF_NUM_DROPS_PER_PORT, &i_target_mba, l_num_drops_per_port_u8);
if(rc) return rc;
rc = FAPI_ATTR_GET(ATTR_EFF_NUM_RANKS_PER_DIMM, &i_target_mba, l_num_ranks_per_dimm_u8array);
@@ -246,20 +241,14 @@ fapi::ReturnCode mss_draminit_training_advanced_cloned(const fapi::Target & i_ta
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
FAPI_INF("freq = %d on %s.", l_attr_mss_freq_u32, l_target_centaur.toEcmdString());
FAPI_INF("volt = %d on %s.", l_attr_mss_volt_u32, l_target_centaur.toEcmdString());
- //FAPI_INF("dimm_type = %d on %s.", l_dimm_type_u8, i_target_mba.toEcmdString());
FAPI_INF("num_drops_per_port = %d on %s.", l_num_drops_per_port_u8, i_target_mba.toEcmdString());
- FAPI_INF("num_ranks_per_dimm = [%02d][%02d][%02d][%02d] on %s.", l_num_ranks_per_dimm_u8array[0][0],l_num_ranks_per_dimm_u8array[0][1], l_num_ranks_per_dimm_u8array[1][0],l_num_ranks_per_dimm_u8array[1][1], i_target_mba.toEcmdString());
+ FAPI_INF("num_ranks_per_dimm = [%02d][%02d][%02d][%02d]",
+ l_num_ranks_per_dimm_u8array[0][0],
+ l_num_ranks_per_dimm_u8array[0][1],
+ l_num_ranks_per_dimm_u8array[1][0],
+ l_num_ranks_per_dimm_u8array[1][1]);
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- // if ( l_num_drops_per_port_u8 == fapi::ENUM_ATTR_EFF_NUM_DROPS_PER_PORT_DUAL )
- // {
- // l_actual_dimm_size_u8 = 2;
- // }
- // else
- // {
- // l_actual_dimm_size_u8 = 1;
- // }
-
rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_TEST_VALID, &i_target_mba, l_shmoo_type_valid_t);
if(rc) return rc;
rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_PARAM_VALID, &i_target_mba, l_shmoo_param_valid_t);
@@ -270,79 +259,87 @@ fapi::ReturnCode mss_draminit_training_advanced_cloned(const fapi::Target & i_ta
l_shmoo_type_valid=(shmoo_type_t)l_shmoo_type_valid_t;
l_shmoo_param_valid=(shmoo_param)l_shmoo_param_valid_t;
- //FAPI_INF("running in simics before attr");
FAPI_INF("+++++++++++++++++++++++++ Read Schmoo Attributes ++++++++++++++++++++++++++");
FAPI_INF("Schmoo param valid = 0x%x on %s", l_shmoo_param_valid, i_target_mba.toEcmdString());
FAPI_INF("Schmoo test valid = 0x%x on %s", l_shmoo_type_valid, i_target_mba.toEcmdString());
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- //FAPI_INF("running in simics after attr");
//Check for Shmoo Parameter, if anyof them is enabled then go into the loop else the procedure exit
- if (( l_num_ranks_per_dimm_u8array[0][0] > 0 ) || (l_num_ranks_per_dimm_u8array[0][1] > 0) || ( l_num_ranks_per_dimm_u8array[1][0] > 0 ) || (l_num_ranks_per_dimm_u8array[1][1] > 0))
+ if ((l_num_ranks_per_dimm_u8array[0][0] > 0) ||
+ (l_num_ranks_per_dimm_u8array[0][1] > 0) ||
+ (l_num_ranks_per_dimm_u8array[1][0] > 0) ||
+ (l_num_ranks_per_dimm_u8array[1][1] > 0))
+ {
+ if ((l_shmoo_param_valid != PARAM_NONE) ||
+ (l_shmoo_type_valid != TEST_NONE))
+ {
+ if ((l_shmoo_param_valid & DRV_IMP) != 0)
+ {
+ rc = drv_imped_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
+ if (rc)
+ {
+ FAPI_ERR("Driver Impedance Schmoo function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ if ((l_shmoo_param_valid & SLEW_RATE) != 0)
+ {
+ rc = slew_rate_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
+ if (rc)
+ {
+ FAPI_ERR("Slew Rate Schmoo Function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ if ((l_shmoo_param_valid & WR_VREF) != 0)
+ {
+ rc = wr_vref_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
+ if (rc)
+ {
+ FAPI_ERR("Write Vref Schmoo Function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ if ((l_shmoo_param_valid & RD_VREF) != 0)
{
- if((l_shmoo_param_valid != PARAM_NONE) || (l_shmoo_type_valid != TEST_NONE))
- {
- if((l_shmoo_param_valid & DRV_IMP) != 0)
- {
- rc = drv_imped_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
- if (rc)
- {
- FAPI_ERR("Driver Impedance Schmoo function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- if((l_shmoo_param_valid & SLEW_RATE) !=0)
- {
- rc = slew_rate_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
- if (rc)
- {
- FAPI_ERR("Slew Rate Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- if((l_shmoo_param_valid & WR_VREF) != 0)
- {
- rc = wr_vref_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
- if (rc)
- {
- FAPI_ERR("Write Vref Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- if((l_shmoo_param_valid & RD_VREF) !=0)
- {
- rc = rd_vref_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
- if (rc)
- {
- FAPI_ERR("Read Vref Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- if ((l_shmoo_param_valid & RCV_IMP) !=0)
- {
- rc = rcv_imp_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
- if (rc)
- {
- FAPI_ERR("Receiver Impedance Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- if (((l_shmoo_param_valid == PARAM_NONE)))
- {
- rc = delay_shmoo(i_target_mba, l_port, l_shmoo_type_valid, &l_left_margin, &l_right_margin, l_shmoo_param);
- if (rc)
- {
- FAPI_ERR("Delay Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- return rc;
- }
- }
- }
+ rc = rd_vref_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
+ if (rc)
+ {
+ FAPI_ERR("Read Vref Schmoo Function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ if ((l_shmoo_param_valid & RCV_IMP) != 0)
+ {
+ rc = rcv_imp_shmoo(i_target_mba, l_port, l_shmoo_type_valid);
+ if (rc)
+ {
+ FAPI_ERR("Receiver Impedance Schmoo Function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ if (((l_shmoo_param_valid == PARAM_NONE)))
+ {
+ rc = delay_shmoo(i_target_mba, l_port, l_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_shmoo_param);
+ if (rc)
+ {
+ FAPI_ERR("Delay Schmoo Function is Failed rc = 0x%08X (creator = %d)",
+ uint32_t(rc), rc.getCreator());
+ return rc;
+ }
+ }
+ }
}
-return rc;
+ return rc;
}
-
-
//-------------------------------------------------------------------------------
// Function name: drv_imped_shmoo()
// This function varies the driver impedance in the nominal mode
@@ -389,105 +386,104 @@ fapi::ReturnCode drv_imped_shmoo(const fapi::Target & i_target_mba,
if (rc) return rc;
FAPI_INF("+++++++++++++++++Read DRIVER IMP Attributes values++++++++++++++++");
- FAPI_INF("CEN_DRV_IMP_DQ_DQS[%d] = [%02d] Ohms, on %s", i_port, l_drv_imp_dq_dqs_nom[i_port], i_target_mba.toEcmdString());
- FAPI_INF("CEN_DRV_IMP_DQ_DQS_SCHMOO[0] = [0x%x], CEN_DRV_IMP_DQ_DQS_SCHMOO[1] = [0x%x] on %s", l_drv_imp_dq_dqs_schmoo[0],l_drv_imp_dq_dqs_schmoo[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_SLEW_RATE_DQ_DQS[0] = [%02d]V/ns , CEN_SLEW_RATE_DQ_DQS[1] = [%02d]V/ns on %s", l_slew_rate_dq_dqs[0],l_slew_rate_dq_dqs[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_SLEW_RATE_DQ_DQS_SCHMOO[0] = [0x%x], CEN_SLEW_RATE_DQ_DQS_SCHMOO[1] = [0x%x] on %s", l_slew_rate_dq_dqs_schmoo[0],l_slew_rate_dq_dqs_schmoo[1], i_target_mba.toEcmdString());
+ FAPI_INF("CEN_DRV_IMP_DQ_DQS[%d] = [%02d] Ohms, on %s",
+ i_port,
+ l_drv_imp_dq_dqs_nom[i_port],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_DRV_IMP_DQ_DQS_SCHMOO[0] = [0x%x], CEN_DRV_IMP_DQ_DQS_SCHMOO[1] = [0x%x] on %s",
+ l_drv_imp_dq_dqs_schmoo[0],
+ l_drv_imp_dq_dqs_schmoo[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_SLEW_RATE_DQ_DQS[0] = [%02d]V/ns , CEN_SLEW_RATE_DQ_DQS[1] = [%02d]V/ns on %s",
+ l_slew_rate_dq_dqs[0],
+ l_slew_rate_dq_dqs[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_SLEW_RATE_DQ_DQS_SCHMOO[0] = [0x%x], CEN_SLEW_RATE_DQ_DQS_SCHMOO[1] = [0x%x] on %s",
+ l_slew_rate_dq_dqs_schmoo[0],
+ l_slew_rate_dq_dqs_schmoo[1],
+ i_target_mba.toEcmdString());
FAPI_INF("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
-
+
if(l_drv_imp_dq_dqs_schmoo[i_port] == 0) //Check for any of the bits enabled in the shmoo
{
- FAPI_INF("DRIVER IMP Shmoo set to FAST Mode and won't do anything");
+ FAPI_INF("DRIVER IMP Shmoo set to FAST Mode and won't do anything");
}
else
- {
- for(index = 0; index< MAX_DRV_IMP; index+=1)
- {
- if (l_drv_imp_dq_dqs_schmoo[i_port] & MASK)
- {
- l_drv_imp_dq_dqs[i_port] = drv_imp_array[index];
- FAPI_INF("Current Driver Impedance Value = %d Ohms", drv_imp_array[index]);
- FAPI_INF("Configuring Driver Impedance Registers:");
- rc = config_drv_imp(i_target_mba, i_port, l_drv_imp_dq_dqs[i_port]);
- if (rc) return rc;
- l_drv_imp_dq_dqs_in = l_drv_imp_dq_dqs[i_port];
- FAPI_INF("Configuring Slew Rate Registers:");
- rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs[i_port], l_slew_rate_dq_dqs[i_port]);
- if (rc) return rc;
- FAPI_INF("Calling Shmoo for finding Timing Margin:");
- if (shmoo_param_count)
- {
- rc = set_attribute(i_target_mba); if(rc) return rc;
- }
- rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
- &l_left_margin, &l_right_margin, l_drv_imp_dq_dqs_in);
- if (rc) return rc;
- l_left_margin_drv_imp_array[index]= l_left_margin;
- l_right_margin_drv_imp_array[index]= l_right_margin;
- shmoo_param_count++;
- }
- else
- {
- l_left_margin_drv_imp_array[index]= 0;
- l_right_margin_drv_imp_array[index]= 0;
- }
- l_drv_imp_dq_dqs_schmoo[i_port] = (l_drv_imp_dq_dqs_schmoo[i_port] >> 1);
- }
+ {
+ for (index = 0; index < MAX_DRV_IMP; index += 1)
+ {
+ if (l_drv_imp_dq_dqs_schmoo[i_port] & MASK)
+ {
+ l_drv_imp_dq_dqs[i_port] = drv_imp_array[index];
+ FAPI_INF("Current Driver Impedance Value = %d Ohms",
+ drv_imp_array[index]);
+ FAPI_INF("Configuring Driver Impedance Registers:");
+ rc = config_drv_imp(i_target_mba, i_port,
+ l_drv_imp_dq_dqs[i_port]);
+ if (rc) return rc;
+ l_drv_imp_dq_dqs_in = l_drv_imp_dq_dqs[i_port];
+ FAPI_INF("Configuring Slew Rate Registers:");
+ rc = config_slew_rate(i_target_mba, i_port, l_slew_type,
+ l_drv_imp_dq_dqs[i_port],
+ l_slew_rate_dq_dqs[i_port]);
+ if (rc) return rc;
+ FAPI_INF("Calling Shmoo for finding Timing Margin:");
+ if (shmoo_param_count)
+ {
+ rc = set_attribute(i_target_mba);
+ if (rc) return rc;
+ }
+ rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_drv_imp_dq_dqs_in);
+ if (rc) return rc;
+ l_left_margin_drv_imp_array[index] = l_left_margin;
+ l_right_margin_drv_imp_array[index] = l_right_margin;
+ shmoo_param_count++;
+ }
+ else
+ {
+ l_left_margin_drv_imp_array[index] = 0;
+ l_right_margin_drv_imp_array[index] = 0;
+ }
+ l_drv_imp_dq_dqs_schmoo[i_port] = (l_drv_imp_dq_dqs_schmoo[i_port] >> 1);
+ }
l_drv_imp_dq_dqs_nom_fc = l_drv_imp_dq_dqs_nom[i_port];
- find_best_margin(DRV_IMP, l_left_margin_drv_imp_array,
- l_right_margin_drv_imp_array, MAX_DRV_IMP, l_drv_imp_dq_dqs_nom_fc, count);
-
- if (count >= MAX_DRV_IMP)
+ find_best_margin(DRV_IMP, l_left_margin_drv_imp_array,
+ l_right_margin_drv_imp_array, MAX_DRV_IMP,
+ l_drv_imp_dq_dqs_nom_fc, count);
+
+ if (count >= MAX_DRV_IMP)
+ {
+ FAPI_ERR("Driver Imp new input(%d) out of bounds, (>= %d)", count,
+ MAX_DRV_IMP);
+ const uint8_t & COUNT_DATA = count;
+ FAPI_SET_HWP_ERROR(rc, RC_DRV_IMPED_SHMOO_INVALID_MARGIN_DATA);
+ return rc;
+ }
+ else
{
- FAPI_ERR("Driver Imp new input(%d) out of bounds, (>= %d)",
- count, MAX_DRV_IMP);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
- return rc;
+ FAPI_INF("Restoring the nominal values!");
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_DRV_IMP_DQ_DQS, &i_target_mba,
+ l_drv_imp_dq_dqs_nom);
+ if (rc) return rc;
+ rc = config_drv_imp(i_target_mba, i_port,
+ l_drv_imp_dq_dqs_nom[i_port]);
+ if (rc) return rc;
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_SLEW_RATE_DQ_DQS, &i_target_mba,
+ l_slew_rate_dq_dqs);
+ if (rc) return rc;
+ rc = config_slew_rate(i_target_mba, i_port, l_slew_type,
+ l_drv_imp_dq_dqs_nom[i_port],
+ l_slew_rate_dq_dqs[i_port]);
+ if (rc) return rc;
}
- else
- {
-
- /* if(i_port == 0)
- {
- l_drv_imp_dq_dqs_new[0] = drv_imp_array[count];
- l_drv_imp_dq_dqs_new[1] = l_drv_imp_dq_dqs_nom[1]; // This can be removed once the get/set attribute takes care of this
- }
- else
- {
- l_drv_imp_dq_dqs_new[1] = drv_imp_array[count];
- l_drv_imp_dq_dqs_new[0] = l_drv_imp_dq_dqs_nom[0];
- }*/
-
- // if (l_drv_imp_dq_dqs_new[i_port] != l_drv_imp_dq_dqs_nom[i_port])
- // {
- //FAPI_INF("Better Margin found on %d Ohms on %s", l_drv_imp_dq_dqs_new[i_port], i_target_mba.toEcmdString());
- // rc = FAPI_ATTR_SET(ATTR_EFF_CEN_DRV_IMP_DQ_DQS, &i_target_mba, l_drv_imp_dq_dqs_new);
- // if (rc) return rc;
- //FAPI_INF("Configuring New Driver Impedance Value to Registers:");
- //rc = config_drv_imp(i_target_mba, i_port, l_drv_imp_dq_dqs_new[i_port]);
- //if (rc) return rc;
- //rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs_new[i_port], l_slew_rate_dq_dqs[i_port]);
- //if (rc) return rc;
- // }
- // else
- // {
- //FAPI_INF("Nominal value will not be changed - Restoring the original values!");
- FAPI_INF("Restoring the nominal values!");
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_DRV_IMP_DQ_DQS, &i_target_mba, l_drv_imp_dq_dqs_nom);
- if (rc) return rc;
- rc = config_drv_imp(i_target_mba, i_port, l_drv_imp_dq_dqs_nom[i_port]);
- if (rc) return rc;
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_SLEW_RATE_DQ_DQS, &i_target_mba, l_slew_rate_dq_dqs);
- if (rc) return rc;
- rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs_nom[i_port], l_slew_rate_dq_dqs[i_port]);
- if (rc) return rc;
- // }
- }
- FAPI_INF("Restoring mcbist setup attribute...");
- rc = reset_attribute(i_target_mba); if (rc) return rc;
- FAPI_INF("++++ Driver impedance shmoo function executed successfully ++++");
+ FAPI_INF("Restoring mcbist setup attribute...");
+ rc = reset_attribute(i_target_mba);
+ if (rc) return rc;
+ FAPI_INF("++++ Driver impedance shmoo function executed successfully ++++");
}
-return rc;
+ return rc;
}
//-----------------------------------------------------------------------------------------
@@ -511,7 +507,6 @@ fapi::ReturnCode slew_rate_shmoo(const fapi::Target & i_target_mba,
uint8_t l_slew_rate_dq_dqs_nom[MAX_PORT] = {0};
uint8_t l_slew_rate_dq_dqs_nom_fc = 0;
uint8_t l_slew_rate_dq_dqs_in = 0;
- //uint8_t l_slew_rate_dq_dqs_new[MAX_PORT] = {0};
uint32_t l_slew_rate_dq_dqs_schmoo[MAX_PORT] = {0};
uint8_t l_drv_imp_dq_dqs_nom[MAX_PORT] = {0};
i_shmoo_type_valid = WR_EYE; // Hard coded - Other shmoo type is not valid - Temporary
@@ -534,101 +529,96 @@ fapi::ReturnCode slew_rate_shmoo(const fapi::Target & i_target_mba,
if (rc) return rc;
FAPI_INF("+++++++++++++++++Read Slew Shmoo Attributes values+++++++++++++++");
- FAPI_INF("CEN_DRV_IMP_DQ_DQS[0] = [%02d] Ohms, CEN_DRV_IMP_DQ_DQS[1] = [%02d] Ohms on %s", l_drv_imp_dq_dqs_nom[0],l_drv_imp_dq_dqs_nom[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_SLEW_RATE_DQ_DQS[0] = [%02d]V/ns , CEN_SLEW_RATE_DQ_DQS[1] = [%02d]V/ns on %s", l_slew_rate_dq_dqs_nom[0],l_slew_rate_dq_dqs_nom[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_SLEW_RATE_DQ_DQS_SCHMOO[0] = [0x%x], CEN_SLEW_RATE_DQ_DQS_SCHMOO[1] = [0x%x] on %s", l_slew_rate_dq_dqs_schmoo[0],l_slew_rate_dq_dqs_schmoo[1], i_target_mba.toEcmdString());
+ FAPI_INF("CEN_DRV_IMP_DQ_DQS[0] = [%02d] Ohms, CEN_DRV_IMP_DQ_DQS[1] = [%02d] Ohms on %s",
+ l_drv_imp_dq_dqs_nom[0],
+ l_drv_imp_dq_dqs_nom[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_SLEW_RATE_DQ_DQS[0] = [%02d]V/ns , CEN_SLEW_RATE_DQ_DQS[1] = [%02d]V/ns on %s",
+ l_slew_rate_dq_dqs_nom[0],
+ l_slew_rate_dq_dqs_nom[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_SLEW_RATE_DQ_DQS_SCHMOO[0] = [0x%x], CEN_SLEW_RATE_DQ_DQS_SCHMOO[1] = [0x%x] on %s",
+ l_slew_rate_dq_dqs_schmoo[0],
+ l_slew_rate_dq_dqs_schmoo[1],
+ i_target_mba.toEcmdString());
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
if(l_slew_rate_dq_dqs_schmoo == 0) //Check for any of the bits enabled in the shmoo
{
- FAPI_INF("Slew Rate Shmoo set to FAST Mode and won't do anything");
+ FAPI_INF("Slew Rate Shmoo set to FAST Mode and won't do anything");
}
else
{
- for(index = 0; index < MAX_NUM_SLEW_RATES; index+=1)
- {
- if (l_slew_rate_dq_dqs_schmoo[i_port] & MASK )
- {
- l_slew_rate_dq_dqs[i_port] = slew_rate_array[index];
- FAPI_INF("Current Slew rate value is %d V/ns", slew_rate_array[index]);
- FAPI_INF("Configuring Slew registers:");
- rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs_nom[i_port], l_slew_rate_dq_dqs[i_port]);
+ for (index = 0; index < MAX_NUM_SLEW_RATES; index += 1)
+ {
+ if (l_slew_rate_dq_dqs_schmoo[i_port] & MASK)
+ {
+ l_slew_rate_dq_dqs[i_port] = slew_rate_array[index];
+ FAPI_INF("Current Slew rate value is %d V/ns",
+ slew_rate_array[index]);
+ FAPI_INF("Configuring Slew registers:");
+ rc = config_slew_rate(i_target_mba, i_port, l_slew_type,
+ l_drv_imp_dq_dqs_nom[i_port],
+ l_slew_rate_dq_dqs[i_port]);
if (rc) return rc;
- l_slew_rate_dq_dqs_in = l_slew_rate_dq_dqs[i_port];
- FAPI_INF("Calling Shmoo for finding Timing Margin:");
- if (shmoo_param_count)
- {
- rc = set_attribute(i_target_mba); if(rc) return rc;
- }
- rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
- &l_left_margin, &l_right_margin, l_slew_rate_dq_dqs_in);
+ l_slew_rate_dq_dqs_in = l_slew_rate_dq_dqs[i_port];
+ FAPI_INF("Calling Shmoo for finding Timing Margin:");
+ if (shmoo_param_count)
+ {
+ rc = set_attribute(i_target_mba);
+ if (rc) return rc;
+ }
+ rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_slew_rate_dq_dqs_in);
if (rc) return rc;
- l_left_margin_slew_array[index]= l_left_margin;
- l_right_margin_slew_array[index]= l_right_margin;
- shmoo_param_count++;
- }
- else
- {
- l_left_margin_slew_array[index]= 0;
- l_right_margin_slew_array[index]= 0;
- }
- l_slew_rate_dq_dqs_schmoo[i_port] = (l_slew_rate_dq_dqs_schmoo[i_port] >> 1);
- }
+ l_left_margin_slew_array[index] = l_left_margin;
+ l_right_margin_slew_array[index] = l_right_margin;
+ shmoo_param_count++;
+ }
+ else
+ {
+ l_left_margin_slew_array[index] = 0;
+ l_right_margin_slew_array[index] = 0;
+ }
+ l_slew_rate_dq_dqs_schmoo[i_port]
+ = (l_slew_rate_dq_dqs_schmoo[i_port] >> 1);
+ }
l_slew_rate_dq_dqs_nom_fc = l_slew_rate_dq_dqs_nom[i_port];
- find_best_margin(SLEW_RATE, l_left_margin_slew_array,
- l_right_margin_slew_array, MAX_NUM_SLEW_RATES, l_slew_rate_dq_dqs_nom_fc, count);
- if (count >= MAX_NUM_SLEW_RATES)
+ find_best_margin(SLEW_RATE, l_left_margin_slew_array,
+ l_right_margin_slew_array, MAX_NUM_SLEW_RATES,
+ l_slew_rate_dq_dqs_nom_fc, count);
+ if (count >= MAX_NUM_SLEW_RATES)
{
- FAPI_ERR("Driver Imp new input(%d) out of bounds, (>= %d)",
- count, MAX_NUM_SLEW_RATES);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
- return rc;
+ FAPI_ERR("Driver Imp new input(%d) out of bounds, (>= %d)", count,
+ MAX_NUM_SLEW_RATES);
+ const uint8_t & COUNT_DATA = count;
+ FAPI_SET_HWP_ERROR(rc, RC_SLEW_RATE_SHMOO_INVALID_MARGIN_DATA);
+ return rc;
+ }
+ else
+ {
+ FAPI_INF("Restoring the nominal values!");
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_DRV_IMP_DQ_DQS, &i_target_mba,
+ l_drv_imp_dq_dqs_nom);
+ if (rc) return rc;
+ rc = config_drv_imp(i_target_mba, i_port,
+ l_drv_imp_dq_dqs_nom[i_port]);
+ if (rc) return rc;
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_SLEW_RATE_DQ_DQS, &i_target_mba,
+ l_slew_rate_dq_dqs_nom);
+ if (rc) return rc;
+ rc = config_slew_rate(i_target_mba, i_port, l_slew_type,
+ l_drv_imp_dq_dqs_nom[i_port],
+ l_slew_rate_dq_dqs_nom[i_port]);
+ if (rc) return rc;
}
- else
- {
-
- /* if(i_port == 0)
- {
- l_slew_rate_dq_dqs_new[0] = slew_rate_array[count];
- l_slew_rate_dq_dqs_new[1] = l_slew_rate_dq_dqs_nom[1];
- }
- else
- {
- l_slew_rate_dq_dqs_new[1] = slew_rate_array[count];
- l_slew_rate_dq_dqs_new[0] = l_slew_rate_dq_dqs_nom[0];
- }*/
-
-
- FAPI_INF("Restoring the nominal values!");
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_DRV_IMP_DQ_DQS, &i_target_mba, l_drv_imp_dq_dqs_nom);
- if (rc) return rc;
- rc = config_drv_imp(i_target_mba, i_port, l_drv_imp_dq_dqs_nom[i_port]);
- if (rc) return rc;
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_SLEW_RATE_DQ_DQS, &i_target_mba, l_slew_rate_dq_dqs_nom);
- if (rc) return rc;
- rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs_nom[i_port], l_slew_rate_dq_dqs_nom[i_port]);
- if (rc) return rc;
-
- /* if (l_slew_rate_dq_dqs_new[i_port] != l_slew_rate_dq_dqs_nom[i_port])
- {
- FAPI_INF("Better Margin found on Slew Rate: %d V/ns on %s", l_slew_rate_dq_dqs_new[i_port], i_target_mba.toEcmdString());
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_SLEW_RATE_DQ_DQS, &i_target_mba, l_slew_rate_dq_dqs_new);
- if (rc) return rc;
- FAPI_INF("Configuring New Slew Rate Value to Registers:");
- rc = config_slew_rate(i_target_mba, i_port, l_slew_type, l_drv_imp_dq_dqs_nom[i_port], l_slew_rate_dq_dqs_new[i_port]);
- if (rc) return rc;
- }
- else
- {
- FAPI_INF("Nominal value will not be changed!");
- FAPI_INF("Slew Rate: %d V/ns on %s", l_slew_rate_dq_dqs_nom[i_port], i_target_mba.toEcmdString());
- } */
- }
FAPI_INF("Restoring mcbist setup attribute...");
- rc = reset_attribute(i_target_mba); if (rc) return rc;
- FAPI_INF("++++ Slew Rate shmoo function executed successfully ++++");
+ rc = reset_attribute(i_target_mba);
+ if (rc) return rc;
+ FAPI_INF("++++ Slew Rate shmoo function executed successfully ++++");
}
-return rc;
+ return rc;
}
//----------------------------------------------------------------------------------------------
@@ -650,7 +640,6 @@ fapi::ReturnCode wr_vref_shmoo(const fapi::Target & i_target_mba,
fapi::ReturnCode rc;
uint32_t l_wr_dram_vref[MAX_PORT] = {0};
uint32_t l_wr_dram_vref_nom[MAX_PORT] = {0};
- //uint32_t l_wr_dram_vref_new[MAX_PORT] = {0};
uint32_t l_wr_dram_vref_schmoo[MAX_PORT] = {0};
uint32_t l_wr_dram_vref_nom_fc = 0;
uint32_t l_wr_dram_vref_in = 0;
@@ -670,101 +659,93 @@ fapi::ReturnCode wr_vref_shmoo(const fapi::Target & i_target_mba,
rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_WR_VREF_SCHMOO, &i_target_mba, l_wr_dram_vref_schmoo);
if (rc) return rc;
FAPI_INF("+++++++++++++++++WRITE DRAM VREF Shmoo Attributes Values+++++++++++++++");
- FAPI_INF("DRAM_WR_VREF[0] = %d , DRAM_WR_VREF[1] = %d on %s", l_wr_dram_vref_nom[0], l_wr_dram_vref_nom[1],i_target_mba.toEcmdString());
- FAPI_INF("DRAM_WR_VREF_SCHMOO[0] = [%x],DRAM_WR_VREF_SCHMOO[1] = [%x] on %s", l_wr_dram_vref_schmoo[0], l_wr_dram_vref_schmoo[1],i_target_mba.toEcmdString());
+ FAPI_INF("DRAM_WR_VREF[0] = %d , DRAM_WR_VREF[1] = %d on %s",
+ l_wr_dram_vref_nom[0],
+ l_wr_dram_vref_nom[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("DRAM_WR_VREF_SCHMOO[0] = [%x],DRAM_WR_VREF_SCHMOO[1] = [%x] on %s",
+ l_wr_dram_vref_schmoo[0],
+ l_wr_dram_vref_schmoo[1],
+ i_target_mba.toEcmdString());
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- if(l_wr_dram_vref_schmoo[i_port] == 0)
+ if (l_wr_dram_vref_schmoo[i_port] == 0)
{
- FAPI_INF("FAST Shmoo Mode: This function will not change any Write DRAM VREF settings");
+ FAPI_INF("FAST Shmoo Mode: This function will not change any Write DRAM VREF settings");
}
else
{
- for(index = 0; index < MAX_WR_VREF; index+=1)
- {
- if (l_wr_dram_vref_schmoo[i_port] & MASK)
- {
- FAPI_INF("Current Vref multiplier value is %d", wr_vref_array[index]);
- l_wr_dram_vref[i_port] = wr_vref_array[index];
- rc = config_wr_dram_vref(i_target_mba, i_port, l_wr_dram_vref[i_port]);
- if (rc) return rc;
- l_wr_dram_vref_in = l_wr_dram_vref[i_port];
- //FAPI_INF(" Calling Shmoo for finding Timing Margin:");
- if (shmoo_param_count)
- {
- rc = set_attribute(i_target_mba);
- if (rc) return rc;
- }
- rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
- &l_left_margin, &l_right_margin, l_wr_dram_vref_in);
- if (rc) return rc;
- l_left_margin_wr_vref_array[index]= l_left_margin;
- l_right_margin_wr_vref_array[index]= l_right_margin;
- shmoo_param_count++;
- FAPI_INF("Wr Vref = %d ; Min Setup time = %d; Min Hold time = %d", wr_vref_array[index],l_left_margin_wr_vref_array[index], l_right_margin_wr_vref_array[index]);
- }
- else
- {
- l_left_margin_wr_vref_array[index]= 0;
- l_right_margin_wr_vref_array[index]= 0;
- }
- l_wr_dram_vref_schmoo[i_port] = (l_wr_dram_vref_schmoo[i_port] >> 1);
- //FAPI_INF("Wr Vref = %d ; Min Setup time = %d; Min Hold time = %d", wr_vref_array[index],l_left_margin_wr_vref_array[index], l_right_margin_wr_vref_array[index]);
- //FAPI_INF("Configuring Vref registers_2:, index %d , max value %d, schmoo %x mask %d ", index, MAX_WR_VREF, l_wr_dram_vref_schmoo[i_port], MASK);
- }
- l_wr_dram_vref_nom_fc = l_wr_dram_vref_nom[i_port];
- find_best_margin(WR_VREF, l_left_margin_wr_vref_array,
- l_right_margin_wr_vref_array, MAX_WR_VREF, l_wr_dram_vref_nom_fc, count);
- if (count >= MAX_WR_VREF)
+ for (index = 0; index < MAX_WR_VREF; index += 1)
+ {
+ if (l_wr_dram_vref_schmoo[i_port] & MASK)
+ {
+ FAPI_INF("Current Vref multiplier value is %d",
+ wr_vref_array[index]);
+ l_wr_dram_vref[i_port] = wr_vref_array[index];
+ rc = config_wr_dram_vref(i_target_mba, i_port,
+ l_wr_dram_vref[i_port]);
+ if (rc) return rc;
+ l_wr_dram_vref_in = l_wr_dram_vref[i_port];
+ //FAPI_INF(" Calling Shmoo for finding Timing Margin:");
+ if (shmoo_param_count)
+ {
+ rc = set_attribute(i_target_mba);
+ if (rc) return rc;
+ }
+ rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_wr_dram_vref_in);
+ if (rc) return rc;
+ l_left_margin_wr_vref_array[index] = l_left_margin;
+ l_right_margin_wr_vref_array[index] = l_right_margin;
+ shmoo_param_count++;
+ FAPI_INF("Wr Vref = %d ; Min Setup time = %d; Min Hold time = %d",
+ wr_vref_array[index],
+ l_left_margin_wr_vref_array[index],
+ l_right_margin_wr_vref_array[index]);
+ }
+ else
+ {
+ l_left_margin_wr_vref_array[index] = 0;
+ l_right_margin_wr_vref_array[index] = 0;
+ }
+ l_wr_dram_vref_schmoo[i_port] = (l_wr_dram_vref_schmoo[i_port] >> 1);
+ //FAPI_INF("Wr Vref = %d ; Min Setup time = %d; Min Hold time = %d", wr_vref_array[index],l_left_margin_wr_vref_array[index], l_right_margin_wr_vref_array[index]);
+ //FAPI_INF("Configuring Vref registers_2:, index %d , max value %d, schmoo %x mask %d ", index, MAX_WR_VREF, l_wr_dram_vref_schmoo[i_port], MASK);
+ }
+ l_wr_dram_vref_nom_fc = l_wr_dram_vref_nom[i_port];
+ find_best_margin(WR_VREF, l_left_margin_wr_vref_array,
+ l_right_margin_wr_vref_array, MAX_WR_VREF,
+ l_wr_dram_vref_nom_fc, count);
+ if (count >= MAX_WR_VREF)
{
- FAPI_ERR("Write dram vref input(%d) out of bounds, (>= %d)",
- count, MAX_WR_VREF);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
- return rc;
+ FAPI_ERR("Write dram vref input(%d) out of bounds, (>= %d)", count,
+ MAX_WR_VREF);
+ const uint8_t & COUNT_DATA = count;
+ FAPI_SET_HWP_ERROR(rc, RC_WR_VREF_SHMOO_INVALID_MARGIN_DATA);
+ return rc;
}
- else
- {
-
- /* if(i_port == 0)
- {
- l_wr_dram_vref_new[0] = wr_vref_array_fitness[count];
- l_wr_dram_vref_new[1] = l_wr_dram_vref_nom[1];
- }
- else
- {
- l_wr_dram_vref_new[1] = wr_vref_array_fitness[count];
- l_wr_dram_vref_new[0] = l_wr_dram_vref_nom[0];
- }
-
- if(l_wr_dram_vref_new[i_port] != l_wr_dram_vref_nom[i_port])
- {
- //FAPI_INF("Best Margin Found on Vref Multiplier : %d on %s", wr_vref_array_fitness[count], i_target_mba.toEcmdString());
- //rc = FAPI_ATTR_SET(ATTR_EFF_DRAM_WR_VREF, &i_target_mba, l_wr_dram_vref_new);
- //if (rc) return rc;
- //FAPI_INF("Configuring New Vref Value to registers:");
- //rc = config_wr_dram_vref(i_target_mba, i_port, l_wr_dram_vref_new[i_port]);
- //if (rc) return rc;
- }
- else
- {*/
- // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
- FAPI_INF(" Restoring the nominal values!");
- rc = FAPI_ATTR_SET(ATTR_EFF_DRAM_WR_VREF, &i_target_mba, l_wr_dram_vref_nom);
- if (rc) return rc;
- rc = config_wr_dram_vref(i_target_mba, i_port, l_wr_dram_vref_nom[i_port]);
- if (rc) return rc;
- // }
+ else
+ {
+ // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
+ FAPI_INF(" Restoring the nominal values!");
+ rc = FAPI_ATTR_SET(ATTR_EFF_DRAM_WR_VREF, &i_target_mba,
+ l_wr_dram_vref_nom);
+ if (rc) return rc;
+ rc = config_wr_dram_vref(i_target_mba, i_port,
+ l_wr_dram_vref_nom[i_port]);
+ if (rc) return rc;
}
- FAPI_INF("Restoring mcbist setup attribute...");
- rc = reset_attribute(i_target_mba); if (rc) return rc;
- FAPI_INF("++++ Write DRAM Vref Shmoo function executed successfully ++++");
+ FAPI_INF("Restoring mcbist setup attribute...");
+ rc = reset_attribute(i_target_mba);
+ if (rc) return rc;
+ FAPI_INF("++++ Write DRAM Vref Shmoo function executed successfully ++++");
}
return rc;
}
-
//----------------------------------------------------------------------------------------------
// Function name: rd_vref_shmoo()
// Description: This function varies the Centaur IO vref in 16 steps
@@ -775,7 +756,7 @@ fapi::ReturnCode wr_vref_shmoo(const fapi::Target & i_target_mba,
// Shmoo Mode: FEW_ADDR, QUARTER_ADDR, HALF_ADDR, FULL_ADDR
// i_pattern, i_test_type : Default = 0, mcbist lab function would use this arg
//----------------------------------------------------------------------------------------------
-
+
fapi::ReturnCode rd_vref_shmoo(const fapi::Target & i_target_mba,
uint8_t i_port,
shmoo_type_t i_shmoo_type_valid)
@@ -785,7 +766,6 @@ fapi::ReturnCode rd_vref_shmoo(const fapi::Target & i_target_mba,
uint32_t l_rd_cen_vref_nom[MAX_PORT] = {0};
uint32_t l_rd_cen_vref_nom_fc = 0;
uint32_t l_rd_cen_vref_in = 0;
- //uint32_t l_rd_cen_vref_new[MAX_PORT] ={0};
uint32_t l_rd_cen_vref_schmoo[MAX_PORT] = {0};
uint8_t index = 0;
uint8_t count = 0;
@@ -796,102 +776,96 @@ fapi::ReturnCode rd_vref_shmoo(const fapi::Target & i_target_mba,
uint32_t l_right_margin = 0;
uint32_t l_left_margin_rd_vref_array[MAX_RD_VREF] = {0};
uint32_t l_right_margin_rd_vref_array[MAX_RD_VREF] = {0};
-
-
+
rc = FAPI_ATTR_GET(ATTR_EFF_CEN_RD_VREF, &i_target_mba, l_rd_cen_vref_nom);
if (rc) return rc;
rc = FAPI_ATTR_GET(ATTR_EFF_CEN_RD_VREF_SCHMOO, &i_target_mba, l_rd_cen_vref_schmoo);
if (rc) return rc;
FAPI_INF("+++++++++++++++++CENTAUR VREF Read Shmoo Attributes values+++++++++++++++");
- FAPI_INF("CEN_RD_VREF[0] = %d CEN_RD_VREF[1] = %d on %s", l_rd_cen_vref_nom[0],l_rd_cen_vref_nom[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_RD_VREF_SCHMOO[0] = [%x], CEN_RD_VREF_SCHMOO[1] = [%x] on %s", l_rd_cen_vref_schmoo[0], l_rd_cen_vref_schmoo[1],i_target_mba.toEcmdString());
+ FAPI_INF("CEN_RD_VREF[0] = %d CEN_RD_VREF[1] = %d on %s",
+ l_rd_cen_vref_nom[0],
+ l_rd_cen_vref_nom[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_RD_VREF_SCHMOO[0] = [%x], CEN_RD_VREF_SCHMOO[1] = [%x] on %s",
+ l_rd_cen_vref_schmoo[0],
+ l_rd_cen_vref_schmoo[1],
+ i_target_mba.toEcmdString());
FAPI_INF("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- if(l_rd_cen_vref_schmoo[i_port] == 0)
+ if (l_rd_cen_vref_schmoo[i_port] == 0)
{
- FAPI_INF("FAST Shmoo Mode: This function will not change any Read Centaur VREF settings");
+ FAPI_INF("FAST Shmoo Mode: This function will not change any Read Centaur VREF settings");
}
else
{
- for(index = 0; index< MAX_RD_VREF; index+=1)
+ for (index = 0; index < MAX_RD_VREF; index += 1)
{
if ((l_rd_cen_vref_schmoo[i_port] & MASK) == 1)
- {
- l_rd_cen_vref[i_port] = rd_cen_vref_array[index];
- FAPI_INF("Current Read Vref Multiplier value is %d", rd_cen_vref_array[index]);
- FAPI_INF("Configuring Read Vref Registers:");
- rc = config_rd_cen_vref(i_target_mba, i_port, l_rd_cen_vref[i_port]); if (rc) return rc;
- l_rd_cen_vref_in = l_rd_cen_vref[i_port];
- //FAPI_INF(" Calling Shmoo function to find out Timing Margin:");
- if (shmoo_param_count)
- {
- rc = set_attribute(i_target_mba);
- if (rc) return rc;
- }
- rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid, &l_left_margin, &l_right_margin, l_rd_cen_vref_in);
- if (rc) return rc;
- l_left_margin_rd_vref_array[index]= l_left_margin;
- l_right_margin_rd_vref_array[index]= l_right_margin;
- shmoo_param_count++;
- FAPI_INF("Read Vref = %d ; Min Setup time = %d; Min Hold time = %d", rd_cen_vref_array[index],l_left_margin_rd_vref_array[index], l_right_margin_rd_vref_array[index]);
- }
- else
- {
- l_left_margin_rd_vref_array[index]= 0;
- l_right_margin_rd_vref_array[index]= 0;
- }
- l_rd_cen_vref_schmoo[i_port] = (l_rd_cen_vref_schmoo[i_port] >> 1);
- /* FAPI_INF("Read Vref = %d ; Min Setup time = %d; Min Hold time = %d", rd_cen_vref_array[index],l_left_margin_rd_vref_array[index], l_right_margin_rd_vref_array[index]); */
- }
- l_rd_cen_vref_nom_fc = l_rd_cen_vref_nom[i_port];
- find_best_margin(RD_VREF, l_left_margin_rd_vref_array,
- l_right_margin_rd_vref_array, MAX_RD_VREF, l_rd_cen_vref_nom_fc, count);
- if (count >= MAX_RD_VREF)
+ {
+ l_rd_cen_vref[i_port] = rd_cen_vref_array[index];
+ FAPI_INF("Current Read Vref Multiplier value is %d",
+ rd_cen_vref_array[index]);
+ FAPI_INF("Configuring Read Vref Registers:");
+ rc = config_rd_cen_vref(i_target_mba, i_port,
+ l_rd_cen_vref[i_port]);
+ if (rc) return rc;
+ l_rd_cen_vref_in = l_rd_cen_vref[i_port];
+ //FAPI_INF(" Calling Shmoo function to find out Timing Margin:");
+ if (shmoo_param_count)
+ {
+ rc = set_attribute(i_target_mba);
+ if (rc) return rc;
+ }
+ rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_rd_cen_vref_in);
+ if (rc) return rc;
+ l_left_margin_rd_vref_array[index] = l_left_margin;
+ l_right_margin_rd_vref_array[index] = l_right_margin;
+ shmoo_param_count++;
+ FAPI_INF("Read Vref = %d ; Min Setup time = %d; Min Hold time = %d",
+ rd_cen_vref_array[index],
+ l_left_margin_rd_vref_array[index],
+ l_right_margin_rd_vref_array[index]);
+ }
+ else
+ {
+ l_left_margin_rd_vref_array[index] = 0;
+ l_right_margin_rd_vref_array[index] = 0;
+ }
+ l_rd_cen_vref_schmoo[i_port] = (l_rd_cen_vref_schmoo[i_port] >> 1);
+ /* FAPI_INF("Read Vref = %d ; Min Setup time = %d; Min Hold time = %d", rd_cen_vref_array[index],l_left_margin_rd_vref_array[index], l_right_margin_rd_vref_array[index]); */
+ }
+ l_rd_cen_vref_nom_fc = l_rd_cen_vref_nom[i_port];
+ find_best_margin(RD_VREF, l_left_margin_rd_vref_array,
+ l_right_margin_rd_vref_array, MAX_RD_VREF,
+ l_rd_cen_vref_nom_fc, count);
+ if (count >= MAX_RD_VREF)
{
- FAPI_ERR("Read vref new input(%d) out of bounds, (>= %d)",
- count, MAX_RD_VREF);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
- return rc;
+ FAPI_ERR("Read vref new input(%d) out of bounds, (>= %d)", count,
+ MAX_RD_VREF);
+ const uint8_t & COUNT_DATA = count;
+ FAPI_SET_HWP_ERROR(rc, RC_RD_VREF_SHMOO_INVALID_MARGIN_DATA);
+ return rc;
}
- else
- {
-
- /* if(i_port == 0)
- {
- l_rd_cen_vref_new[0] = rd_cen_vref_array_fitness[count];
- l_rd_cen_vref_new[1] = l_rd_cen_vref_nom[1];
- }
- else
- {
- l_rd_cen_vref_new[1] = rd_cen_vref_array_fitness[count];
- l_rd_cen_vref_new[0] = l_rd_cen_vref_nom[0];
- }
-
- if(l_rd_cen_vref_new[i_port] != l_rd_cen_vref_nom[i_port])
- {
- //FAPI_INF("Best Margin Found on Vref : %dmv , %dmV on %s", l_rd_cen_vref_new[i_port], rd_cen_vref_array_fitness[count], i_target_mba.toEcmdString());
- //rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RD_VREF, &i_target_mba, l_rd_cen_vref_new);
- //if (rc) return rc;
- //FAPI_INF("Configuring New Read Vref Value to Registers:");
- //rc = config_rd_cen_vref(i_target_mba, i_port, l_rd_cen_vref_new[i_port]);
- //if (rc) return rc;
- }
- else
- {*/
- // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
- FAPI_INF("Restoring Nominal values!");
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RD_VREF, &i_target_mba, l_rd_cen_vref_nom);
- if (rc) return rc;
- rc = config_rd_cen_vref(i_target_mba, i_port, l_rd_cen_vref_nom[i_port]);
- if (rc) return rc;
- // }
- }
- FAPI_INF("Restoring mcbist setup attribute...");
- rc = reset_attribute(i_target_mba); if (rc) return rc;
- FAPI_INF("++++ Centaur Read Vref Shmoo function executed successfully ++++");
+ else
+ {
+ // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
+ FAPI_INF("Restoring Nominal values!");
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RD_VREF, &i_target_mba,
+ l_rd_cen_vref_nom);
+ if (rc) return rc;
+ rc = config_rd_cen_vref(i_target_mba, i_port,
+ l_rd_cen_vref_nom[i_port]);
+ if (rc) return rc;
+ }
+ FAPI_INF("Restoring mcbist setup attribute...");
+ rc = reset_attribute(i_target_mba);
+ if (rc) return rc;
+ FAPI_INF("++++ Centaur Read Vref Shmoo function executed successfully ++++");
}
-return rc;
+ return rc;
}
//------------------------------------------------------------------------------
@@ -912,7 +886,6 @@ fapi::ReturnCode rcv_imp_shmoo(const fapi::Target & i_target_mba,
uint8_t l_rcv_imp_dq_dqs_nom[MAX_PORT] = {0};
uint8_t l_rcv_imp_dq_dqs_nom_fc = 0;
uint8_t l_rcv_imp_dq_dqs_in = 0;
- //uint8_t l_rcv_imp_dq_dqs_new[MAX_PORT] = {0};
uint32_t l_rcv_imp_dq_dqs_schmoo[MAX_PORT] = {0};
uint8_t index = 0;
uint8_t count = 0;
@@ -923,99 +896,91 @@ fapi::ReturnCode rcv_imp_shmoo(const fapi::Target & i_target_mba,
uint32_t l_right_margin = 0;
uint32_t l_left_margin_rcv_imp_array[MAX_RCV_IMP] = {0};
uint32_t l_right_margin_rcv_imp_array[MAX_RCV_IMP] = {0};
-
-
+
rc = FAPI_ATTR_GET(ATTR_EFF_CEN_RCV_IMP_DQ_DQS, &i_target_mba, l_rcv_imp_dq_dqs_nom);
if (rc) return rc;
rc = FAPI_ATTR_GET(ATTR_EFF_CEN_RCV_IMP_DQ_DQS_SCHMOO, &i_target_mba, l_rcv_imp_dq_dqs_schmoo);
if (rc) return rc;
FAPI_INF("+++++++++++++++++RECIVER IMP Read Shmoo Attributes values+++++++++++++++");
- FAPI_INF("CEN_RCV_IMP_DQ_DQS[0] = %d , CEN_RCV_IMP_DQ_DQS[1] = %d on %s", l_rcv_imp_dq_dqs_nom[0],l_rcv_imp_dq_dqs_nom[1], i_target_mba.toEcmdString());
- FAPI_INF("CEN_RCV_IMP_DQ_DQS_SCHMOO[0] = [%d], CEN_RCV_IMP_DQ_DQS_SCHMOO[1] = [%d], on %s", l_rcv_imp_dq_dqs_schmoo[0],l_rcv_imp_dq_dqs_schmoo[1], i_target_mba.toEcmdString());
+ FAPI_INF("CEN_RCV_IMP_DQ_DQS[0] = %d , CEN_RCV_IMP_DQ_DQS[1] = %d on %s",
+ l_rcv_imp_dq_dqs_nom[0],
+ l_rcv_imp_dq_dqs_nom[1],
+ i_target_mba.toEcmdString());
+ FAPI_INF("CEN_RCV_IMP_DQ_DQS_SCHMOO[0] = [%d], CEN_RCV_IMP_DQ_DQS_SCHMOO[1] = [%d], on %s",
+ l_rcv_imp_dq_dqs_schmoo[0],
+ l_rcv_imp_dq_dqs_schmoo[1],
+ i_target_mba.toEcmdString());
FAPI_INF("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- if(l_rcv_imp_dq_dqs_schmoo[i_port] == 0)
+ if (l_rcv_imp_dq_dqs_schmoo[i_port] == 0)
{
- FAPI_INF("FAST Shmoo Mode: This function will not change any Write DRAM VREF settings");
+ FAPI_INF("FAST Shmoo Mode: This function will not change any Write DRAM VREF settings");
}
else
{
- for(index = 0; index< MAX_RCV_IMP; index+=1)
+ for (index = 0; index < MAX_RCV_IMP; index += 1)
{
if ((l_rcv_imp_dq_dqs_schmoo[i_port] & MASK) == 1)
{
- l_rcv_imp_dq_dqs[i_port] = rcv_imp_array[index];
- FAPI_INF("Current Receiver Impedance: %d Ohms ", rcv_imp_array[index]);
- FAPI_INF("Configuring Receiver impedance registers:");
- rc = config_rcv_imp(i_target_mba, i_port, l_rcv_imp_dq_dqs[i_port]); if (rc) return rc;
- l_rcv_imp_dq_dqs_in = l_rcv_imp_dq_dqs[i_port];
- //FAPI_INF("Calling Shmoo function to find out timing margin:");
- if (shmoo_param_count)
- {
- rc = set_attribute(i_target_mba);
- if (rc) return rc;
- }
- rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
- &l_left_margin, &l_right_margin, l_rcv_imp_dq_dqs_in);
- if (rc) return rc;
- l_left_margin_rcv_imp_array[index]= l_left_margin;
- l_right_margin_rcv_imp_array[index]= l_right_margin;
- shmoo_param_count++;
- }
- else
- {
- l_left_margin_rcv_imp_array[index]= 0;
- l_right_margin_rcv_imp_array[index]= 0;
- }
- l_rcv_imp_dq_dqs_schmoo[i_port] = (l_rcv_imp_dq_dqs_schmoo[i_port] >> 1);
- }
- l_rcv_imp_dq_dqs_nom_fc = l_rcv_imp_dq_dqs_nom[i_port];
- find_best_margin(RCV_IMP, l_left_margin_rcv_imp_array,
- l_right_margin_rcv_imp_array, MAX_RCV_IMP, l_rcv_imp_dq_dqs_nom_fc, count);
- if (count >= MAX_RCV_IMP)
+ l_rcv_imp_dq_dqs[i_port] = rcv_imp_array[index];
+ FAPI_INF("Current Receiver Impedance: %d Ohms ",
+ rcv_imp_array[index]);
+ FAPI_INF("Configuring Receiver impedance registers:");
+ rc = config_rcv_imp(i_target_mba, i_port,
+ l_rcv_imp_dq_dqs[i_port]);
+ if (rc) return rc;
+ l_rcv_imp_dq_dqs_in = l_rcv_imp_dq_dqs[i_port];
+ //FAPI_INF("Calling Shmoo function to find out timing margin:");
+ if (shmoo_param_count)
+ {
+ rc = set_attribute(i_target_mba);
+ if (rc) return rc;
+ }
+ rc = delay_shmoo(i_target_mba, i_port, i_shmoo_type_valid,
+ &l_left_margin, &l_right_margin,
+ l_rcv_imp_dq_dqs_in);
+ if (rc) return rc;
+ l_left_margin_rcv_imp_array[index] = l_left_margin;
+ l_right_margin_rcv_imp_array[index] = l_right_margin;
+ shmoo_param_count++;
+ }
+ else
+ {
+ l_left_margin_rcv_imp_array[index] = 0;
+ l_right_margin_rcv_imp_array[index] = 0;
+ }
+ l_rcv_imp_dq_dqs_schmoo[i_port] = (l_rcv_imp_dq_dqs_schmoo[i_port] >> 1);
+ }
+ l_rcv_imp_dq_dqs_nom_fc = l_rcv_imp_dq_dqs_nom[i_port];
+ find_best_margin(RCV_IMP, l_left_margin_rcv_imp_array,
+ l_right_margin_rcv_imp_array, MAX_RCV_IMP,
+ l_rcv_imp_dq_dqs_nom_fc, count);
+ if (count >= MAX_RCV_IMP)
{
- FAPI_ERR("Receiver Imp new input(%d) out of bounds, (>= %d)",
- count, MAX_RCV_IMP);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
- return rc;
+ FAPI_ERR("Receiver Imp new input(%d) out of bounds, (>= %d)",
+ count, MAX_RCV_IMP);
+ const uint8_t & COUNT_DATA = count;
+ FAPI_SET_HWP_ERROR(rc, RC_RCV_IMP_SHMOO_INVALID_MARGIN_DATA);
+ return rc;
}
- else
- {
-
- /* if(i_port == 0)
- {
- l_rcv_imp_dq_dqs_new[0] = rcv_imp_array[count];
- l_rcv_imp_dq_dqs_new[1] = l_rcv_imp_dq_dqs_nom[1]; // This can be removed once the get/set attribute takes care of this
- }
- else
- {
- l_rcv_imp_dq_dqs_new[1] = rcv_imp_array[count];
- l_rcv_imp_dq_dqs_new[0] = l_rcv_imp_dq_dqs_nom[0];
- }*/
- // if (l_rcv_imp_dq_dqs_new[i_port] != l_rcv_imp_dq_dqs_nom[i_port])
- // {
- //FAPI_INF("Better Margin found on %d on %s", l_rcv_imp_dq_dqs_new[i_port], i_target_mba.toEcmdString());
- //rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RCV_IMP_DQ_DQS, &i_target_mba, l_rcv_imp_dq_dqs_new);
- //if (rc) return rc;
- //rc = config_rcv_imp(i_target_mba, i_port, l_rcv_imp_dq_dqs_new[i_port]);
- //if (rc) return rc;
- // }
- // else
- // {
- // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
- FAPI_INF("Restoring the nominal values!");
- rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RCV_IMP_DQ_DQS, &i_target_mba, l_rcv_imp_dq_dqs_nom);
- if (rc) return rc;
- rc = config_rcv_imp(i_target_mba, i_port, l_rcv_imp_dq_dqs_nom[i_port]);
- if (rc) return rc;
- // }
- }
- FAPI_INF("Restoring mcbist setup attribute...");
- rc = reset_attribute(i_target_mba); if (rc) return rc;
- FAPI_INF("++++ Receiver Impdeance Shmoo function executed successfully ++++");
+ else
+ {
+ // FAPI_INF("Nominal value will not be changed!- Restoring the original values!");
+ FAPI_INF("Restoring the nominal values!");
+ rc = FAPI_ATTR_SET(ATTR_EFF_CEN_RCV_IMP_DQ_DQS, &i_target_mba,
+ l_rcv_imp_dq_dqs_nom);
+ if (rc) return rc;
+ rc = config_rcv_imp(i_target_mba, i_port,
+ l_rcv_imp_dq_dqs_nom[i_port]);
+ if (rc) return rc;
+ }
+ FAPI_INF("Restoring mcbist setup attribute...");
+ rc = reset_attribute(i_target_mba);
+ if (rc) return rc;
+ FAPI_INF("++++ Receiver Impdeance Shmoo function executed successfully ++++");
}
-return rc;
+ return rc;
}
//------------------------------------------------------------------------------
@@ -1046,17 +1011,8 @@ fapi::ReturnCode delay_shmoo(const fapi::Target & i_target_mba, uint8_t i_port,
{
FAPI_ERR("Delay Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
}
- //FAPI_INF("Abhijit Saurabh sizeof generic_shmoo is %d", sizeof(l_pShmoo));
-
delete l_pShmoo;
-
- // rc = mss_shmoo.run(i_target_mba, o_left_margin, o_right_margin,i_shmoo_param);
- // if(rc)
- // {
- // FAPI_ERR("Delay Schmoo Function is Failed rc = 0x%08X (creator = %d)", uint32_t(rc), rc.getCreator());
- // return rc;
- // }
-return rc;
+ return rc;
}
@@ -1113,81 +1069,91 @@ void find_best_margin(shmoo_param i_shmoo_param_valid,
uint32_t diff_margin = 0;
uint8_t index = 0;
uint8_t index2 = 0;
-
-
- for(index = 0; index < i_max; index+=1) //send max from top function
+
+ for (index = 0; index < i_max; index += 1) //send max from top function
{
- if(i_shmoo_param_valid & DRV_IMP)
- {
- if (drv_imp_array[index] == i_param_nom)
- {
- left_margin_nom = i_left[index];
- right_margin_nom = i_right[index];
- diff_margin_nom = (i_left[index] >= i_right[index]) ? (i_left[index] - i_right[index]) : (i_right[index] - i_left[index]);
- //FAPI_INF("Driver impedance value (NOM): %d Ohms Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
- break;
- }
+ if (i_shmoo_param_valid & DRV_IMP)
+ {
+ if (drv_imp_array[index] == i_param_nom)
+ {
+ left_margin_nom = i_left[index];
+ right_margin_nom = i_right[index];
+ diff_margin_nom = (i_left[index] >= i_right[index]) ?
+ (i_left[index]- i_right[index]) :
+ (i_right[index] - i_left[index]);
+ //FAPI_INF("Driver impedance value (NOM): %d Ohms Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
+ break;
+ }
}
- else if(i_shmoo_param_valid & SLEW_RATE)
+ else if (i_shmoo_param_valid & SLEW_RATE)
{
- if (slew_rate_array[index] == i_param_nom)
- {
- left_margin_nom = i_left[index];
- right_margin_nom = i_right[index];
- diff_margin_nom = (i_left[index] >= i_right[index]) ? (i_left[index] - i_right[index]) : (i_right[index] - i_left[index]);
- //FAPI_INF("Slew rate value (NOM): %d V/ns Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
- break;
- }
+ if (slew_rate_array[index] == i_param_nom)
+ {
+ left_margin_nom = i_left[index];
+ right_margin_nom = i_right[index];
+ diff_margin_nom = (i_left[index] >= i_right[index]) ?
+ (i_left[index] - i_right[index]) :
+ (i_right[index] - i_left[index]);
+ //FAPI_INF("Slew rate value (NOM): %d V/ns Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
+ break;
+ }
}
- else if(i_shmoo_param_valid & WR_VREF)
- {
- if (wr_vref_array_fitness[index] == i_param_nom)
- {
- left_margin_nom = i_left[index];
- right_margin_nom = i_right[index];
- diff_margin_nom = (i_left[index] >= i_right[index]) ? (i_left[index] - i_right[index]) : (i_right[index] - i_left[index]);
- //FAPI_INF("Write DRAM Vref Multiplier value (NOM): %d Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
- break;
- }
- }
- else if(i_shmoo_param_valid & RD_VREF)
- {
- if (rd_cen_vref_array_fitness[index] == i_param_nom)
- {
- left_margin_nom = i_left[index];
- right_margin_nom = i_right[index];
- diff_margin_nom = (i_left[index] >= i_right[index]) ? (i_left[index] - i_right[index]) : (i_right[index] - i_left[index]);
- //FAPI_INF("Centaur Read Vref Multiplier value (NOM): %d Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
- break;
- }
+ else if (i_shmoo_param_valid & WR_VREF)
+ {
+ if (wr_vref_array_fitness[index] == i_param_nom)
+ {
+ left_margin_nom = i_left[index];
+ right_margin_nom = i_right[index];
+ diff_margin_nom = (i_left[index] >= i_right[index]) ?
+ (i_left[index] - i_right[index]) :
+ (i_right[index] - i_left[index]);
+ //FAPI_INF("Write DRAM Vref Multiplier value (NOM): %d Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
+ break;
+ }
+ }
+ else if (i_shmoo_param_valid & RD_VREF)
+ {
+ if (rd_cen_vref_array_fitness[index] == i_param_nom)
+ {
+ left_margin_nom = i_left[index];
+ right_margin_nom = i_right[index];
+ diff_margin_nom = (i_left[index] >= i_right[index]) ?
+ (i_left[index] - i_right[index]) :
+ (i_right[index] - i_left[index]);
+ //FAPI_INF("Centaur Read Vref Multiplier value (NOM): %d Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
+ break;
+ }
}
- else if(i_shmoo_param_valid & RCV_IMP)
- {
- if (rcv_imp_array[index] == i_param_nom)
- {
- left_margin_nom = i_left[index];
- right_margin_nom = i_right[index];
- diff_margin_nom = (i_left[index] >= i_right[index]) ? (i_left[index] - i_right[index]) : (i_right[index] - i_left[index]);
- // FAPI_INF("Receiver Impedance value (NOM): %d Ohms Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
- break;
- }
+ else if (i_shmoo_param_valid & RCV_IMP)
+ {
+ if (rcv_imp_array[index] == i_param_nom)
+ {
+ left_margin_nom = i_left[index];
+ right_margin_nom = i_right[index];
+ diff_margin_nom = (i_left[index] >= i_right[index]) ?
+ (i_left[index] - i_right[index]) :
+ (i_right[index] - i_left[index]);
+ // FAPI_INF("Receiver Impedance value (NOM): %d Ohms Setup Margin: %d Hold Margin: %d", i_param_nom, i_left[index], i_right[index]);
+ break;
+ }
}
-
}
- for(index2 = 0; index2 < i_max; index2+=1)
+ for (index2 = 0; index2 < i_max; index2 += 1)
{
- left_margin = i_left[index2];
- right_margin = i_right[index2];
- //total_margin = i_left[index2] + i_right[index2];
- diff_margin = (i_left[index2] >= i_right[index2]) ? (i_left[index2] - i_right[index2]) : (i_right[index2] - i_left[index2]);
- if ((left_margin > 0 && right_margin > 0))
- {
- if((left_margin >= left_margin_nom) && (right_margin >= right_margin_nom) && (diff_margin <= diff_margin_nom))
- {
- o_index = index2;
- //wont break this loop, since the purpose is to find the best parameter value & best timing margin The enum is constructed to do that
- // FAPI_INF("Index value %d, Min Setup Margin: %d, Min Hold Margin: %d", o_index, i_left[index2], i_right[index2]);
- }
- }
+ left_margin = i_left[index2];
+ right_margin = i_right[index2];
+ //total_margin = i_left[index2] + i_right[index2];
+ diff_margin = (i_left[index2] >= i_right[index2]) ? (i_left[index2]
+ - i_right[index2]) : (i_right[index2] - i_left[index2]);
+ if ((left_margin > 0 && right_margin > 0))
+ {
+ if ((left_margin >= left_margin_nom) && (right_margin
+ >= right_margin_nom) && (diff_margin <= diff_margin_nom))
+ {
+ o_index = index2;
+ //wont break this loop, since the purpose is to find the best parameter value & best timing margin The enum is constructed to do that
+ // FAPI_INF("Index value %d, Min Setup Margin: %d, Min Hold Margin: %d", o_index, i_left[index2], i_right[index2]);
+ }
+ }
}
}
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.H b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.H
index 1cae04c33..c9375d910 100755
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.H
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_draminit_training_advanced.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_draminit_training_advanced.H,v 1.16 2013/08/08 14:54:08 sasethur Exp $
+// $Id: mss_draminit_training_advanced.H,v 1.17 2014/01/23 17:10:05 sasethur Exp $
/* File is created by SARAVANAN SETHURAMAN on Thur Sept 28 2011. */
//------------------------------------------------------------------------------
@@ -54,6 +54,7 @@
// 1.14 | 10-May-13 | sasethur | Added user input for test type, pattern from wrapper
// 1.15 | 10-May-13 | sasethur | changed uint8_t to uint32_t for test type, pattern
// 1.16 | 08-Aug-13 | sasethur | Removed Pattern and testype
+// 1.17 | 17-Jan-14 | mjjones | RAS Review cleanup
#ifndef _MSS_DRAMINIT_TRAINING_ADVANCED_H
#define _MSS_DRAMINIT_TRAINING_ADVANCED_H
@@ -69,14 +70,12 @@ typedef fapi::ReturnCode (*mss_draminit_training_advanced_FP_t)(const fapi::Targ
extern "C"
{
/**
-* @brief Draminit training advanced procedure shmoo's drv_impedance, slew, vref and receiver impedance and get the optimum value
-*
-* @param[in] i_target Reference to target
-* i_pattern To enable patterns for mcbist used in lab/debug mode - user option
-* i_test_type To enable test types for mcbist used in lab/debug mode - user option
-* @return ReturnCode
-*/
-
+ * @brief Draminit training advanced procedure shmoo's drv_impedance, slew, vref and receiver impedance and get the optimum value
+ *
+ * @param[in] i_target Reference to MBA target
+ *
+ * @return ReturnCode
+ */
fapi::ReturnCode mss_draminit_training_advanced(const fapi::Target & i_target_mba);
} // extern C
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.C b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.C
index ae34690e8..f2be0429d 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.C
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_mcbist_address.C,v 1.13 2013/12/18 10:40:10 sasethur Exp $
+// $Id: mss_mcbist_address.C,v 1.14 2014/01/24 06:59:19 sasethur Exp $
// *!***************************************************************************
// *! (C) Copyright International Business Machines Corp. 1997, 1998, 2013
// *! All Rights Reserved -- Property of IBM
@@ -38,6 +38,7 @@
//-------------------------------------------------------------------------------
// Version:|Author: | Date: | Comment:
// --------|--------|---------|--------------------------------------------------
+// 1.14 |mjjones |20-Jan-13| RAS Review Updates
// 1.13 |preet |18-Dec-13| Added 64K default for few addr_mode
// 1.12 |preet |17-Dec-13| Added Addr modes
// 1.11 |preeragh|17-May-13| Fixed FW Review Comments
@@ -58,958 +59,1511 @@ using namespace fapi;
#define DELIMITERS ","
-fapi::ReturnCode address_generation(const fapi:: Target & i_target_mba,uint8_t i_port,mcbist_addr_mode i_addr_type,interleave_type i_add_inter_type,uint8_t i_rank,uint64_t &io_start_address, uint64_t &io_end_address)
-
-{
-fapi::ReturnCode rc;
-uint8_t l_num_ranks_per_dimm[MAX_VALUE_TWO][MAX_VALUE_TWO];
-uint8_t l_num_master_ranks[MAX_VALUE_TWO][MAX_VALUE_TWO];
-uint8_t l_dram_gen=0;
-uint8_t l_dram_banks=0;
-uint8_t l_dram_rows=0;
-uint8_t l_dram_cols=0;
-uint8_t l_dram_density=0;
-uint8_t l_dram_width=0;
-uint8_t l_addr_inter=0;
-uint8_t l_num_ranks_p0_dim0,l_num_ranks_p0_dim1,l_num_ranks_p1_dim0,l_num_ranks_p1_dim1;
-uint8_t mr3_valid,mr2_valid,mr1_valid;
-uint32_t rc_num;
-char S0[] = "b";
-//char l_my_addr[MAX_STRING_LEN];
-
-//Choose a default buffer for the below
-//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
-//MR0(MSB) MR1 MR2 MR3 BA0 BA1 BA2 BA3 C3 C4 C5 C6 C7 C8 C9 C10 C11 R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 SL0(MSB) SL1 SL2
-ecmdDataBufferBase l_default_add_buffer(64);
-ecmdDataBufferBase l_new_add_buffer(64);
-
-rc_num = l_default_add_buffer.flushTo0();
-if (rc_num){FAPI_ERR( "Error in function addr_gen:");rc.setEcmdError(rc_num);return rc;}
-rc_num = l_new_add_buffer.flushTo0();
-if (rc_num){FAPI_ERR( "Error in function addr_gen:");rc.setEcmdError(rc_num);return rc;}
-
-
-rc = FAPI_ATTR_GET(ATTR_EFF_NUM_RANKS_PER_DIMM, &i_target_mba, l_num_ranks_per_dimm); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM, &i_target_mba, l_num_master_ranks); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_GEN, &i_target_mba, l_dram_gen); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_BANKS, &i_target_mba, l_dram_banks); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_ROWS, &i_target_mba, l_dram_rows); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_COLS, &i_target_mba, l_dram_cols); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_DENSITY, &i_target_mba, l_dram_density); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_WIDTH, &i_target_mba, l_dram_width); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_INTER, &i_target_mba, l_addr_inter); if(rc) return rc;
-
-
-//------------------------------ Debug Stuff -------------------------------
-//FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[0][0]);
-//FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[0][1]);
-//FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[1][0]);
-//FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[1][1]);
-//------------------------------ Debug Stuff -------------------------------
-
-//FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p0_dim0 is %d ",l_num_master_ranks[0][0]);
-//FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p0_dim1 is %d ",l_num_master_ranks[0][1]);
-//FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p1_dim0 is %d ",l_num_master_ranks[1][0]);
-//FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p1_dim1 is %d ",l_num_master_ranks[1][1]);
-
-//-------------------------------------------------------------------------------
-
-l_num_ranks_p0_dim0 = l_num_ranks_per_dimm[0][0];
-l_num_ranks_p0_dim1 = l_num_ranks_per_dimm[0][1];
-l_num_ranks_p1_dim0 = l_num_ranks_per_dimm[1][0];
-l_num_ranks_p1_dim1 = l_num_ranks_per_dimm[1][1];
-
-//Initial all ranks are invalid
-mr3_valid = 0;
-mr2_valid = 0;
-mr1_valid = 0;
-
-if( (l_num_ranks_p0_dim0 == 1 && l_num_ranks_p0_dim1 == 0) || (l_num_ranks_p1_dim0 == 1 && l_num_ranks_p1_dim1 == 0) ) //Single Rank case -- default0
- {
- //do rank-only stuff for this
- //FAPI_INF("--- INSIDE 1R");
- l_addr_inter=3;
- }
-
-else if ( (l_num_ranks_p0_dim0 == 1 && l_num_ranks_p0_dim1 == 1) || (l_num_ranks_p1_dim0 == 1 && l_num_ranks_p1_dim1 == 1) )
+fapi::ReturnCode address_generation(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ mcbist_addr_mode i_addr_type,
+ interleave_type i_add_inter_type,
+ uint8_t i_rank,
+ uint64_t &io_start_address,
+ uint64_t &io_end_address)
{
- //FAPI_INF("--- INSIDE p0d0 valid and p0d1 valid --- 0 4---- 2R");
- mr1_valid=1;
+ fapi::ReturnCode rc;
+ uint8_t l_num_ranks_per_dimm[MAX_VALUE_TWO][MAX_VALUE_TWO];
+ uint8_t l_num_master_ranks[MAX_VALUE_TWO][MAX_VALUE_TWO];
+ uint8_t l_dram_gen = 0;
+ uint8_t l_dram_banks = 0;
+ uint8_t l_dram_rows = 0;
+ uint8_t l_dram_cols = 0;
+ uint8_t l_dram_density = 0;
+ uint8_t l_dram_width = 0;
+ uint8_t l_addr_inter = 0;
+ uint8_t l_num_ranks_p0_dim0, l_num_ranks_p0_dim1, l_num_ranks_p1_dim0,
+ l_num_ranks_p1_dim1;
+ uint8_t mr3_valid, mr2_valid, mr1_valid;
+ uint32_t rc_num;
+ char S0[] = "b";
+ //Choose a default buffer for the below
+ //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+ //MR0(MSB) MR1 MR2 MR3 BA0 BA1 BA2 BA3 C3 C4 C5 C6 C7 C8 C9 C10 C11 R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 SL0(MSB) SL1 SL2
+ ecmdDataBufferBase l_default_add_buffer(64);
+ ecmdDataBufferBase l_new_add_buffer(64);
+
+ rc_num = l_default_add_buffer.flushTo0();
+ rc_num |= l_new_add_buffer.flushTo0();
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function addr_gen:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+
+ rc = FAPI_ATTR_GET(ATTR_EFF_NUM_RANKS_PER_DIMM, &i_target_mba, l_num_ranks_per_dimm);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM, &i_target_mba,
+ l_num_master_ranks);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_GEN, &i_target_mba, l_dram_gen);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_BANKS, &i_target_mba, l_dram_banks);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_ROWS, &i_target_mba, l_dram_rows);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_COLS, &i_target_mba, l_dram_cols);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_DENSITY, &i_target_mba, l_dram_density);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_EFF_DRAM_WIDTH, &i_target_mba, l_dram_width);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_INTER, &i_target_mba, l_addr_inter);
+ if (rc) return rc;
+
+ //------------------------------ Debug Stuff -------------------------------
+ //FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[0][0]);
+ //FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[0][1]);
+ //FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[1][0]);
+ //FAPI_INF("ATTR_EFF_NUM_RANKS_PER_DIMM is %d ",l_num_ranks_per_dimm[1][1]);
+ //------------------------------ Debug Stuff -------------------------------
+ //FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p0_dim0 is %d ",l_num_master_ranks[0][0]);
+ //FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p0_dim1 is %d ",l_num_master_ranks[0][1]);
+ //FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p1_dim0 is %d ",l_num_master_ranks[1][0]);
+ //FAPI_INF("ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM l_num_master_p1_dim1 is %d ",l_num_master_ranks[1][1]);
+ //-------------------------------------------------------------------------------
+
+ l_num_ranks_p0_dim0 = l_num_ranks_per_dimm[0][0];
+ l_num_ranks_p0_dim1 = l_num_ranks_per_dimm[0][1];
+ l_num_ranks_p1_dim0 = l_num_ranks_per_dimm[1][0];
+ l_num_ranks_p1_dim1 = l_num_ranks_per_dimm[1][1];
+
+ //Initial all ranks are invalid
+ mr3_valid = 0;
+ mr2_valid = 0;
+ mr1_valid = 0;
+
+ if ((l_num_ranks_p0_dim0 == 1 && l_num_ranks_p0_dim1 == 0) ||
+ (l_num_ranks_p1_dim0 == 1 && l_num_ranks_p1_dim1 == 0)) //Single Rank case -- default0
+ {
+ //do rank-only stuff for this
+ //FAPI_INF("--- INSIDE 1R");
+ l_addr_inter = 3;
+ }
+ else if ((l_num_ranks_p0_dim0 == 1 && l_num_ranks_p0_dim1 == 1) ||
+ (l_num_ranks_p1_dim0 == 1 && l_num_ranks_p1_dim1 == 1))
+ {
+ //FAPI_INF("--- INSIDE p0d0 valid and p0d1 valid --- 0 4---- 2R");
+ mr1_valid = 1;
+ }
+ else if ((l_num_ranks_p0_dim0 == 2 && l_num_ranks_p0_dim1 == 0) ||
+ (l_num_ranks_p1_dim0 == 2 && l_num_ranks_p1_dim1 == 0))
+ {
+ //FAPI_INF("--- INSIDE p0d0 valid and p0d1 valid --- 0 1---- 2R");
+ mr3_valid = 1;
+ }
+ else if ((l_num_ranks_p0_dim0 == 2 && l_num_ranks_p0_dim1 == 2) ||
+ (l_num_ranks_p1_dim0 == 2 && l_num_ranks_p1_dim1 == 2)) //Rank 01 and 45 case
+ {
+ //FAPI_INF("--- INSIDE --- 2R 0145");
+ mr3_valid = 1;
+ mr1_valid = 1;
+ }
+ else if ((l_num_ranks_p0_dim0 == 4 && l_num_ranks_p0_dim1 == 0) ||
+ (l_num_ranks_p1_dim0 == 4 && l_num_ranks_p1_dim1 == 0)) //Rank 0123 on single dimm case
+ {
+ mr3_valid = 1;
+ mr2_valid = 1;
+ }
+ else if ((l_num_ranks_p0_dim0 == 4 && l_num_ranks_p0_dim1 == 4) ||
+ (l_num_ranks_p1_dim0 == 4 && l_num_ranks_p1_dim1 == 4)) //Rank 0123 and 4567 case
+ {
+ mr3_valid = 1;
+ mr2_valid = 1;
+ mr1_valid = 1;
+ }
+ else
+ {
+ FAPI_INF("-- Error ---- mcbist_addr_Check dimm_Config ----- ");
+ }
+
+ //FAPI_INF("ATTR_EFF_DRAM_GEN is %d ",l_dram_gen);
+ //FAPI_INF("ATTR_EFF_DRAM_BANKS is %d ",l_dram_banks);
+ //FAPI_INF("ATTR_EFF_DRAM_ROWS is %d ",l_dram_rows);
+ //FAPI_INF("ATTR_EFF_DRAM_COLS is %d ",l_dram_cols);
+ //FAPI_INF("ATTR_EFF_DRAM_DENSITY is %d ",l_dram_density);
+ //FAPI_INF("ATTR_EFF_DRAM_WIDTH is %d ",l_dram_width);
+ //FAPI_INF("ATTR_ADDR_INTER Mode is %d ",l_addr_inter);
+ //FAPI_INF("--- BANK-RANK Address interleave ---");
+ rc = parse_addr(i_target_mba, S0, mr3_valid, mr2_valid, mr1_valid,
+ l_dram_rows, l_dram_cols, l_addr_inter);
+ if (rc) return rc;
+
+ return rc;
}
-else if ( (l_num_ranks_p0_dim0 == 2 && l_num_ranks_p0_dim1 == 0) || (l_num_ranks_p1_dim0 == 2 && l_num_ranks_p1_dim1 == 0) )
+fapi::ReturnCode parse_addr(const fapi::Target & i_target_mba,
+ char addr_string[],
+ uint8_t mr3_valid,
+ uint8_t mr2_valid,
+ uint8_t mr1_valid,
+ uint8_t l_dram_rows,
+ uint8_t l_dram_cols,
+ uint8_t l_addr_inter)
{
- //FAPI_INF("--- INSIDE p0d0 valid and p0d1 valid --- 0 1---- 2R");
- mr3_valid=1;
-}
-else if ((l_num_ranks_p0_dim0 == 2 && l_num_ranks_p0_dim1 == 2)|| (l_num_ranks_p1_dim0 == 2 && l_num_ranks_p1_dim1 == 2)) //Rank 01 and 45 case
- {
- //FAPI_INF("--- INSIDE --- 2R 0145");
- mr3_valid = 1;
- mr1_valid=1;
- }
-
-else if((l_num_ranks_p0_dim0 == 4 && l_num_ranks_p0_dim1 == 0 )|| (l_num_ranks_p1_dim0 == 4 && l_num_ranks_p1_dim1 == 0 )) //Rank 0123 on single dimm case
- {
- mr3_valid = 1;mr2_valid = 1;
- }
-
-else if ((l_num_ranks_p0_dim0 == 4 && l_num_ranks_p0_dim1 == 4) || (l_num_ranks_p1_dim0 == 4 && l_num_ranks_p1_dim1 == 4)) //Rank 0123 and 4567 case
-{
- mr3_valid = 1;
- mr2_valid = 1;
- mr1_valid = 1;
-}
-
-else
-
- {
- FAPI_INF("-- Error ---- mcbist_addr_Check dimm_Config ----- ");
- }
-
-//FAPI_INF("ATTR_EFF_DRAM_GEN is %d ",l_dram_gen);
-//FAPI_INF("ATTR_EFF_DRAM_BANKS is %d ",l_dram_banks);
-//FAPI_INF("ATTR_EFF_DRAM_ROWS is %d ",l_dram_rows);
-//FAPI_INF("ATTR_EFF_DRAM_COLS is %d ",l_dram_cols);
-//FAPI_INF("ATTR_EFF_DRAM_DENSITY is %d ",l_dram_density);
-//FAPI_INF("ATTR_EFF_DRAM_WIDTH is %d ",l_dram_width);
-//FAPI_INF("ATTR_ADDR_INTER Mode is %d ",l_addr_inter);
-
-
-
-//FAPI_INF("--- BANK-RANK Address interleave ---");
-rc = parse_addr(i_target_mba,S0,mr3_valid,mr2_valid,mr1_valid,l_dram_rows,l_dram_cols,l_addr_inter);if(rc) return rc;
-
-
-
-return rc;
-
-}
-
-
-fapi::ReturnCode parse_addr(const fapi:: Target & i_target_mba, char addr_string[],uint8_t mr3_valid,uint8_t mr2_valid,uint8_t mr1_valid,uint8_t l_dram_rows,uint8_t l_dram_cols,uint8_t l_addr_inter)
-{
-fapi::ReturnCode rc;
-uint8_t i=MAX_ADDR_BITS;
-
-uint8_t l_slave_rank = 0;
-uint8_t l_value;
-uint32_t l_value32 = 0;
-uint32_t l_sbit,rc_num;
-uint32_t l_start=0;
-uint32_t l_len = 0;
-uint64_t l_readscom_value = 0;
-uint64_t l_end = 0;
-uint64_t l_start_addr = 0;
-uint8_t l_value_zero = 0;
-uint8_t l_user_end_addr = 0;
-ecmdDataBufferBase l_data_buffer_64(64);
-ecmdDataBufferBase l_data_buffer_rd64(64);
-uint8_t l_attr_addr_mode = 0;
-uint8_t l_num_cols = 0;
-uint8_t l_num_rows = 0;
-
-
-
-rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_ADDR_MODE, &i_target_mba, l_attr_addr_mode); if(rc) return rc;
-
-rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_NUM_COLS, &i_target_mba, l_num_cols); if(rc) return rc;
-rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_NUM_ROWS, &i_target_mba, l_num_rows); if(rc) return rc;
-
-if(l_num_cols == 0)
-{l_num_cols = l_dram_cols;}
-
-if(l_num_rows == 0 )
-{l_num_rows = l_dram_rows;}
-
-
-//Set all the addr reg to 0
-
-//Define Custom String
-
-//Set all Params based on the string.
-
-rc_num = l_data_buffer_64.flushTo0();
-
- l_sbit = 0;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
-
- l_sbit = 54;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64);
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i--;
-
- ////FAPI_INF("Inside strcmp ba2");
- l_sbit = 48;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i--;
-
- ////FAPI_INF("Inside strcmp ba3");
- l_sbit = 42;l_value =i;
- //------- Enable these for DDR4 --- for now constant map to zero
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("ba3 Invalid");
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i++;
-
-
- ////FAPI_INF("Inside strcmp mr3");
- l_sbit = 18;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- if(mr3_valid==1)
- {
-
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("mr3 Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp mr2");
- l_sbit = 12;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- if(mr2_valid==1)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- //FAPI_INF("Inside mr2 --- l_addr_inter");
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i--;
- }
-
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("mr2 Invalid");
- i++;
- }
-
-
-
-
- ////FAPI_INF("Inside strcmp mr1");
- l_sbit = 6;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- if(mr1_valid==1)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- //FAPI_INF("Inside mr1 --- l_addr_inter");
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("mr1 Invalid");
- i++;
- }
-
-
-
-
-
- ////FAPI_INF("Inside strcmp mr0");
- l_sbit = 0;l_value =i;
- //------- Enable these for DDR4 --- for now constant map to zero
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i++;
- ////FAPI_INF("Value of i = %d",i);
- //FAPI_INF("mr0 Invalid\n");
-
-
-
- ////FAPI_INF("Inside strcmp cl3");
- l_sbit = 42;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i++;
- //FAPI_INF("col2 Invalid");
- ////FAPI_INF("Value of i = %d",i);
-
-
-
-
- ////FAPI_INF("Inside strcmp cl3");
- l_sbit = 36;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 1)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 3 -- Invalid");
- i++;
- }
-
- ////FAPI_INF("Inside strcmp cl4");
- l_sbit = 30;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 2)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
-
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 4 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp cl5");
- l_sbit = 24;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 3)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 5 -- Invalid");
- i++;
- }
-
- ////FAPI_INF("Inside strcmp cl6");
- l_sbit = 18;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 4)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 6 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp cl7");
- l_sbit = 12;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 5)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 7 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp cl8");
- l_sbit = 6;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 6)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 8 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp cl9");
- l_sbit = 0;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 7)
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;i--;}
-
-
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106cb,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 9 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp cl11");
- l_sbit = 54;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 11)
- {
- if(l_dram_cols >=11)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_DBG("%s: Inside l_dram_cols > 10");
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- FAPI_DBG("%s:Col 11 -- Invalid",i_target_mba.toEcmdString());
- i++;
- }
-
-
-
-
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 11 -- Invalid");
- i++;
-
- }
-
- ////FAPI_INF("Value of i = %d",i);
-
-
-
- ////FAPI_INF("Inside strcmp cl13");
- l_sbit = 48;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_cols >= 12)
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("Col 13 Invalid");
- i++;
- }
- ////FAPI_INF("Value of i = %d",i);
-
-
-
-
-
- ////FAPI_INF("Inside strcmp r0");
- l_sbit = 42;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 0 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 0 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r1");
- l_sbit = 36;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 1 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 1 -- Invalid");
- i++;
- }
-
-
-
-
- ////FAPI_INF("Inside strcmp r2");
- l_sbit = 30;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 2 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 2 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r3");
- l_sbit = 24;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 3 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 3 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r4");
- l_sbit = 18;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 4 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;}
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 4 -- Invalid");
- i++;
- }
-
-
-
-
-
- ////FAPI_INF("Inside strcmp r5");
- l_sbit = 12;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 5 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 5 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r6");
- l_sbit = 6;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 6 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 6 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r7");
- l_sbit = 0;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 7 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106ca,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 7 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r8");
- l_sbit = 54;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 8 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 8 -- Invalid");
- i++;
- }
-
-
-
-
- ////FAPI_INF("Inside strcmp r9");
- l_sbit = 48;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 9 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 9 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r10");
- l_sbit = 42;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 10 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 10 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r11");
- l_sbit = 36;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 11 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 11 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r12");
- l_sbit = 30;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 12 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 12 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r13");
- l_sbit = 24;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 13 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 13 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r14");
- l_sbit = 18;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if(l_num_rows > 14 )
- {rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- ////FAPI_INF("Value of i = %d",i);
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 14 -- Invalid");
- i++;
- }
-
-
-
- ////FAPI_INF("Inside strcmp r15");
- l_sbit = 12;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if ( l_num_rows > 15 )
- { rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("row 15 -- Invalid");
- i++;
- }
- ////FAPI_INF("Value of i = %d",i);
-
-
-
- ////FAPI_INF("Inside strcmp r16 and l_dram_rows = %d",l_dram_rows);
- l_sbit = 6;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- if ( l_dram_rows >= 17 )
- {
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i--;
- }
- else
- {
- ////FAPI_INF("r16 not used");
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- //FAPI_INF("Row 16 Invalid");
- rc = fapiPutScom(i_target_mba,0x030106c9,l_data_buffer_64); if(rc) return rc;
- i++;
- }
- ////FAPI_INF("Value of i = %d",i);
-
-
-
- ////FAPI_INF("Inside strcmp sl2");
- l_sbit = 36;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //------- Enable these for later --- for now constant map to zero
- if (l_slave_rank==0)
- {l_value =0;}
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("sl2 Invalid");
- i++;
- ////FAPI_INF("Value of i = %d",i);
-
-
-
- ////FAPI_INF("Inside strcmp sl1");
- l_sbit = 30;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //------- Enable these for later --- for now constant map to zero
- if (l_slave_rank==0)
- {l_value =0;}
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- i++;
- //FAPI_INF("sl1 Invalid");
- ////FAPI_INF("Value of i = %d",i);
-
-
-
- ////FAPI_INF("Inside strcmp sl0");
- l_sbit = 24;l_value =i;
- rc = fapiGetScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //------- Enable these for later --- for now constant map to zero
- if (l_slave_rank==0)
- {l_value =0;}
- rc_num = rc_num| l_data_buffer_64.insertFromRight(l_value_zero,l_sbit ,6);if (rc_num){FAPI_ERR( "Error in function parse_addr:");rc.setEcmdError(rc_num);return rc;}
- rc = fapiPutScom(i_target_mba,0x030106c8,l_data_buffer_64); if(rc) return rc;
- //FAPI_INF("sl0 Invalid");
- i++;
- ////FAPI_INF("Value of i = %d",i);
-
-
-
-
-
-
- //------ Setting Start and end addr counters
-
-//FAPI_INF("Debug - --------------- Setting Start and End Counters -----------\n");
-rc_num = l_data_buffer_rd64.flushTo0();
-rc = fapiPutScom(i_target_mba,0x030106d0,l_data_buffer_rd64); if(rc) return rc;
-l_value = i+1;
-//FAPI_INF("Setting end_addr Value of i = %d",i);
-rc_num = l_data_buffer_rd64.flushTo0();
-
-//Calculate and set Valid bits for end_addr
-
-for(i=l_value;i <= 37;i++)
- { rc_num = l_data_buffer_rd64.clearBit(i);
- rc_num = l_data_buffer_rd64.setBit(i);
- }
- if (rc_num){FAPI_ERR( "Error in function addr_gen:");rc.setEcmdError(rc_num);return rc;}
-
-l_readscom_value = l_data_buffer_rd64.getDoubleWord (0);
-//FAPI_INF("Debug - Initial End addr for 0x030106d2 = %016llX",l_readscom_value);
-
-rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_ADDR_MODE, &i_target_mba, l_attr_addr_mode); if(rc) return rc;
-
-rc = FAPI_ATTR_GET(ATTR_MCBIST_START_ADDR, &i_target_mba, l_start_addr); if(rc) return rc;
-//FAPI_INF("User Defined ATTR - Start = %016llX",l_start_addr);
-rc = FAPI_ATTR_GET(ATTR_MCBIST_END_ADDR, &i_target_mba, l_end); if(rc) return rc;
-
-//FAPI_INF("User defined END ATTR - End Address = %016llX",l_end);
-
-rc = FAPI_ATTR_GET(ATTR_MCBIST_RANK, &i_target_mba, l_user_end_addr); if(rc) return rc;
-
-if(l_user_end_addr == 1)
-{
-
-//Setting start and end Temp
-
-rc_num = l_data_buffer_rd64.setDoubleWord(0,l_start_addr);if(rc_num) return rc;
-rc = fapiPutScom(i_target_mba,0x030106d0,l_data_buffer_rd64); if(rc) return rc;
-rc = fapiPutScom(i_target_mba,0x030106d1,l_data_buffer_rd64); if(rc) return rc;
-
-rc_num = l_data_buffer_rd64.setDoubleWord(0,l_end);if(rc_num) return rc;
-rc = fapiPutScom(i_target_mba,0x030106d2,l_data_buffer_rd64); if(rc) return rc;
-rc = fapiPutScom(i_target_mba,0x030106d3,l_data_buffer_rd64); if(rc) return rc;
-}
-
-else
-{
-
-//l_attr_addr_mode = 3; //Default it for FW with Full Address Range
-
-if(l_attr_addr_mode == 0)
-{
- //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- Few Address Mode --------",l_attr_addr_mode);
- l_sbit = 32;
- rc_num = l_data_buffer_rd64.flushTo0();
- l_start = 24;
- l_len = 8;
- l_value32 = 28;
- rc_num=l_data_buffer_rd64.insert(l_value32,l_sbit,l_len,l_start);
-
- l_readscom_value = 0x000003FFF8000000ull;
- rc_num = l_data_buffer_rd64.setDoubleWord(0,l_readscom_value);if(rc_num) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d2,l_data_buffer_rd64); if(rc) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d3,l_data_buffer_rd64); if(rc) return rc;
- l_readscom_value = l_data_buffer_rd64.getDoubleWord (0);
- //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
-}
-
-else if(l_attr_addr_mode == 1)
-{
- //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- QUARTER ADDRESSING Mode --------",l_attr_addr_mode);
- l_readscom_value = l_readscom_value >> 2;
- //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
- rc_num = l_data_buffer_rd64.setDoubleWord(0,l_readscom_value);if(rc_num) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d2,l_data_buffer_rd64); if(rc) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d3,l_data_buffer_rd64); if(rc) return rc;
-
-}
-else if(l_attr_addr_mode == 2)
-{
- //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- HALF ADDRESSING Mode --------",l_attr_addr_mode);
- l_readscom_value = l_readscom_value >> 1;
- //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
- rc_num = l_data_buffer_rd64.setDoubleWord(0,l_readscom_value);if(rc_num) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d2,l_data_buffer_rd64); if(rc) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d3,l_data_buffer_rd64); if(rc) return rc;
-}
-else
-{
- //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- FULL Address Mode --------",l_attr_addr_mode);
- //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
- rc = fapiPutScom(i_target_mba,0x030106d2,l_data_buffer_rd64); if(rc) return rc;
- rc = fapiPutScom(i_target_mba,0x030106d3,l_data_buffer_rd64); if(rc) return rc;
-}
-
-}
-
-return rc;
-
+ fapi::ReturnCode rc;
+ uint8_t i = MAX_ADDR_BITS;
+
+ uint8_t l_slave_rank = 0;
+ uint8_t l_value;
+ uint32_t l_value32 = 0;
+ uint32_t l_sbit, rc_num;
+ uint32_t l_start = 0;
+ uint32_t l_len = 0;
+ uint64_t l_readscom_value = 0;
+ uint64_t l_end = 0;
+ uint64_t l_start_addr = 0;
+ uint8_t l_value_zero = 0;
+ uint8_t l_user_end_addr = 0;
+ ecmdDataBufferBase l_data_buffer_64(64);
+ ecmdDataBufferBase l_data_buffer_rd64(64);
+ uint8_t l_attr_addr_mode = 0;
+ uint8_t l_num_cols = 0;
+ uint8_t l_num_rows = 0;
+
+ rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_ADDR_MODE, &i_target_mba, l_attr_addr_mode);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_NUM_COLS, &i_target_mba, l_num_cols);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_ADDR_NUM_ROWS, &i_target_mba, l_num_rows);
+ if (rc) return rc;
+
+ if (l_num_cols == 0)
+ {
+ l_num_cols = l_dram_cols;
+ }
+
+ if (l_num_rows == 0)
+ {
+ l_num_rows = l_dram_rows;
+ }
+
+ //Set all the addr reg to 0
+ //Define Custom String
+ //Set all Params based on the string.
+ rc_num = l_data_buffer_64.flushTo0();
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+
+ l_sbit = 0;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+
+ l_sbit = 54;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+
+ ////FAPI_INF("Inside strcmp ba2");
+ l_sbit = 48;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+
+ ////FAPI_INF("Inside strcmp ba3");
+ l_sbit = 42;
+ l_value = i;
+ //------- Enable these for DDR4 --- for now constant map to zero
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("ba3 Invalid");
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i++;
+
+ ////FAPI_INF("Inside strcmp mr3");
+ l_sbit = 18;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ if (mr3_valid == 1)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("mr3 Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp mr2");
+ l_sbit = 12;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ if (mr2_valid == 1)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ //FAPI_INF("Inside mr2 --- l_addr_inter");
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("mr2 Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp mr1");
+ l_sbit = 6;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ if (mr1_valid == 1)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ //FAPI_INF("Inside mr1 --- l_addr_inter");
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("mr1 Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp mr0");
+ l_sbit = 0;
+ l_value = i;
+ //------- Enable these for DDR4 --- for now constant map to zero
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i++;
+ ////FAPI_INF("Value of i = %d",i);
+ //FAPI_INF("mr0 Invalid\n");
+
+ ////FAPI_INF("Inside strcmp cl3");
+ l_sbit = 42;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i++;
+ //FAPI_INF("col2 Invalid");
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp cl3");
+ l_sbit = 36;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 1)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 3 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl4");
+ l_sbit = 30;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 2)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 4 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl5");
+ l_sbit = 24;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 3)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 5 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl6");
+ l_sbit = 18;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 4)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 6 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl7");
+ l_sbit = 12;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 5)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 7 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl8");
+ l_sbit = 6;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 6)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 8 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl9");
+ l_sbit = 0;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 7)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106cb, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 9 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp cl11");
+ l_sbit = 54;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 11)
+ {
+ if (l_dram_cols >= 11)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_DBG("%s: Inside l_dram_cols > 10");
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ FAPI_DBG("%s:Col 11 -- Invalid", i_target_mba.toEcmdString());
+ i++;
+ }
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 11 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp cl13");
+ l_sbit = 48;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_cols >= 12)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("Col 13 Invalid");
+ i++;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp r0");
+ l_sbit = 42;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 0)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 0 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r1");
+ l_sbit = 36;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 1)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 1 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r2");
+ l_sbit = 30;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 2)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 2 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r3");
+ l_sbit = 24;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 3)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 3 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r4");
+ l_sbit = 18;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 4)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 4 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r5");
+ l_sbit = 12;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 5)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 5 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r6");
+ l_sbit = 6;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 6)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 6 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r7");
+ l_sbit = 0;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 7)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106ca, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 7 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r8");
+ l_sbit = 54;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 8)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 8 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r9");
+ l_sbit = 48;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 9)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 9 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r10");
+ l_sbit = 42;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 10)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 10 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r11");
+ l_sbit = 36;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 11)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 11 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r12");
+ l_sbit = 30;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 12)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 12 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r13");
+ l_sbit = 24;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 13)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 13 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r14");
+ l_sbit = 18;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 14)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 14 -- Invalid");
+ i++;
+ }
+
+ ////FAPI_INF("Inside strcmp r15");
+ l_sbit = 12;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_num_rows > 15)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("row 15 -- Invalid");
+ i++;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp r16 and l_dram_rows = %d",l_dram_rows);
+ l_sbit = 6;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ if (l_dram_rows >= 17)
+ {
+ rc_num = l_data_buffer_64.insertFromRight(l_value, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i--;
+ }
+ else
+ {
+ ////FAPI_INF("r16 not used");
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ //FAPI_INF("Row 16 Invalid");
+ rc = fapiPutScom(i_target_mba, 0x030106c9, l_data_buffer_64);
+ if (rc) return rc;
+ i++;
+ }
+ ////FAPI_INF("Value of i = %d",i);
+
+
+ ////FAPI_INF("Inside strcmp sl2");
+ l_sbit = 36;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //------- Enable these for later --- for now constant map to zero
+ if (l_slave_rank == 0)
+ {
+ l_value = 0;
+ }
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("sl2 Invalid");
+ i++;
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp sl1");
+ l_sbit = 30;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //------- Enable these for later --- for now constant map to zero
+ if (l_slave_rank == 0)
+ {
+ l_value = 0;
+ }
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ i++;
+ //FAPI_INF("sl1 Invalid");
+ ////FAPI_INF("Value of i = %d",i);
+ ////FAPI_INF("Inside strcmp sl0");
+ l_sbit = 24;
+ l_value = i;
+ rc = fapiGetScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //------- Enable these for later --- for now constant map to zero
+ if (l_slave_rank == 0)
+ {
+ l_value = 0;
+ }
+ rc_num = l_data_buffer_64.insertFromRight(l_value_zero, l_sbit, 6);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106c8, l_data_buffer_64);
+ if (rc) return rc;
+ //FAPI_INF("sl0 Invalid");
+ i++;
+ ////FAPI_INF("Value of i = %d",i);
+
+ //------ Setting Start and end addr counters
+
+ //FAPI_INF("Debug - --------------- Setting Start and End Counters -----------\n");
+ rc_num = l_data_buffer_rd64.flushTo0();
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106d0, l_data_buffer_rd64);
+ if (rc) return rc;
+ l_value = i + 1;
+ //FAPI_INF("Setting end_addr Value of i = %d",i);
+ rc_num = l_data_buffer_rd64.flushTo0();
+
+ //Calculate and set Valid bits for end_addr
+ for (i = l_value; i <= 37; i++)
+ {
+ rc_num |= l_data_buffer_rd64.clearBit(i);
+ rc_num |= l_data_buffer_rd64.setBit(i);
+ }
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+
+ l_readscom_value = l_data_buffer_rd64.getDoubleWord(0);
+
+ rc = FAPI_ATTR_GET(ATTR_EFF_SCHMOO_ADDR_MODE, &i_target_mba, l_attr_addr_mode);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_START_ADDR, &i_target_mba, l_start_addr);
+ if (rc) return rc;
+ //FAPI_INF("User Defined ATTR - Start = %016llX",l_start_addr);
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_END_ADDR, &i_target_mba, l_end);
+ if (rc) return rc;
+ rc = FAPI_ATTR_GET(ATTR_MCBIST_RANK, &i_target_mba, l_user_end_addr);
+ if (rc) return rc;
+
+ if (l_user_end_addr == 1)
+ {
+ //Setting start and end Temp
+ rc_num = l_data_buffer_rd64.setDoubleWord(0, l_start_addr);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106d0, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d1, l_data_buffer_rd64);
+ if (rc) return rc;
+
+ rc_num = l_data_buffer_rd64.setDoubleWord(0, l_end);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106d2, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d3, l_data_buffer_rd64);
+ if (rc) return rc;
+ }
+
+ else
+ {
+ if (l_attr_addr_mode == 0)
+ {
+ //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- Few Address Mode --------",l_attr_addr_mode);
+ l_sbit = 32;
+ rc_num = l_data_buffer_rd64.flushTo0();
+ l_start = 24;
+ l_len = 8;
+ l_value32 = 28;
+ rc_num |= l_data_buffer_rd64.insert(l_value32, l_sbit, l_len, l_start);
+ l_readscom_value = 0x000003FFF8000000ull;
+ rc_num |= l_data_buffer_rd64.setDoubleWord(0, l_readscom_value);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+
+ rc = fapiPutScom(i_target_mba, 0x030106d2, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d3, l_data_buffer_rd64);
+ if (rc) return rc;
+ l_readscom_value = l_data_buffer_rd64.getDoubleWord(0);
+ //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
+ }
+ else if (l_attr_addr_mode == 1)
+ {
+ //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- QUARTER ADDRESSING Mode --------",l_attr_addr_mode);
+ l_readscom_value = l_readscom_value >> 2;
+ //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
+ rc_num = l_data_buffer_rd64.setDoubleWord(0, l_readscom_value);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106d2, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d3, l_data_buffer_rd64);
+ if (rc) return rc;
+ }
+ else if (l_attr_addr_mode == 2)
+ {
+ //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- HALF ADDRESSING Mode --------",l_attr_addr_mode);
+ l_readscom_value = l_readscom_value >> 1;
+ //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
+ rc_num = l_data_buffer_rd64.setDoubleWord(0, l_readscom_value);
+ if (rc_num)
+ {
+ FAPI_ERR("Error in function parse_addr:");
+ rc.setEcmdError(rc_num);
+ return rc;
+ }
+ rc = fapiPutScom(i_target_mba, 0x030106d2, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d3, l_data_buffer_rd64);
+ if (rc) return rc;
+ }
+ else
+ {
+ //FAPI_INF("ATTR_EFF_SCHMOO_ADDR_MODE - %d ---- FULL Address Mode --------",l_attr_addr_mode);
+ //FAPI_INF("Debug - Final End addr for 0x030106d2 = %016llX",l_readscom_value);
+ rc = fapiPutScom(i_target_mba, 0x030106d2, l_data_buffer_rd64);
+ if (rc) return rc;
+ rc = fapiPutScom(i_target_mba, 0x030106d3, l_data_buffer_rd64);
+ if (rc) return rc;
+ }
+ }
+
+ return rc;
}
}
diff --git a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.H b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.H
index 7859e84f8..6f924047e 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.H
+++ b/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_mcbist_address.H
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_mcbist_address.H,v 1.4 2013/12/17 18:33:49 sasethur Exp $
+// $Id: mss_mcbist_address.H,v 1.5 2014/01/24 06:59:30 sasethur Exp $
// *!***************************************************************************
// *! (C) Copyright International Business Machines Corp. 1997, 1998, 2013
// *! All Rights Reserved -- Property of IBM
@@ -39,44 +39,51 @@
// Version:|Author: | Date: | Comment:
// 1.3 |bellows |03-Apr-13| Added Id for firmware
// 1.4 |preeragh|17-Dec-14| Removed unwanted header includes
+// 1.5 |mjjones |20-Jan-14| RAS Review Updates
// --------|--------|---------|--------------------------------------------------
//------------------------------------------------------------------------------
#ifndef MSS_MCBIST_ADDRESS_H
#define MSS_MCBIST_ADDRESS_H
-/****************************************************************************************/
-/* mss_mcbist_address.H */
-/****************************************************************************************/
+/*****************************************************************************/
+/* mss_mcbist_address.H */
+/*****************************************************************************/
#include <fapi.H>
#include <cen_scom_addresses.H>
#include <mss_access_delay_reg.H>
#include <mss_mcbist.H>
-#include<string.h>
+#include <string.h>
extern "C"
{
using namespace fapi;
-/*enum address_mode
-{
- SF,
- SR,
- RF,
- RR
-};*/
enum interleave_type
{
-
-BANK_RANK,
-RANK_BANK,
-BANK_ONLY,
-RANK_ONLY,
-RANKS_DIMM0,
-RANKS_DIMM1,
-USER_PATTERN
+ BANK_RANK,
+ RANK_BANK,
+ BANK_ONLY,
+ RANK_ONLY,
+ RANKS_DIMM0,
+ RANKS_DIMM1,
+ USER_PATTERN
};
-fapi::ReturnCode address_generation(const fapi:: Target & i_target_mba,uint8_t i_port,mcbist_addr_mode i_addr_type,interleave_type i_add_inter_type,uint8_t i_rank,uint64_t &io_start_address, uint64_t &io_end_address);
-fapi::ReturnCode parse_addr(const fapi:: Target & i_target_mba, char addr_string[],uint8_t mr3_valid,uint8_t mr2_valid,uint8_t mr1_valid,uint8_t l_dram_rows,uint8_t l_dram_cols,uint8_t l_addr_inter);
+fapi::ReturnCode address_generation(const fapi:: Target & i_target_mba,
+ uint8_t i_port,
+ mcbist_addr_mode i_addr_type,
+ interleave_type i_add_inter_type,
+ uint8_t i_rank,
+ uint64_t &io_start_address,
+ uint64_t &io_end_address);
+
+fapi::ReturnCode parse_addr(const fapi:: Target & i_target_mba,
+ char addr_string[],
+ uint8_t mr3_valid,
+ uint8_t mr2_valid,
+ uint8_t mr1_valid,
+ uint8_t l_dram_rows,
+ uint8_t l_dram_cols,
+ uint8_t l_addr_inter);
}
#endif
diff --git a/src/usr/hwpf/hwp/dram_training/mss_termination_control.C b/src/usr/hwpf/hwp/dram_training/mss_termination_control.C
index d9b179250..c237d0d5b 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_termination_control.C
+++ b/src/usr/hwpf/hwp/dram_training/mss_termination_control.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_termination_control.C,v 1.23 2013/12/02 18:55:39 bellows Exp $
+// $Id: mss_termination_control.C,v 1.25 2014/01/22 15:39:18 mjjones Exp $
/* File is created by SARAVANAN SETHURAMAN on Thur 29 Sept 2011. */
//------------------------------------------------------------------------------
@@ -43,6 +43,8 @@
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
+// 1.25 | mjjones |22-Jan-14| Removed firmware header
+// 1.24 | abhijsau |21-Jan-14| mike and menlo fixed ras review comments
// 1.23 | bellows |02-Dec-13| VPD attribute update
// 1.22 | mwuu |20-Sep-13| Updated ADR DDR3 slew calibration table for 1 setting,
// 1066 20ohms, 4V/ns, changed from 11 to 10.
@@ -112,7 +114,8 @@ fapi::ReturnCode config_drv_imp(const fapi::Target & i_target_mba, uint8_t i_por
if (i_port > 1)
{
FAPI_ERR("Driver impedance port input(%u) out of bounds", i_port);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ const uint8_t & PORT_PARAM = i_port;
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_DRV_IMP_INVALID_INPUT);
return rc;
}
for(i=0; i< MAX_DRV_IMP; i++)
@@ -251,7 +254,8 @@ fapi::ReturnCode config_rcv_imp(const fapi::Target & i_target_mba, uint8_t i_por
if (i_port > 1)
{
FAPI_ERR("Receiver impedance port input(%u) out of bounds", i_port);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ const uint8_t & PORT_PARAM = i_port;
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_RCV_IMP_INVALID_INPUT);
return rc;
}
@@ -416,10 +420,16 @@ fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
uint8_t calibrated_slew_rate_table
[MAX_NUM_PORTS][MAX_NUM_IMP][MAX_NUM_CAL_SLEW_RATES]={{{0}}};
+ // FFDC for bad parameters
+ const uint8_t & PORT_PARAM = i_port;
+ const uint8_t & SLEW_TYPE_PARAM = i_slew_type;
+ const uint8_t & SLEW_IMP_PARAM = i_slew_imp;
+ const uint8_t & SLEW_RATE_PARAM = i_slew_rate;
+
if (i_port >= MAX_NUM_PORTS)
{
FAPI_ERR("Slew port input(%u) out of bounds", i_port);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_SLEW_RATE_INVALID_INPUT);
return rc;
}
@@ -427,7 +437,7 @@ fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
{
FAPI_ERR("Slew type input(%u) out of bounds, (>= %u)",
i_slew_type, MAX_NUM_SLEW_TYPES);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_SLEW_RATE_INVALID_INPUT);
return rc;
}
@@ -451,7 +461,7 @@ fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
break;
default:
FAPI_ERR("Slew rate input(%u) out of bounds", i_slew_rate);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_SLEW_RATE_INVALID_INPUT);
return rc;
}
@@ -474,7 +484,7 @@ fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
default: // OHM15 || OHM20 not valid for data
FAPI_ERR("Slew impedance input(%u) invalid "
"or out of bounds, index=%u", i_slew_imp, imp_idx);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_IMP_INPUT_ERROR);
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_SLEW_RATE_INVALID_INPUT);
return rc;
}
@@ -571,7 +581,7 @@ fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
(imp_idx >= MAX_NUM_IMP))
{
FAPI_ERR("Slew impedance input(%u) out of bounds", i_slew_imp);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_IMP_INPUT_ERROR);
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_SLEW_RATE_INVALID_INPUT);
return rc;
}
@@ -709,7 +719,8 @@ fapi::ReturnCode config_wr_dram_vref(const fapi::Target & i_target_mba, uint8_t
if (i_port > 1)
{
FAPI_ERR("Write Vref port input(%u) out of bounds", i_port);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ const uint8_t & PORT_PARAM = i_port;
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_WR_DRAM_VREF_INVALID_INPUT);
return rc;
}
@@ -837,7 +848,8 @@ fapi::ReturnCode config_rd_cen_vref (const fapi::Target & i_target_mba, uint8_t
if (i_port > 1)
{
FAPI_ERR("Read vref port input(%u) out of bounds", i_port);
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FN_INPUT_ERROR);
+ const uint8_t & PORT_PARAM = i_port;
+ FAPI_SET_HWP_ERROR(rc, RC_CONFIG_RD_CEN_VREF_INVALID_INPUT);
return rc;
}
@@ -1100,10 +1112,11 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
ddr_idx = 1;
} else if (ddr_type == fapi::ENUM_ATTR_EFF_DRAM_GEN_DDR3) { //type=1
ddr_idx = 0;
- } else { // EMPTY ?? how to handle?
+ } else {
FAPI_ERR("Invalid ATTR_DRAM_DRAM_GEN = %d, %s!", ddr_type,
i_target_mba.toEcmdString());
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_DRAM_GEN);
+ const uint8_t & DRAM_GEN = ddr_type;
+ FAPI_SET_HWP_ERROR(rc, RC_MSS_SLEW_CAL_INVALID_DRAM_GEN);
return rc;
}
@@ -1115,7 +1128,7 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
if (ddr_freq == 0) {
FAPI_ERR("Invalid ATTR_MSS_FREQ = %d on %s!", ddr_freq,
i_target_mba.toEcmdString());
- FAPI_SET_HWP_ERROR(rc, RC_MSS_INVALID_FREQ);
+ FAPI_SET_HWP_ERROR(rc, RC_MSS_SLEW_CAL_INVALID_FREQ);
return rc;
}
// speed(4) 1066=0, 1333=1, 1600=2, 1866=3
@@ -1203,7 +1216,6 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
if (poll_count == MAX_POLL_LOOPS) {
FAPI_INF("WARNING: Timeout on polling BB_Lock, continuing...");
-// return rc;
}
else
{
@@ -1294,16 +1306,16 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
}
else if (cal_status == 2)
{
- FAPI_INF("WARNING: occurred during slew "
- "calibration, imped=%i, slewrate=%i \n\t %s "
- "\t\t\t [%i][%i][%i][%i][%i], input=0x%02X, "
- "ctrl=0x%04X, status=0x%04X continuing...",
- (data_adr ? adr_imp_array[imp] :
- drv_imp_array[(4-imp)]), (slew+3),
- i_target_mba.toEcmdString(), ddr_idx, data_adr,
- freq_idx, imp, slew, (cal_slew & 0x1F),
- ctl_reg.getHalfWord(3),
- stat_reg.getHalfWord(3));
+ FAPI_INF("WARNING: occurred during slew calibration"
+ ", imped=%i, slewrate=%i %s ddr_idx[%i]",
+ data_adr ? adr_imp_array[imp] :
+ drv_imp_array[(4-imp)], (slew+3),
+ i_target_mba.toEcmdString(), ddr_idx);
+ FAPI_INF("data_adr[%i], freq_idx[%i], imp[%i], slew[%i]",
+ data_adr, freq_idx, imp, slew);
+ FAPI_INF("input=0x%02X, ctrl=0x%04X, status=0x%04X",
+ (cal_slew & 0x1F), ctl_reg.getHalfWord(3),
+ stat_reg.getHalfWord(3));
}
cal_slew = cal_slew & 0x80; // clear bits 6:0
rc_ecmd = stat_reg.extractPreserve(&cal_slew, 60, 4, 4);
@@ -1342,19 +1354,23 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
FAPI_ERR("Slew calibration timed out, loop=%i",
poll_count);
}
- FAPI_ERR("Slew calibration failed on %s slew: "
- "imp_idx=%d(%i ohms), slew_idx=%d(%i V/ns), "
- "slew_table=0x%02X,\n\t\t\t ctl_reg=0x%04X, "
- "status=0x%04X on %s!",
- (data_adr ? "ADR" : "DATA"), imp,
- (data_adr ? adr_imp_array[imp] :
- drv_imp_array[(4-imp)]), slew, (slew+3),
- cal_slew, stat_reg.getHalfWord(3),
- ctl_reg.getHalfWord(3),
- i_target_mba.toEcmdString());
-
+ FAPI_ERR("Slew calibration failed on %s slew: "
+ "imp_idx=%d(%i ohms)",
+ (data_adr ? "ADR" : "DATA"), imp,
+ (data_adr ? adr_imp_array[imp] :
+ drv_imp_array[(4-imp)]));
+ FAPI_ERR("slew_idx=%d(%i V/ns), slew_table=0x%02X",
+ slew, (slew+3), cal_slew);
+ FAPI_ERR("ctl_reg=0x%04X, status=0x%04X on %s!",
+ stat_reg.getHalfWord(3),
+ ctl_reg.getHalfWord(3),
+ i_target_mba.toEcmdString());
+
+ const uint8_t & DATA_ADR = data_adr;
+ const uint8_t & IMP = imp;
+ const uint8_t & SLEW = slew;
+ const fapi::Target & MBA_IN_ERROR = i_target_mba;
FAPI_SET_HWP_ERROR(rc, RC_MSS_SLEW_CAL_ERROR);
- //return rc;
array_rcs[l_port]=rc;
continue;
}
@@ -1460,8 +1476,6 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
default:
FAPI_INF("WARNING: EFF_CEN_DRV_IMP_DQ_DQS attribute "
"invalid, using value of 0");
-// FAPI_SET_HWP_ERROR(rc, RC_MSS_IMP_INPUT_ERROR);
-// return rc;
}
// FAPI_DBG("switched imp to value of %u",
// slew_imp_val[SLEW_TYPE_DATA][IMP][j]);
@@ -1543,9 +1557,14 @@ fapi::ReturnCode mss_slew_cal(const fapi::Target &i_target_mba)
FAPI_INF("Setting slew registers for port %i", l_port);
for (uint8_t slew_type=0; slew_type < MAX_NUM_SLEW_TYPES; slew_type++)
{
- array_rcs[l_port]=config_slew_rate(i_target_mba, l_port, slew_type,
+ fapi::ReturnCode config_rc =
+ config_slew_rate(i_target_mba, l_port, slew_type,
slew_imp_val[slew_type][IMP][l_port],
slew_imp_val[slew_type][SLEW][l_port]);
+ if (config_rc)
+ {
+ array_rcs[l_port] = config_rc;
+ }
}
}
diff --git a/src/usr/hwpf/hwp/dram_training/mss_termination_control.H b/src/usr/hwpf/hwp/dram_training/mss_termination_control.H
index 7e6402d72..ee6e21f8e 100644
--- a/src/usr/hwpf/hwp/dram_training/mss_termination_control.H
+++ b/src/usr/hwpf/hwp/dram_training/mss_termination_control.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -20,251 +20,323 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_termination_control.H,v 1.10 2012/12/14 16:17:07 sasethur Exp $
-/* File is created by SARAVANAN SETHURAMAN on Thur Sept 28 2011. */
-
-//------------------------------------------------------------------------------
-// *! (C) Copyright International Business Machines Corp. 2007
-// *! All Rights Reserved -- Property of IBM
-// *! *** IBM Confidential ***
-//------------------------------------------------------------------------------
-// *! TITLE :mss_draminit_training_advanced.H
-// *! DESCRIPTION : Tools for centaur procedures
-// *! OWNER NAME : Saravanan sethuraman Email ID: saravanans@in.ibm.com
-// *! BACKUP NAME : Menlo Wuu Email ID: menlowuu@us.ibm.com
-// #! ADDITIONAL COMMENTS :
-//
-// General purpose funcs
-
-//------------------------------------------------------------------------------
-// Don't forget to create CVS comments when you check in your changes!
-//------------------------------------------------------------------------------
-// CHANGE HISTORY:
-//------------------------------------------------------------------------------
-// Version:| Author: | Date: | Comment:
-//---------|---------- |--------- |---------------------------------------------
-// 1.10 | 14-Dec-12 | sasethur | Updated for fw review comments
-// 1.9 | 07-Dec-12 | sasethur | Updated for fw review comments
-// 1.8 | 16-Nov-12 | mwuu | Added typedef for external call of
-// mss_slew_cal F
-// 1.7 | 14-Nov-12 | mwuu | Changed "l_" variables to "i_" in
-// config_slew_rate FN
-// 1.6 | 14-Nov-12 | mwuu | Fixed revision numbering in comments
-// 1.5 | 14-Nov-12 | mwuu | Added additional slew rates, and new const
-// 1.4 | 26-Oct-12 | mwuu | Added additional slew types enums, need to
-// change MAX_NUM_SLEW_TYPES when attributes
-// updated.
-// 1.3 | 26-Oct-12 | sasethur | Updated FW review comments fapi::,
-// const fapi::Target
-// 1.2 | 17-Oct-12 | mwuu | updates to enum and consts
-// 1.1 | 28-Sep-12 | sasethur | First draft
-
-
-#ifndef MSS_TERMINATION_CONTROL_H
-#define MSS_TERMINATION_CONTROL_H
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
-#include <fapi.H>
-
-enum {
- SLEW_TYPE_DATA = 0,
- SLEW_TYPE_ADR_ADDR = 1,
- SLEW_TYPE_ADR_CNTL = 2,
- SLEW_TYPE_ADR_CLK = 3,
- SLEW_TYPE_ADR_SPCKE = 4,
-
- OHM15 = 15,
- OHM20 = 20,
- OHM24 = 24,
- OHM30 = 30,
- OHM34 = 34,
- OHM40 = 40,
-
- SLEW_3V_NS = 3,
- SLEW_4V_NS = 4,
- SLEW_5V_NS = 5,
- SLEW_6V_NS = 6,
- SLEW_MAXV_NS = 7,
-};
-
-const uint8_t MAX_NUM_PORTS = 2; // max number of ports
-const uint8_t MAX_NUM_SLEW_TYPES = 5; // data(dq/dqs), adr_cmd, adr_cntl, clk, spcke, used by slew_cal FN only
-const uint8_t MAX_NUM_IMP = 4; // number of impedances valid per slew type
-
-//Address shmoo is not done as a part of Training advanced, so the order matches
-//attribute enum
-const uint8_t adr_imp_array[] = {
- 15,
- 20,
- 30,
- 40,
-};
-
-// bypass slew (MAX slew rate) not included since it is not calibrated.
-const uint8_t MAX_NUM_CAL_SLEW_RATES = 4 ; // 3V/ns, 4V/ns, 5V/ns, 6V/n
-const uint8_t MAX_NUM_SLEW_RATES = 4; // 3V/ns, 4V/ns, 5V/ns, 6V/n, MAX?
-const uint8_t slew_rate_array[] = {
-// 7,
- 6,
- 5,
- 4,
- 3,
-};
-
-const uint8_t MAX_SLEW_VALUE = 15; // 4 bit value
-const uint8_t MAX_WR_VREF = 32;
-
-const uint32_t wr_vref_array[] = {
- 420,
- 425,
- 430,
- 435,
- 440,
- 445,
- 450,
- 455,
- 460,
- 465,
- 470,
- 475,
- 480,
- 485,
- 490,
- 495,
- 500,
- 505,
- 510,
- 515,
- 520,
- 525,
- 530,
- 535,
- 540,
- 545,
- 550,
- 555,
- 560,
- 565,
- 570,
- 575
- };
-
-
-//The Array is re-arranged inorder to find the best Eye margin based on the
-//Fitness level - 500 is the best value
-const uint32_t wr_vref_array_fitness[] = {
- 420,
- 425,
- 575,
- 430,
- 570,
- 435,
- 565,
- 440,
- 560,
- 445,
- 555,
- 450,
- 550,
- 455,
- 545,
- 460,
- 540,
- 465,
- 535,
- 470,
- 530,
- 475,
- 525,
- 480,
- 520,
- 485,
- 515,
- 490,
- 510,
- 495,
- 505,
- 500
- };
-
-const uint8_t MAX_RD_VREF = 16;
-const uint32_t rd_cen_vref_array[] = {
- 40375,
- 41750,
- 43125,
- 44500,
- 45875,
- 47250,
- 48625,
- 50000,
- 51375,
- 52750,
- 54125,
- 55500,
- 56875,
- 58250,
- 59625,
- 61000
- };
-
-//The Array is re-arranged inorder to find the best Eye margin based on the
-//Fitness level - 50000 is the best value
-const uint32_t rd_cen_vref_array_fitness[] = {
- 61000,
- 59625,
- 40375,
- 58250,
- 41750,
- 56875,
- 43125,
- 55500,
- 44500,
- 54125,
- 45875,
- 52750,
- 47250,
- 51375,
- 48625,
- 50000
- };
-
-//The Array is re-arranged inorder to find the best Eye margin based on the
-//Fitness level - 24 is the best value
-const uint8_t MAX_DRV_IMP = 4;
-const uint8_t drv_imp_array[] = {
- 40,
- 34,
- 30,
- 24
- };
-
-//The Array is re-arranged inorder to find the best Eye margin based on the
-//Fitness level - 15 is the best value
-const uint8_t MAX_RCV_IMP = 9;
-const uint8_t rcv_imp_array[] = {
- 120,
- 80,
- 60,
- 48,
- 40,
- 34,
- 30,
- 20,
- 15
- };
-
-typedef fapi::ReturnCode (*mss_slew_cal_FP_t)(const fapi::Target & i_target_mba);
-
-extern "C"
-{
-fapi::ReturnCode config_wr_dram_vref(const fapi::Target & i_target_mba, uint8_t i_port, uint32_t l_wr_vref);
-fapi::ReturnCode config_rd_cen_vref(const fapi::Target & i_target_mba, uint8_t i_port, uint32_t l_rd_cen_vref);
-fapi::ReturnCode config_drv_imp(const fapi::Target & i_target_mba, uint8_t i_port, uint8_t l_drv_imp_dq_dqs);
-fapi::ReturnCode config_rcv_imp(const fapi::Target & i_target_mba, uint8_t i_port, uint8_t l_rcv_imp_dq_dqs);
+// $Id: mss_termination_control.H,v 1.12 2014/01/22 15:39:22 mjjones Exp $
+/* File is created by SARAVANAN SETHURAMAN on Thur Sept 28 2011. */
+
+//------------------------------------------------------------------------------
+// *! (C) Copyright International Business Machines Corp. 2007
+// *! All Rights Reserved -- Property of IBM
+// *! *** IBM Confidential ***
+//------------------------------------------------------------------------------
+// *! TITLE :mss_draminit_training_advanced.H
+// *! DESCRIPTION : Tools for centaur procedures
+// *! OWNER NAME : Saravanan sethuraman Email ID: saravanans@in.ibm.com
+// *! BACKUP NAME : Menlo Wuu Email ID: menlowuu@us.ibm.com
+// #! ADDITIONAL COMMENTS :
+//
+// General purpose funcs
+
+//------------------------------------------------------------------------------
+// Don't forget to create CVS comments when you check in your changes!
+//------------------------------------------------------------------------------
+// CHANGE HISTORY:
+//------------------------------------------------------------------------------
+// Version:| Author: | Date: | Comment:
+//---------|---------- |--------- |---------------------------------------------
+// 1.12 | 22-Jan-14 | mjjones | Removed FW header
+// 1.11 | 21-Jan-14 | abhijsau | mike and menlo fixed ras review comments
+// 1.10 | 14-Dec-12 | sasethur | Updated for fw review comments
+// 1.9 | 07-Dec-12 | sasethur | Updated for fw review comments
+// 1.8 | 16-Nov-12 | mwuu | Added typedef for external call of
+// mss_slew_cal F
+// 1.7 | 14-Nov-12 | mwuu | Changed "l_" variables to "i_" in
+// config_slew_rate FN
+// 1.6 | 14-Nov-12 | mwuu | Fixed revision numbering in comments
+// 1.5 | 14-Nov-12 | mwuu | Added additional slew rates, and new const
+// 1.4 | 26-Oct-12 | mwuu | Added additional slew types enums, need to
+// change MAX_NUM_SLEW_TYPES when attributes
+// updated.
+// 1.3 | 26-Oct-12 | sasethur | Updated FW review comments fapi::,
+// const fapi::Target
+// 1.2 | 17-Oct-12 | mwuu | updates to enum and consts
+// 1.1 | 28-Sep-12 | sasethur | First draft
+
+
+#ifndef MSS_TERMINATION_CONTROL_H
+#define MSS_TERMINATION_CONTROL_H
+//----------------------------------------------------------------------
+// Includes
+//----------------------------------------------------------------------
+#include <fapi.H>
+
+enum {
+ SLEW_TYPE_DATA = 0,
+ SLEW_TYPE_ADR_ADDR = 1,
+ SLEW_TYPE_ADR_CNTL = 2,
+ SLEW_TYPE_ADR_CLK = 3,
+ SLEW_TYPE_ADR_SPCKE = 4,
+
+ OHM15 = 15,
+ OHM20 = 20,
+ OHM24 = 24,
+ OHM30 = 30,
+ OHM34 = 34,
+ OHM40 = 40,
+
+ SLEW_3V_NS = 3,
+ SLEW_4V_NS = 4,
+ SLEW_5V_NS = 5,
+ SLEW_6V_NS = 6,
+ SLEW_MAXV_NS = 7,
+};
+
+const uint8_t MAX_NUM_PORTS = 2; // max number of ports
+const uint8_t MAX_NUM_SLEW_TYPES = 5; // data(dq/dqs), adr_cmd, adr_cntl, clk, spcke, used by slew_cal FN only
+const uint8_t MAX_NUM_IMP = 4; // number of impedances valid per slew type
+
+//Address shmoo is not done as a part of Training advanced, so the order matches
+//attribute enum
+const uint8_t adr_imp_array[] = {
+ 15,
+ 20,
+ 30,
+ 40,
+};
+
+// bypass slew (MAX slew rate) not included since it is not calibrated.
+const uint8_t MAX_NUM_CAL_SLEW_RATES = 4 ; // 3V/ns, 4V/ns, 5V/ns, 6V/n
+const uint8_t MAX_NUM_SLEW_RATES = 4; // 3V/ns, 4V/ns, 5V/ns, 6V/n, MAX?
+const uint8_t slew_rate_array[] = {
+ 6,
+ 5,
+ 4,
+ 3,
+};
+
+const uint8_t MAX_SLEW_VALUE = 15; // 4 bit value
+const uint8_t MAX_WR_VREF = 32;
+
+const uint32_t wr_vref_array[] = {
+ 420,
+ 425,
+ 430,
+ 435,
+ 440,
+ 445,
+ 450,
+ 455,
+ 460,
+ 465,
+ 470,
+ 475,
+ 480,
+ 485,
+ 490,
+ 495,
+ 500,
+ 505,
+ 510,
+ 515,
+ 520,
+ 525,
+ 530,
+ 535,
+ 540,
+ 545,
+ 550,
+ 555,
+ 560,
+ 565,
+ 570,
+ 575
+ };
+
+
+//The Array is re-arranged inorder to find the best Eye margin based on the
+//Fitness level - 500 is the best value
+const uint32_t wr_vref_array_fitness[] = {
+ 420,
+ 425,
+ 575,
+ 430,
+ 570,
+ 435,
+ 565,
+ 440,
+ 560,
+ 445,
+ 555,
+ 450,
+ 550,
+ 455,
+ 545,
+ 460,
+ 540,
+ 465,
+ 535,
+ 470,
+ 530,
+ 475,
+ 525,
+ 480,
+ 520,
+ 485,
+ 515,
+ 490,
+ 510,
+ 495,
+ 505,
+ 500
+ };
+
+const uint8_t MAX_RD_VREF = 16;
+const uint32_t rd_cen_vref_array[] = {
+ 40375,
+ 41750,
+ 43125,
+ 44500,
+ 45875,
+ 47250,
+ 48625,
+ 50000,
+ 51375,
+ 52750,
+ 54125,
+ 55500,
+ 56875,
+ 58250,
+ 59625,
+ 61000
+ };
+
+//The Array is re-arranged inorder to find the best Eye margin based on the
+//Fitness level - 50000 is the best value
+const uint32_t rd_cen_vref_array_fitness[] = {
+ 61000,
+ 59625,
+ 40375,
+ 58250,
+ 41750,
+ 56875,
+ 43125,
+ 55500,
+ 44500,
+ 54125,
+ 45875,
+ 52750,
+ 47250,
+ 51375,
+ 48625,
+ 50000
+ };
+
+//The Array is re-arranged inorder to find the best Eye margin based on the
+//Fitness level - 24 is the best value
+const uint8_t MAX_DRV_IMP = 4;
+const uint8_t drv_imp_array[] = {
+ 40,
+ 34,
+ 30,
+ 24
+ };
+
+//The Array is re-arranged inorder to find the best Eye margin based on the
+//Fitness level - 15 is the best value
+const uint8_t MAX_RCV_IMP = 9;
+const uint8_t rcv_imp_array[] = {
+ 120,
+ 80,
+ 60,
+ 48,
+ 40,
+ 34,
+ 30,
+ 20,
+ 15
+ };
+
+extern "C"
+{
+/**
+ * @brief configures PC_VREF_DRV_CONTROL registers to vary the DRAM VREF
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port MBA Port
+ * @param[in] i_wr_dram_vref DRAM VREF to set
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode config_wr_dram_vref(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint32_t i_wr_dram_vref);
+
+/**
+ * @brief configures read vref registers to vary the CEN VREF
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port MBA Port
+ * @param[in] i_rd_cen_vref CEN VREF to set
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode config_rd_cen_vref(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint32_t i_rd_cen_vref);
+
+/**
+ * @brief configures the Driver impedance values to the registers
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port MBA Port
+ * @param[in] i_drv_imp_dq_dqs Driver impedance values
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode config_drv_imp(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_drv_imp_dq_dqs);
+
+/**
+ * @brief configures the Receiver impedance values to the registers
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port MBA Port
+ * @param[in] i_rcv_imp_dq_dqs Receiver impedance values
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode config_rcv_imp(const fapi::Target & i_target_mba,
+ uint8_t i_port,
+ uint8_t i_rcv_imp_dq_dqs);
+
+/**
+ * @brief configures the Slew rate values to the registers
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ * @param[in] i_port MBA Port
+ * @param[in] i_slew_type Slew Type
+ * @param[in] i_slew_imp Slew Impedance
+ * @param[in] i_slew_rate Slew Rate
+ *
+ * @return ReturnCode
+ */
fapi::ReturnCode config_slew_rate(const fapi::Target & i_target_mba,
- const uint8_t i_port, const uint8_t i_slew_type, const uint8_t i_slew_imp,
- const uint8_t i_slew_rate);
-fapi::ReturnCode mss_slew_cal(const fapi::Target & i_target_mba);
-} // extern C
-#endif
+ const uint8_t i_port,
+ const uint8_t i_slew_type,
+ const uint8_t i_slew_imp,
+ const uint8_t i_slew_rate);
+
+/**
+ * @brief runs the slew calibration engine
+ *
+ * Configures MSS_SLEW_DATA/ADR attributes and calls config_slew_rate to set
+ * the slew rate in the registers.
+ *
+ * @param[in] i_target_mba Reference to centaur.mba target
+ *
+ * @return ReturnCode
+ */
+fapi::ReturnCode mss_slew_cal(const fapi::Target & i_target_mba);
+
+} // extern C
+#endif
diff --git a/src/usr/hwpf/hwp/initfiles/cen_ddrphy.initfile b/src/usr/hwpf/hwp/initfiles/cen_ddrphy.initfile
index e3507a0b9..86fdfbb2c 100755
--- a/src/usr/hwpf/hwp/initfiles/cen_ddrphy.initfile
+++ b/src/usr/hwpf/hwp/initfiles/cen_ddrphy.initfile
@@ -1,4 +1,4 @@
-#-- $Id: cen_ddrphy.initfile,v 1.29 2014/01/14 02:24:08 mwuu Exp $
+#-- $Id: cen_ddrphy.initfile,v 1.30 2014/01/23 01:33:13 mwuu Exp $
#-- $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/
#-- centaur/working/procedures/ec_ind/scoms/cen_ddrphy.initfile,v $
#
@@ -6,6 +6,7 @@
#--------------------------------------------------------------------------------
#-- Version:|Author: | Date: | Comment:
#-- --------|--------|--------|--------------------------------------------------
+# 1.30|mwuu |01/22/14|Changed DIMM_TYPE fix for DDR4 CDIMM
# 1.29|mwuu |01/14/14|Added VPD attributes for TSYS_ADR, TSYS_DP18,
# | | |changed DIMM_TYPE for obsolete CDIMM enum
# 1.28|mwuu |11/22/13|Update for VPD attributes
@@ -175,7 +176,7 @@ define def_not_ddr4 = (ATTR_EFF_DRAM_GEN != ENUM_ATTR_EFF_DRAM_GEN_DDR4) ; # not
# shorter test for DIMM type
define def_is_rdimm = (ATTR_EFF_DIMM_TYPE == ENUM_ATTR_EFF_DIMM_TYPE_RDIMM) ; # RDIMM = 1
-define def_is_udimm = (ATTR_EFF_DIMM_TYPE == ENUM_ATTR_EFF_DIMM_TYPE_UDIMM) ; # UDIMM = 2
+#define def_is_udimm = (ATTR_EFF_DIMM_TYPE == ENUM_ATTR_EFF_DIMM_TYPE_UDIMM) ; # UDIMM = 2
define def_is_lrdimm = (ATTR_EFF_DIMM_TYPE == ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM) ; # LRDIMM = 3
# shorter test for DRAM width
@@ -294,7 +295,7 @@ define def_cdi_spcke_ohm40_p1 = (ATTR_VPD_CEN_DRV_IMP_SPCKE[1] == ENUM_ATTR_VPD_
define def_is_type1 = ((ATTR_MSS_DQS_SWIZZLE_TYPE == 1) && (ATTR_EFF_CUSTOM_DIMM != ENUM_ATTR_EFF_CUSTOM_DIMM_YES));
# remove dimm_type == cdimm later
-define def_is_custom = ((ATTR_EFF_CUSTOM_DIMM == ENUM_ATTR_EFF_CUSTOM_DIMM_YES) && (def_is_udimm));
+define def_is_custom = (ATTR_EFF_CUSTOM_DIMM == ENUM_ATTR_EFF_CUSTOM_DIMM_YES);
# define for 2 cycle addressing mode (2N)
define def_2N_mode = (ATTR_VPD_DRAM_2N_MODE_ENABLED == ENUM_ATTR_VPD_DRAM_2N_MODE_ENABLED_TRUE) ;
@@ -460,7 +461,7 @@ scom 0x8000C00D0301143F {
# 59:61 , 0b101 , ((def_is_rdimm) && (def_is_ddr4)) ; # DDR4 RDIMM
# 59:61 , 0b111 , ((def_is_lrdimm) && (def_is_ddr4)) ; # DDR4 LRDIMM
# 62 , 0b1 , any ; # DDR4 Latency Chicken SW
-# 63 , 0b0 , any ; # Retain_Percal_SW
+# 63 , 0b0 , any ; # Retrain_Percal_SW
}
# DPHY01.DDRPHY_PC_CONFIG1_P1
diff --git a/src/usr/hwpf/hwp/mc_config/mss_eff_config/memory_mss_bulk_pwr_throttles.xml b/src/usr/hwpf/hwp/mc_config/mss_eff_config/memory_mss_bulk_pwr_throttles.xml
index 7f89a87da..2a255fa33 100644
--- a/src/usr/hwpf/hwp/mc_config/mss_eff_config/memory_mss_bulk_pwr_throttles.xml
+++ b/src/usr/hwpf/hwp/mc_config/mss_eff_config/memory_mss_bulk_pwr_throttles.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- IBM CONFIDENTIAL -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2013 -->
+<!-- COPYRIGHT International Business Machines Corp. 2013,2014 -->
<!-- -->
<!-- p1 -->
<!-- -->
@@ -21,16 +21,25 @@
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
<hwpErrors>
-<!-- $Id: memory_mss_bulk_pwr_throttles.xml,v 1.2 2013/11/14 17:29:18 pardeik Exp $ -->
+<!-- $Id: memory_mss_bulk_pwr_throttles.xml,v 1.3 2014/01/24 21:56:55 pardeik Exp $ -->
<!-- For file ../../ipl/fapi/mss_bulk_pwr_throttles.C -->
-<!-- // *! OWNER NAME : Joab Henderson Email: joabhend@us.ibm.com -->
-<!-- // *! BACKUP NAME : Michael Pardeik Email: pardeik@us.ibm.com -->
+<!-- // *! OWNER NAME : Michael Pardeik Email: pardeik@us.ibm.com -->
+<!-- // *! BACKUP NAME : Jacob Sloat Email: jdsloat@us.ibm.com -->
<!-- Original Source for RC_MSS_NOT_ENOUGH_AVAILABLE_DIMM_POWER memory_errors.xml -->
<hwpError>
<rc>RC_MSS_NOT_ENOUGH_AVAILABLE_DIMM_POWER</rc>
<description>Unable to find throttle setting that has DIMM power underneath the limit. Callout Firmware.</description>
+ <ffdc>PAIR_POWER</ffdc>
+ <ffdc>PAIR_WATT_TARGET</ffdc>
+ <callout>
+ <target>MEMBUF_CHIP</target>
+ <priority>MEDIUM</priority>
+ </callout>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
</hwpError>
-
</hwpErrors>
diff --git a/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_bulk_pwr_throttles.C b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_bulk_pwr_throttles.C
index 33d02501c..eadd4ff93 100644
--- a/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_bulk_pwr_throttles.C
+++ b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_bulk_pwr_throttles.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_bulk_pwr_throttles.C,v 1.18 2014/01/23 17:32:43 pardeik Exp $
+// $Id: mss_bulk_pwr_throttles.C,v 1.19 2014/01/24 21:57:28 pardeik Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/
// centaur/working/procedures/ipl/fapi/mss_bulk_pwr_throttles.C,v $
//------------------------------------------------------------------------------
@@ -71,6 +71,7 @@
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
+// 1.19 | pardeik |24-JAN-14| RAS update for HWP error
// 1.18 | pardeik |23-JAN-14| gerrit review updates to break out of for loop
// 1.17 | pardeik |21-JAN-14| updates to prevent a negative power limit
// 1.16 | pardeik |06-JAN-14| use max utiliation from MRW for MAX_UTIL
@@ -431,6 +432,9 @@ extern "C" {
// return error for TMGT to handle if there is not enough available memory power
// at the minimum utilization throttle setting
FAPI_ERR("Not enough available memory power [Channel Pair Power %4.2f/%d cW]", channel_pair_power, channel_pair_watt_target);
+ const float & PAIR_POWER = channel_pair_power;
+ const uint32_t & PAIR_WATT_TARGET = channel_pair_watt_target;
+ const fapi::Target & MEMBUF_CHIP = target_chip;
FAPI_SET_HWP_ERROR(rc, RC_MSS_NOT_ENOUGH_AVAILABLE_DIMM_POWER);
return rc;
}
OpenPOWER on IntegriCloud