]> git.proxmox.com Git - mirror_edk2.git/blob - EmulatorPkg/PlatformSmbiosDxe/SmbiosTable.c
EmulatorPkg: Replace BSD License with BSD+Patent License
[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
27 SMBIOS_TABLE_TYPE0 gSmbiosType0Template = {
28 { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 },
29 1, // Vendor String
30 2, // BiosVersion String
31 0xE000, // BiosSegment
32 3, // BiosReleaseDate String
33 0x7F, // BiosSize
34 { // BiosCharacteristics
35 0, // Reserved :2; ///< Bits 0-1.
36 0, // Unknown :1;
37 0, // BiosCharacteristicsNotSupported :1;
38 0, // IsaIsSupported :1;
39 0, // McaIsSupported :1;
40 0, // EisaIsSupported :1;
41 1, // PciIsSupported :1;
42 0, // PcmciaIsSupported :1;
43 0, // PlugAndPlayIsSupported :1;
44 0, // ApmIsSupported :1;
45 1, // BiosIsUpgradable :1;
46 1, // BiosShadowingAllowed :1;
47 0, // VlVesaIsSupported :1;
48 0, // EscdSupportIsAvailable :1;
49 0, // BootFromCdIsSupported :1;
50 1, // SelectableBootIsSupported :1;
51 0, // RomBiosIsSocketed :1;
52 0, // BootFromPcmciaIsSupported :1;
53 0, // EDDSpecificationIsSupported :1;
54 0, // JapaneseNecFloppyIsSupported :1;
55 0, // JapaneseToshibaFloppyIsSupported :1;
56 0, // Floppy525_360IsSupported :1;
57 0, // Floppy525_12IsSupported :1;
58 0, // Floppy35_720IsSupported :1;
59 0, // Floppy35_288IsSupported :1;
60 0, // PrintScreenIsSupported :1;
61 0, // Keyboard8042IsSupported :1;
62 0, // SerialIsSupported :1;
63 0, // PrinterIsSupported :1;
64 0, // CgaMonoIsSupported :1;
65 0, // NecPc98 :1;
66 0 // ReservedForVendor :32; ///< Bits 32-63. Bits 32-47 reserved for BIOS vendor
67 ///< and bits 48-63 reserved for System Vendor.
68 },
69 { // BIOSCharacteristicsExtensionBytes[]
70 0x81, // AcpiIsSupported :1;
71 // UsbLegacyIsSupported :1;
72 // AgpIsSupported :1;
73 // I2OBootIsSupported :1;
74 // Ls120BootIsSupported :1;
75 // AtapiZipDriveBootIsSupported :1;
76 // Boot1394IsSupported :1;
77 // SmartBatteryIsSupported :1;
78 // BIOSCharacteristicsExtensionBytes[1]
79 0x0a, // BiosBootSpecIsSupported :1;
80 // FunctionKeyNetworkBootIsSupported :1;
81 // TargetContentDistributionEnabled :1;
82 // UefiSpecificationSupported :1;
83 // VirtualMachineSupported :1;
84 // ExtensionByte2Reserved :3;
85 },
86 0x00, // SystemBiosMajorRelease
87 0x01, // SystemBiosMinorRelease
88 0xFF, // EmbeddedControllerFirmwareMajorRelease
89 0xFF, // EmbeddedControllerFirmwareMinorRelease
90 };
91 CHAR8 *gSmbiosType0Strings[] = {
92 "http://www.tianocore.org/edk2/", // Vendor String
93 __TIME__, // BiosVersion String
94 __DATE__, // BiosReleaseDate String
95 NULL
96 };
97
98 SMBIOS_TABLE_TYPE1 gSmbiosType1Template = {
99 { EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, sizeof (SMBIOS_TABLE_TYPE1), 0 },
100 1, // Manufacturer String
101 2, // ProductName String
102 3, // Version String
103 4, // SerialNumber String
104 { 0x25EF0280, 0xEC82, 0x42B0, { 0x8F, 0xB6, 0x10, 0xAD, 0xCC, 0xC6, 0x7C, 0x02 } },
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 { { 0 } }, // ContainedElements[1];
167 };
168 CHAR8 *gSmbiosType3Strings[] = {
169 "http://www.tianocore.org/edk2/",
170 "EmulatorPkg",
171 "Chassis Board Serial#",
172 "Chassis Board Asset Tag#",
173 NULL
174 };
175
176 SMBIOS_TABLE_TYPE8 gSmbiosType8Template1 = {
177 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
178 0, // InternalReferenceDesignator String
179 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
180 1, // ExternalReferenceDesignator String
181 PortConnectorTypeNone, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
182 PortTypeOther, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
183 };
184 CHAR8 *gSmbiosType8Strings1[] = {
185 "Mini DisplayPort",
186 NULL
187 };
188
189 SMBIOS_TABLE_TYPE8 gSmbiosType8Template2 = {
190 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
191 0, // InternalReferenceDesignator String
192 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
193 1, // ExternalReferenceDesignator String
194 PortConnectorTypeNone, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
195 PortTypeFireWire, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
196 };
197 CHAR8 *gSmbiosType8Strings2[] = {
198 "FireWire 800",
199 NULL
200 };
201
202
203 SMBIOS_TABLE_TYPE8 gSmbiosType8Template3 = {
204 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
205 0, // InternalReferenceDesignator String
206 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
207 1, // ExternalReferenceDesignator String
208 PortConnectorTypeRJ45, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
209 PortTypeNetworkPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
210 };
211 CHAR8 *gSmbiosType8Strings3[] = {
212 "Ethernet",
213 NULL
214 };
215
216 SMBIOS_TABLE_TYPE8 gSmbiosType8Template4 = {
217 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
218 0, // InternalReferenceDesignator String
219 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
220 1, // ExternalReferenceDesignator String
221 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
222 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
223 };
224 CHAR8 *gSmbiosType8Strings4[] = {
225 "USB0",
226 NULL
227 };
228
229 SMBIOS_TABLE_TYPE8 gSmbiosType8Template5 = {
230 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
231 0, // InternalReferenceDesignator String
232 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
233 1, // ExternalReferenceDesignator String
234 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
235 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
236 };
237 CHAR8 *gSmbiosType8Strings5[] = {
238 "USB1",
239 NULL
240 };
241
242 SMBIOS_TABLE_TYPE8 gSmbiosType8Template6 = {
243 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
244 0, // InternalReferenceDesignator String
245 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
246 1, // ExternalReferenceDesignator String
247 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
248 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
249 };
250 CHAR8 *gSmbiosType8Strings6[] = {
251 "USB2",
252 NULL
253 };
254
255 SMBIOS_TABLE_TYPE8 gSmbiosType8Template7 = {
256 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
257 0, // InternalReferenceDesignator String
258 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
259 1, // ExternalReferenceDesignator String
260 PortConnectorTypeUsb, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
261 PortTypeUsb, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
262 };
263 CHAR8 *gSmbiosType8Strings7[] = {
264 "USB3",
265 NULL
266 };
267
268 SMBIOS_TABLE_TYPE8 gSmbiosType8Template8 = {
269 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
270 0, // InternalReferenceDesignator String
271 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
272 1, // ExternalReferenceDesignator String
273 PortConnectorTypeHeadPhoneMiniJack, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
274 PortTypeAudioPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
275 };
276 CHAR8 *gSmbiosType8Strings8[] = {
277 "Audio Line In",
278 NULL
279 };
280
281 SMBIOS_TABLE_TYPE8 gSmbiosType8Template9 = {
282 { EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE8), 0 },
283 0, // InternalReferenceDesignator String
284 PortConnectorTypeNone, // InternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
285 1, // ExternalReferenceDesignator String
286 PortConnectorTypeHeadPhoneMiniJack, // ExternalConnectorType; ///< The enumeration value from MISC_PORT_CONNECTOR_TYPE.
287 PortTypeAudioPort, // PortType; ///< The enumeration value from MISC_PORT_TYPE.
288 };
289 CHAR8 *gSmbiosType8Strings9[] = {
290 "Audio Line Out",
291 NULL
292 };
293
294 SMBIOS_TABLE_TYPE9 gSmbiosType9Template = {
295 { EFI_SMBIOS_TYPE_SYSTEM_SLOTS, sizeof (SMBIOS_TABLE_TYPE9), 0 },
296 1, // SlotDesignation String
297 SlotTypeOther, // SlotType; ///< The enumeration value from MISC_SLOT_TYPE.
298 SlotDataBusWidthOther, // SlotDataBusWidth; ///< The enumeration value from MISC_SLOT_DATA_BUS_WIDTH.
299 SlotUsageAvailable, // CurrentUsage; ///< The enumeration value from MISC_SLOT_USAGE.
300 SlotLengthOther, // SlotLength; ///< The enumeration value from MISC_SLOT_LENGTH.
301 0, // SlotID;
302 { // SlotCharacteristics1;
303 1, // CharacteristicsUnknown :1;
304 0, // Provides50Volts :1;
305 0, // Provides33Volts :1;
306 0, // SharedSlot :1;
307 0, // PcCard16Supported :1;
308 0, // CardBusSupported :1;
309 0, // ZoomVideoSupported :1;
310 0, // ModemRingResumeSupported:1;
311 },
312 { // SlotCharacteristics2;
313 0, // PmeSignalSupported :1;
314 0, // HotPlugDevicesSupported :1;
315 0, // SmbusSignalSupported :1;
316 0, // Reserved :5; ///< Set to 0.
317 },
318 0, // SegmentGroupNum;
319 0, // BusNum;
320 0, // DevFuncNum;
321 };
322 CHAR8 *gSmbiosType9Strings[] = {
323 "SD Card",
324 NULL
325 };
326
327 SMBIOS_TABLE_TYPE11 gSmbiosType11Template = {
328 { EFI_SMBIOS_TYPE_OEM_STRINGS, sizeof (SMBIOS_TABLE_TYPE11), 0 },
329 1 // StringCount
330 };
331 CHAR8 *gSmbiosType11Strings[] = {
332 "https://svn.code.sf.net/p/edk2/code/trunk/edk2/EmulatorPkg/",
333 NULL
334 };
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
419
420 SMBIOS_TEMPLATE_ENTRY gSmbiosTemplate[] = {
421 { (SMBIOS_STRUCTURE *)&gSmbiosType0Template, gSmbiosType0Strings },
422 { (SMBIOS_STRUCTURE *)&gSmbiosType1Template, gSmbiosType1Strings },
423 { (SMBIOS_STRUCTURE *)&gSmbiosType2Template, gSmbiosType2Strings },
424 { (SMBIOS_STRUCTURE *)&gSmbiosType3Template, gSmbiosType3Strings },
425 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template1, gSmbiosType8Strings1 },
426 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template2, gSmbiosType8Strings2 },
427 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template3, gSmbiosType8Strings3 },
428 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template4, gSmbiosType8Strings4 },
429 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template5, gSmbiosType8Strings5 },
430 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template6, gSmbiosType8Strings6 },
431 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template7, gSmbiosType8Strings7 },
432 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template8, gSmbiosType8Strings8 },
433 { (SMBIOS_STRUCTURE *)&gSmbiosType8Template9, gSmbiosType8Strings9 },
434 { (SMBIOS_STRUCTURE *)&gSmbiosType9Template, gSmbiosType9Strings },
435 { (SMBIOS_STRUCTURE *)&gSmbiosType11Template, gSmbiosType11Strings },
436 { (SMBIOS_STRUCTURE *)&gSmbiosType12Template, gSmbiosType12Strings },
437 { (SMBIOS_STRUCTURE *)&gSmbiosType16Template, NULL },
438 { (SMBIOS_STRUCTURE *)&gSmbiosType17Template, gSmbiosType17Strings },
439 { (SMBIOS_STRUCTURE *)&gSmbiosType23Template, NULL },
440 { (SMBIOS_STRUCTURE *)&gSmbiosType32Template, NULL },
441 { NULL, NULL }
442 };