AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / HT / htNotify.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * HT Notify interface.
6  *
7  * This file provides internal interface to event and status
8  * notification.
9  *
10  * @xrefitem bom "File Content Label" "Release Content"
11  * @e project:      AGESA
12  * @e sub-project:  HyperTransport
13  * @e \$Revision: 44324 $        @e  \$Date: 2010-12-22 02:16:51 -0700 (Wed, 22 Dec 2010) $
14  *
15  */
16 /*
17 *****************************************************************************
18 *
19 * Copyright (C) 2012 Advanced Micro Devices, Inc.
20 * All rights reserved.
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions are met:
24 *     * Redistributions of source code must retain the above copyright
25 *       notice, this list of conditions and the following disclaimer.
26 *     * Redistributions in binary form must reproduce the above copyright
27 *       notice, this list of conditions and the following disclaimer in the
28 *       documentation and/or other materials provided with the distribution.
29 *     * Neither the name of Advanced Micro Devices, Inc. nor the names of
30 *       its contributors may be used to endorse or promote products derived
31 *       from this software without specific prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
37 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 *
44 * ***************************************************************************
45 *
46 */
47
48 #ifndef _HT_NOTIFY_H_
49 #define _HT_NOTIFY_H_
50
51 /*----------------------------------------------------------------------------------------*/
52 /* Event specific event data definitions.
53  * All structures must be 4 UINT32's in size, no more, no less.
54  */
55
56 /// For event ::HT_EVENT_HW_SYNCFLOOD
57 typedef struct {
58   UINT32 Node;                   ///< The Node on which observed
59   UINT32 Link;                   ///< The Link on that Node which reported synch flood
60   UINT32 Reserved1;              ///< Reserved.
61   UINT32 Reserved2;              ///< Reserved.
62 } HT_EVENT_DATA_HW_SYNCFLOOD;
63
64 /// For event ::HT_EVENT_HW_HTCRC
65 typedef struct {
66   UINT32 Node;                   ///< The Node on which event is observed
67   UINT32 Link;                   ///< The Link on that Node which reported CRC error
68   UINT32 LaneMask;               ///< The CRC lane mask for the Link
69   UINT32 Reserved1;              ///< Reserved.
70 } HT_EVENT_DATA_HW_HT_CRC;
71
72 /// For event ::HT_EVENT_NCOH_BUS_MAX_EXCEED
73 typedef struct {
74   UINT32 Node;                   ///< the Node with this non-coherent chain
75   UINT32 Link;                   ///< the Link on that Node to this chain
76   UINT32 Bus;                    ///< the current bus number
77   UINT32 Reserved1;              ///< Reserved.
78 } HT_EVENT_DATA_NCOH_BUS_MAX_EXCEED;
79
80 /// For event ::HT_EVENT_NCOH_CFG_MAP_EXCEED
81 typedef struct {
82   UINT32 Node;                   ///< the Node with this non-coherent chain
83   UINT32 Link;                   ///< the Link on that Node to this chain
84   UINT32 Reserved1;              ///< Reserved.
85   UINT32 Reserved2;              ///< Reserved.
86 } HT_EVENT_DATA_NCOH_CFG_MAP_EXCEED;
87
88 /// For event ::HT_EVENT_NCOH_BUID_EXCEED
89 typedef struct {
90   UINT32 Node;                   ///< the Node with this non-coherent chain
91   UINT32 Link;                   ///< the Link on that Node to this chain
92   UINT32 Depth;                  ///< the position on the chain, zero is CPU host
93   UINT16 CurrentBuid;            ///< the current available BUID
94   UINT16 UnitCount;              ///< the number of ids which would be consumed by this device
95 } HT_EVENT_DATA_NCOH_BUID_EXCEED;
96
97 /// For event ::HT_EVENT_NCOH_DEVICE_FAILED
98 typedef struct {
99   UINT32 Node;                   ///< the Node with this non-coherent chain
100   UINT32 Link;                   ///< the Link on that Node to this chain
101   UINT32 Depth;                  ///< the position on the chain, zero is CPU host
102   UINT32 AttemptedBuid;          ///< the BUID we tried to assign to that device
103 } HT_EVENT_DATA_NCOH_DEVICE_FAILED;
104
105 /// For event ::HT_EVENT_NCOH_AUTO_DEPTH
106 typedef struct {
107   UINT32 Node;                   ///< the Node with this non-coherent chain
108   UINT32 Link;                   ///< the Link on that Node to this chain
109   UINT32 Depth;                  ///< the position on the chain of the last device, zero is CPU host
110   UINT32 Reserved1;              ///< Reserved.
111 } HT_EVENT_DATA_NCOH_AUTO_DEPTH;
112
113 /// For event ::HT_EVENT_OPT_REQUIRED_CAP_RETRY,
114 ///           ::HT_EVENT_OPT_REQUIRED_CAP_GEN3.
115 typedef struct {
116   UINT32 Node;                   ///< the Node with this non-coherent chain
117   UINT32 Link;                   ///< the Link on that Node to this chain
118   UINT32 Depth;                  ///< the position on the chain, zero is CPU host
119   UINT32 Reserved1;              ///< Reserved.
120 } HT_EVENT_DATA_OPT_REQUIRED_CAP;
121
122 /// For event ::HT_EVENT_OPT_UNUSED_LINKS
123 typedef struct {
124   UINT32 NodeA;                  ///< One of the nodes connected
125   UINT32 LinkA;                  ///< its unusable link
126   UINT32 NodeB;                  ///< The other connected node
127   UINT32 LinkB;                  ///< its unusable link
128 } HT_EVENT_DATA_OPT_UNUSED_LINKS;
129
130 /// For event ::HT_EVENT_OPT_LINK_PAIR_EXCEED
131 typedef struct {
132   UINT32 NodeA;                  ///< One of the nodes connected
133   UINT32 NodeB;                  ///< The other connected node
134   UINT32 MasterLink;             ///< NodeA's unusable Master link
135   UINT32 AltLink;                ///< NodeA's unusable Alternatelink
136 } HT_EVENT_DATA_OPT_LINK_PAIR_EXCEED;
137
138 /// For event ::HT_EVENT_COH_NO_TOPOLOGY.
139 /// There is no routing for this system's topology.
140 typedef struct {
141   UINT32 TotalNodes;             ///< the number of Nodes in the unmatched topology
142   UINT32 Reserved1;              ///< Reserved.
143   UINT32 Reserved2;              ///< Reserved.
144   UINT32 Reserved3;              ///< Reserved.
145 } HT_EVENT_DATA_COH_NO_TOPOLOGY;
146
147 /// For event ::HT_EVENT_COH_PROCESSOR_TYPE_MIX
148 typedef struct {
149   UINT32 Node;                   ///< the Node from which the incompatible family was found
150   UINT32 Link;                   ///< the Link to the incompatible Node
151   UINT32 TotalNodes;             ///< the number of Nodes found at that point
152   UINT32 Reserved1;              ///< Reserved.
153 } HT_EVENT_DATA_COH_PROCESSOR_TYPE_MIX;
154
155 /// For event ::HT_EVENT_COH_NODE_DISCOVERED
156 typedef struct {
157   UINT32 Node;                   ///< the Node from which the new Node was found
158   UINT32 Link;                   ///< the Link to the new Node
159   UINT32 NewNode;                ///< the Node id of the newly discovered Node
160   UINT32 TempRoute;              ///< the new Node is temporarily at this id
161 } HT_EVENT_DATA_COH_NODE_DISCOVERED;
162
163 /// For event ::HT_EVENT_COH_MPCAP_MISMATCH
164 typedef struct {
165   UINT32 Node;                   ///< the Node from which condition was observed
166   UINT32 Link;                   ///< the Link on the current Node
167   UINT32 SysMpCap;               ///< the current aggregate system capability (the minimum found so far)
168   UINT32 TotalNodes;             ///< the number of Nodes found, before this was observed
169 } HT_EVENT_DATA_COH_MP_CAP_MISMATCH;
170
171 /*----------------------------------------------------------------------------------------*/
172 /* Event specific Notify functions.
173  */
174
175 VOID
176 NotifyAlertHwSyncFlood (
177   IN       UINT8        Node,
178   IN       UINT8        Link,
179   IN       STATE_DATA   *State
180   );
181
182 VOID
183 NotifyAlertHwHtCrc (
184   IN       UINT8      Node,
185   IN       UINT8      Link,
186   IN       UINT8      LaneMask,
187   IN       STATE_DATA *State
188   );
189
190 VOID
191 NotifyErrorNcohBusMaxExceed (
192   IN       UINT8      Node,
193   IN       UINT8      Link,
194   IN       UINT8      Bus,
195   IN       STATE_DATA *State
196   );
197
198 VOID
199 NotifyErrorNcohCfgMapExceed (
200   IN       UINT8      Node,
201   IN       UINT8      Link,
202   IN       STATE_DATA *State
203   );
204
205 VOID
206 NotifyErrorNcohBuidExceed (
207   IN       UINT8      Node,
208   IN       UINT8      Link,
209   IN       UINT8      Depth,
210   IN       UINT8      Id,
211   IN       UINT8      Units,
212   IN       STATE_DATA *State
213   );
214
215 VOID
216 NotifyErrorNcohDeviceFailed (
217   IN       UINT8      Node,
218   IN       UINT8      Link,
219   IN       UINT8      Depth,
220   IN       UINT8      Id,
221   IN       STATE_DATA *State
222   );
223
224 VOID
225 NotifyInfoNcohAutoDepth (
226   IN       UINT8      Node,
227   IN       UINT8      Link,
228   IN       UINT8      Depth,
229   IN       STATE_DATA *State
230   );
231
232 VOID
233 NotifyWarningOptRequiredCapRetry (
234   IN       UINT8      Node,
235   IN       UINT8      Link,
236   IN       UINT8      Depth,
237   IN       STATE_DATA *State
238   );
239
240 VOID
241 NotifyWarningOptRequiredCapGen3 (
242   IN       UINT8      Node,
243   IN       UINT8      Link,
244   IN       UINT8      Depth,
245   IN       STATE_DATA *State
246   );
247
248 VOID
249 NotifyWarningOptUnusedLinks (
250   IN       UINT32    NodeA,
251   IN       UINT32    LinkA,
252   IN       UINT32    NodeB,
253   IN       UINT32    LinkB,
254   IN       STATE_DATA *State
255   );
256
257 VOID
258 NotifyWarningOptLinkPairExceed (
259   IN       UINT32    NodeA,
260   IN       UINT32    NodeB,
261   IN       UINT32    MasterLink,
262   IN       UINT32    AltLink,
263   IN       STATE_DATA *State
264   );
265
266 VOID
267 NotifyErrorCohNoTopology (
268   IN       UINT8      Nodes,
269   IN       STATE_DATA *State
270   );
271
272 VOID
273 NotifyFatalCohProcessorTypeMix (
274   IN       UINT8      Node,
275   IN       UINT8      Link,
276   IN       UINT8      Nodes,
277   IN       STATE_DATA *State
278   );
279
280 VOID
281 NotifyInfoCohNodeDiscovered (
282   IN       UINT8      Node,
283   IN       UINT8      Link,
284   IN       UINT8      NewNode,
285   IN       UINT8      TempRoute,
286   IN       STATE_DATA *State
287   );
288
289 VOID
290 NotifyFatalCohMpCapMismatch (
291   IN       UINT8      Node,
292   IN       UINT8      Link,
293   IN       UINT8      Cap,
294   IN       UINT8      Nodes,
295   IN       STATE_DATA *State
296   );
297
298 #endif /* _HT_NOTIFY_H_ */