|
@@ -0,0 +1,211 @@
|
|
1
|
+#ifndef _THUNDERXCFG_H
|
|
2
|
+#define _THUNDERXCFG_H
|
|
3
|
+
|
|
4
|
+/** @file
|
|
5
|
+ *
|
|
6
|
+ * Cavium ThunderX Board Configuration
|
|
7
|
+ *
|
|
8
|
+ * The definitions in this section are extracted from BSD-licensed
|
|
9
|
+ * (but non-public) portions of ThunderPkg.
|
|
10
|
+ *
|
|
11
|
+ */
|
|
12
|
+
|
|
13
|
+FILE_LICENCE ( BSD2 );
|
|
14
|
+
|
|
15
|
+#include <ipxe/efi/efi.h>
|
|
16
|
+
|
|
17
|
+/******************************************************************************
|
|
18
|
+ *
|
|
19
|
+ * From ThunderxBoardConfig.h
|
|
20
|
+ *
|
|
21
|
+ ******************************************************************************
|
|
22
|
+ *
|
|
23
|
+ * Header file for Cavium ThunderX Board Configurations
|
|
24
|
+ * Copyright (c) 2015, Cavium 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
|
|
29
|
+ * are met:
|
|
30
|
+ *
|
|
31
|
+ * 1. Redistributions of source code must retain the above copyright
|
|
32
|
+ * notice, this list of conditions and the following disclaimer.
|
|
33
|
+ * 2. Redistributions in binary form must reproduce the above
|
|
34
|
+ * copyright notice, this list of conditions and the following
|
|
35
|
+ * disclaimer in the documentation and/or other materials provided
|
|
36
|
+ * with the distribution.
|
|
37
|
+ *
|
|
38
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
39
|
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
40
|
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
41
|
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
42
|
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
43
|
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
44
|
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
45
|
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
46
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
47
|
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
48
|
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
49
|
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
50
|
+ * SUCH DAMAGE.
|
|
51
|
+ *
|
|
52
|
+ */
|
|
53
|
+
|
|
54
|
+#define MAX_NODES 2
|
|
55
|
+#define CLUSTER_COUNT 3
|
|
56
|
+#define CORE_PER_CLUSTER_COUNT 16
|
|
57
|
+#define CORE_COUNT (CLUSTER_COUNT*CORE_PER_CLUSTER_COUNT)
|
|
58
|
+#define BGX_PER_NODE_COUNT 2
|
|
59
|
+#define LMAC_PER_BGX_COUNT 4
|
|
60
|
+#define PEM_PER_NODE_COUNT 6
|
|
61
|
+#define LMC_PER_NODE_COUNT 4
|
|
62
|
+#define DIMM_PER_LMC_COUNT 2
|
|
63
|
+
|
|
64
|
+#define THUNDERX_CPU_ID(node, cluster, core) (((node) << 16) | ((cluster) << 8) | (core))
|
|
65
|
+
|
|
66
|
+//TODO: Put common type definitions in separate common include file
|
|
67
|
+typedef enum {
|
|
68
|
+ BGX_MODE_SGMII, /* 1 lane, 1.250 Gbaud */
|
|
69
|
+ BGX_MODE_XAUI, /* 4 lanes, 3.125 Gbaud */
|
|
70
|
+ BGX_MODE_DXAUI, /* 4 lanes, 6.250 Gbaud */
|
|
71
|
+ BGX_MODE_RXAUI, /* 2 lanes, 6.250 Gbaud */
|
|
72
|
+ BGX_MODE_XFI, /* 1 lane, 10.3125 Gbaud */
|
|
73
|
+ BGX_MODE_XLAUI, /* 4 lanes, 10.3125 Gbaud */
|
|
74
|
+ BGX_MODE_10G_KR,/* 1 lane, 10.3125 Gbaud */
|
|
75
|
+ BGX_MODE_40G_KR,/* 4 lanes, 10.3125 Gbaud */
|
|
76
|
+ BGX_MODE_UNKNOWN
|
|
77
|
+} BGX_MODE_T;
|
|
78
|
+
|
|
79
|
+typedef enum {
|
|
80
|
+ EBB8800,
|
|
81
|
+ EBB8804,
|
|
82
|
+ CRB_1S,
|
|
83
|
+ CRB_2S,
|
|
84
|
+ ASIANCAT,
|
|
85
|
+ GBT_MT60,
|
|
86
|
+ INVENTEC_P3E003,
|
|
87
|
+ BOARD_MAX
|
|
88
|
+} BOARD_TYPE;
|
|
89
|
+
|
|
90
|
+typedef struct {
|
|
91
|
+ BOOLEAN Enabled;
|
|
92
|
+ UINT64 LaneToSds;
|
|
93
|
+ UINT64 MacAddress;
|
|
94
|
+} LMAC_CFG;
|
|
95
|
+
|
|
96
|
+typedef struct {
|
|
97
|
+ BOOLEAN BgxEnabled;
|
|
98
|
+ BGX_MODE_T BgxMode;
|
|
99
|
+ UINTN LmacCount; //Maximum number of LMAcs
|
|
100
|
+ UINT64 BaseAddress;
|
|
101
|
+ UINT64 LmacType;
|
|
102
|
+ /* Bit mask of QLMs connected to this BGX */
|
|
103
|
+ UINT64 QlmMask;
|
|
104
|
+ UINT64 QlmFreq;
|
|
105
|
+ BOOLEAN UseTraining;
|
|
106
|
+ LMAC_CFG Lmacs[LMAC_PER_BGX_COUNT];
|
|
107
|
+} BGX_CFG;
|
|
108
|
+
|
|
109
|
+typedef struct {
|
|
110
|
+ BOOLEAN PemUsable;
|
|
111
|
+} PEM_CFG;
|
|
112
|
+
|
|
113
|
+typedef struct {
|
|
114
|
+ enum { NotPresent, Empty, Available } Status;
|
|
115
|
+ UINT8 Type;
|
|
116
|
+ UINT8 SubType;
|
|
117
|
+ UINT8 Rank;
|
|
118
|
+ UINT16 Mfg;
|
|
119
|
+ UINTN SizeMb;
|
|
120
|
+ UINTN Speed;
|
|
121
|
+ CHAR8 Serial[16];
|
|
122
|
+ CHAR8 PartNo[24];
|
|
123
|
+} DIMM_CFG;
|
|
124
|
+
|
|
125
|
+typedef struct {
|
|
126
|
+ DIMM_CFG DimmCfg[DIMM_PER_LMC_COUNT];
|
|
127
|
+} LMC_CFG;
|
|
128
|
+
|
|
129
|
+typedef struct {
|
|
130
|
+ BOOLEAN Core[CORE_COUNT];
|
|
131
|
+ BGX_CFG BgxCfg[BGX_PER_NODE_COUNT];
|
|
132
|
+ PEM_CFG PemCfg[PEM_PER_NODE_COUNT];
|
|
133
|
+ LMC_CFG LmcCfg[LMC_PER_NODE_COUNT];
|
|
134
|
+ UINT64 RamStart;
|
|
135
|
+ UINT64 RamReserve;
|
|
136
|
+ UINT64 RamSize;
|
|
137
|
+ UINTN CPUSpeed;
|
|
138
|
+ UINTN CPUVersion;
|
|
139
|
+} NODE_CFG;
|
|
140
|
+
|
|
141
|
+#define MAX_SERIAL 32
|
|
142
|
+#define MAX_REVISION 32
|
|
143
|
+typedef struct {
|
|
144
|
+ BOARD_TYPE BoardType;
|
|
145
|
+ CHAR8 Serial[MAX_SERIAL];
|
|
146
|
+ CHAR8 Revision[MAX_REVISION];
|
|
147
|
+ UINTN NumNodes;
|
|
148
|
+ UINTN BmcBootTwsiBus;
|
|
149
|
+ UINTN BmcBootTwsiAddr;
|
|
150
|
+ UINTN RtcTwsiBus;
|
|
151
|
+ UINTN RtcTwsiAddr;
|
|
152
|
+ /* IPMI support*/
|
|
153
|
+ UINTN BmcIpmiTwsiBus;
|
|
154
|
+ UINTN BmcIpmiTwsiAddr;
|
|
155
|
+ NODE_CFG Node[MAX_NODES];
|
|
156
|
+ UINT16 CpuClusterCount;
|
|
157
|
+ UINT16 CpuPerClusterCount;
|
|
158
|
+ UINT16 PcieSegmentCount;
|
|
159
|
+ UINT64 MacAddrRangeStart;
|
|
160
|
+ UINTN DdrSpeed;
|
|
161
|
+ UINT64 AcpiOemTableId;
|
|
162
|
+} BOARD_CFG;
|
|
163
|
+
|
|
164
|
+/******************************************************************************
|
|
165
|
+ *
|
|
166
|
+ * From ThunderConfigProtocol.h
|
|
167
|
+ *
|
|
168
|
+ ******************************************************************************
|
|
169
|
+ *
|
|
170
|
+ * Thunder board Configuration Protocol
|
|
171
|
+ *
|
|
172
|
+ * Copyright (c) 2015, Cavium Inc. All rights reserved.<BR>
|
|
173
|
+ *
|
|
174
|
+ * This program and the accompanying materials are licensed and made
|
|
175
|
+ * available under the terms and conditions of the BSD License which
|
|
176
|
+ * accompanies this distribution. The full text of the license may
|
|
177
|
+ * be found at http://opensource.org/licenses/bsd-license.php
|
|
178
|
+ *
|
|
179
|
+ * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
|
|
180
|
+ * BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
|
|
181
|
+ * EXPRESS OR IMPLIED.
|
|
182
|
+ *
|
|
183
|
+ */
|
|
184
|
+
|
|
185
|
+#define EFI_THUNDER_CONFIG_PROTOCOL_GUID \
|
|
186
|
+ {0xb75a0608, 0x99ff, 0x11e5, {0x9b, 0xeb, 0x00, 0x14, 0xd1, 0xfa, 0x23, 0x5c}}
|
|
187
|
+
|
|
188
|
+///
|
|
189
|
+/// Forward declaration
|
|
190
|
+///
|
|
191
|
+typedef struct _EFI_THUNDER_CONFIG_PROTOCOL EFI_THUNDER_CONFIG_PROTOCOL;
|
|
192
|
+
|
|
193
|
+///
|
|
194
|
+/// Function prototypes
|
|
195
|
+///
|
|
196
|
+typedef
|
|
197
|
+EFI_STATUS
|
|
198
|
+(EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG)(
|
|
199
|
+ IN EFI_THUNDER_CONFIG_PROTOCOL *This,
|
|
200
|
+ OUT BOARD_CFG** cfg
|
|
201
|
+ );
|
|
202
|
+
|
|
203
|
+///
|
|
204
|
+/// Protocol structure
|
|
205
|
+///
|
|
206
|
+typedef struct _EFI_THUNDER_CONFIG_PROTOCOL {
|
|
207
|
+ EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG GetConfig;
|
|
208
|
+ BOARD_CFG* BoardConfig;
|
|
209
|
+} EFI_THUNDER_CONFIG_PROTOCOL;
|
|
210
|
+
|
|
211
|
+#endif /* _THUNDERXCFG_H */
|