summaryrefslogtreecommitdiffstats
path: root/import/chips/p9/common/pmlib/include/wof_sgpe_pgpe_api.h
blob: f51db66674200abbeede020bc7c494b9d84fdec4 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: import/chips/p9/common/pmlib/include/wof_sgpe_pgpe_api.h $    */
/*                                                                        */
/* OpenPOWER HCODE Project                                                */
/*                                                                        */
/* COPYRIGHT 2016,2018                                                    */
/* [+] 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                                                     */

#ifndef __IPC_MESSAGES_H__
#define __IPC_MESSAGES_H__

//---------------
// IPC from SGPE to PGPE
//---------------
enum MESSAGE_ID_IPI2HI_SGPE_PGPE
{
    MSGID_SGPE_PGPE_UPDATE_ACTIVE_CORES    = 0x8,
    MSGID_SGPE_PGPE_UPDATE_ACTIVE_QUADS    = 0x9,
    MSGID_SGPE_PGPE_SUSPEND_PSTATES        = 0x10
};

//---------------
// IPC from PGPE to SGPE
//---------------
enum MESSAGE_ID_IPI3HI_PGPE_SGPE
{
    MSGID_PGPE_SGPE_INVALID                = 0,
    MSGID_PGPE_SGPE_CONTROL_STOP_UPDATES   = 1,
    MSGID_PGPE_SGPE_SUSPEND_STOP           = 2
};

enum CTRL_STOP_UPDATES_ACTIONS
{
    CTRL_STOP_UPDT_RESERVED0               = 0x0,
    CTRL_STOP_UPDT_ENABLE_CORE             = 0x1,
    CTRL_STOP_UPDT_ENABLE_QUAD             = 0x2,
    CTRL_STOP_UPDT_ENABLE_CORE_QUAD        = 0x3,
    CTRL_STOP_UPDT_RESERVED1               = 0x4,
    CTRL_STOP_UPDT_DISABLE_CORE            = 0x5,
    CTRL_STOP_UPDT_DISABLE_QUAD            = 0x6,
    CTRL_STOP_UPDT_DISABLE_CORE_QUAD       = 0x7
};


enum UPDATE_ACTIVE_TYPES
{
    UPDATE_ACTIVE_CORES_TYPE_ENTRY              = 0x0,
    UPDATE_ACTIVE_CORES_TYPE_EXIT               = 0x1,
    UPDATE_ACTIVE_QUADS_TYPE_ENTRY              = 0x0,
    UPDATE_ACTIVE_QUADS_TYPE_EXIT               = 0x1,
    UPDATE_ACTIVE_QUADS_ENTRY_TYPE_DONE         = 0x0,
    UPDATE_ACTIVE_QUADS_ENTRY_TYPE_NOTIFY       = 0x1
};

enum SUSPEND_STOP_COMMANDS
{
    SUSPEND_STOP_UNSUSPEND_ENTRY                = 0x1,
    SUSPEND_STOP_UNSUSPEND_EXIT                 = 0x2,
    SUSPEND_STOP_UNSUSPEND_ENTRY_EXIT           = 0x3,
    SUSPEND_STOP_SUSPEND_ENTRY                  = 0x5,
    SUSPEND_STOP_SUSPEND_EXIT                   = 0x6,
    SUSPEND_STOP_SUSPEND_ENTRY_EXIT             = 0x7
};

//
// Return Codes
//
#define SGPE_PGPE_IPC_RC_SUCCESS                0x01
#define SGPE_PGPE_RC_REQ_WHILE_PENDING_ACK      0x10
#define SGPE_PGPE_RC_PM_COMPLEX_SUSPEND         0x11

enum IPC_SGPE_PGPE_RETURN_CODES
{
    IPC_SGPE_PGPE_RC_NULL                  = 0x00,
    IPC_SGPE_PGPE_RC_SUCCESS               = 0x01,
    IPC_SGPE_PGPE_RC_REQ_WHILE_PENDING_ACK = 0x10
};

// Sgpe to Pgpe IPC message format
typedef union
{
    uint64_t value;
    struct
    {
        uint32_t msg_num                : 4;
        uint32_t update_type            : 1;
        uint32_t reserved               : 3;
        uint32_t return_code            : 8;
        uint32_t active_cores           : 24;
        uint32_t return_active_cores    : 24;
    } fields;
} ipcmsg_s2p_update_active_cores_t;

typedef union
{
    uint64_t value;
    struct
    {
        uint32_t msg_num                : 4;
        uint32_t update_type            : 1;
        uint32_t entry_type             : 1;
        uint32_t reserved               : 2;
        uint32_t return_code            : 8;
        uint32_t requested_quads        : 6;
        uint32_t reserved0              : 2;
        uint32_t return_active_quads    : 6;
        uint32_t reserved1              : 2;
        uint32_t pad                    : 32;
    } fields;
} ipcmsg_s2p_update_active_quads_t;

// Pgpe to Sgpe IPC message format
typedef union
{
    uint64_t value;
    struct
    {
        uint32_t msg_num                : 8;
        uint32_t return_code            : 8;
        uint32_t action                 : 8;
        uint32_t pad                    : 8;
        uint32_t active_quads           : 6;
        uint32_t reserved               : 2;
        uint32_t active_cores           : 24;
    } fields;
} ipcmsg_p2s_ctrl_stop_updates_t;


typedef union
{
    uint64_t value;
    struct
    {
        uint32_t msg_num                : 8;
        uint32_t return_code            : 8;
        uint32_t command                : 8;
        uint32_t reserved0              : 8;
        uint32_t reserved1              : 32;
    } fields;
} ipcmsg_p2s_suspend_stop_t;


#endif // __IPC_MESSAGES_H__
OpenPOWER on IntegriCloud