blob: 340c5c31397d820a672f53580ac2c7c125e52632 [file] [log] [blame]
Frank Vibrans2b4c8312011-02-14 18:30:54 +00001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * Topology interface definitions.
6 *
7 * Contains AMD AGESA internal interface for topology related data which
8 * is consumed by code other than HyperTransport init (and produced by
9 * HyperTransport init.)
10 *
11 * @xrefitem bom "File Content Label" "Release Content"
12 * @e project: AGESA
13 * @e sub-project: Core
Edward O'Callaghane3f47ea2014-11-18 18:27:29 +110014 * @e \$Revision: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $
Frank Vibrans2b4c8312011-02-14 18:30:54 +000015 */
Edward O'Callaghane3f47ea2014-11-18 18:27:29 +110016/*****************************************************************************
Frank Vibrans2b4c8312011-02-14 18:30:54 +000017 *
Edward O'Callaghane3f47ea2014-11-18 18:27:29 +110018 * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc.
Frank Vibrans2b4c8312011-02-14 18:30:54 +000019 * All rights reserved.
Edward O'Callaghane963b382014-07-06 19:27:14 +100020 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000021 * 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.
Edward O'Callaghane963b382014-07-06 19:27:14 +100028 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
29 * its contributors may be used to endorse or promote products derived
Frank Vibrans2b4c8312011-02-14 18:30:54 +000030 * from this software without specific prior written permission.
Edward O'Callaghane963b382014-07-06 19:27:14 +100031 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000032 * 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.
Edward O'Callaghane963b382014-07-06 19:27:14 +100042 *
Edward O'Callaghane3f47ea2014-11-18 18:27:29 +110043 ***************************************************************************/
Frank Vibrans2b4c8312011-02-14 18:30:54 +000044
45#ifndef _TOPOLOGY_H_
46#define _TOPOLOGY_H_
47
48// Defines for limiting data structure maximum allocation and limit checking.
49#define MAX_NODES 8
50#define MAX_SOCKETS MAX_NODES
51#define MAX_DIES 2
52
53// Defines useful with package link
54#define HT_LIST_MATCH_INTERNAL_LINK_0 0xFA
55#define HT_LIST_MATCH_INTERNAL_LINK_1 0xFB
56#define HT_LIST_MATCH_INTERNAL_LINK_2 0xFC
57
58/**
59 * Hop Count Table.
60 * This is a heap data structure. The Hops array is filled as a size x size matrix.
61 * The unused space, if any, is all at the end.
62 */
63typedef struct {
64 UINT8 Size; ///< The row and column size of actual hop count data */
65 UINT8 Hops[MAX_NODES * MAX_NODES]; ///< Room for a dynamic two dimensional array of [size][size] */
66} HOP_COUNT_TABLE;
67
68/**
69 * Socket and Module to Node Map Item.
70 * Provide the Node Id and core id range for each module in each processor.
71 */
72typedef struct {
73 UINT8 Node; ///< The module's Node id.
74 UINT8 LowCore; ///< The lowest processor core id for this module.
75 UINT8 HighCore; ///< The highest processor core id for this module.
76 UINT8 EnabledComputeUnits; ///< The value of Enabled for this processor module.
77 UINT8 DualCoreComputeUnits; ///< The value of DualCore for this processor module.
78} SOCKET_DIE_TO_NODE_ITEM;
79
80/**
81 * Socket and Module to Node Map.
82 * This type is a pointer to the actual map, it can be used for a struct item or
83 * for typecasting a heap buffer pointer.
84 */
85typedef SOCKET_DIE_TO_NODE_ITEM (*SOCKET_DIE_TO_NODE_MAP)[MAX_SOCKETS][MAX_DIES];
86
87/**
88 * Node id to Socket Die Map Item.
89 */
90typedef struct {
91 UINT8 Socket; ///< socket of the processor containing the Node.
92 UINT8 Die; ///< the module in the processor which is Node.
93} NODE_TO_SOCKET_DIE_ITEM;
94
95/**
96 * Node id to Socket Die Map.
97 */
98typedef NODE_TO_SOCKET_DIE_ITEM (*NODE_TO_SOCKET_DIE_MAP)[MAX_NODES];
99
100/**
101 * Provide AP core with socket and node context at start up.
102 * This information is posted to the AP cores using a register as a mailbox.
103 */
104typedef struct {
105 UINT32 Node:4; ///< The node id of Core's node.
106 UINT32 Socket:4; ///< The socket of this Core's node.
107 UINT32 Module:2; ///< The internal module number for Core's node.
108 UINT32 ModuleType:2; ///< Single Module = 0, Multi-module = 1.
109 UINT32 :20; ///< Reserved
110} AP_MAIL_INFO_FIELDS;
111
112/**
113 * AP info fields can be written and read to a register.
114 */
115typedef union {
116 UINT32 Info; ///< Just a number for register access, or opaque passing.
117 AP_MAIL_INFO_FIELDS Fields; ///< access to the info fields.
118} AP_MAIL_INFO;
119
120/**
121 * Provide AP core with system degree and system core number at start up.
122 * This information is posted to the AP cores using a register as a mailbox.
123 */
124typedef struct {
125 UINT32 SystemDegree:3; ///< The number of connected links
126 UINT32 :3; ///< Reserved
127 UINT32 HeapIndex:6; ///< The zero-based system core number
128 UINT32 :20; ///< Reserved
129} AP_MAIL_EXT_INFO_FIELDS;
130
131/**
132 * AP info fields can be written and read to a register.
133 */
134typedef union {
135 UINT32 Info; ///< Just a number for register access, or opaque passing.
136 AP_MAIL_EXT_INFO_FIELDS Fields; ///< access to the info fields.
137} AP_MAIL_EXT_INFO;
138
139/**
140 * AP Info mailbox set.
141 */
142typedef struct {
143 AP_MAIL_INFO ApMailInfo; ///< The AP mail info
144 AP_MAIL_EXT_INFO ApMailExtInfo; ///< The extended AP mail info
145} AP_MAILBOXES;
146
147/**
148 * Provide a northbridge to package mapping for link assignments.
149 *
150 */
151typedef struct {
152 UINT8 Link; ///< The Node's link
153 UINT8 Module; ///< The internal module position of Node
154 UINT8 PackageLink; ///< The corresponding package link
155} PACKAGE_HTLINK_MAP_ITEM;
156
157/**
158 * A Processor's complete set of link assignments
159 */
160typedef PACKAGE_HTLINK_MAP_ITEM (*PACKAGE_HTLINK_MAP)[];
161
162#endif // _TOPOLOGY_H_