zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * Internal access to HT Interface, general purpose features. |
| 6 | * |
| 7 | * This file provides definitions used by HT internal modules. The |
| 8 | * external HT interface (in agesa.h) is accessed using these methods. |
| 9 | * This keeps the HT Feature implementations abstracted from the HT |
| 10 | * external interface. |
| 11 | * |
| 12 | * This file includes the interface support which is not removed with |
| 13 | * various build options. |
| 14 | * |
| 15 | * @xrefitem bom "File Content Label" "Release Content" |
| 16 | * @e project: AGESA |
| 17 | * @e sub-project: HyperTransport |
| 18 | * @e \$Revision: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $ |
| 19 | * |
| 20 | */ |
| 21 | /* |
| 22 | ***************************************************************************** |
| 23 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 24 | * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. |
| 25 | * All rights reserved. |
| 26 | * |
| 27 | * Redistribution and use in source and binary forms, with or without |
| 28 | * modification, are permitted provided that the following conditions are met: |
| 29 | * * Redistributions of source code must retain the above copyright |
| 30 | * notice, this list of conditions and the following disclaimer. |
| 31 | * * Redistributions in binary form must reproduce the above copyright |
| 32 | * notice, this list of conditions and the following disclaimer in the |
| 33 | * documentation and/or other materials provided with the distribution. |
| 34 | * * Neither the name of Advanced Micro Devices, Inc. nor the names of |
| 35 | * its contributors may be used to endorse or promote products derived |
| 36 | * from this software without specific prior written permission. |
| 37 | * |
| 38 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 39 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 40 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 41 | * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY |
| 42 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 43 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 44 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 45 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 46 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 47 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 48 | * *************************************************************************** |
| 49 | * |
| 50 | */ |
| 51 | |
| 52 | #ifndef _HT_INTERFACE_GENERAL_H_ |
| 53 | #define _HT_INTERFACE_GENERAL_H_ |
| 54 | |
| 55 | /*---------------------------------------------------------------------------- |
| 56 | * Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS) |
| 57 | * |
| 58 | *---------------------------------------------------------------------------- |
| 59 | */ |
| 60 | |
| 61 | /*----------------------------------------------------------------------------- |
| 62 | * DEFINITIONS AND MACROS |
| 63 | * |
| 64 | *----------------------------------------------------------------------------- |
| 65 | */ |
| 66 | |
| 67 | /*---------------------------------------------------------------------------- |
| 68 | * TYPEDEFS, STRUCTURES, ENUMS |
| 69 | * |
| 70 | *---------------------------------------------------------------------------- |
| 71 | */ |
| 72 | |
| 73 | /*---------------------------------------------------------------------------- |
| 74 | * Prototypes to Interface from Feature Code |
| 75 | * |
| 76 | *---------------------------------------------------------------------------- |
| 77 | */ |
| 78 | |
| 79 | /** |
| 80 | * Is PackageLink an Internal Link? |
| 81 | */ |
| 82 | BOOLEAN |
| 83 | IsPackageLinkInternal ( |
| 84 | IN UINT8 PackageLink |
| 85 | ); |
| 86 | |
| 87 | /** |
| 88 | * Get the Socket number for a given Node number. |
| 89 | * |
| 90 | */ |
| 91 | UINT8 |
| 92 | GetSocketFromMap ( |
| 93 | IN UINT8 Node, |
| 94 | IN STATE_DATA *State |
| 95 | ); |
| 96 | |
| 97 | /** |
| 98 | * Ignore a Link. |
| 99 | * |
| 100 | */ |
| 101 | FINAL_LINK_STATE |
| 102 | GetIgnoreLink ( |
| 103 | IN UINT8 Node, |
| 104 | IN UINT8 Link, |
| 105 | IN IGNORE_LINK *NbIgnoreLinkList, |
| 106 | IN STATE_DATA *State |
| 107 | ); |
| 108 | |
| 109 | /** |
| 110 | * Get a new Socket Die to Node Map. |
| 111 | * |
| 112 | */ |
| 113 | VOID |
| 114 | NewNodeAndSocketTables ( |
| 115 | IN OUT STATE_DATA *State |
| 116 | ); |
| 117 | |
| 118 | /** |
| 119 | * Get the minimum Northbridge frequency for the system. |
| 120 | * |
| 121 | */ |
| 122 | UINT32 |
| 123 | GetMinNbCoreFreq ( |
| 124 | IN PLATFORM_CONFIGURATION *PlatformConfig, |
| 125 | IN AMD_CONFIG_PARAMS *StdHeader |
| 126 | ); |
| 127 | |
| 128 | /** |
| 129 | * Fill in the socket's Node id when a processor is discovered in that socket. |
| 130 | * |
| 131 | */ |
| 132 | VOID |
| 133 | SetNodeToSocketMap ( |
| 134 | IN UINT8 Node, |
| 135 | IN UINT8 CurrentNodeModule, |
| 136 | IN UINT8 PackageLink, |
| 137 | IN UINT8 NewNode, |
| 138 | IN UINT8 HardwareSocket, |
| 139 | IN UINT8 Module, |
| 140 | IN STATE_DATA *State |
| 141 | ); |
| 142 | |
| 143 | /** |
| 144 | * Clean up the map structures after severe event has caused a fall back to 1 node. |
| 145 | * |
| 146 | */ |
| 147 | VOID |
| 148 | CleanMapsAfterError ( |
| 149 | IN STATE_DATA *State |
| 150 | ); |
| 151 | |
| 152 | /** |
| 153 | * Post Node id and other context info to AP cores via mailbox. |
| 154 | * |
| 155 | */ |
| 156 | VOID |
| 157 | PostMapToAp ( |
| 158 | IN STATE_DATA *State |
| 159 | ); |
| 160 | |
| 161 | #endif /* _HT_INTERFACE_GENERAL_H_ */ |