<commit_before>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/io/p9_io_obus_firmask_save_restore.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2018,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_io_obus_firmask_save_restore.H
/// @brief HWP that will give user ability to save off obus firmask into attribute
///        and restore them at a later date.
///
///-----------------------------------------------------------------------------
/// *HWP HW  Owner        : <NAME>    <<EMAIL>>
/// *HWP HW  Backup Owner :
/// *HWP FW Owner         : <NAME> <<EMAIL>>
/// *HWP Team             : IO
/// *HWP Level            : 3
/// *HWP Consumed by      : HB
///-----------------------------------------------------------------------------

#ifndef _P9_IO_OBUS_FIRMASK_SAVE_RESTORE_H
#define _P9_IO_OBUS_FIRMASK_SAVE_RESTORE_H


//-----------------------------------------------------------------------------
//  System Header Include
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//  fapi2 Includes
//-----------------------------------------------------------------------------
#include <fapi2.H>

//-----------------------------------------------------------------------------
//  Definitions
//-----------------------------------------------------------------------------

namespace p9iofirmasksaverestore
{

/**
* @brief Operation Type (Save or Restore)
*/
enum OP_TYPE
{
    SAVE      = 0x0,
    RESTORE   = 0x1,
};

} // namespace p9iofirmasksaverestore

typedef fapi2::ReturnCode (*p9_io_obus_firmask_save_restore_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&,
        const p9iofirmasksaverestore::OP_TYPE);

extern "C"
{
    /**
    *     @brief This hardware procedure takes a processor chip and an OP_TYPE enum in as params.
    *     Depending on what the enum says to do this procedure will either read and store the
    *     values of PU_IOE_PB_IOO_FIR_MASK_REG on the processor and OBUS_LL0_LL0_LL0_PB_IOOL_FIR_MASK_REGs
    *     on all of the PROC's child OBUSes, or it will write those scoms based one what we
    *     have stored away previously.
    *
    *     This HWP is expected to be called by Hostboot during IPL time with the SAVE OP_TYPE so
    *     that Hostboot can temporarily apply extra masks during IPL time. This scominit for these
    *     registers is done in istep 10.6 (proc_chiplet_scominit) so this HWP need to be called with
    *     the SAVE paramter after istep 10.6. Once we reach runtime HBRT will call this HWP again with
    *     the RESTORE OP_TYPE and the masks will be restored to their initial values. We expect the
    *     HWP to be called with the RESTORE_OP_TYPE during the HBRT initialzation after the target service
    *     has been initialized in HBRT.
    *
    *     Note: If this HWP is called with the SAVE op then after we read and store the firmasks
    *           into attributes, we will set additional bits in the mask.
    *
    *        Firs to save and restore
    *        - 0x5013803  = PBIOOFIR MASK
    *        Bits Masked on Save :
    *            PARSER00_ATTN_MASK:28
    *            PARSER01_ATTN_MASK:29
    *            PARSER02_ATTN_MASK:30
    *            PARSER03_ATTN_MASK:31
    *            PARSER04_ATTN_MASK:32
    *            PARSER05_ATTN_MASK:33
    *            PARSER06_ATTN_MASK:34
    *            PARSER07_ATTN_MASK:35
    *            DOB01_ERR_MASK:52<commit_msg>Clear obus fir mask attrs after restoring obus firmasks<commit_after>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/io/p9_io_obus_firmask_save_restore.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2018,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_io_obus_firmask_save_restore.H
/// @brief HWP that will give user ability to save off obus firmask into attribute
///        and restore them at a later date.
///
///-----------------------------------------------------------------------------
/// *HWP HW  Owner        : <NAME>    <<EMAIL>>
/// *HWP HW  Backup Owner :
/// *HWP FW Owner         : <NAME> <<EMAIL>>
/// *HWP Team             : IO
/// *HWP Level            : 3
/// *HWP Consumed by      : HB
///-----------------------------------------------------------------------------

#ifndef _P9_IO_OBUS_FIRMASK_SAVE_RESTORE_H
#define _P9_IO_OBUS_FIRMASK_SAVE_RESTORE_H


//-----------------------------------------------------------------------------
//  System Header Include
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//  fapi2 Includes
//-----------------------------------------------------------------------------
#include <fapi2.H>

//-----------------------------------------------------------------------------
//  Definitions
//-----------------------------------------------------------------------------

namespace p9iofirmasksaverestore
{

/**
* @brief Operation Type (Save or Restore)
*/
enum OP_TYPE
{
    SAVE      = 0x0,
    RESTORE   = 0x1,
};

} // namespace p9iofirmasksaverestore

typedef fapi2::ReturnCode (*p9_io_obus_firmask_save_restore_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&,
        const p9iofirmasksaverestore::OP_TYPE);

extern "C"
{
    /**
    *     @brief This hardware procedure takes a processor chip and an OP_TYPE enum in as params.
    *     Depending on what the enum says to do this procedure will either read and store the
    *     values of PU_IOE_PB_IOO_FIR_MASK_REG on the processor and OBUS_LL0_LL0_LL0_PB_IOOL_FIR_MASK_REGs
    *     on all of the PROC's child OBUSes, or it will write those scoms based one what we
    *     have stored away previously.
    *
    *     This HWP is expected to be called by Hostboot during IPL time with the SAVE OP_TYPE so
    *     that Hostboot can temporarily apply extra masks during IPL time. This scominit for these
    *     registers is done in istep 10.6 (proc_chiplet_scominit) so this HWP need to be called with
    *     the SAVE paramter after istep 10.6. Once we reach runtime HBRT will call this HWP again with
    *     the RESTORE OP_TYPE and the masks will be restored to their initial values. We expect the
    *     HWP to be called with the RESTORE_OP_TYPE during the HBRT initialzation after the target service
    *     has been initialized in HBRT. There should only be one single HWP call with the RESTORE flag for
    *     every call there is with the SAVE flag.
    *
    *     Note: If this HWP is called with the SAVE op then after we read and store the firmasks
    *           into attributes, we will set additional bits in the mask.
    *
    *        Firs to save and restore
    *        - 0x5013803  = PBIOOFIR MASK
    *        Bits Masked on Save :
    *            PARSER00_ATTN_MASK:28
    *            PARSER01_ATTN_MASK:29
    *            PARSER02_ATTN_MASK:30
    *            PARSER03_ATTN_MASK:31
    *            PARSER04_ATTN_MASK:32
    *            PARSER05_ATTN_MASK:33
    *            PARSER06_ATTN_MASK:34
    *            PARSER07_ATTN_MASK:35
    *            DOB01_ERR_MASK:52
{'fraction_non_alphanumeric': 0.1797134452984154, 'fraction_numerical': 0.015940791346427556, 'mean_word_length': 1.0269230769230768, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5326981', 'n_tokens_mistral': 2578, 'n_tokens_neox': 2427, 'n_words': 812}