Skip to content

Commit bdca640

Browse files
sglancy6Nicholas E Bofferding
authored andcommitted
Adds Exp FW version check for PHY reset
Change-Id: Ic7b96345c1d970f7cfc89855859248d13b8dfcc3 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/103108 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: NAREN A DEVAIAH <naren.devaiah@in.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/103130 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: Nicholas E Bofferding <bofferdn@us.ibm.com>
1 parent aa7a85e commit bdca640

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,33 @@ fapi_try_exit:
219219
return fapi2::current_err;
220220
}
221221

222+
///
223+
/// @brief Get the firwmare revision based upon the partition that was booted
224+
/// @param[in] i_target OCMB_CHIP target
225+
/// @param[in] o_fw_version the FW version that was booted
226+
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error code
227+
///
228+
inline fapi2::ReturnCode get_booted_fw_version(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
229+
uint32_t& o_fw_version)
230+
{
231+
o_fw_version = 0;
232+
uint32_t l_partition = 0;
233+
234+
FAPI_TRY(mss::attr::get_exp_fw_partition_id(i_target, l_partition));
235+
236+
// If we're the A-side partion, grab the A-side value
237+
if(l_partition == fapi2::ENUM_ATTR_MSS_EXP_FW_PARTITION_ID_A)
238+
{
239+
return mss::attr::get_exp_fw_version_a(i_target, o_fw_version);
240+
}
241+
242+
// Otherwise, return the B-side value
243+
return mss::attr::get_exp_fw_version_b(i_target, o_fw_version);
244+
245+
fapi_try_exit:
246+
return fapi2::current_err;
247+
}
248+
222249
} // ns mss
223250

224251
#endif

src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/phy/exp_phy_reset.C

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <lib/eff_config/explorer_attr_engine_traits.H>
4646
#include <generic/memory/lib/data_engine/data_engine.H>
4747
#include <lib/phy/exp_phy_reset.H>
48+
#include <lib/exp_attribute_accessors_manual.H>
4849

4950
namespace mss
5051
{
@@ -117,9 +118,20 @@ fapi_try_exit:
117118
fapi2::ReturnCode is_reset_supported( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
118119
mss::states& o_is_reset_supported )
119120
{
120-
// TODO:592 Update explorer PHY reset code when Microchip FW supports it
121+
// Microchip FW does not support the PHY reset at a version of CL397559 or lower
122+
constexpr uint32_t PHY_RESET_UNSUPPORTED = 397559;
123+
124+
// Grab the firmware revision that was booted
121125
o_is_reset_supported = mss::states::NO;
122-
return fapi2::FAPI2_RC_SUCCESS;
126+
uint32_t l_fw_revision = 0;
127+
FAPI_TRY(mss::get_booted_fw_version(i_target, l_fw_revision));
128+
129+
// If we're at or below the unsupported value? the reset is unsupported
130+
// Otherwise it's supported
131+
o_is_reset_supported = l_fw_revision <= PHY_RESET_UNSUPPORTED ? mss::states::NO : mss::states::YES;
132+
133+
fapi_try_exit:
134+
return fapi2::current_err;
123135
}
124136

125137
} // ns phy

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@
573573
</description>
574574
<valueType>uint32</valueType>
575575
<initToZero/>
576+
<enum>A = 65, B = 66</enum>
576577
<writeable/>
577578
<mssAccessorName>exp_fw_partition_id</mssAccessorName>
578579
</attribute>

0 commit comments

Comments
 (0)