summaryrefslogtreecommitdiffstats
path: root/src/import/chips/centaur/common/scominfo/centaur_scominfo.H
blob: f552625a971a0adfd62294fb1314cbe1784e165b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/centaur/common/scominfo/centaur_scominfo.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2015,2017                        */
/* [+] 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 centaur_scominfo.H
/// @brief Centaur chip unit SCOM address platform translation code
///
/// HWP HWP Owner: unknown
/// HWP FW Owner: dcrowell@us.ibm.com
/// HWP Team: Infrastructure
/// HWP Level: 1
/// HWP Consumed by: FSP/HB
///

#ifndef centaur_scominfo_h
#define centaur_scominfo_h

#include <vector>
#include <stdint.h>

extern "C" {
    typedef enum
    {
        CENTAUR_CHIP = 0, //Included as we might need this for future expansion
        MBA_CHIPUNIT = 1
    } centaurChipUnits_t;

    struct centaur_chipUnitPairing_t
    {
        centaurChipUnits_t chipUnitType;
        uint32_t chipUnitNum;
    };


    /**
     @brief creates the actual scom addr based on the chipunit, chipUnitNum, and chipUnit Zero's scom addr
     @param i_CentaurCU enumeration of the ChipUnit
     @param i_ChipUnitNum number of the chipUnit
     @param i_scomAddr the scom addr of chipUnit zero
     @param i_mode, used for special purposes, default to 0
     @retval uint64_t actual scom addr for the chipUnit/chipUnitNum passed in
    */
    uint64_t centaur_scominfo_createChipUnitScomAddr(centaurChipUnits_t i_CentaurCU, uint8_t i_ChipUnitNum,
            uint64_t i_scomAddr, uint32_t i_mode = 0);

    /**
     @brief determines if the scom address correlates to a chipUnit, if so create a list of chipUnits and their number
     @param i_scomAddr scom address that we want to test
     @param o_chipUnitRelated, bool returns true if scom addr is a chipUnit Addr
     @param o_chipUnitPairing, list of the enum of chipUnitPairings
     @param i_mode, used for special purposes, default to 0
     @retval uint32_t return non-zero for error
    */
    uint32_t centaur_scominfo_isChipUnitScom(uint64_t i_scomAddr, bool& o_chipUnitRelated,
            std::vector<centaur_chipUnitPairing_t>& o_chipUnitPairing, uint32_t i_mode = 0);

}

#endif /* centaur_scominfo_h */
OpenPOWER on IntegriCloud