5 * Code for detailed notification of events and status.
7 * Routines for logging and reporting details and summary status.
9 * @xrefitem bom "File Content Label" "Release Content"
11 * @e sub-project: HyperTransport
12 * @e \$Revision: 56279 $ @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 2011) $
16 *****************************************************************************
18 * Copyright (C) 2012 Advanced Micro Devices, Inc.
19 * All rights reserved.
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * * Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * * Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
29 * its contributors may be used to endorse or promote products derived
30 * from this software without specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 * ***************************************************************************
48 *----------------------------------------------------------------------------
51 *----------------------------------------------------------------------------
62 #include "GeneralServices.h"
67 #define FILECODE PROC_HT_HTNOTIFY_FILECODE
68 /*----------------------------------------------------------------------------
69 * DEFINITIONS AND MACROS
71 *----------------------------------------------------------------------------
74 /*----------------------------------------------------------------------------
77 *----------------------------------------------------------------------------
80 /*----------------------------------------------------------------------------------------*/
84 * Errors, events, faults, warnings, and useful information are provided by
85 * calling this routine as often as necessary, once for each notification.
86 * @sa AGESA.h for class, and event definitions.
87 * @sa htNotify.h for event data definitions.
89 * @param[in] EvtClass What level event is this
90 * @param[in] Event A unique ID of this event
91 * @param[in] EventData useful data associated with the event.
92 * @param[in] State the log area and remaining free space
97 IN AGESA_STATUS EvtClass,
99 IN CONST UINT8 *EventData,
103 UINT32 DataParam[NUMBER_OF_EVENT_DATA_PARAMS];
105 // Remember the highest event class notified, that becomes our return code.
106 if (State->MaxEventClass < EvtClass) {
107 State->MaxEventClass = EvtClass;
110 // Copy the event data to the log data
114 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
130 /*----------------------------------------------------------------------------------------*/
132 * For event HT_EVENT_HW_SYNCFLOOD
134 * @param[in] Node The node on which the fault is reported
135 * @param[in] Link The link from that node
136 * @param[in] State our State
140 NotifyAlertHwSyncFlood (
146 HT_EVENT_DATA_HW_SYNCFLOOD Evt;
147 // Zero out the event data
151 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
155 IDS_HDT_CONSOLE (HT_TRACE, "Sync Flood on Node %d Link %d.\n", Node, Link);
158 setEventNotify (AGESA_ALERT,
159 HT_EVENT_HW_SYNCFLOOD,
160 (UINT8 *)&Evt, State);
163 /*----------------------------------------------------------------------------------------*/
165 * For event HT_EVENT_HW_HTCRC
167 * @param[in] Node The node on which the error is reported
168 * @param[in] Link The link from that node
169 * @param[in] LaneMask The lanes which had CRC
170 * @param[in] State our State
181 HT_EVENT_DATA_HW_HT_CRC Evt;
182 // Zero out the event data
186 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
190 IDS_HDT_CONSOLE (HT_TRACE, "CRC Error on Node %d Link %d lanes %x.\n", Node, Link, LaneMask);
193 Evt.LaneMask = LaneMask;
194 setEventNotify (AGESA_ALERT,
196 (UINT8 *)&Evt, State);
199 /*----------------------------------------------------------------------------------------*/
201 * For event HT_EVENT_NCOH_BUS_MAX_EXCEED
203 * @param[in] Node The node on which the chain is located
204 * @param[in] Link The link from that node
205 * @param[in] Bus The bus number to assign
206 * @param[in] State our State
210 NotifyErrorNcohBusMaxExceed (
217 HT_EVENT_DATA_NCOH_BUS_MAX_EXCEED Evt;
218 // Zero out the event data
222 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
229 setEventNotify (AGESA_ERROR,
230 HT_EVENT_NCOH_BUS_MAX_EXCEED,
231 (UINT8 *)&Evt, State);
234 /*----------------------------------------------------------------------------------------*/
236 * For event HT_EVENT_NCOH_CFG_MAP_EXCEED
238 * @param[in] Node The node on which the chain is located
239 * @param[in] Link The link from that node
240 * @param[in] State our State
244 NotifyErrorNcohCfgMapExceed (
250 HT_EVENT_DATA_NCOH_CFG_MAP_EXCEED Evt;
251 // Zero out the event data
255 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
261 setEventNotify (AGESA_ERROR,
262 HT_EVENT_NCOH_CFG_MAP_EXCEED,
263 (UINT8 *)&Evt, State);
266 /*----------------------------------------------------------------------------------------*/
268 * For event HT_EVENT_NCOH_BUID_EXCEED
270 * @param[in] Node The node on which the chain is located
271 * @param[in] Link The link from that node
272 * @param[in] Depth Position on chain
273 * @param[in] Id The Id which was attempted to assigned
274 * @param[in] Units The number of units in this device
275 * @param[in] State our State
279 NotifyErrorNcohBuidExceed (
288 HT_EVENT_DATA_NCOH_BUID_EXCEED Evt;
289 // Zero out the event data
293 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
300 Evt.CurrentBuid = Id;
301 Evt.UnitCount = Units;
302 setEventNotify (AGESA_ERROR,
303 HT_EVENT_NCOH_BUID_EXCEED,
304 (UINT8 *)&Evt, State);
307 /*----------------------------------------------------------------------------------------*/
309 * For event HT_EVENT_NCOH_DEVICE_FAILED
311 * @param[in] Node The node on which the chain is located
312 * @param[in] Link The link from that node
313 * @param[in] Depth Position on chain
314 * @param[in] Id The Id which was attempted to assigned
315 * @param[in] State our State
319 NotifyErrorNcohDeviceFailed (
327 HT_EVENT_DATA_NCOH_DEVICE_FAILED Evt;
328 // Zero out the event data
332 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
339 Evt.AttemptedBuid = Id;
340 setEventNotify (AGESA_ERROR,
341 HT_EVENT_NCOH_DEVICE_FAILED,
342 (UINT8 *)&Evt, State);
345 /*----------------------------------------------------------------------------------------*/
347 * For event HT_EVENT_NCOH_AUTO_DEPTH
349 * @param[in] Node The node on which the chain is located
350 * @param[in] Link The link from that node
351 * @param[in] Depth Position on chain
352 * @param[in] State our State
356 NotifyInfoNcohAutoDepth (
363 HT_EVENT_DATA_NCOH_AUTO_DEPTH Evt;
364 // Zero out the event data
368 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
375 setEventNotify (AGESA_SUCCESS,
376 HT_EVENT_NCOH_AUTO_DEPTH,
377 (UINT8 *)&Evt, State);
380 /*----------------------------------------------------------------------------------------*/
382 * For event HT_EVENT_OPT_REQUIRED_CAP_RETRY
384 * @param[in] Node The node on which the chain is located
385 * @param[in] Link The link from that node
386 * @param[in] Depth Position on chain
387 * @param[in] State our State
391 NotifyWarningOptRequiredCapRetry (
398 HT_EVENT_DATA_OPT_REQUIRED_CAP Evt;
399 // Zero out the event data
403 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
410 setEventNotify (AGESA_WARNING,
411 HT_EVENT_OPT_REQUIRED_CAP_RETRY,
412 (UINT8 *)&Evt, State);
415 /*----------------------------------------------------------------------------------------*/
417 * For event HT_EVENT_OPT_REQUIRED_CAP_GEN3
419 * @param[in] Node The node on which the chain is located
420 * @param[in] Link The link from that node
421 * @param[in] Depth Position on chain
422 * @param[in] State our State
426 NotifyWarningOptRequiredCapGen3 (
433 HT_EVENT_DATA_OPT_REQUIRED_CAP Evt;
434 // Zero out the event data
438 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
445 setEventNotify (AGESA_WARNING,
446 HT_EVENT_OPT_REQUIRED_CAP_GEN3,
447 (UINT8 *)&Evt, State);
450 /*----------------------------------------------------------------------------------------*/
452 * For event HT_EVENT_OPT_UNUSED_LINKS
454 * @param[in] NodeA One of the nodes connected
455 * @param[in] NodeB The other connected node
456 * @param[in] LinkA its unusable link
457 * @param[in] LinkB its unusable link
458 * @param[in] State our State
462 NotifyWarningOptUnusedLinks (
470 HT_EVENT_DATA_OPT_UNUSED_LINKS Evt;
471 // Zero out the event data
475 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
483 setEventNotify (AGESA_WARNING,
484 HT_EVENT_OPT_UNUSED_LINKS,
485 (UINT8 *)&Evt, State);
489 /*----------------------------------------------------------------------------------------*/
491 * For event HT_EVENT_OPT_LINK_PAIR_EXCEED
493 * @param[in] NodeA One of the nodes connected
494 * @param[in] NodeB The other connected node
495 * @param[in] MasterLink its unusable Masterlink
496 * @param[in] AltLink its unusable Alternate link
497 * @param[in] State our State
501 NotifyWarningOptLinkPairExceed (
504 IN UINT32 MasterLink,
509 HT_EVENT_DATA_OPT_LINK_PAIR_EXCEED Evt;
510 // Zero out the event data
514 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
519 Evt.MasterLink = MasterLink;
521 Evt.AltLink = AltLink;
522 setEventNotify (AGESA_WARNING,
523 HT_EVENT_OPT_LINK_PAIR_EXCEED,
524 (UINT8 *)&Evt, State);
528 /*----------------------------------------------------------------------------------------*/
530 * For event HT_EVENT_COH_NO_TOPOLOGY
532 * @param[in] Nodes The total number of nodes found so far
533 * @param[in] State our State
537 NotifyErrorCohNoTopology (
542 HT_EVENT_DATA_COH_NO_TOPOLOGY Evt;
543 // Zero out the event data
547 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
551 IDS_HDT_CONSOLE (HT_TRACE, "No Topology Matched system with %d nodes found.\n", Nodes);
552 Evt.TotalNodes = Nodes;
553 setEventNotify (AGESA_ERROR,
554 HT_EVENT_COH_NO_TOPOLOGY,
555 (UINT8 *)&Evt, State);
558 /*----------------------------------------------------------------------------------------*/
560 * For event HT_EVENT_COH_PROCESSOR_TYPE_MIX
562 * @param[in] Node The node from which a new node was discovered
563 * @param[in] Link The link from that node
564 * @param[in] Nodes The total number of nodes found so far
565 * @param[in] State our State
569 NotifyFatalCohProcessorTypeMix (
576 HT_EVENT_DATA_COH_PROCESSOR_TYPE_MIX Evt;
577 // Zero out the event data
581 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
585 IDS_HDT_CONSOLE (HT_TRACE, "Illegal Processor Type Mix.\n");
588 Evt.TotalNodes = Nodes;
589 setEventNotify (AGESA_CRITICAL,
590 HT_EVENT_COH_PROCESSOR_TYPE_MIX,
591 (UINT8 *)&Evt, State);
594 /*----------------------------------------------------------------------------------------*/
596 * For event HT_EVENT_COH_NODE_DISCOVERED
598 * @param[in] Node Node from which a new node was discovered
599 * @param[in] Link The link to that new node
600 * @param[in] NewNode The new node's id
601 * @param[in] TempRoute Temporarily, during discovery, the new node is accessed at this id.
602 * @param[in] State our State
606 NotifyInfoCohNodeDiscovered (
614 HT_EVENT_DATA_COH_NODE_DISCOVERED Evt;
615 // Zero out the event data
619 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
623 IDS_HDT_CONSOLE (HT_TRACE, "Adding Node %d.\n", NewNode);
626 Evt.NewNode = NewNode;
627 Evt.TempRoute = TempRoute;
628 setEventNotify (AGESA_SUCCESS,
629 HT_EVENT_COH_NODE_DISCOVERED,
630 (UINT8 *)&Evt, State);
633 /*----------------------------------------------------------------------------------------*/
635 * For event HT_EVENT_COH_MPCAP_MISMATCH
637 * @param[in] Node The node from which a new node was discovered
638 * @param[in] Link The link from that node
639 * @param[in] Cap The aggregate system MP Capability
640 * @param[in] Nodes The total number of nodes found so far
641 * @param[in] State our State
645 NotifyFatalCohMpCapMismatch (
653 HT_EVENT_DATA_COH_MP_CAP_MISMATCH Evt;
654 // Zero out the event data
658 (sizeof(UINT32) * NUMBER_OF_EVENT_DATA_PARAMS),
662 IDS_HDT_CONSOLE (HT_TRACE, "Mp Capability Mismatch.\n");
666 Evt.TotalNodes = Nodes;
667 setEventNotify (AGESA_CRITICAL,
668 HT_EVENT_COH_MPCAP_MISMATCH,
669 (UINT8 *)&Evt, State);