From 7ac1d851fdfe0b247fea4c1e3943811d08221f0a Mon Sep 17 00:00:00 2001 From: Matt Ploetz Date: Mon, 29 Jul 2013 11:27:07 -0500 Subject: Integrate HWP io_pre_trainadv and io_post_trainadv Change-Id: Iea6f4fee71070d8dce1f5af74006f9f12005c7c3 RTC: 71685 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5624 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/hwp/bus_training/io_post_trainadv.C | 115 +++++++++++++++++++++++ src/usr/hwpf/hwp/bus_training/io_post_trainadv.H | 53 +++++++++++ src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C | 115 +++++++++++++++++++++++ src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H | 54 +++++++++++ src/usr/hwpf/hwp/bus_training/makefile | 2 + 5 files changed, 339 insertions(+) create mode 100644 src/usr/hwpf/hwp/bus_training/io_post_trainadv.C create mode 100644 src/usr/hwpf/hwp/bus_training/io_post_trainadv.H create mode 100644 src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C create mode 100644 src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H (limited to 'src/usr/hwpf/hwp/bus_training') diff --git a/src/usr/hwpf/hwp/bus_training/io_post_trainadv.C b/src/usr/hwpf/hwp/bus_training/io_post_trainadv.C new file mode 100644 index 000000000..7a6314cef --- /dev/null +++ b/src/usr/hwpf/hwp/bus_training/io_post_trainadv.C @@ -0,0 +1,115 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/bus_training/io_post_trainadv.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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: io_post_trainadv.C,v 1.1 2013/05/10 20:06:00 thomsen Exp $ +//*!*************************************************************************** +// *! (C) Copyright International Business Machines Corp. 1997, 1998 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//*!*************************************************************************** +// *! FILENAME : io_post_trainadv.C +// *! TITLE : +// *! DESCRIPTION : The purpose of this code is to allow for future post-training activity such as Host-based characterization +// *! CONTEXT : +// *! +// *! OWNER NAME : Varghese, Varkey Email: varkey.kv@in.ibm.com +// *! BACKUP NAME : Swaminathan, Janani Email: jaswamin@in.ibm.com +// *! +//*!*************************************************************************** +// CHANGE HISTORY: +//----------------------------------------------------------------------------- +// Version:|Author: | Date: | Comment: +// --------|--------|--------|------------------------------------------------- +// 1.1 |thomsen |05/10/13| Initial empty shell +//----------------------------------------------------------------------------- + +#include +#include "io_post_trainadv.H" +#include "gcr_funcs.H" + +extern "C" { + + +using namespace fapi; +//================================================================================================================================ +// These functions work on a pair of targets. One is the master side of the bus interface, the other the slave side. For eg; in EDI(DMI2)PU is the master and Centaur is the slave +// In EI4 both sides have pu targets +ReturnCode io_post_trainadv(const Target& target){ + ReturnCode rc; + //uint32_t master_group=0; + FAPI_DBG("Running IO POST TRAINING ADVANCED PROCEDURE"); + // ____ __ _______ + // / __ \/ |/ / _/ + // / / / / /|_/ // / + // / /_/ / / / // / + // /_____/_/ /_/___/ + if( (target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET )){ + FAPI_DBG("This is a Processor DMI bus post training invocation using base DMI scom address"); + //master_interface=CP_IOMC0_P0; // base scom for MC bus + //master_group=3; // Design requires us to do this as per scom map and layout + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + else if( (target.getType() == fapi::TARGET_TYPE_MEMBUF_CHIP)){ + FAPI_DBG("This is a Centaur DMI bus post training invocation using base DMI scom address"); + //master_interface=CEN_DMI; // base scom for CEN + //master_group=0; + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + // + // | |/ // / + // | // __ \/ / / / ___/ + // / |/ /_/ / /_/ (__ ) + // /_/|_/_.___/\__,_/____/ + else if( (target.getType() == fapi::TARGET_TYPE_XBUS_ENDPOINT )){ + FAPI_DBG("This is a X Bus post training invocation"); + //master_interface=CP_FABRIC_X0; // base scom for X bus + //master_group=0; // Design requires us to do this as per scom map and layout + if(rc.ok()){ + // No Z cal in EI4/X bus design + for(int i=0;i<5;++i){ + //master_group=i; + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + } + } + // ___ __ + // / | / /_ __ _______ + // / /| | / __ \/ / / / ___/ + // / ___ |/ /_/ / /_/ (__ ) + // /_/ |_/_.___/\__,_/____/ + else if( (target.getType() == fapi::TARGET_TYPE_ABUS_ENDPOINT )){ + FAPI_DBG("This is an A Bus post training invocation"); + //master_interface=CP_FABRIC_A0; // base scom for A bus , assume translation to A1 by PLAT + //master_group=0; // Design requires us to do this as per scom map and layout + // EDI-A bus needs both impedance cal and offset cal + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);} + } + else{ + FAPI_ERR("Invalid io_post_trainadv HWP invocation . Target doesnt belong to DMI/X/A instances"); + // ADD THIS WHEN IMPLEMENTING FUNCTION: FAPI_SET_HWP_ERROR(rc, IO_post_TRAINADV_INVALID_INVOCATION_RC); + } + return rc; +} +//================================================================================================================================ + + +} //end extern C diff --git a/src/usr/hwpf/hwp/bus_training/io_post_trainadv.H b/src/usr/hwpf/hwp/bus_training/io_post_trainadv.H new file mode 100644 index 000000000..18e07a896 --- /dev/null +++ b/src/usr/hwpf/hwp/bus_training/io_post_trainadv.H @@ -0,0 +1,53 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/bus_training/io_post_trainadv.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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: io_post_trainadv.H,v 1.1 2013/05/10 20:05:59 thomsen Exp $ +#ifndef IO_POST_TRAINADV_H_ +#define IO_POST_TRAINADV_H_ + +#include + +using namespace fapi; + +/** + * io_post_trainadv HWP func pointer typedef + * + */ +typedef fapi::ReturnCode (*io_post_trainadv_FP_t)(const fapi::Target &target); + +extern "C" +{ + +/** + * io_post_trainadv HWP + * + * master_target is any IO target P8 MCS,XBUS,Abus or centaur + * + * + * + * + */ + +fapi::ReturnCode io_post_trainadv(const fapi::Target &target); + +} // extern "C" +#endif // io_post_trainadv_H_ diff --git a/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C b/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C new file mode 100644 index 000000000..e0911e90a --- /dev/null +++ b/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C @@ -0,0 +1,115 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/bus_training/io_pre_trainadv.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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: io_pre_trainadv.C,v 1.1 2013/05/10 20:05:59 thomsen Exp $ +// *!*************************************************************************** +// *! (C) Copyright International Business Machines Corp. 1997, 1998 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +// *!*************************************************************************** +// *! FILENAME : io_pre_trainadv.C +// *! TITLE : +// *! DESCRIPTION : The purpose of this code is to allow for future pre-training activity such as Host-based characterization +// *! CONTEXT : +// *! +// *! OWNER NAME : Varghese, Varkey Email: varkey.kv@in.ibm.com +// *! BACKUP NAME : Swaminathan, Janani Email: jaswamin@in.ibm.com +// *! +// *!*************************************************************************** +// CHANGE HISTORY: +//------------------------------------------------------------------------------ +// Version:|Author: | Date: | Comment: +// --------|--------|--------|-------------------------------------------------- +// 1.1 |thomsen |05/10/13| Initial empty shell +//------------------------------------------------------------------------------ + +#include +#include "io_pre_trainadv.H" +#include "gcr_funcs.H" + +extern "C" { + + +using namespace fapi; +//================================================================================================================================ +// These functions work on a pair of targets. One is the master side of the bus interface, the other the slave side. For eg; in EDI(DMI2)PU is the master and Centaur is the slave +// In EI4 both sides have pu targets +ReturnCode io_pre_trainadv(const Target& target){ + ReturnCode rc; + //uint32_t master_group=0; + FAPI_DBG("Running IO PRE TRAINING ADVANCED PROCEDURE"); + // ____ __ _______ + // / __ \/ |/ / _/ + // / / / / /|_/ // / + // / /_/ / / / // / + // /_____/_/ /_/___/ + if( (target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET )){ + FAPI_DBG("This is a Processor DMI bus pre training invocation using base DMI scom address"); + //master_interface=CP_IOMC0_P0; // base scom for MC bus + //master_group=3; // Design requires us to do this as per scom map and layout + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + else if( (target.getType() == fapi::TARGET_TYPE_MEMBUF_CHIP)){ + FAPI_DBG("This is a Centaur DMI bus pre training invocation using base DMI scom address"); + //master_interface=CEN_DMI; // base scom for CEN + //master_group=0; + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + // _ __ __ + // | |/ // /_ __ _______ + // | // __ \/ / / / ___/ + // / |/ /_/ / /_/ (__ ) + // /_/|_/_.___/\__,_/____/ + else if( (target.getType() == fapi::TARGET_TYPE_XBUS_ENDPOINT )){ + FAPI_DBG("This is a X Bus pre training invocation"); + //master_interface=CP_FABRIC_X0; // base scom for X bus + //master_group=0; // Design requires us to do this as per scom map and layout + if(rc.ok()){ + // No Z cal in EI4/X bus design + for(int i=0;i<5;++i){ + //master_group=i; + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + } + } + // ___ __ + // / | / /_ __ _______ + // / /| | / __ \/ / / / ___/ + // / ___ |/ /_/ / /_/ (__ ) + // /_/ |_/_.___/\__,_/____/ + else if( (target.getType() == fapi::TARGET_TYPE_ABUS_ENDPOINT )){ + FAPI_DBG("This is an A Bus pre training invocation"); + //master_interface=CP_FABRIC_A0; // base scom for A bus , assume translation to A1 by PLAT + //master_group=0; // Design requires us to do this as per scom map and layout + // EDI-A bus needs both impedance cal and offset cal + // USER CODE HERE: ex. rc=run_offset_cal(target,master_interface,master_group);if (rc) {return(rc);}; + } + else{ + FAPI_ERR("Invalid io_pre_trainadv HWP invocation . Target doesnt belong to DMI/X/A instances"); + // ADD THIS WHEN IMPLEMENTING FUNCTION: FAPI_SET_HWP_ERROR(rc, IO_PRE_TRAINADV_INVALID_INVOCATION_RC); + } + return rc; +} +//================================================================================================================================ + + +} //end extern C diff --git a/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H b/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H new file mode 100644 index 000000000..3f49fc2e6 --- /dev/null +++ b/src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H @@ -0,0 +1,54 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/bus_training/io_pre_trainadv.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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: io_pre_trainadv.H,v 1.1 2013/05/10 20:05:59 thomsen Exp $ +#ifndef IO_PRE_TRAINADV_H_ +#define IO_PRE_TRAINADV_H_ + +#include + +using namespace fapi; + +/** + * io_pre_trainadv HWP func pointer typedef + * + */ +typedef fapi::ReturnCode (*io_pre_trainadv_FP_t)(const fapi::Target &target); + +extern "C" +{ + +/** + * io_pre_trainadv HWP + * + * master_target is any IO target P8 MCS,XBUS,Abus or centaur + * + * + * + * + */ + +fapi::ReturnCode io_pre_trainadv(const fapi::Target &target); + +} // extern "C" +#endif // io_pre_trainadv_H_ + diff --git a/src/usr/hwpf/hwp/bus_training/makefile b/src/usr/hwpf/hwp/bus_training/makefile index da43662fc..20fa0afbb 100644 --- a/src/usr/hwpf/hwp/bus_training/makefile +++ b/src/usr/hwpf/hwp/bus_training/makefile @@ -44,6 +44,8 @@ OBJS = gcr_funcs.o io_funcs.o io_run_training.o pbusLinkSvc.o proc_fab_smp.o \ erepairAccessorHwpFuncs.o \ erepairGetFailedLanesHwp.o \ erepairSetFailedLanesHwp.o \ + io_post_trainadv.o \ + io_pre_trainadv.o ## NOTE: add a new directory onto the vpaths when you add a new HWP -- cgit v1.2.1