diff options
author | Stephen Glancy <sglancy@us.ibm.com> | 2018-08-20 14:32:40 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-02-13 10:11:56 -0600 |
commit | 8212d722bc1054b61b066c7464d487dc9d4c29d4 (patch) | |
tree | bc0e5d9b1666cce9c41ebd876ca695c632f1f6b8 /src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C | |
parent | 73bc592f980c06405c4ca5c8bc5d8d738ffeb250 (diff) | |
download | talos-hostboot-8212d722bc1054b61b066c7464d487dc9d4c29d4.tar.gz talos-hostboot-8212d722bc1054b61b066c7464d487dc9d4c29d4.zip |
Adds explorer OMI training code
Change-Id: Ic08c41538ae95b08ce05aa1a2413d45318f3e4ee
Original-Change-Id: Ic4fcd226eea7478ffff6cacb830f8e1e83e6f247
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64919
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: RYAN P. KING <rpking@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71772
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C')
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C new file mode 100644 index 000000000..adcd12f6a --- /dev/null +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C @@ -0,0 +1,80 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_train.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 exp_omi_train.C +/// @brief Contains the explorer OMI train +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 3 +// *HWP Consumed by: Memory + +#include <fapi2.H> +#include <generic/memory/lib/utils/c_str.H> +#include <lib/omi/exp_omi_utils.H> +#include <lib/i2c/exp_i2c.H> +#include <exp_omi_train.H> + +extern "C" +{ + + /// + /// @brief Trains the OCMB link + /// @param[in] i_target the OCMB target to operate on + /// @return FAPI2_RC_SUCCESS iff ok + /// + fapi2::ReturnCode exp_omi_train(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target) + { + // TODO:RTC197867 Update these constants to read out actual values from attributes + constexpr uint8_t MANUFACTURING_MODE_OFF = 0x00; + constexpr uint8_t NO_LOOPBACK_TESTING = 0x00; + constexpr uint8_t OPENCAPI_TRANSPORT_LAYER = 0x00; + constexpr uint8_t IMMEDIATE_DL_LAYER_BOOT = 0x00; + constexpr uint8_t FULL_BOOT_MODE = 0x00; + constexpr uint8_t LANE_MODE_8 = 0x01; + constexpr uint8_t SERDES_25600MBPS = 0x03; + std::vector<uint8_t> l_data; + + // Gets the data setup + FAPI_TRY(mss::exp::omi::train::setup_fw_boot_config(i_target, + MANUFACTURING_MODE_OFF, + NO_LOOPBACK_TESTING, + OPENCAPI_TRANSPORT_LAYER, + IMMEDIATE_DL_LAYER_BOOT, + FULL_BOOT_MODE, + LANE_MODE_8, + SERDES_25600MBPS, + l_data)); + + // Issues the command and checks for completion + // Note: the status check also checks for the OMI training completion, so after we run this command, we're good to go + FAPI_TRY(mss::exp::i2c::boot_config(i_target, l_data)); + + fapi_try_exit: + return fapi2::current_err; + } +} |