]> git.proxmox.com Git - mirror_edk2.git/blob - EmulatorPkg/PlatformSmbiosDxe/SmbiosTable.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / EmulatorPkg / PlatformSmbiosDxe / SmbiosTable.c
1 /** @file
2 Static SMBIOS Table for platform
3
4 Note SMBIOS 2.7.1 Required structures:
5 BIOS Information (Type 0)
6 System Information (Type 1)
7 System Enclosure (Type 3)
8 Processor Information (Type 4) - CPU Driver
9 Cache Information (Type 7) - For cache that is external to processor
10 System Slots (Type 9) - If system has slots
11 Physical Memory Array (Type 16)
12 Memory Device (Type 17) - For each socketed system-memory Device
13 Memory Array Mapped Address (Type 19) - One per contiguous block per Physical Memroy Array
14 System Boot Information (Type 32)
15
16 Copyright (c) 2012, Apple Inc. All rights reserved.<BR>
17 SPDX-License-Identifier: BSD-2-Clause-Patent
18
19 **/
20
21 #include <PiDxe.h>
22 #include <IndustryStandard/SmBios.h>
23 #include <Protocol/Smbios.h>
24 #include <Library/SmbiosLib.h>
25
26 SMBIOS_TABLE_TYPE0 gSmbiosType0Template = {
27 { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 },
28 1, // Vendor String
29 2, // BiosVersion String
30 0xE000, // BiosSegment
31 3, // BiosReleaseDate String
32 0x7F, // BiosSize
33 { // BiosCharacteristics
34 0, // Reserved :2; ///< Bits 0-1.
35 0, // Unknown :1;
36 0, // BiosCharacteristicsNotSupported :1;
37 0, // IsaIsSupported :1;
38 0, // McaIsSupported :1;
39 0, // EisaIsSupported :1;
40 1, // PciIsSupported :1;
41 0, // PcmciaIsSupported :1;
42 0, // PlugAndPlayIsSupported :1;
43 0, // ApmIsSupported :1;
44 1, // BiosIsUpgradable :1;
45 1, // BiosShadowingAllowed :1;
46 0, // VlVesaIsSupported :1;
47 0, // EscdSupportIsAvailable :1;
48 0, // BootFromCdIsSupported :1;
49 1, // SelectableBootIsSupported :1;
50 0, // RomBiosIsSocketed :1;
51 0, // BootFromPcmciaIsSupported :1;
52 0, // EDDSpecificationIsSupported :1;
53 0, // JapaneseNecFloppyIsSupported :1;
54 0, // JapaneseToshibaFloppyIsSupported :1;
55 0, // Floppy525_360IsSupported :1;
56 0, // Floppy525_12IsSupported :1;
57 0, // Floppy35_720IsSupported :1;
58 0, // Floppy35_288IsSupported :1;
59 0, // PrintScreenIsSupported :1;
60 0, // Keyboard8042IsSupported :1;
61 0, // SerialIsSupported :1;
62 0, // PrinterIsSupported :1;
63 0, // CgaMonoIsSupported :1;
64 0, // NecPc98 :1;
65 0 // ReservedForVendor :32; ///< Bits 32-63. Bits 32-47 reserved for BIOS vendor
66 ///< and bits 48-63 reserved for System Vendor.
67 },
68 { // BIOSCharacteristicsExtensionBytes[]
69 0x81, // AcpiIsSupported :1;
70 // UsbLegacyIsSupported :1;
71 // AgpIsSupported :1;
72 // I2OBootIsSupported :1;
73 // Ls120BootIsSupported :1;
74 // AtapiZipDriveBootIsSupported :1;
75 // Boot1394IsSupported :1;
76 // SmartBatteryIsSupported :1;
77 // BIOSCharacteristicsExtensionBytes[1]
78 0x0a, // BiosBootSpecIsSupported :1;
79 // FunctionKeyNetworkBootIsSupported :1;
80 // TargetContentDistributionEnabled :1;
81 // UefiSpecificationSupported :1;
82 // VirtualMachineSupported :1;
83 // ExtensionByte2Reserved :3;
84 },
85 0x00, // SystemBiosMajorRelease
86 0x01, // SystemBiosMinorRelease
87 0xFF, // EmbeddedControllerFirmwareMajorRelease
88 0xFF, // EmbeddedControllerFirmwareMinorRelease
89 };
90 CHAR8 *gSmbiosType0Strings[] = {
91 "http://www.tianocore.org/edk2/", // Vendor String
92 __TIME__, // BiosVersion String
93 __DATE__, // BiosReleaseDate String
94 NULL
95 };
96
97 SMBIOS_TABLE_TYPE1 gSmbiosType1Template = {
98 { EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, sizeof (SMBIOS_TABLE_TYPE1), 0 },
99 1, // Manufacturer String
100 2, // ProductName String
101 3, // Version String
102 4, // SerialNumber String
103 { 0x25EF0280, 0xEC82, 0x42B0, { 0x8F, 0xB6, 0x10, 0xAD, 0xCC, 0xC6, 0x7C, 0x02}
104 },
105 SystemWakeupTypePowerSwitch,
106 5, // SKUNumber String
107 6, // Family String
108 };
109 CHAR8 *gSmbiosType1Strings[] = {
110 "http://www.tianocore.org/edk2/",
111 "EmulatorPkg",
112 "1.0",
113 "System Serial#",
114 "System SKU#",
115 "edk2",
116 NULL
117 };
118
119 SMBIOS_TABLE_TYPE2 gSmbiosType2Template = {
120 { EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION, sizeof (SMBIOS_TABLE_TYPE2), 0 },
121 1, // Manufacturer String
122 2, // ProductName String
123 3, // Version String
124 4, // SerialNumber String
125 5, // AssetTag String
126 { // FeatureFlag
127 1, // Motherboard :1;
128 0, // RequiresDaughterCard :1;
129 0, // Removable :1;
130 0, // Replaceable :1;
131 0, // HotSwappable :1;
132 0, // Reserved :3;
133 },
134 6, // LocationInChassis String
135 0, // ChassisHandle;
136 BaseBoardTypeMotherBoard, // BoardType;
137 0, // NumberOfContainedObjectHandles;
138 { 0 } // ContainedObjectHandles[1];
139 };
140 CHAR8 *gSmbiosType2Strings[] = {
141 "http://www.tianocore.org/edk2/",
142 "EmulatorPkg",
143 "1.0",
144 "Base Board Serial#",
145 "Base Board Asset Tag#",
146 "Part Component",
147 NULL
148 };
149
150 SMBIOS_TABLE_TYPE3 gSmbiosType3Template = {
151 { EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, sizeof (SMBIOS_TABLE_TYPE3), 0 },
152 1, // Manufacturer String
153 MiscChassisTypeLapTop, // Type;
154 2, // Version String
155 3, // SerialNumber String
156 4, // AssetTag String
157 ChassisStateSafe, // BootupState;
158 ChassisStateSafe, // PowerSupplyState;
159 ChassisStateSafe, // ThermalState;
160 ChassisSecurityStatusNone, // SecurityStatus;
161 { 0, 0, 0, 0}, // OemDefined[4];
162 0, // Height;
163 0, // NumberofPowerCords;
164 0, // ContainedElementCount;
165 0, // ContainedElementRecordLength;
166 {
167 { 0 }
168 }, // ContainedElements[1];
169 };
170 CHAR8 *gSmbiosType3Strings[] = {
171 "http://www.tianocore.org/edk2/",
172 "EmulatorPkg",
173 "Chassis Board Serial#",
174 "Chassis Board Asset Tag#",
175 NULL
176 };
177
178 SMBIOS_TABLE_TYPE8 gSmbiosType8Template1 = {
179 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
180 0, // InternalReferenceDesignator String
181 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
182 1, // ExternalReferenceDesignator String
183 PortConnectorTypeNone, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
184 PortTypeOther, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
185 };
186 CHAR8 *gSmbiosType8Strings1[] = {
187 "Mini DisplayPort",
188 NULL
189 };
190
191 SMBIOS_TABLE_TYPE8 gSmbiosType8Template2 = {
192 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
193 0, // InternalReferenceDesignator String
194 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
195 1, // ExternalReferenceDesignator String
196 PortConnectorTypeNone, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
197 PortTypeFireWire, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
198 };
199 CHAR8 *gSmbiosType8Strings2[] = {
200 "FireWire 800",
201 NULL
202 };
203
204 SMBIOS_TABLE_TYPE8 gSmbiosType8Template3 = {
205 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
206 0, // InternalReferenceDesignator String
207 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
208 1, // ExternalReferenceDesignator String
209 PortConnectorTypeRJ45, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
210 PortTypeNetworkPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
211 };
212 CHAR8 *gSmbiosType8Strings3[] = {
213 "Ethernet",
214 NULL
215 };
216
217 SMBIOS_TABLE_TYPE8 gSmbiosType8Template4 = {
218 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
219 0, // InternalReferenceDesignator String
220 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
221 1, // ExternalReferenceDesignator String
222 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
223 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
224 };
225 CHAR8 *gSmbiosType8Strings4[] = {
226 "USB0",
227 NULL
228 };
229
230 SMBIOS_TABLE_TYPE8 gSmbiosType8Template5 = {
231 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
232 0, // InternalReferenceDesignator String
233 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
234 1, // ExternalReferenceDesignator String
235 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
236 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
237 };
238 CHAR8 *gSmbiosType8Strings5[] = {
239 "USB1",
240 NULL
241 };
242
243 SMBIOS_TABLE_TYPE8 gSmbiosType8Template6 = {
244 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
245 0, // InternalReferenceDesignator String
246 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
247 1, // ExternalReferenceDesignator String
248 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
249 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
250 };
251 CHAR8 *gSmbiosType8Strings6[] = {
252 "USB2",
253 NULL
254 };
255
256 SMBIOS_TABLE_TYPE8 gSmbiosType8Template7 = {
257 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
258 0, // InternalReferenceDesignator String
259 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
260 1, // ExternalReferenceDesignator String
261 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
262 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
263 };
264 CHAR8 *gSmbiosType8Strings7[] = {
265 "USB3",
266 NULL
267 };
268
269 SMBIOS_TABLE_TYPE8 gSmbiosType8Template8 = {
270 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
271 0, // InternalReferenceDesignator String
272 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
273 1, // ExternalReferenceDesignator String
274 PortConnectorTypeHeadPhoneMiniJack, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
275 PortTypeAudioPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
276 };
277 CHAR8 *gSmbiosType8Strings8[] = {
278 "Audio Line In",
279 NULL
280 };
281
282 SMBIOS_TABLE_TYPE8 gSmbiosType8Template9 = {
283 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
284 0, // InternalReferenceDesignator String
285 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
286 1, // ExternalReferenceDesignator String
287 PortConnectorTypeHeadPhoneMiniJack, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
288 PortTypeAudioPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
289 };
290 CHAR8 *gSmbiosType8Strings9[] = {
291 "Audio Line Out",
292 NULL
293 };
294
295 SMBIOS_TABLE_TYPE9 gSmbiosType9Template = {
296 { EFI_SMBIOS_TYPE_SYSTEM_SLOTS, sizeof (SMBIOS_TABLE_TYPE9), 0 },
297 1, // SlotDesignation String
298 SlotTypeOther, // SlotType; ///< The enumeration value from MISC_SLOT_TYPE.
299 SlotDataBusWidthOther, // SlotDataBusWidth; ///< The enumeration value from MISC_SLOT_DATA_BUS_WIDTH.
300 SlotUsageAvailable, // CurrentUsage; ///< The enumeration value from MISC_SLOT_USAGE.
301 SlotLengthOther, // SlotLength; ///< The enumeration value from MISC_SLOT_LENGTH.
302 0, // SlotID;
303 { // SlotCharacteristics1;
304 1, // CharacteristicsUnknown :1;
305 0, // Provides50Volts :1;
306 0, // Provides33Volts :1;
307 0, // SharedSlot :1;
308 0, // PcCard16Supported :1;
309 0, // CardBusSupported :1;
310 0, // ZoomVideoSupported :1;
311 0, // ModemRingResumeSupported:1;
312 },
313 { // SlotCharacteristics2;
314 0, // PmeSignalSupported :1;
315 0, // HotPlugDevicesSupported :1;
316 0, // SmbusSignalSupported :1;
317 0, // Reserved :5; ///< Set to 0.
318 },
319 0, // SegmentGroupNum;
320 0, // BusNum;
321 0, // DevFuncNum;
322 };
323 CHAR8 *gSmbiosType9Strings[] = {
324 "SD Card",
325 NULL
326 };
327
328 SMBIOS_TABLE_TYPE11 gSmbiosType11Template = {
329 { EFI_SMBIOS_TYPE_OEM_STRINGS, sizeof (SMBIOS_TABLE_TYPE11), 0 },
330 1 // StringCount
331 };
332 CHAR8 *gSmbiosType11Strings[] = {
333 "https://svn.code.sf.net/p/edk2/code/trunk/edk2/EmulatorPkg/",
334 NULL
335 };
336
337 SMBIOS_TABLE_TYPE12 gSmbiosType12Template = {
338 { EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS, sizeof (SMBIOS_TABLE_TYPE12), 0 },
339 1 // StringCount
340 };
341 CHAR8 *gSmbiosType12Strings[] = {
342 "https://svn.code.sf.net/p/edk2/code/trunk/edk2/EmulatorPkg/EmulatorPkg.dsc",
343 NULL
344 };
345
346 SMBIOS_TABLE_TYPE16 gSmbiosType16Template = {
347 { EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, sizeof (SMBIOS_TABLE_TYPE16), 0 },
348 MemoryArrayLocationSystemBoard, // Location; ///< The enumeration value from MEMORY_ARRAY_LOCATION.
349 MemoryArrayUseSystemMemory, // Use; ///< The enumeration value from MEMORY_ARRAY_USE.
350 MemoryErrorCorrectionUnknown, // MemoryErrorCorrection; ///< The enumeration value from MEMORY_ERROR_CORRECTION.
351 0x80000000, // MaximumCapacity;
352 0xFFFE, // MemoryErrorInformationHandle;
353 1, // NumberOfMemoryDevices;
354 0x3fffffffffffffffULL, // ExtendedMaximumCapacity;
355 };
356
357 SMBIOS_TABLE_TYPE17 gSmbiosType17Template = {
358 { EFI_SMBIOS_TYPE_MEMORY_DEVICE, sizeof (SMBIOS_TABLE_TYPE17), 0 },
359 0, // MemoryArrayHandle;
360 0xFFFE, // MemoryErrorInformationHandle;
361 0xFFFF, // TotalWidth;
362 0xFFFF, // DataWidth;
363 0xFFFF, // Size;
364 MemoryFormFactorUnknown, // FormFactor; ///< The enumeration value from MEMORY_FORM_FACTOR.
365 0xff, // DeviceSet;
366 1, // DeviceLocator String
367 2, // BankLocator String
368 MemoryTypeDram, // MemoryType; ///< The enumeration value from MEMORY_DEVICE_TYPE.
369 { // TypeDetail;
370 0, // Reserved :1;
371 0, // Other :1;
372 1, // Unknown :1;
373 0, // FastPaged :1;
374 0, // StaticColumn :1;
375 0, // PseudoStatic :1;
376 0, // Rambus :1;
377 0, // Synchronous :1;
378 0, // Cmos :1;
379 0, // Edo :1;
380 0, // WindowDram :1;
381 0, // CacheDram :1;
382 0, // Nonvolatile :1;
383 0, // Registered :1;
384 0, // Unbuffered :1;
385 0, // Reserved1 :1;
386 },
387 0, // Speed;
388 3, // Manufacturer String
389 0, // SerialNumber String
390 0, // AssetTag String
391 0, // PartNumber String
392 0, // Attributes;
393 0, // ExtendedSize;
394 0, // ConfiguredMemoryClockSpeed;
395 };
396 CHAR8 *gSmbiosType17Strings[] = {
397 "OS Virtual Memory",
398 "malloc",
399 "OSV",
400 NULL
401 };
402
403 SMBIOS_TABLE_TYPE23 gSmbiosType23Template = {
404 { EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, sizeof (SMBIOS_TABLE_TYPE23), 0 },
405 0, // Capabilities;
406 0, // ResetCount;
407 0, // ResetLimit;
408 0, // TimerInterval;
409 0 // Timeout;
410 };
411
412 SMBIOS_TABLE_TYPE32 gSmbiosType32Template = {
413 { EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, sizeof (SMBIOS_TABLE_TYPE32), 0 },
414 { 0, 0, 0, 0, 0, 0}, // Reserved[6];
415 BootInformationStatusNoError // BootStatus
416 };
417
418 SMBIOS_TEMPLATE_ENTRY gSmbiosTemplate[] = {
419 { (SMBIOS_STRUCTURE *)&gSmbiosType0Template, gSmbiosType0Strings },
420 { (SMBIOS_STRUCTURE *)&gSmbiosType1Template, gSmbiosType1Strings },
421 { (SMBIOS_STRUCTURE *)&gSmbiosType2Template, gSmbiosType2Strings },
422 { (SMBIOS_STRUCTURE *)&gSmbiosType3Template, gSmbiosType3Strings },
423 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template1, gSmbiosType8Strings1 },
424 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template2, gSmbiosType8Strings2 },
425 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template3, gSmbiosType8Strings3 },
426 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template4, gSmbiosType8Strings4 },
427 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template5, gSmbiosType8Strings5 },
428 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template6, gSmbiosType8Strings6 },
429 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template7, gSmbiosType8Strings7 },
430 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template8, gSmbiosType8Strings8 },
431 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template9, gSmbiosType8Strings9 },
432 { (SMBIOS_STRUCTURE *)&gSmbiosType9Template, gSmbiosType9Strings },
433 { (SMBIOS_STRUCTURE *)&gSmbiosType11Template, gSmbiosType11Strings },
434 { (SMBIOS_STRUCTURE *)&gSmbiosType12Template, gSmbiosType12Strings },
435 { (SMBIOS_STRUCTURE *)&gSmbiosType16Template, NULL },
436 { (SMBIOS_STRUCTURE *)&gSmbiosType17Template, gSmbiosType17Strings },
437 { (SMBIOS_STRUCTURE *)&gSmbiosType23Template, NULL },
438 { (SMBIOS_STRUCTURE *)&gSmbiosType32Template, NULL },
439 { NULL, NULL }
440 };