/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/fir/exp_unmask.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2019,2020 */ /* [+] 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 exp_unmask.C /// @brief Subroutines for unmasking and setting up MSS FIR /// // *HWP HWP Owner: Stephen Glancy // *HWP HWP Backup: Andre Marin // *HWP Team: Memory // *HWP Level: 3 // *HWP Consumed by: FSP:HB #include #include #include #include #include #include #include #include namespace mss { namespace unmask { /// /// @brief Unmask and setup actions performed after draminit_mc /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// template<> fapi2::ReturnCode after_draminit_mc( const fapi2::Target& i_target ) { fapi2::ReturnCode l_rc1 = fapi2::FAPI2_RC_SUCCESS; fapi2::ReturnCode l_rc2 = fapi2::FAPI2_RC_SUCCESS; fapi2::ReturnCode l_rc3 = fapi2::FAPI2_RC_SUCCESS; // Create registers and check success for MCBISTFIR and SRQFIR and RDFFIR mss::fir::reg l_exp_mcbist_reg(i_target, l_rc1); mss::fir::reg l_exp_srq_reg(i_target, l_rc2); mss::fir::reg l_exp_rdf_reg(i_target, l_rc3); FAPI_TRY(l_rc1, "unable to create fir::reg for %d", EXPLR_MCBIST_MCBISTFIRQ); FAPI_TRY(l_rc2, "unable to create fir::reg for %d", EXPLR_SRQ_SRQFIRQ); FAPI_TRY(l_rc3, "unable to create fir::reg for %d", EXPLR_RDF_FIR); // Write MCBISTFIR register per Explorer unmask spec FAPI_TRY(l_exp_mcbist_reg.attention() .write()); // Write RDF FIR register per Explorer unmask spec // TK Need to set EXPLR_RDF_FIR_MAINTENANCE_RCD to recoverable for planar/ISDIMM FAPI_TRY(l_exp_rdf_reg.recoverable_error() .recoverable_error() .recoverable_error() .recoverable_error() .recoverable_error() .checkstop() .checkstop() .recoverable_error() .recoverable_error() .checkstop() .checkstop() .write()); // Write SRQ FIR register per Explorer unmask spec FAPI_TRY(l_exp_srq_reg.recoverable_error() .write()); return fapi2::FAPI2_RC_SUCCESS; fapi_try_exit: FAPI_DBG("Exiting with return code : 0x%08X...", (uint64_t) fapi2::current_err); return fapi2::current_err; } /// /// @brief Unmask and setup actions performed after draminit_training /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// template<> fapi2::ReturnCode after_draminit_training( const fapi2::Target& i_target ) { fapi2::ReturnCode l_rc1 = fapi2::FAPI2_RC_SUCCESS; fapi2::ReturnCode l_rc2 = fapi2::FAPI2_RC_SUCCESS; // Create registers and check success for MCBISTFIR and SRQFIR mss::fir::reg l_exp_mcbist_reg(i_target, l_rc1); mss::fir::reg l_exp_srq_reg(i_target, l_rc2); FAPI_TRY(l_rc1, "unable to create fir::reg for %d", EXPLR_MCBIST_MCBISTFIRQ); FAPI_TRY(l_rc2, "unable to create fir::reg for %d", EXPLR_SRQ_SRQFIRQ); // Write MCBISTFIR register per Explorer unmask spec; omit bit 10 cmd_complete until draminit_mc FAPI_TRY(l_exp_mcbist_reg.recoverable_error() .checkstop() .checkstop() .recoverable_error() .checkstop() .write()); // Write SRQ FIR register per Explorer unmask spec FAPI_TRY(l_exp_srq_reg.recoverable_error() .checkstop() .recoverable_error() .checkstop() .checkstop() .checkstop() .checkstop() .recoverable_error() .checkstop() .checkstop() .checkstop() .recoverable_error() .write()); return fapi2::FAPI2_RC_SUCCESS; fapi_try_exit: FAPI_DBG("Exiting with return code : 0x%08X...", (uint64_t) fapi2::current_err); return fapi2::current_err; } /// /// @brief Unmask and setup actions performed after mss_scominit /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// TODO: Need to implement this function template<> fapi2::ReturnCode after_scominit( const fapi2::Target& i_target ) { return fapi2::FAPI2_RC_SUCCESS; } /// /// @brief Unmask and setup actions performed after mss_ddr_phy_reset /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// TODO: Need to implement this function template<> fapi2::ReturnCode after_phy_reset( const fapi2::Target& i_target ) { return fapi2::FAPI2_RC_SUCCESS; } /// /// @brief Unmask and setup actions for memdiags related FIR /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// TODO: Need to implement this function template<> fapi2::ReturnCode after_memdiags( const fapi2::Target& i_target ) { return fapi2::FAPI2_RC_SUCCESS; } /// /// @brief Unmask and setup actions for scrub related FIR /// @param[in] i_target the fapi2::Target /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok /// TODO: Need to implement this function template<> fapi2::ReturnCode after_background_scrub( const fapi2::Target& i_target ) { return fapi2::FAPI2_RC_SUCCESS; } } // end unmask ns } // end mss ns