/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_generic_shmoo.C $ */ /* */ /* IBM CONFIDENTIAL */ /* */ /* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ /* Object Code Only (OCO) source materials */ /* Licensed Internal Code Source Materials */ /* IBM HostBoot Licensed Internal Code */ /* */ /* The source code for this program is not published or otherwise */ /* divested of its trade secrets, irrespective of what has been */ /* deposited with the U.S. Copyright Office. */ /* */ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ // $Id: mss_generic_shmoo.C,v 1.45 2013/04/23 13:57:28 sasethur Exp $ // *!*************************************************************************** // *! (C) Copyright International Business Machines Corp. 1997, 1998 // *! All Rights Reserved -- Property of IBM // *! *** IBM Confidential *** // *!*************************************************************************** // *! FILENAME : mss_generic_shmoo.C // *! TITLE : MSS Generic Shmoo Implementation // *! DESCRIPTION : Memory Subsystem Generic Shmoo -- abstraction for HB // *! CONTEXT : To make all shmoos share a common abstraction layer // *! // *! OWNER NAME : Abhijit Saurabh Email: abhijit.saurabh@in.ibm.com // *! BACKUP NAME : preetham Email: preeragh@in.ibm.com // *! // *!*************************************************************************** // CHANGE HISTORY: //------------------------------------------------------------------------------ // Version:|Author: | Date: | Comment: // --------|--------|---------|-------------------------------------------------- // 1.44 |bellows |04/22/13 | fixed fw comments // 1.43 |bellows |04/11/13 | quick fix for firmware delivery. Uninitialized varialbles: i_mcbtest, i_mcbpatt // 1.42 |abhijit |04/09/13 | added shmoo param // 1.40 |abhijit |03/22/13 | Fixed boundary checks // 1.38 |abhijit |03/19/13 | included spare byte and ECC and fixed printing for RD_EYE // 1.36 |abhijit |03/19/13 | changed mcbist call position // 1.35 |abhijit |03/16/13 | fixed clearing of error map regs for mba23 // 1.32 |abhijit |03/12/13 | new parallel schmoo under dev // 1.27 |abhijit |01/21/13 | fixed ISDIMM mapping need some workaround // 1.26 |abhijit |01/21/13 | fixed fw comments // 1.25 |abhijit |01/21/13 | fixed the constructor definition // 1.21 |sasethur|01/17/13 | Updated for sanity mcbist function // 1.20 |abhijit |01/11/13 | Updated for change in setup_mcbist function // 1.19 |aditya |01/07/13 | Updated for change in setup_mcbist function // 1.18 |sasethur|14-DEC-12| Updated for change in access delay function // 1.16 |sasethur|14-DEC-12| Updated for Warning // 1.15 |abhijit |13-DEC-12| Updated for FW review comments // 1.14 |abhijit |06-DEC-12| Fixed more FW review comments // 1.12 |abhijit |15-Nov-12| Fixed FW review comments // 1.11 |abhijit |29-Oct-12| added change for ISDIMM checker DQS. // 1.9 |abhijit |22-Oct-12| added Write and read DQS. // 1.8 |abhijit |15-Oct-12|Updated multiple changes // 1.0 |varkeykv|27-Sep-11|Initial check in //------------------------------------------------------------------------------ #include #include "mss_generic_shmoo.H" #include "mss_mcbist.H" #include #include extern "C" { using namespace fapi; // START IMPLEMENTATION OF generic_shmoo CLASS METHODS //! shmoo_mask - What shmoos do you want to run ... encoded as Hex 0x2,0x4,0x8,0x16 /*------------------------------------------------------------------------------ * constructor: generic_shmoo * Description :Constructor used to initialize variables and do the initial settings * * Parameters: i_target: mba; iv_port: 0, 1 * ---------------------------------------------------------------------------*/ generic_shmoo:: generic_shmoo(uint8_t addr,shmoo_type_t shmoo_mask,shmoo_algorithm_t shmoo_algorithm) { //this->shmoo_mask=shmoo_mask; //! Sets what Shmoos the caller wants to run this->algorithm=shmoo_algorithm ; this->iv_addr=addr ; //iv_MAX_RANKS=8; iv_MAX_BYTES=10; iv_DQS_ON=0; iv_pattern=0; iv_test_type=0; iv_dmm_type=0; iv_shmoo_param=0; for(int p=0;p3){ l_nibble_is=1; }else{ l_nibble_is=0; } //FAPI_INF("\n the final byte and nibble is %d and %d for rank=%d \n",l_byte_is,l_nibble_is,i_rank); if( mcbist_error_map [l_p][l_rnk][l_byte_is][l_nibble_is] == 1){ //pass=0; schmoo_error_map[l_p][rank][l_n]=1; //FAPI_INF("We are in error and nibble is %d and rank is %d and port is %d \n",l_n,rank,l_p); } else { //schmoo_error_map[l_p][rank][l_n]=0; //pass=0; //FAPI_INF("We are in error2"); } } else { if( mcbist_error_map [l_p][l_rnk][l_byte][l_nibble] == 1){ //pass=0; schmoo_error_map[l_p][rank][l_n]=1; //FAPI_INF("We are in error and nibble is %d and rank is %d and port is %d \n",l_n,rank,l_p); } else { //schmoo_error_map[l_p][rank][l_n]=0; //pass=0; //FAPI_INF("We are in error2"); } } l_n++; } } } } for (l_p=0;l_pl_max_limit){ schmoo_error_map[l_p][rank][l_n]=1; } l_dq=l_dq+4; } } } rc=do_mcbist_test(i_target); if(rc) { FAPI_ERR("generic_shmoo::find_bound do_mcbist_test failed"); return rc; } rc=check_error_map(i_target,l_p,pass); if(rc) { FAPI_ERR("generic_shmoo::find_bound do_mcbist_test failed"); return rc; } } for (l_p=0;l_p= 20)&&(pass==1));l_current_val-=20) { //use saurabh function for writing here FAPI_INF(" curr val in left = %d and pass=%d ",l_current_val,pass); rc=mss_access_delay_reg(i_target,l_access_type_e,iv_port,0,l_input_type_e,l_dq,0,l_current_val);if(rc) return rc; rc=do_mcbist_test(i_target,rank,byte,nibble,pass); if(rc) { FAPI_ERR("generic_shmoo::find_bound do_mcbist_test failed"); return rc; } } if(!pass) { SHMOO[scenario].MBA.P[iv_port].S[rank].K.lb_regval[l_dq][l_rp]=l_current_val; } FAPI_INF(" left bound = %d ",SHMOO[scenario].MBA.P[iv_port].S[rank].K.rb_regval[l_dq][l_rp]); l_current_val=SHMOO[scenario].MBA.P[iv_port].S[rank].K.nom_val[l_dq][l_rp]; rc=mss_access_delay_reg(i_target,l_access_type_e,iv_port,0,l_input_type_e,l_dq,0,l_current_val);if(rc) return rc; } } else if(bound==RIGHT) { if(algorithm==SEQ_LIN) { l_max_value=SHMOO[scenario].static_knob.max_val; for(l_current_val=SHMOO[scenario].MBA.P[iv_port].S[rank].K.nom_val[l_dq][l_rp];((l_current_val