/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ /* implied. See the License for the specific language governing */ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ /// /// @file p9_mss_scominit.C /// @brief SCOM inits for PHY, MC /// // *HWP HWP Owner: Louis Stermole // *HWP HWP Backup: Andre Marin // *HWP Team: Memory // *HWP Level: 3 // *HWP Consumed by: FSP:HB #include #include #include #include #include #include #include #include #include #include #include #include using fapi2::TARGET_TYPE_MCA; using fapi2::TARGET_TYPE_MCBIST; using fapi2::FAPI2_RC_SUCCESS; /// /// @brief SCOM inits for PHY, MC /// @param[in] i_target, the MCBIST /// @return FAPI2_RC_SUCCESS iff ok /// fapi2::ReturnCode p9_mss_scominit( const fapi2::Target& i_target ) { FAPI_INF("Start MSS SCOM init"); // We need to make sure we scominit the magic port. const auto l_mca_targets = mss::find_targets_with_magic(i_target); fapi2::ReturnCode l_rc; fapi2::Target FAPI_SYSTEM; if (mss::count_dimm(i_target) == 0) { FAPI_INF("... skipping mss_scominit %s - no DIMM ...", mss::c_str(i_target)); return fapi2::FAPI2_RC_SUCCESS; } for (const auto& l_mca_target : l_mca_targets ) { FAPI_INF("scominit for %s", mss::c_str(l_mca_target)); // Can't MCA init ports with no DIMM, they don't have attributes like timing. if (mss::count_dimm(l_mca_target) != 0) { FAPI_INF("mca scominit for %s", mss::c_str(l_mca_target)); FAPI_EXEC_HWP(l_rc, p9n_mca_scom, l_mca_target, i_target, l_mca_target.getParent(), FAPI_SYSTEM, i_target.getParent()); if (l_rc) { FAPI_ERR("%s Error from p9.mca.scom.initfile", mss::c_str(l_mca_target)); fapi2::current_err = l_rc; goto fapi_try_exit; } FAPI_INF("mca thermal throttle scominit for %s", mss::c_str(l_mca_target)); FAPI_TRY(mss::mc::thermal_throttle_scominit(l_mca_target)); } // ... but we do scominit PHY's with no DIMM. There are no attributes needed and we need // to make sure we init the magic port. FAPI_INF("phy scominit for %s", mss::c_str(l_mca_target)); FAPI_EXEC_HWP(l_rc, p9n_ddrphy_scom, l_mca_target, i_target.getParent()); if (l_rc) { FAPI_ERR("%s Error from p9.ddrphy.scom.initfile", mss::c_str(l_mca_target)); fapi2::current_err = l_rc; goto fapi_try_exit; } } FAPI_EXEC_HWP(l_rc, p9n_mcbist_scom, i_target ); if (l_rc) { FAPI_ERR("%s Error from p9.mcbist.scom.initfile", mss::c_str(i_target)); fapi2::current_err = l_rc; goto fapi_try_exit; } // Initialize via scoms for non-static PHY items. FAPI_TRY( mss::phy_scominit(i_target), "%s failed phy_scominit", mss::c_str(i_target) ); // Do FIRry things FAPI_TRY( mss::unmask::after_scominit(i_target), "%s failed after_scominit", mss::c_str(i_target) ); fapi_try_exit: FAPI_INF("%s End MSS SCOM init ReturnCode:0x%016lx", mss::c_str(i_target), uint64_t(fapi2::current_err)); return fapi2::current_err; }