Skip to content

Commit df80bf4

Browse files
devonbaughencrgeddes
authored andcommitted
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 <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/84891 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>
1 parent e3407c1 commit df80bf4

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct fields
6565
static constexpr mss::field_t<mss::endian::BIG> DFE_DISABLE{0, 0, 1};
6666
static constexpr mss::field_t<mss::endian::BIG> LANE_MODE{0, 1, 3};
6767
static constexpr mss::field_t<mss::endian::BIG> SERDES_FREQ{0, 4, 4};
68+
static constexpr mss::field_t<mss::endian::BIG> ADAPTATION_MODE{1, 0, 1};
6869
static constexpr mss::field_t<mss::endian::BIG> FW_MODE{1, 1, 2};
6970
static constexpr mss::field_t<mss::endian::BIG> LOOPBACK_TEST{1, 3, 1};
7071
static constexpr mss::field_t<mss::endian::BIG> TRANSPORT_LAYER{1, 4, 2};
@@ -182,6 +183,20 @@ struct fieldTraits<fields::FW_MODE>
182183
using COMPARISON_OP = std::less_equal<T>;
183184
};
184185

186+
///
187+
/// @class fieldTraits - ADAPTATION_MODE specialization
188+
/// @brief Traits assoiated with the Explorer I2C commands
189+
///
190+
template <>
191+
struct fieldTraits<fields::ADAPTATION_MODE>
192+
{
193+
static constexpr uint8_t COMPARISON_VAL = 0x01;
194+
static constexpr const char* FIELD_STR = "Adaptation Mode";
195+
196+
template <typename T>
197+
using COMPARISON_OP = std::less_equal<T>;
198+
};
199+
185200
///
186201
/// @class fieldTraits - CMD_ID specialization
187202
/// @brief Traits assoiated with the Explorer I2C commands
@@ -380,6 +395,33 @@ inline fapi2::ReturnCode set_dl_layer_boot_mode(const fapi2::Target<fapi2::TARGE
380395
return set_field<fields::DL_LAYER_BOOT_MODE>(i_target, io_data, i_setting);
381396
}
382397

398+
/// @brief ADAPTATION_MODE getter
399+
/// @param[in] i_target the OCMB target
400+
/// @param[in] i_data the buffer as a reference to a vector
401+
/// @param[out] o_setting
402+
/// @return FAPI2_RC_SUCCESS iff okay
403+
///
404+
inline fapi2::ReturnCode get_adaptation_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
405+
const std::vector<uint8_t>& i_data,
406+
uint8_t& o_setting)
407+
{
408+
return get_field<fields::ADAPTATION_MODE>(i_target, i_data, o_setting);
409+
}
410+
411+
///
412+
/// @brief ADAPTATION_MODE setter
413+
/// @param[in] i_target the OCMB target
414+
/// @param[in,out] io_data the buffer as a reference to a vector
415+
/// @param[in] i_setting the value to set
416+
/// @return FAPI2_RC_SUCCESS iff okay
417+
///
418+
inline fapi2::ReturnCode set_adaptation_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
419+
std::vector<uint8_t>& io_data,
420+
const uint8_t i_setting)
421+
{
422+
return set_field<fields::ADAPTATION_MODE>(i_target, io_data, i_setting);
423+
}
424+
383425
///
384426
/// @brief DL_LAYER_BOOT_MODE getter
385427
/// @param[in] i_target the OCMB target

src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ fapi2::ReturnCode setup_fw_boot_config( const fapi2::Target<fapi2::TARGET_TYPE_O
102102
uint8_t l_dl_layer_boot_mode = 0;
103103
uint8_t l_dfe_disable = 0;
104104
uint8_t l_lane_mode = 0;
105+
uint8_t l_adaptation_mode = 0;
105106
uint32_t l_omi_freq = 0;
106107

107108
const auto& l_proc = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
108109

109110
// Read the EXP_FW_BOOT_CONFIG from the attributes
111+
FAPI_TRY(mss::attr::get_ocmb_exp_boot_config_adaptation_mode(i_target, l_adaptation_mode));
112+
110113
FAPI_TRY(mss::attr::get_ocmb_exp_boot_config_fw_mode(i_target, l_fw_mode));
111114

112115
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<fapi2::TARGET_TYPE_O
133136
FAPI_TRY(mss::exp::i2c::boot_cfg::set_transport_layer( i_target, o_data, l_transport_layer ));
134137
FAPI_TRY(mss::exp::i2c::boot_cfg::set_loopback_test( i_target, o_data, l_loopback_test ));
135138
FAPI_TRY(mss::exp::i2c::boot_cfg::set_fw_mode( i_target, o_data, l_fw_mode ));
139+
FAPI_TRY(mss::exp::i2c::boot_cfg::set_adaptation_mode( i_target, o_data, l_adaptation_mode ));
136140

137141
fapi_try_exit:
138142
return fapi2::current_err;

src/import/chips/ocmb/explorer/procedures/xml/attribute_info/exp_omi_train.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,19 @@
156156
<mssAccessorName>ocmb_exp_boot_config_serdes_frequency</mssAccessorName>
157157
</attribute>
158158

159+
<attribute>
160+
<id>ATTR_MSS_OCMB_EXP_BOOT_CONFIG_ADAPTATION_MODE</id>
161+
<targetType>TARGET_TYPE_OCMB_CHIP</targetType>
162+
<description>
163+
Indicates whether to enable adaptation
164+
</description>
165+
<valueType>uint8</valueType>
166+
<enum>
167+
DISABLE = 0,
168+
ENABLE = 1
169+
</enum>
170+
<default>ENABLE</default>
171+
<platInit/>
172+
<mssAccessorName>ocmb_exp_boot_config_adaptation_mode</mssAccessorName>
173+
</attribute>
159174
</attributes>

0 commit comments

Comments
 (0)