<commit_before>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/ocmb/odyssey/procedures/hwp/memory/lib/shared/ody_consts.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2022                             */
/* [+] 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 ody_consts.H
/// @brief Odyssey specific constants definitions
///
// *HWP HWP Owner: <NAME> <<EMAIL>>
// *HWP HWP Backup: <NAME> <<EMAIL>>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: CI

#ifndef _MSS_ODY_CONSTS_H_
#define _MSS_ODY_CONSTS_H_

#ifndef __PPE__
    #include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#endif

namespace mss
{

namespace ody
{

// This constant is for MMIO scoms. MMIO addresses are addressed by byte,
// while scoms are numbered by register. So multiply by 8, aka shift by 3
constexpr uint32_t OCMB_ADDR_SHIFT = 3;

#ifndef __PPE__

///
/// @brief common Odyssey sizes
///
enum sizes
{
    MAX_PORT_PER_OCMB = 2,

    // This is used for targeting only (attribute arrays, target positions) so needs to be 2 for P10
    MAX_DIMM_PER_PORT = 2,

    // This is the maximum number of DIMM per port that the hardware supports
    HW_MAX_DIMM_PER_PORT = 1,

    // Technically this is 2 for Odyssey, but this value is used for attribute array indexing which requires 4
    // Any code that converts DIMM ranks to port ranks should use the rank API
    MAX_RANK_PER_DIMM = 4,

    // This is the maximum number of main ranks per DIMM supported by the hardware
    HW_MAX_RANK_PER_DIMM = 2,

    // This is used in the row repair code to determine how many sPPRs we can do. We used an artificial limit of one
    // per bank group on DDR4, but it's technically one per bank, per DRAM, so 40*16 per DIMM
    // TODO: Zen:MST-1422 Update this for Odyssey
    MAX_BG_PER_DIMM = 4,

    MAX_DQ_BITS_PER_PORT = 80,
    MAX_SYMBOLS_PER_PORT = 72,
    MAX_MRANK_PER_PORT = MAX_DIMM_PER_PORT * MAX_RANK_PER_DIMM,
    MAX_BYTES_PER_PORT = MAX_DQ_BITS_PER_PORT / BITS_PER_BYTE,
    MAX_NIBBLES_PER_PORT = MAX_DQ_BITS_PER_PORT / BITS_PER_NIBBLE,

    // Enumerations for the Odyssey serial number attribute
    // The hostboot team requested that we only use enumerations for attribute values
    // These are attribute positions in an array, so moving them here
    // TODO: Zen:MST-1413 Update these for Odyssey
    SERIAL_PART_NUMBER = 3,
    SERIAL_PART_NUMBER_LEN = 7,
    SERIAL_RAW_CARD = 12,
    SERIAL_RAW_CARD_LEN = 2,
    SERIAL_SERIAL_NUMBER = 14,
    SERIAL_SERIAL_NUMBER_LEN = 12,
};

#endif

///
/// @brief Odyssey ffdc codes
///
enum ffdc_codes : uint16_t
{<commit_msg>Remove cfg_steering bits for rank 2 and 3 for the RDF0 and WDF0 regs<commit_after>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/ocmb/odyssey/procedures/hwp/memory/lib/shared/ody_consts.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2022                             */
/* [+] 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 ody_consts.H
/// @brief Odyssey specific constants definitions
///
// *HWP HWP Owner: <NAME> <<EMAIL>>
// *HWP HWP Backup: <NAME> <<EMAIL>>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: CI

#ifndef _MSS_ODY_CONSTS_H_
#define _MSS_ODY_CONSTS_H_

#ifndef __PPE__
    #include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#endif

namespace mss
{

namespace ody
{

// This constant is for MMIO scoms. MMIO addresses are addressed by byte,
// while scoms are numbered by register. So multiply by 8, aka shift by 3
constexpr uint32_t OCMB_ADDR_SHIFT = 3;

#ifndef __PPE__

///
/// @brief common Odyssey sizes
///
enum sizes
{
    MAX_PORT_PER_OCMB = 2,

    // This is used for targeting only (attribute arrays, target positions) so needs to be 2 for P10
    MAX_DIMM_PER_PORT = 2,

    // This is the maximum number of DIMM per port that the hardware supports
    HW_MAX_DIMM_PER_PORT = 1,

    // Technically this is 2 for Odyssey, but this value is used for attribute array indexing which requires 4
    // Any code that converts DIMM ranks to port ranks should use the rank API
    MAX_RANK_PER_DIMM = 4,

    // This is the maximum number of main ranks per DIMM supported by the hardware
    HW_MAX_RANK_PER_DIMM = 2,

    // This is used in the row repair code to determine how many sPPRs we can do. We used an artificial limit of one
    // per bank group on DDR4, but it's technically one per bank, per DRAM, so 40*16 per DIMM
    // TODO: Zen:MST-1422 Update this for Odyssey
    MAX_BG_PER_DIMM = 4,

    MAX_DQ_BITS_PER_PORT = 80,
    MAX_SYMBOLS_PER_PORT = 72,
    MAX_MRANK_PER_PORT = MAX_DIMM_PER_PORT * MAX_RANK_PER_DIMM,
    HW_MAX_MRANK_PER_PORT = HW_MAX_DIMM_PER_PORT * HW_MAX_RANK_PER_DIMM,
    MAX_BYTES_PER_PORT = MAX_DQ_BITS_PER_PORT / BITS_PER_BYTE,
    MAX_NIBBLES_PER_PORT = MAX_DQ_BITS_PER_PORT / BITS_PER_NIBBLE,

    // Enumerations for the Odyssey serial number attribute
    // The hostboot team requested that we only use enumerations for attribute values
    // These are attribute positions in an array, so moving them here
    // TODO: Zen:MST-1413 Update these for Odyssey
    SERIAL_PART_NUMBER = 3,
    SERIAL_PART_NUMBER_LEN = 7,
    SERIAL_RAW_CARD = 12,
    SERIAL_RAW_CARD_LEN = 2,
    SERIAL_SERIAL_NUMBER = 14,
    SERIAL_SERIAL_NUMBER_LEN = 12,
};

#endif

///
/// @brief Odyssey ffdc codes
///
enum ffdc_codes : uint16_t
{
{'fraction_non_alphanumeric': 0.0750992758701238, 'fraction_numerical': 0.01284746554543331, 'mean_word_length': 1.5016067776803974, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '681623', 'n_tokens_mistral': 2404, 'n_tokens_neox': 2249, 'n_words': 780}