Skip to content

Commit

Permalink
Disables explorer low power mode for CCS
Browse files Browse the repository at this point in the history
This allows CCS to issue data to the DRAM bus

Change-Id: I007d1215eb6c5cd9b1d601d10a1063801c1119e8
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/94956
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: ANDRE A MARIN <aamarin@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/94978
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sglancy6 authored and dcrowell77 committed Apr 15, 2020
1 parent 445272e commit 085223b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 6 deletions.
Expand Up @@ -40,6 +40,8 @@
#include <generic/memory/lib/ccs/ccs.H>
#include <lib/ccs/ccs_explorer.H>
#include <lib/utils/mss_exp_conversions.H>
#include <explorer_scom_addresses.H>
#include <explorer_scom_addresses_fld.H>

// Generates linkage
constexpr std::pair<uint64_t, uint64_t> ccsTraits<mss::mc_type::EXPLORER>::CS_N[];
Expand All @@ -50,18 +52,58 @@ namespace mss
namespace ccs
{

///
/// @brief Configures the chip to properly execute CCS instructions - EXPLORER specialization
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
///
template<>
fapi2::ReturnCode setup_to_execute<mss::mc_type::EXPLORER>(
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT> >& i_ports)
{
// Loops through all ports
for(const auto& l_port : i_ports)
{
// Disables low power mode
fapi2::buffer<uint64_t> l_data;
FAPI_TRY(fapi2::getScom(l_port, EXPLR_SRQ_MBARPC0Q, l_data));

l_data.setBit<EXPLR_SRQ_MBARPC0Q_CFG_CONC_LP_DATA_DISABLE>();

FAPI_TRY(fapi2::putScom(l_port, EXPLR_SRQ_MBARPC0Q, l_data));
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Cleans up from a CCS execution - multiple ports - EXPLORER specialization
/// @param[in] i_program the vector of instructions
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
///
template<>
fapi2::ReturnCode cleanup_from_execute<fapi2::TARGET_TYPE_MEM_PORT, mss::mc_type::EXPLORER>
fapi2::ReturnCode cleanup_from_execute<mss::mc_type::EXPLORER>
(const ccs::program& i_program,
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT> >& i_ports)
{
// Loops through all ports
for(const auto& l_port : i_ports)
{
// Re-enable low power mode
fapi2::buffer<uint64_t> l_data;
FAPI_TRY(fapi2::getScom(l_port, EXPLR_SRQ_MBARPC0Q, l_data));

l_data.clearBit<EXPLR_SRQ_MBARPC0Q_CFG_CONC_LP_DATA_DISABLE>();

FAPI_TRY(fapi2::putScom(l_port, EXPLR_SRQ_MBARPC0Q, l_data));
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand Down
15 changes: 14 additions & 1 deletion src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C
Expand Up @@ -85,14 +85,27 @@ fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Configures the chip to properly execute CCS instructions - NIMBUS specialization
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
///
template<>
fapi2::ReturnCode setup_to_execute<mss::mc_type::NIMBUS>(const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >&
i_ports)
{
// Nothing to do here for nimbus
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Execute a set of CCS instructions - multiple ports - NIMBUS specialization
/// @param[in] i_program the vector of instructions
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
///
template<>
fapi2::ReturnCode cleanup_from_execute<fapi2::TARGET_TYPE_MCA, mss::mc_type::NIMBUS>(const ccs::program& i_program,
fapi2::ReturnCode cleanup_from_execute<mss::mc_type::NIMBUS>(const ccs::program& i_program,
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >& i_ports)
{
#if LRDIMM_CAPABLE
Expand Down
23 changes: 19 additions & 4 deletions src/import/generic/memory/lib/ccs/ccs.H
Expand Up @@ -1080,14 +1080,26 @@ fapi_try_exit:
}

///
/// @brief Execute a set of CCS instructions - multiple ports
/// @tparam P the port type for this CCS engine
/// @brief Configures the chip to properly execute CCS instructions
/// @tparam MC the MC type on which to operate
/// @tparam P the port type for this CCS engine - derived from i_ports
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
/// @note Code location for pre CCS execute workarounds
///
template< mss::mc_type MC, fapi2::TargetType P>
fapi2::ReturnCode setup_to_execute(const std::vector< fapi2::Target<P> >& i_ports);

///
/// @brief Cleans up the chip from executing CCS instructions
/// @tparam MC the MC type on which to operate
/// @tparam P the port type for this CCS engine - derived from i_ports
/// @param[in] i_program the vector of instructions
/// @param[in] i_ports the vector of ports
/// @return FAPI2_RC_SUCCSS iff ok
/// @note Code location for post CCS execute workarounds
///
template< fapi2::TargetType P, mss::mc_type MC>
template< mss::mc_type MC, fapi2::TargetType P>
fapi2::ReturnCode cleanup_from_execute(const ccs::program& i_program,
const std::vector< fapi2::Target<P> >& i_ports);

Expand Down Expand Up @@ -1216,6 +1228,9 @@ static inline fapi2::ReturnCode execute( const fapi2::Target<T>& i_target,
std::vector<rank_configuration> l_rank_configs;
FAPI_TRY(get_rank_config(i_target, l_rank_configs));

// Pre CCS execution configuration
FAPI_TRY(setup_to_execute<DEFAULT_MC_TYPE>(i_ports));

// Stop the CCS engine just for giggles - it might be running ...
FAPI_TRY( start_stop(i_target, mss::states::STOP), "Error in ccs::execute" );

Expand Down Expand Up @@ -1297,7 +1312,7 @@ static inline fapi2::ReturnCode execute( const fapi2::Target<T>& i_target,
}

// Cleans up after executing the CCS program (runs workarounds if needed)
FAPI_TRY((cleanup_from_execute<P, DEFAULT_MC_TYPE>(i_program, i_ports)));
FAPI_TRY((cleanup_from_execute<DEFAULT_MC_TYPE>(i_program, i_ports)));

fapi_try_exit:
i_program.iv_instructions.clear();
Expand Down

0 comments on commit 085223b

Please sign in to comment.