Skip to content

Commit

Permalink
Initial mss_field endian modification
Browse files Browse the repository at this point in the history
Change-Id: I93ed2a6a9834af2a233fc06be9727af5d20f0bb8
Original-Change-Id: Ia64288c78b36dc77cd0440a83e859650631e3c06
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65722
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68136
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
aamarin authored and crgeddes committed Oct 30, 2018
1 parent 148e9b6 commit f47ca20
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ namespace i2c
///
/// @class fields
/// @brief Explorer I2C command fields
/// @tparam E Endian type
///
struct fields
{
// First value is byte index, then buffer extract start bit, and extract data length

// Part of EXP_FW_BOOT_CONFIG
static constexpr mss::field_t BOOT_MODE{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 FW_MODE{1, 2, 1};
static constexpr mss::field_t LOOPBACK_TEST{1, 3, 1};
static constexpr mss::field_t TRANSPORT_LAYER{1, 4, 2};
static constexpr mss::field_t DL_LAYER_BOOT_MODE{1, 6, 2};
static constexpr mss::field_t<mss::endian::BIG> BOOT_MODE{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> FW_MODE{1, 2, 1};
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};
static constexpr mss::field_t<mss::endian::BIG> DL_LAYER_BOOT_MODE{1, 6, 2};

// Part of EXP_FW_STATUS
static constexpr mss::field_t CMD_ID{0, 0, 8};
static constexpr mss::field_t STATUS_CODE{1, 0, 8};
static constexpr mss::field_t BOOT_STAGE{2, 6, 2};
static constexpr mss::field_t<mss::endian::BIG> CMD_ID{0, 0, 8};
static constexpr mss::field_t<mss::endian::BIG> STATUS_CODE{1, 0, 8};
static constexpr mss::field_t<mss::endian::BIG> BOOT_STAGE{2, 6, 2};
};

///
/// @class fieldTraits
/// @brief Traits assoiated with the Explorer I2C commands
/// @tparam F the Explorer I2C field
///
template < const field_t& F >
template < const mss::field_t<endian::BIG>& F >
struct fieldTraits;

///
Expand Down Expand Up @@ -230,15 +230,15 @@ struct fieldTraits<fields::BOOT_STAGE>
/// @param[out] o_value the output value received
/// @return FAPI2_RC_SUCCESS iff okay
///
template< const field_t& F,
template< const mss::field_t<endian::BIG>& F,
typename IT,
typename OT,
typename TT = fieldTraits<F> >
inline fapi2::ReturnCode get_field(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::vector<IT>& i_data,
OT& o_value)
{
return mss::get_field<F, TT>(i_target, i_data, EXP_I2C_GET_FIELD, o_value);
return mss::get_field<endian::BIG, F, TT>(i_target, i_data, EXP_I2C_GET_FIELD, o_value);
}

///
Expand All @@ -251,7 +251,7 @@ inline fapi2::ReturnCode get_field(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_C
/// @param[in,out] io_data the buffer as a reference to a vector
/// @return FAPI2_RC_SUCCESS iff okay
///
template< const field_t& F,
template< const mss::field_t<endian::BIG>& F,
typename IT,
typename OT,
typename TT = fieldTraits<F> >
Expand All @@ -260,7 +260,7 @@ inline fapi2::ReturnCode set_field(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_C
const IT i_value)

{
return mss::set_field<F, TT>(i_target, i_value, EXP_I2C_SET_FIELD, io_data);
return mss::set_field<endian::BIG, F, TT>(i_target, i_value, EXP_I2C_SET_FIELD, io_data);
}

namespace boot_cfg
Expand Down

0 comments on commit f47ca20

Please sign in to comment.