From df80bf43c740bd6a46e186353a85257ab6702539 Mon Sep 17 00:00:00 2001 From: Devon Baughen Date: Thu, 3 Oct 2019 12:24:38 -0400 Subject: add function to turn on adaptation in bootconfig Change-Id: Ia5602d413250f1fbbb23d50b113f245526e3bf54 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84744 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: PPE CI Dev-Ready: Devon A Baughen Reviewed-by: STEPHEN GLANCY Reviewed-by: Louis Stermole Tested-by: Hostboot CI Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84891 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R Geddes --- .../procedures/hwp/memory/lib/i2c/exp_i2c_fields.H | 42 ++++++++++++++++++++++ .../procedures/hwp/memory/lib/omi/exp_omi_utils.C | 4 +++ 2 files changed, 46 insertions(+) (limited to 'src/import/chips/ocmb/explorer/procedures/hwp') diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H index 9d2181b12..a11f0a03d 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H @@ -65,6 +65,7 @@ struct fields static constexpr mss::field_t DFE_DISABLE{0, 0, 1}; static constexpr mss::field_t LANE_MODE{0, 1, 3}; static constexpr mss::field_t SERDES_FREQ{0, 4, 4}; + static constexpr mss::field_t ADAPTATION_MODE{1, 0, 1}; static constexpr mss::field_t FW_MODE{1, 1, 2}; static constexpr mss::field_t LOOPBACK_TEST{1, 3, 1}; static constexpr mss::field_t TRANSPORT_LAYER{1, 4, 2}; @@ -182,6 +183,20 @@ struct fieldTraits using COMPARISON_OP = std::less_equal; }; +/// +/// @class fieldTraits - ADAPTATION_MODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits +{ + static constexpr uint8_t COMPARISON_VAL = 0x01; + static constexpr const char* FIELD_STR = "Adaptation Mode"; + + template + using COMPARISON_OP = std::less_equal; +}; + /// /// @class fieldTraits - CMD_ID specialization /// @brief Traits assoiated with the Explorer I2C commands @@ -380,6 +395,33 @@ inline fapi2::ReturnCode set_dl_layer_boot_mode(const fapi2::Target(i_target, io_data, i_setting); } +/// @brief ADAPTATION_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_adaptation_mode(const fapi2::Target& i_target, + const std::vector& i_data, + uint8_t& o_setting) +{ + return get_field(i_target, i_data, o_setting); +} + +/// +/// @brief ADAPTATION_MODE setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_adaptation_mode(const fapi2::Target& i_target, + std::vector& io_data, + const uint8_t i_setting) +{ + return set_field(i_target, io_data, i_setting); +} + /// /// @brief DL_LAYER_BOOT_MODE getter /// @param[in] i_target the OCMB target diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.C index 7fcf4362a..47e85362f 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.C @@ -102,11 +102,14 @@ fapi2::ReturnCode setup_fw_boot_config( const fapi2::Target(i_target); // Read the EXP_FW_BOOT_CONFIG from the attributes + FAPI_TRY(mss::attr::get_ocmb_exp_boot_config_adaptation_mode(i_target, l_adaptation_mode)); + FAPI_TRY(mss::attr::get_ocmb_exp_boot_config_fw_mode(i_target, l_fw_mode)); FAPI_TRY(mss::attr::get_ocmb_exp_boot_config_opencapi_loopback_test(i_target, l_loopback_test)); @@ -133,6 +136,7 @@ fapi2::ReturnCode setup_fw_boot_config( const fapi2::Target