Skip to content

Commit

Permalink
add function to turn on adaptation in bootconfig
Browse files Browse the repository at this point in the history
Change-Id: Ia5602d413250f1fbbb23d50b113f245526e3bf54
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84744
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Dev-Ready: Devon A Baughen <devon.baughen1@ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84890
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
  • Loading branch information
devonbaughen authored and RAJA DAS committed Oct 21, 2019
1 parent 9a430dd commit c6c08ec
Showing 1 changed file with 42 additions and 0 deletions.
Expand Up @@ -65,6 +65,7 @@ struct fields
static constexpr mss::field_t<mss::endian::BIG> DFE_DISABLE{0, 0, 1};
static constexpr mss::field_t<mss::endian::BIG> LANE_MODE{0, 1, 3};
static constexpr mss::field_t<mss::endian::BIG> SERDES_FREQ{0, 4, 4};
static constexpr mss::field_t<mss::endian::BIG> ADAPTATION_MODE{1, 0, 1};
static constexpr mss::field_t<mss::endian::BIG> FW_MODE{1, 1, 2};
static constexpr mss::field_t<mss::endian::BIG> LOOPBACK_TEST{1, 3, 1};
static constexpr mss::field_t<mss::endian::BIG> TRANSPORT_LAYER{1, 4, 2};
Expand Down Expand Up @@ -182,6 +183,20 @@ struct fieldTraits<fields::FW_MODE>
using COMPARISON_OP = std::less_equal<T>;
};

///
/// @class fieldTraits - ADAPTATION_MODE specialization
/// @brief Traits assoiated with the Explorer I2C commands
///
template <>
struct fieldTraits<fields::ADAPTATION_MODE>
{
static constexpr uint8_t COMPARISON_VAL = 0x01;
static constexpr const char* FIELD_STR = "Adaptation Mode";

template <typename T>
using COMPARISON_OP = std::less_equal<T>;
};

///
/// @class fieldTraits - CMD_ID specialization
/// @brief Traits assoiated with the Explorer I2C commands
Expand Down Expand Up @@ -380,6 +395,33 @@ inline fapi2::ReturnCode set_dl_layer_boot_mode(const fapi2::Target<fapi2::TARGE
return set_field<fields::DL_LAYER_BOOT_MODE>(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<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::vector<uint8_t>& i_data,
uint8_t& o_setting)
{
return get_field<fields::ADAPTATION_MODE>(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<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
std::vector<uint8_t>& io_data,
const uint8_t i_setting)
{
return set_field<fields::ADAPTATION_MODE>(i_target, io_data, i_setting);
}

///
/// @brief DL_LAYER_BOOT_MODE getter
/// @param[in] i_target the OCMB target
Expand Down

0 comments on commit c6c08ec

Please sign in to comment.