diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H index ae215936e..866e12775 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H @@ -149,6 +149,25 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Checks if the I2C interface returns an ACK +/// @param[in] i_target the OCMB target +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode is_ready(const fapi2::Target& i_target) +{ + // We send a simple but valid command to poll the I2C + // Arbitrarily send an EXP_FW_STATUS command id + size_t l_size = 0; + std::vector l_cmd_id; + fw_status_setup(l_size, l_cmd_id); + + // We just ignore the data. We'll see FAPI2_RC_SUCCESS if + // the I2C returns an ACK. + std::vector l_data; + return fapi2::getI2c(i_target, l_size, l_cmd_id, l_data); +} + }// i2c }// exp }// mss diff --git a/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml b/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml index 05492570b..c5061b457 100644 --- a/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml +++ b/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml @@ -60,4 +60,42 @@ + + RC_MSS_EXP_I2C_POLLING_TIMEOUT + + Polling the explorer I2C slave interface for an ACK + timed out. + + + CODE + MEDIUM + + + TARGET + HIGH + + + TARGET + + + + + RC_MSS_EXP_STATUS_POLLING_TIMEOUT + + Polling the explorer for successful return code + timed out. + + + CODE + MEDIUM + + + TARGET + HIGH + + + TARGET + + + diff --git a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H index 8c3498c23..cb8ff8c70 100644 --- a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H +++ b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H @@ -42,6 +42,42 @@ namespace mss { +/// +/// @brief Common constants +/// +enum common_consts +{ + DEFAULT_POLL_LIMIT = 50, ///< the number of poll attempts in the event we can't calculate another +}; + +/// +/// @brief Common timings +/// +enum common_timings +{ + DELAY_1NS = 1, + DELAY_10NS = 10 , ///< general purpose 10 ns delay for HW mode + DELAY_100NS = 100, ///< general purpose 100 ns delay for HW mode + DELAY_1US = 1000, ///< general purpose 1 usec delay for HW mode + DELAY_10US = 10000, ///< general purpose 1 usec delay for HW mode + DELAY_100US = 100000, ///< general purpose 100 usec delay for HW mode + DELAY_1MS = 1000000, ///< general purpose 1 ms delay for HW mode +}; + +/// +/// @brief Common conversions +/// +enum conversions +{ + CONVERT_PS_IN_A_NS = 1000, ///< 1000 pico in an nano + CONVERT_PS_IN_A_US = 1000000, ///< 1000000 picos in a micro + MHZ_TO_KHZ = 1000, + SEC_IN_HOUR = 60 * 60, ///< seconds in an hour, used for scrub times + NIBBLES_PER_BYTE = 2, + BITS_PER_NIBBLE = 4, + BITS_PER_BYTE = 8, +}; + /// /// @brief FFDC generic codes /// @@ -191,27 +227,6 @@ enum guard_band : uint16_t }// spd -enum conversions -{ - NIBBLES_PER_BYTE = 2, - BITS_PER_NIBBLE = 4, - BITS_PER_BYTE = 8, - - CONVERT_PS_IN_A_NS = 1000, ///< 1000 pico in an nano - CONVERT_PS_IN_A_US = 1000000, ///< 1000000 picos in a micro - - DELAY_1NS = 1, - DELAY_10NS = 10 , ///< general purpose 10 ns delay for HW mode - DELAY_100NS = 100, ///< general purpose 100 ns delay for HW mode - DELAY_1US = 1000, ///< general purpose 1 usec delay for HW mode - DELAY_10US = 10000, ///< general purpose 1 usec delay for HW mode - DELAY_100US = 100000, ///< general purpose 100 usec delay for HW mode - DELAY_1MS = 1000000, ///< general purpose 1 ms delay for HW mode - - MHZ_TO_KHZ = 1000, - SEC_IN_HOUR = 60 * 60, ///< seconds in an hour, used for scrub times -}; - }// mss #endif