diff options
author | Andre Marin <aamarin@us.ibm.com> | 2018-08-09 16:04:51 -0500 |
---|---|---|
committer | Raja Das <rajadas2@in.ibm.com> | 2019-07-26 00:52:21 -0500 |
commit | 17441d0bfa74dc95092fac68a9b1c7f66ba0511f (patch) | |
tree | eed22b5dbdb7c22a5afe84eb92ef572a2da527b2 /src/import/chips | |
parent | 856ef301ba842e7ac87c705ab1864677858bf334 (diff) | |
download | talos-sbe-17441d0bfa74dc95092fac68a9b1c7f66ba0511f.tar.gz talos-sbe-17441d0bfa74dc95092fac68a9b1c7f66ba0511f.zip |
Added I2C fields, EXP_FW_STATUS API
Change-Id: If7a0ae8cf93abda451dacac9fec86c33036d53fa
Original-Change-Id: I827ea3219f60ebcf9951db1ab0feb3421858767f
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63578
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'src/import/chips')
4 files changed, 744 insertions, 0 deletions
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 dc3dc3f7..ae215936 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 @@ -22,3 +22,135 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file exp_i2c.H +/// @brief explorer I2C utility function declarations +/// +// *HWP HWP Owner: Andre A. Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: HB:FSP + +#ifndef _MSS_EXP_I2C_H_ +#define _MSS_EXP_I2C_H_ + +#include <fapi2.H> +#include <i2c_access.H> + +#include <vector> +#include <lib/i2c/exp_i2c_fields.H> + +namespace mss +{ +namespace exp +{ +namespace i2c +{ +namespace check +{ + +/// +/// @brief Checks the I2c explorer status codes +/// @param[in] i_target the OCMB target +/// @param[in] i_cmd_id the command ID +/// @param[in] i_data data to check from EXP_FW_STATUS +/// +inline fapi2::ReturnCode status_code( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const uint8_t i_cmd_id, + const std::vector<uint8_t>& i_data ) +{ + // Set to a high number to make sure check for SUCCESS (== 0) isn't a fluke + size_t l_status = ~(0); + FAPI_TRY( status::get_status_code(i_target, i_data, l_status) ); + + // Technically many cmds have their own status code decoding..but SUCCESS is always 0. + // If it's anything else we can just look up the status code + FAPI_ASSERT( l_status == status_codes::SUCCESS, + fapi2::MSS_EXP_STATUS_CODE_UNSUCCESSFUL(). + set_TARGET(i_target). + set_STATUS_CODE(l_status). + set_CMD_ID(i_cmd_id), + "Status code did not return SUCCESS (%d), received (%d) for %s", + status_codes::SUCCESS, l_status, mss::c_str(i_target) ); + + return fapi2::FAPI2_RC_SUCCESS; + +fapi_try_exit: + return fapi2::current_err; +} + +}// check + +/// +/// @brief EXP_FW_STATUS setup helper function - useful for testing +/// @param[out] o_size the size of data +/// @param[out] o_cmd_id the explorer command ID +/// +inline void fw_status_setup(size_t& o_size, + std::vector<uint8_t>& o_cmd_id) +{ + o_size = FW_STATUS_BYTE_LEN; + o_cmd_id.assign({FW_STATUS}); +} + +/// +/// @brief EXP_FW_STATUS +/// @param[in] i_target the OCMB target +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode fw_status(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target) +{ + // Retrieve setup data + size_t l_size = 0; + std::vector<uint8_t> l_cmd_id; + fw_status_setup(l_size, l_cmd_id); + + // Get data and check for errors + { + std::vector<uint8_t> l_data; + FAPI_TRY(fapi2::getI2c(i_target, l_size, l_cmd_id, l_data)); + FAPI_TRY( check::status_code(i_target, l_cmd_id[0], l_data) ); + } + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief EXP_FW_BOOT_CONFIG setup +/// @param[in,out] io_data the data to go to boot config +/// +inline void boot_config_setup(std::vector<uint8_t>& io_data) + +{ + io_data.insert(io_data.begin(), FW_BOOT_CONFIG); +} + +/// +/// @brief EXP_FW_BOOT_CONFIG +/// @param[in] i_target the OCMB target +/// @param[in] i_data the data to write +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode boot_config(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data) +{ + // Retrieve setup data + std::vector<uint8_t> l_configured_data(i_data); + boot_config_setup(l_configured_data); + + // Get data and check for errors + FAPI_TRY(fapi2::putI2c(i_target, l_configured_data)); + FAPI_TRY(fw_status(i_target)); + +fapi_try_exit: + return fapi2::current_err; +} + +}// i2c +}// exp +}// mss + +#endif diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H index 05525cf1..2a8b8301 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c_fields.H @@ -22,3 +22,496 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file exp_i2c_fields.H +/// @brief explorer I2C field definition and operations +/// +// *HWP HWP Owner: Andre A. Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: HB:FSP + +#ifndef _MSS_EXP_I2C_FIELDS_H_ +#define _MSS_EXP_I2C_FIELDS_H_ + +#include <generic/memory/lib/utils/mss_field.H> +#include <lib/shared/exp_consts.H> +#include <functional> + +namespace mss +{ +namespace exp +{ +namespace i2c +{ + +/// +/// @class fields +/// @brief Explorer I2C command fields +/// +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}; + + // 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}; +}; + +/// +/// @class fieldTraits +/// @brief Traits assoiated with the Explorer I2C commands +/// @tparam F the Explorer I2C field +/// +template < const field_t& F > +struct fieldTraits; + +/// +/// @class fieldTraits - SERDES_FREQ specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::SERDES_FREQ> +{ + static constexpr size_t COMPARISON_VAL = 0x0F; + static constexpr const char* FIELD_STR = "SerDes Frequency"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - LANE_MODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::LANE_MODE> +{ + static constexpr size_t COMPARISON_VAL = 0x02; + static constexpr const char* FIELD_STR = "Lane mode"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - BOOT_MODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::BOOT_MODE> +{ + static constexpr size_t COMPARISON_VAL = 0x01; + static constexpr const char* FIELD_STR = "Boot mode"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - DL_LAYER_BOOT_MODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::DL_LAYER_BOOT_MODE> +{ + static constexpr size_t COMPARISON_VAL = 0x01; + static constexpr const char* FIELD_STR = "DL Layer Boot mode"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - TRANSPORT_LAYER specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::TRANSPORT_LAYER> +{ + static constexpr size_t COMPARISON_VAL = 0x02; + static constexpr const char* FIELD_STR = "Transport Layer"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - LOOPBACK_TEST specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::LOOPBACK_TEST> +{ + static constexpr size_t COMPARISON_VAL = 0x01; + static constexpr const char* FIELD_STR = "OpenCapi looptest test"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - FW_MODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template <> +struct fieldTraits<fields::FW_MODE> +{ + static constexpr size_t COMPARISON_VAL = 0x01; + static constexpr const char* FIELD_STR = "FW Mode"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - CMD_ID specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template<> +struct fieldTraits<fields::CMD_ID> +{ + static constexpr size_t COMPARISON_VAL = 0xFF; + static constexpr const char* FIELD_STR = "Command ID"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - STATUS_CODE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template<> +struct fieldTraits<fields::STATUS_CODE> +{ + static constexpr size_t COMPARISON_VAL = 0xFF; + static constexpr const char* FIELD_STR = "Status Code"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @class fieldTraits - BOOT_STAGE specialization +/// @brief Traits assoiated with the Explorer I2C commands +/// +template<> +struct fieldTraits<fields::BOOT_STAGE> +{ + static constexpr size_t COMPARISON_VAL = 0x03; + static constexpr const char* FIELD_STR = "Boot Stage"; + + template <typename T> + using COMPARISON_OP = std::less_equal<T>; +}; + +/// +/// @brief Explorer I2C field getter +/// @tparam F the explorer I2C field +/// @tparam IT Input type +/// @tparam OT Output type +/// @tparam TT Traits associated with exp I2C - defaults to fieldTraits<F> +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_value the output value received +/// @return FAPI2_RC_SUCCESS iff okay +/// +template< const field_t& 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); +} + +/// +/// @brief Explorer I2C field setter +/// @tparam IT Input type +/// @tparam OT Output type +/// @tparam TT Traits associated with exp I2C - defaults to fieldTraits<F> +/// @param[in] i_target the OCMB target +/// @param[in] i_value the input value to set +/// @param[in,out] io_data the buffer as a reference to a vector +/// @return FAPI2_RC_SUCCESS iff okay +/// +template< const field_t& F, + typename IT, + typename OT, + typename TT = fieldTraits<F> > +inline fapi2::ReturnCode set_field(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<OT>& io_data, + const IT i_value) + +{ + return mss::set_field<F, TT>(i_target, i_value, EXP_I2C_SET_FIELD, io_data); +} + +namespace boot_cfg +{ + +/// +/// @brief SERDES_FREQ getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_serdes_freq(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::SERDES_FREQ>(i_target, i_data, o_setting); +} + +/// +/// @brief SERDES_FREQ setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_serdes_freq(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::SERDES_FREQ>(i_target, io_data, i_setting); +} + +/// +/// @brief LANE_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_lane_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::LANE_MODE>(i_target, i_data, o_setting); +} + +/// +/// @brief LANE_MODE setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_lane_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::LANE_MODE>(i_target, io_data, i_setting); +} + +/// +/// @brief BOOT_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_boot_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::BOOT_MODE>(i_target, i_data, o_setting); +} + +/// +/// @brief BOOT_MODE setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_boot_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::BOOT_MODE>(i_target, io_data, i_setting); +} + +/// @brief DL_LAYER_BOOT_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_dl_layer_boot_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::DL_LAYER_BOOT_MODE>(i_target, i_data, o_setting); +} + +/// +/// @brief DL_LAYER_BOOT_MODE setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_dl_layer_boot_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::DL_LAYER_BOOT_MODE>(i_target, io_data, i_setting); +} + +/// +/// @brief DL_LAYER_BOOT_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_transport_layer(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::TRANSPORT_LAYER>(i_target, i_data, o_setting); +} + + +/// +/// @brief TRANSPORT_LAYER setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_transport_layer(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::TRANSPORT_LAYER>(i_target, io_data, i_setting); +} + +/// +/// @brief LOOPBACK_TEST getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_loopback_test(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::LOOPBACK_TEST>(i_target, i_data, o_setting); +} + +/// +/// @brief LOOPBACK_TEST setter +/// @param[in] i_target the OCMB target +/// @param[in,out] io_data the buffer as a reference to a vector +/// @param[in] i_setting the value to set +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_loopback_test(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::LOOPBACK_TEST>(i_target, io_data, i_setting); +} + +/// +/// @brief FW_MODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_fw_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::FW_MODE>(i_target, i_data, o_setting); +} + +/// +/// @brief FW_MODE setter +/// @param[in] i_target the OCMB target +/// @param[in] i_setting the value to set +/// @param[in,out] io_data the buffer as a reference to a vector +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode set_fw_mode(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + std::vector<uint8_t>& io_data, + const uint8_t i_setting) +{ + return set_field<fields::FW_MODE>(i_target, io_data, i_setting); +} + +}// boot_cfg + +namespace status +{ + +/// +/// @brief BOOT_STAGE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_boot_stage(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::BOOT_STAGE>(i_target, i_data, o_setting); +} + +/// +/// @brief STATUS_CODE getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_status_code(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::STATUS_CODE>(i_target, i_data, o_setting); +} + +/// +/// @brief CMD_ID getter +/// @param[in] i_target the OCMB target +/// @param[in] i_data the buffer as a reference to a vector +/// @param[out] o_setting +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode get_cmd_id(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const std::vector<uint8_t>& i_data, + size_t& o_setting) +{ + return get_field<fields::CMD_ID>(i_target, i_data, o_setting); +} + +}// status +}// i2c +}// exp +}// mss + +#endif diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H index 8bd5af9a..bd2d51fd 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H @@ -22,3 +22,101 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file explorer_check_for_ready.H +/// @brief explorer_check_for_ready HWP declaration +/// +// *HWP HWP Owner: Andre A. Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: CI + +namespace mss +{ +namespace exp +{ +namespace i2c +{ + +/// +/// @brief explorer ffdc codes +/// +enum ffdc_codes +{ + EXP_I2C_GET_FIELD = 0x0000, + EXP_I2C_SET_FIELD = 0x0001, +}; + +/// @brief List of explorer I2C commands +/// +enum cmd_id : uint8_t +{ + FW_BOOT_CONFIG = 0x01, + FW_STATUS = 0x02, + FW_REG_ADDR_LATCH = 0x03, + FW_REG_READ = 0x04, + FW_REG_WRITE = 0x05, + FW_DOWNLOAD = 0x06, + FW_CONT_REG_READ = 0x07, + FW_CONT_REG_WRITE = 0x08, +}; + +/// +/// @brief common explorer sizes +/// +enum sizes +{ + // 32-bit commands + FW_BOOT_CONFIG_BYTE_LEN = 4, + FW_STATUS_BYTE_LEN = 4, + + // Largest R/W length for bytes of data + MIN_DATA_BYTES_LEN = 1, + MAX_DATA_BYTES_LEN = 32, +}; + +/// +/// @brief General I2C status codes +/// @note Shared I2C status codes for EXP_FW_REG_READ, EXP_FW_REG_WRITE, +/// EXP_FW_CONT_REG_READ, and EXP_FW_CONT_REG_WRITE +/// +enum status_codes +{ + SUCCESS = 0x00, + ADDRESS_OUT_OF_RANGE = 0x01, + ADDRESS_PROHIBITED = 0x02, +}; + +/// +/// @brief status codes for FW_BOOT_CONFIG +/// +enum fw_boot_cfg_status +{ + FW_BOOT_CFG_SUCCESS = status_codes::SUCCESS, + + // Loopback fail + FW_BOOT_CFG_LB_FAIL = 0x01, + // Transport layer fail + FW_BOOT_CFG_UNSUPPORTED_TL = 0x02, + // DL (data link) layer fail + FW_BOOT_CFG_UNSUPPORTED_DL = 0x03, + // SERDES (serializer/deserializer) FREQ fail + FW_BOOT_CFG_UNSUPPORTED_SERDES_FREQ = 0x04, +}; + +/// +/// @brief I2C boot stage options +/// @note certain cmds work in certain boot stages +/// +enum boot_stages +{ + BOOT_ROM_STAGE = 0x01, + FW_UPGRADE_MODE = 0x02, + RUNTIME_FW = 0x03, +}; + +}// 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 ea9b10ab..05492570 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 @@ -39,4 +39,25 @@ </deconfigure> </hwpError> + <hwpError> + <rc>RC_MSS_EXP_STATUS_CODE_UNSUCCESSFUL</rc> + <description> + Explorer status code for command ID EXP_FW_STATUS + did not return SUCCESS + </description> + <ffdc>STATUS_CODE</ffdc> + <ffdc>CMD_ID</ffdc> + <callout> + <procedure>CODE</procedure> + <priority>MEDIUM</priority> + </callout> + <callout> + <target>TARGET</target> + <priority>HIGH</priority> + </callout> + <deconfigure> + <target>TARGET</target> + </deconfigure> + </hwpError> + </hwpErrors> |