<commit_before>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.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_freq_system.C
/// @brief Sets synchronous mode an
///
// *HWP HWP Owner: <NAME>  <<EMAIL>>
// *HWP FW Owner: <NAME> <<EMAIL>>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: FSP:HB
#include <vector>
#include <map>

#include <fapi2.H>
#include <mss.H>

#include <p9_mss_freq_system.H>
#include <lib/utils/find.H>
#include <lib/utils/count_dimm.H>
#include <lib/freq/sync.H>


using fapi2::TARGET_TYPE_SYSTEM;
using fapi2::TARGET_TYPE_PROC_CHIP;
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCS;

extern "C"
{
    ///
    /// @brief Set synchronous mode
    /// @param[in] i_targets vector of controllers (e.g., MCS)
    /// @return FAPI2_RC_SUCCESS iff ok
    ///
    fapi2::ReturnCode p9_mss_freq_system( const std::vector< fapi2::Target<TARGET_TYPE_MCBIST> >& i_targets )
    {
        FAPI_INF("----- In p9_mss_freq_system ----");

        // If there are no DIMM we don't need to bother. In fact, we can't as we didn't setup
        // attributes for the PHY, etc. If there is even one DIMM on any of this list of MCBIST,
        // we do the right thing.
        uint64_t l_dimm_count = 0;
        std::for_each( i_targets.begin(), i_targets.end(),
                       [&l_dimm_count](const fapi2::Target<TARGET_TYPE_MCBIST>& i_target)
        {
            l_dimm_count += mss::count_dimm(i_target);
        }
                     );

        if (l_dimm_count == 0)
        {
            FAPI_INF("... skipping freq_system - no DIMM ...");<commit_msg>L3 work for volt and freq_systems<commit_after>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.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_freq_system.C
/// @brief Sets synchronous mode an
///
// *HWP HWP Owner: <NAME>  <<EMAIL>>
// *HWP FW Owner: <NAME> <<EMAIL>>
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
#include <vector>
#include <map>

#include <fapi2.H>
#include <mss.H>

#include <p9_mss_freq_system.H>
#include <lib/utils/find.H>
#include <lib/utils/count_dimm.H>
#include <lib/freq/sync.H>


using fapi2::TARGET_TYPE_SYSTEM;
using fapi2::TARGET_TYPE_PROC_CHIP;
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCS;

extern "C"
{
    ///
    /// @brief Set synchronous mode
    /// @param[in] i_targets vector of controllers (e.g., MCS)
    /// @return FAPI2_RC_SUCCESS iff ok
    ///
    fapi2::ReturnCode p9_mss_freq_system( const std::vector< fapi2::Target<TARGET_TYPE_MCBIST> >& i_targets )
    {
        FAPI_INF("----- In p9_mss_freq_system ----");

        // If there are no DIMM we don't need to bother. In fact, we can't as we didn't setup
        // attributes for the PHY, etc. If there is even one DIMM on any of this list of MCBIST,
        // we do the right thing.
        uint64_t l_dimm_count = 0;
        std::for_each( i_targets.begin(),
                       i_targets.end(),
                       [&l_dimm_count](const fapi2::Target<TARGET_TYPE_MCBIST>& i_target)
        {
            l_dimm_count += mss::count_dimm(i_target);
        } );

        if (l_dimm_count == 0)
        {
            FAPI_INF("... skipping freq_system - no DIMM ...");
{'fraction_non_alphanumeric': 0.10627590290112493, 'fraction_numerical': 0.009621077560686798, 'mean_word_length': 1.1491730279898218, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 62, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4152788', 'n_tokens_mistral': 1765, 'n_tokens_neox': 1677, 'n_words': 481}