diff options
Diffstat (limited to 'src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C')
-rw-r--r-- | src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C | 57 |
1 files changed, 10 insertions, 47 deletions
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C index 578ddeac3..bec758f65 100644 --- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C +++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C @@ -41,7 +41,6 @@ #include <lib/utils/pmic_consts.H> #include <generic/memory/lib/utils/shared/mss_generic_consts.H> #include <generic/memory/lib/utils/c_str.H> -#include <mss_generic_attribute_getters.H> extern "C" { @@ -68,58 +67,22 @@ extern "C" if (i_mode == mss::pmic::enable_mode::MANUAL) { FAPI_TRY(mss::pmic::enable_manual(l_pmics)); - return fapi2::FAPI2_RC_SUCCESS; } - - if (!l_dimms.empty()) + else { - uint8_t l_module_height = 0; - FAPI_TRY(mss::attr::get_dram_module_height(l_dimms[0], l_module_height)); - - FAPI_ASSERT(l_module_height == fapi2::ENUM_ATTR_MEM_EFF_DRAM_MODULE_HEIGHT_1U || - l_module_height == fapi2::ENUM_ATTR_MEM_EFF_DRAM_MODULE_HEIGHT_2U, - fapi2::PMIC_DIMM_SPD_UNSUPPORTED_MODULE_HEIGHT() - .set_TARGET(l_dimms[0]) - .set_VALUE(l_module_height), - "DIMM %s module height attribute not identified as 1U or 2U. " - "ENUM_ATTR_MEM_EFF_DRAM_MODULE_HEIGHT of %u . Not supported yet.", - mss::c_str(l_dimms[0]), l_module_height); - - // Else, 1 or 2 + if (!l_dimms.empty()) { - static constexpr uint8_t PMICS_PER_DIMM = 2; - - for (uint8_t l_dimm_index = 0; l_dimm_index < l_dimms.size(); ++l_dimm_index) - { - // The PMICs are in sorted order - const auto& l_dimm = l_dimms[l_dimm_index]; - FAPI_TRY(mss::pmic::order_pmics_by_sequence(l_dimm, l_dimm_index, PMICS_PER_DIMM, l_pmics)); - - // Now the PMICs are in the right order of DIMM and the right order by their defined SPD sequence within each dimm - // Let's kick off the enables - for (const auto& l_pmic : l_pmics) - { - // Get the corresponding DIMM target to feed to the helpers - const auto& l_dimm = l_dimms[mss::index(l_pmic) / PMICS_PER_DIMM]; - uint16_t l_vendor_id = 0; - - // Get vendor ID - FAPI_TRY(mss::pmic::get_mfg_id[mss::index(l_pmic)](l_dimm, l_vendor_id)); - - // Poll to make sure PBULK reports good, then we can enable the chip and write/read registers - FAPI_TRY(mss::pmic::poll_for_pbulk_good(l_pmic), - "pmic_enable: poll for pbulk good either failed, or returned not good status on PMIC %s", - mss::c_str(l_pmic)); - - // Call the enable procedure - FAPI_TRY((mss::pmic::enable_chip_1U_2U - (l_pmic, l_dimm, l_vendor_id)), - "pmic_enable: Error enabling PMIC %s", mss::c_str(l_pmic)); - } - } + FAPI_TRY(mss::pmic::pmic_enable_SPD(l_pmics, l_dimms)); } } + // Check that all the PMIC statuses are good post-enable + FAPI_TRY(mss::pmic::status::check_all_pmics(i_ocmb_target), + "Bad statuses returned, or error checking statuses of PMICs on %s", mss::c_str(i_ocmb_target)); + + // If we get here, statuses are good + FAPI_INF("All status codes were OK for PMICs on %s", mss::c_str(i_ocmb_target)); + return fapi2::FAPI2_RC_SUCCESS; fapi_try_exit: |