summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C64
1 files changed, 19 insertions, 45 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C
index ce9137db9..67ddf14d5 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C
@@ -55,7 +55,7 @@ extern "C"
mss::display_git_commit_info("exp_draminit");
uint32_t l_crc = 0;
- host_fw_command_struct l_cmd;
+ uint8_t l_phy_init_mode = 0;
user_input_msdg l_phy_params;
FAPI_TRY(mss::exp::setup_phy_params(i_target, l_phy_params),
@@ -65,54 +65,28 @@ extern "C"
FAPI_TRY( mss::exp::ib::putUserInputMsdg(i_target, l_phy_params, l_crc),
"Failed putUserInputMsdg() for %s", mss::c_str(i_target) );
- {
- // Issue full boot mode cmd though EXP-FW REQ buffer
- FAPI_TRY( mss::exp::setup_cmd_params(i_target,
- l_crc,
- sizeof(l_phy_params),
- l_cmd) );
- FAPI_TRY( mss::exp::ib::putCMD(i_target, l_cmd),
- "Failed putCMD() for %s", mss::c_str(i_target) );
- }
+ // Get phy init mode attribute
+ FAPI_TRY(mss::attr::get_exp_phy_init_mode(i_target, l_phy_init_mode));
- // Wait a bit for the command (and training) to complete
- // Value based on initial Explorer hardware in Cronus in i2c mode.
- // Training takes ~10ms with no trace, ~450ms with Explorer UART debug
- FAPI_TRY( fapi2::delay( (mss::DELAY_1MS * 8), 200) );
+ // Make sure we're in range
+ FAPI_ASSERT((l_phy_init_mode <= fapi2::ENUM_ATTR_MSS_OCMB_PHY_INIT_MODE_WITH_EYE_CAPTURE),
+ fapi2::MSS_EXP_UNKNOWN_PHY_INIT_MODE()
+ .set_TARGET(i_target)
+ .set_VALUE(l_phy_init_mode),
+ "%s Value for phy init mode for exp_draminit is unknown: %u expected 0 (NORMAL), 1 (WITH_EYE_CAPTURE)",
+ mss::c_str(i_target), l_phy_init_mode);
- // Read the response message from EXP-FW RESP buffer
+ // Call appropriate init function
+ if (l_phy_init_mode == fapi2::ENUM_ATTR_MSS_OCMB_PHY_INIT_MODE_NORMAL)
{
- host_fw_response_struct l_response;
- user_response_msdg l_train_response;
-
- std::vector<uint8_t> l_rsp_data;
- fapi2::ReturnCode l_rc(fapi2::FAPI2_RC_SUCCESS);
-
- FAPI_TRY( mss::exp::ib::getRSP(i_target, l_response, l_rsp_data),
- "Failed getRSP() for %s", mss::c_str(i_target) );
-
- // Proccesses the response data
- FAPI_TRY( mss::exp::read_training_response(i_target, l_rsp_data, l_train_response),
- "Failed read_training_response for %s", mss::c_str(i_target));
-
- // Displays the training response
- FAPI_TRY( mss::exp::train::display_info(i_target, l_train_response));
-
- // Check if cmd was successful
- l_rc = mss::exp::check::response(i_target, l_response, l_cmd);
-
- // If not, then we need to process the bad bitmap
- if(l_rc != fapi2::FAPI2_RC_SUCCESS)
- {
- mss::exp::bad_bit_interface l_interface(l_train_response);
-
- // Record bad bits should only fail if we have an attributes issue - that's a major issue
- FAPI_TRY(mss::record_bad_bits<mss::mc_type::EXPLORER>(i_target, l_interface));
-
- // Now, go to our true error handling procedure
- FAPI_TRY(l_rc, "mss::exp::check::response failed for %s", mss::c_str(i_target));
- }
+ FAPI_TRY(mss::exp::host_fw_phy_normal_init(i_target, l_crc));
}
+ else
+ {
+ FAPI_TRY(mss::exp::host_fw_phy_init_with_eye_capture(i_target, l_crc, l_phy_params));
+ }
+
+ return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
FAPI_INF("Draminit training - %s %s",
OpenPOWER on IntegriCloud