diff options
author | Chris Steffen <cwsteffen@us.ibm.com> | 2016-07-05 09:26:38 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-08-09 12:12:09 -0400 |
commit | c3e0a9ea1d0d43892cce1c507782b72dfec66494 (patch) | |
tree | 7e65ec06f95cbcf1c4320b56a4e7dc40a76ec9aa /src/import | |
parent | 481d34db3c9cb6fcc016daf5f70f9f8f63791256 (diff) | |
download | talos-hostboot-c3e0a9ea1d0d43892cce1c507782b72dfec66494.tar.gz talos-hostboot-c3e0a9ea1d0d43892cce1c507782b72dfec66494.zip |
Created P9 IO Common Source File
Added source file & makefile to build
Change-Id: I49c6229cc8e2aa5911819e0d2726882956a6e98f
Original-Change-Id: I237cd2a439190f3dcc3f8bd0b09694cad7a64671
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26640
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Christopher W. Steffen <cwsteffen@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28051
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/io/p9_io_common.C | 119 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/io/p9_io_common.mk | 27 |
2 files changed, 146 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_common.C b/src/import/chips/p9/procedures/hwp/io/p9_io_common.C new file mode 100644 index 000000000..108e6df48 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/io/p9_io_common.C @@ -0,0 +1,119 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/io/p9_io_common.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file p9_io_common.C +/// @brief IO Common Functions. +///----------------------------------------------------------------------------- +/// *HWP HWP Owner : Chris Steffen <cwsteffen@us.ibm.com> +/// *HWP HWP Backup Owner : Gary Peterson <garyp@us.ibm.com> +/// *HWP FW Owner : Jamie Knight <rjknight@us.ibm.com> +/// *HWP Team : IO +/// *HWP Level : 3 3 +/// *HWP Consumed by : FSP:HB +///----------------------------------------------------------------------------- +/// +/// @verbatim +/// IO Common Functions +// +/// @endverbatim +///---------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- +#include <p9_io_common.H> +#include <p9_io_scom.H> +#include <p9_io_regs.H> + +//----------------------------------------------------------------------------- +// Function Declarations +//----------------------------------------------------------------------------- +/** + * @brief Shorten timers if we are running in simulation + * a right aligned value. + * @param[in] i_target FAPI2 Target + * @param[in] i_groups Clock groups + * @return Field Data + */ +fapi2::ReturnCode p9_io_xbus_shorten_timers( + const fapi2::Target < fapi2::TARGET_TYPE_XBUS >& i_target, + const std::vector < uint8_t >& i_groups ) +{ + FAPI_IMP( "p9_io_xbus_shorten_timers: I/O EDI+ Xbus Entering" ); + const uint8_t LANE_00 = 0; + uint64_t reg_data = 0; + uint8_t l_is_sim = 0; + + FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_IS_SIMULATION, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), l_is_sim) ); + + if( l_is_sim ) + { + for( auto grp : i_groups ) + { + FAPI_TRY( io::read( EDIP_RX_CTL_MODE7_EO_PG, i_target, grp, LANE_00, reg_data ), + "read edip_rx_ctl_mode7_eo_pg failed" ); + io::set( EDIP_RX_ABORT_CHECK_TIMEOUT_SEL, 0x0, reg_data ); + io::set( EDIP_RX_POLLING_TIMEOUT_SEL, 0x0, reg_data ); + FAPI_TRY( io::write( EDIP_RX_CTL_MODE7_EO_PG, i_target, grp, LANE_00, reg_data ), + "write edip_rx_ctl_mode7_eo_pg failed" ); + + FAPI_TRY( io::rmw( EDIP_RX_SERVO_CHG_CFG, i_target, grp, LANE_00, 0x0 ), + "rmw edip_rx_rx_servo_chg_cfg failed" ); + + + FAPI_TRY( io::read( EDIP_RX_CTL_MODE14_EO_PG, i_target, grp, LANE_00, reg_data ), + "read edip_rx_ctl_mode14_eo_pg failed" ); + io::set( EDIP_RX_AMP_INIT_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_AMP_RECAL_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_PEAK_INIT_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_PEAK_RECAL_TIMEOUT, 0x0, reg_data ); + FAPI_TRY( io::write( EDIP_RX_CTL_MODE14_EO_PG, i_target, grp, LANE_00, reg_data ), + "write edip_rx_ctl_mode14_eo_pg failed" ); + + FAPI_TRY( io::read( EDIP_RX_CTL_MODE15_EO_PG, i_target, grp, LANE_00, reg_data ), + "read edip_rx_ctl_mode15_eo_pg failed" ); + io::set( EDIP_RX_AMIN_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_CM_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_OFF_INIT_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_OFF_RECAL_TIMEOUT, 0x0, reg_data ); + FAPI_TRY( io::write( EDIP_RX_CTL_MODE15_EO_PG, i_target, grp, LANE_00, reg_data ), + "write edip_rx_ctl_mode15_eo_pg failed" ); + + FAPI_TRY( io::read( EDIP_RX_CTL_MODE16_EO_PG, i_target, grp, LANE_00, reg_data ), + "read edip_rx_ctl_mode16_eo_pg failed" ); + io::set( EDIP_RX_AMP_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_BER_TIMEOUT, 0x0, reg_data ); + io::set( EDIP_RX_USERDEF_TIMEOUT, 0x0, reg_data ); + FAPI_TRY( io::write( EDIP_RX_CTL_MODE16_EO_PG, i_target, grp, LANE_00, reg_data ), + "write edip_rx_ctl_mode16_eo_pg failed" ); + } + } + +fapi_try_exit: + FAPI_IMP( "p9_io_xbus_shorten_timers: I/O EDI+ Xbus Exiting" ); + return fapi2::current_err; +} + + diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_common.mk b/src/import/chips/p9/procedures/hwp/io/p9_io_common.mk new file mode 100644 index 000000000..b3c6eae4b --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/io/p9_io_common.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/io/p9_io_common.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2016 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG + +PROCEDURE=p9_io_common +$(call BUILD_PROCEDURE) |