1 /** @file
2   Module to clarify the element info of the smbios structure.
3 
4   Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
5   This program and the accompanying materials
6   are licensed and made available under the terms and conditions of the BSD License
7   which accompanies this distribution.  The full text of the license may be found at
8   http://opensource.org/licenses/bsd-license.php
9 
10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef _SMBIOS_PRINT_INFO_H_
16 #define _SMBIOS_PRINT_INFO_H_
17 
18 #include <IndustryStandard/SmBios.h>
19 
20 extern UINT8  SmbiosMajorVersion;
21 extern UINT8  SmbiosMinorVersion;
22 
23 #define SHOW_NONE     0x00
24 #define SHOW_OUTLINE  0x01
25 #define SHOW_NORMAL   0x02
26 #define SHOW_DETAIL   0x03
27 //
28 // SHOW_ALL: WaitEnter() not wait input.
29 //
30 #define SHOW_ALL          0x04
31 #define SHOW_STATISTICS   0x05
32 
33 #define AS_UINT16(pData)  (*((UINT16 *) pData))
34 #define AS_UINT32(pData)  (*((UINT32 *) pData))
35 #define AS_UINT64(pData)  (*((UINT64 *) pData))
36 
37 /**
38   Print the info of EPS(Entry Point Structure).
39 
40   @param[in] SmbiosTable    Pointer to the SMBIOS table entry point.
41   @param[in] Option         Display option.
42 **/
43 VOID
44 SmbiosPrintEPSInfo (
45   IN  SMBIOS_TABLE_ENTRY_POINT  *SmbiosTable,
46   IN  UINT8                     Option
47   );
48 
49 /**
50   This function print the content of the structure pointed by Struct.
51 
52   @param[in] Struct       Point to the structure to be printed.
53   @param[in] Option       Print option of information detail.
54 
55   @retval EFI_SUCCESS               Successfully Printing this function.
56   @retval EFI_INVALID_PARAMETER     Invalid Structure.
57   @retval EFI_UNSUPPORTED           Unsupported.
58 **/
59 EFI_STATUS
60 SmbiosPrintStructure (
61   IN  SMBIOS_STRUCTURE_POINTER  *Struct,
62   IN  UINT8                     Option
63   );
64 
65 /**
66   Display BIOS Information (Type 0) information.
67 
68   @param[in] Chara    The information bits.
69   @param[in] Option   The optional information.
70 **/
71 VOID
72 DisplayBiosCharacteristics (
73   IN UINT64  Chara,
74   IN UINT8   Option
75   );
76 
77 /**
78   Display Bios Characteristice extensions1 information.
79 
80   @param[in] Byte1    The information.
81   @param[in] Option   The optional information.
82 **/
83 VOID
84 DisplayBiosCharacteristicsExt1 (
85   IN UINT8 Byte1,
86   IN UINT8 Option
87   );
88 
89 /**
90   Display Bios Characteristice extensions2 information.
91 
92   @param[in] Byte2    The information.
93   @param[in] Option   The optional information.
94 **/
95 VOID
96 DisplayBiosCharacteristicsExt2 (
97   IN UINT8 Byte2,
98   IN UINT8 Option
99   );
100 
101 /**
102   Display Processor Information (Type 4) information.
103 
104   @param[in] Family       The family value.
105   @param[in] Option       The option value.
106 **/
107 VOID
108 DisplayProcessorFamily (
109   UINT8 Family,
110   UINT8 Option
111   );
112 
113 /**
114   Display processor family information.
115 
116   @param[in] Family2      The family value.
117   @param[in] Option       The option value.
118 **/
119 VOID
120 DisplayProcessorFamily2 (
121   IN UINT16 Family2,
122   IN UINT8  Option
123   );
124 
125 /**
126   Display processor voltage information.
127 
128   @param[in] Voltage      The Voltage.
129                       Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
130                       Bits 6:4  Reserved, must be zero
131                       Bits 3:0  Voltage Capability.
132                                 A Set bit indicates that the voltage is supported.
133                         Bit 0 - 5V
134                         Bit 1 - 3.3V
135                         Bit 2 - 2.9V
136                         Bit 3 - Reserved, must be zero.
137 
138                       Note:
139                         Setting of multiple bits indicates the socket is configurable
140                         If bit 7 is set to 1, the remaining seven bits of the field are set to
141                         contain the processor's current voltage times 10.
142                         For example, the field value for a processor voltage of 1.8 volts would be
143                         92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
144 
145   @param[in] Option       The option.
146 **/
147 VOID
148 DisplayProcessorVoltage (
149   IN UINT8 Voltage,
150   IN UINT8 Option
151   );
152 
153 /**
154   Display processor information.
155 
156   @param[in] Status   The status.
157 Bit 7 Reserved, must be 0
158 Bit 6 CPU Socket Populated
159   1 - CPU Socket Populated
160   0 - CPU Socket Unpopulated
161 Bits 5:3 Reserved, must be zero
162 Bits 2:0 CPU Status
163   0h - Unknown
164   1h - CPU Enabled
165   2h - CPU Disabled by User via BIOS Setup
166   3h - CPU Disabled By BIOS (POST Error)
167   4h - CPU is Idle, waiting to be enabled.
168   5-6h - Reserved
169   7h - Other
170 
171   @param[in] Option   The option
172 **/
173 VOID
174 DisplayProcessorStatus (
175   IN UINT8 Status,
176   IN UINT8 Option
177   );
178 
179 /**
180   Display information about Memory Controller Information (Type 5).
181 
182   @param[in] Size     Memory size.
183   @param[in] SlotNum  Which slot is this about.
184   @param[in] Option   Option for the level of detail output required.
185 **/
186 VOID
187 DisplayMaxMemoryModuleSize (
188   IN UINT8 Size,
189   IN UINT8 SlotNum,
190   IN UINT8 Option
191   );
192 
193 /**
194   Display information about memory configuration handles.
195 
196   @param[in] Handles  The buffer of handles to output info on.
197   @param[in] SlotNum  The number of handles in the above buffer.
198   @param[in] Option   Option for the level of detail output required.
199 **/
200 VOID
201 DisplayMemoryModuleConfigHandles (
202   IN UINT16 *Handles,
203   IN UINT8  SlotNum,
204   IN UINT8  Option
205   );
206 
207 /**
208   Display Memory Module Information (Type 6).
209 
210   @param[in] BankConnections
211   @param[in] Option
212 **/
213 VOID
214 DisplayMmBankConnections (
215   IN UINT8 BankConnections,
216   IN UINT8 Option
217   );
218 
219 /**
220   Display memory informcation.
221 
222   Bits 0:6  Size (n),
223       where 2**n is the size in MB with three special-case values:
224       7Dh Not determinable (Installed Size only)
225       7Eh Module is installed, but no memory has been enabled
226       7Fh Not installed
227   Bit  7  Defines whether the memory module has a single- (0)
228           or double-bank (1) connection.
229 
230   @param[in] Size   - The size
231   @param[in] Option - The option
232 **/
233 VOID
234 DisplayMmMemorySize (
235   IN UINT8 Size,
236   IN UINT8 Option
237   );
238 
239 /**
240   Display Cache Configuration.
241 
242   @param[in] CacheConfiguration   Cache Configuration.
243 Bits 15:10 Reserved, must be 0
244 Bits 9:8 Operational Mode
245   0h - Write Through
246   1h - Write Back
247   2h - Varies with Memory Address
248   3h - Unknown
249 Bit 7 Enabled/Disabled
250   1 - Enabled
251   0 - Disabled
252 Bits 6:5 Location
253   0h - Internal
254   1h - External
255   2h - Reserved
256   3h - Unknown
257 Bit 4 Reserved, must be zero
258 Bit 3 Cache Socketed
259   1 - Socketed
260   0 - Unsocketed
261 Bits 2:0 Cache Level
262   1 through 8 (For example, an L1 cache would
263   use value 000b and an L3 cache would use 010b.)
264 
265   @param[in] Option   The option
266 **/
267 VOID
268 DisplayCacheConfiguration (
269   IN UINT16 CacheConfiguration,
270   IN UINT8 Option
271   );
272 
273 /**
274   The Slot ID field of the System Slot structure provides a mechanism to
275   correlate the physical attributes of the slot to its logical access method
276   (which varies based on the Slot Type field).
277 
278   @param[in] SlotId   - The slot ID
279   @param[in] SlotType - The slot type
280   @param[in] Option   - The Option
281 **/
282 VOID
283 DisplaySystemSlotId (
284   IN UINT16  SlotId,
285   IN UINT8   SlotType,
286   IN UINT8   Option
287   );
288 
289 /**
290   Display Portable Battery (Type 22) information.
291 
292   The date the cell pack was manufactured, in packed format:
293    Bits 15:9  Year, biased by 1980, in the range 0 to 127.
294    Bits 8:5 Month, in the range 1 to 12.
295    Bits 4:0 Date, in the range 1 to 31.
296   For example, 01 February 2000 would be identified as
297   0010 1000 0100 0001b (0x2841).
298 
299   @param[in] Date     The date
300   @param[in] Option   The option
301 **/
302 VOID
303 DisplaySBDSManufactureDate (
304   IN UINT16  Date,
305   IN UINT8   Option
306   );
307 
308 /**
309   Display System Reset  (Type 23) information.
310 
311   Routine Description:
312   Identifies the system-reset capabilities for the system.
313    Bits 7:6 Reserved for future assignment via this specification, set to 00b.
314    Bit 5  System contains a watchdog timer, either True (1) or False (0).
315    Bits 4:3 Boot Option on Limit.
316     Identifies the system action to be taken when the Reset Limit is reached, one of:
317     00b Reserved, do not use.
318     01b Operating system
319     10b System utilities
320     11b Do not rebootBits
321    2:1  Boot Option.  Indicates the action to be taken following a watchdog reset, one of:
322     00b Reserved, do not use.
323     01b Operating system
324     10b System utilities
325     11b Do not reboot
326    Bit 0  Status.
327     1b The system reset is enabled by the user
328     0b The system reset is not enabled by the user
329 
330   @param[in] Reset   Reset
331   @param[in] Option  The option
332 **/
333 VOID
334 DisplaySystemResetCapabilities (
335   IN UINT8 Reset,
336   IN UINT8 Option
337   );
338 
339 /**
340   Display Hardware Security (Type 24) information.
341 
342     Routine Description:
343     Identifies the password and reset status for the system:
344 
345     Bits 7:6    Power-on Password Status, one of:
346       00b Disabled
347       01b Enabled
348       10b Not Implemented
349       11b Unknown
350     Bits 5:4    Keyboard Password Status, one of:
351       00b Disabled
352       01b Enabled
353       10b Not Implemented
354       11b Unknown
355     Bits 3:2    Administrator Password Status, one  of:
356       00b Disabled
357       01b Enabled
358       10b Not Implemented
359       11b Unknown
360     Bits 1:0    Front Panel Reset Status, one of:
361       00b Disabled
362       01b Enabled
363       10b Not Implemented
364       11b Unknown
365 
366   @param[in] Settings The device settings.
367   @param[in] Option   The device options.
368 **/
369 VOID
370 DisplayHardwareSecuritySettings (
371   IN UINT8 Settings,
372   IN UINT8 Option
373   );
374 
375 /**
376   Display Out-of-Band Remote Access (Type 30) information.
377 
378   @param[in] Connections        The device characteristics.
379   @param[in] Option             The device options.
380 **/
381 VOID
382 DisplayOBRAConnections (
383   IN UINT8   Connections,
384   IN UINT8   Option
385   );
386 
387 /**
388   Display System Boot Information (Type 32) information.
389 
390   @param[in] Parameter      The parameter.
391   @param[in] Option         The options.
392 **/
393 VOID
394 DisplaySystemBootStatus (
395   IN UINT8 Parameter,
396   IN UINT8 Option
397   );
398 
399 /**
400   Display System Power Supply (Type 39) information.
401 
402   @param[in] Characteristics    The device characteristics.
403   @param[in] Option             The device options.
404 **/
405 VOID
406 DisplaySPSCharacteristics (
407   IN UINT16  Characteristics,
408   IN UINT8   Option
409   );
410 
411 #endif
412