]>
Commit | Line | Data |
---|---|---|
42c9d9f8 RN |
1 | /** @file\r |
2 | This PPI provides the super I/O register access functionality.\r | |
3 | \r | |
4 | Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | @par Revision Reference:\r | |
14 | This PPI is from PI Version 1.2.1.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __EFI_SUPER_IO_PPI_H__\r | |
19 | #define __EFI_SUPER_IO_PPI_H__\r | |
20 | \r | |
21 | #include <Protocol/SuperIo.h>\r | |
22 | \r | |
23 | #define EFI_SIO_PPI_GUID \\r | |
24 | { \\r | |
25 | 0x23a464ad, 0xcb83, 0x48b8, {0x94, 0xab, 0x1a, 0x6f, 0xef, 0xcf, 0xe5, 0x22} \\r | |
26 | }\r | |
27 | \r | |
28 | typedef struct _EFI_SIO_PPI EFI_SIO_PPI;\r | |
29 | typedef struct _EFI_SIO_PPI *PEFI_SIO_PPI;\r | |
30 | \r | |
31 | typedef UINT16 EFI_SIO_REGISTER;\r | |
32 | #define EFI_SIO_REG(ldn,reg) (EFI_SIO_REGISTER) (((ldn) << 8) | reg)\r | |
33 | #define EFI_SIO_LDN_GLOBAL 0xFF\r | |
34 | \r | |
35 | /**\r | |
36 | Read a Super I/O register.\r | |
37 | \r | |
38 | The register is specified as an 8-bit logical device number and an 8-bit\r | |
39 | register value. The logical device numbers for specific SIO devices can be\r | |
40 | determined using the Info member of the PPI structure.\r | |
41 | \r | |
42 | @param This A pointer to this instance of the EFI_SIO_PPI.\r | |
43 | @param ExitCfgMode A boolean specifying whether the driver should turn on\r | |
44 | configuration mode (FALSE) or turn off configuration mode\r | |
45 | (TRUE) after completing the read operation. The driver must\r | |
46 | track the current state of the configuration mode (if any)\r | |
47 | and turn on configuration mode (if necessary) prior to\r | |
48 | register access.\r | |
49 | @param Register A value specifying the logical device number (bits 15:8) \r | |
50 | and the register to read (bits 7:0). The logical device \r | |
51 | number of EFI_SIO_LDN_GLOBAL indicates that global\r | |
52 | registers will be used.\r | |
53 | @param IoData A pointer to the returned register value.\r | |
54 | \r | |
55 | @retval EFI_SUCCESS Success.\r | |
56 | @regval EFI_TIMEOUT The register could not be read in the a reasonable\r | |
57 | amount of time. The exact time is device-specific.\r | |
58 | @retval EFI_INVALID_PARAMETERS Register was out of range for this device.\r | |
59 | @retval EFI_INVALID_PARAMETERS IoData was NULL\r | |
60 | @retval EFI_DEVICE_ERROR There was a device fault or the device was not present.\r | |
61 | **/\r | |
62 | typedef\r | |
63 | EFI_STATUS\r | |
64 | (EFIAPI *EFI_PEI_SIO_REGISTER_READ)(\r | |
9a8eb9a2 | 65 | IN EFI_PEI_SERVICES **PeiServices,\r |
42c9d9f8 RN |
66 | IN CONST EFI_SIO_PPI *This,\r |
67 | IN BOOLEAN ExitCfgMode,\r | |
68 | IN EFI_SIO_REGISTER Register,\r | |
69 | OUT UINT8 *IoData\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Write a Super I/O register.\r | |
74 | \r | |
75 | The register is specified as an 8-bit logical device number and an 8-bit register\r | |
76 | value. The logical device numbers for specific SIO devices can be determined\r | |
77 | using the Info member of the PPI structure.\r | |
78 | \r | |
79 | @param This A pointer to this instance of the EFI_SIO_PPI.\r | |
80 | @param ExitCfgMode A boolean specifying whether the driver should turn on\r | |
81 | configuration mode (FALSE) or turn off configuration mode\r | |
82 | (TRUE) after completing the read operation. The driver must\r | |
83 | track the current state of the configuration mode (if any)\r | |
84 | and turn on configuration mode (if necessary) prior to\r | |
85 | register access.\r | |
86 | @param Register A value specifying the logical device number (bits 15:8) \r | |
87 | and the register to read (bits 7:0). The logical device \r | |
88 | number of EFI_SIO_LDN_GLOBAL indicates that global\r | |
89 | registers will be used.\r | |
90 | @param IoData A pointer to the returned register value.\r | |
91 | \r | |
92 | @retval EFI_SUCCESS Success.\r | |
93 | @regval EFI_TIMEOUT The register could not be read in the a reasonable\r | |
94 | amount of time. The exact time is device-specific.\r | |
95 | @retval EFI_INVALID_PARAMETERS Register was out of range for this device.\r | |
96 | @retval EFI_INVALID_PARAMETERS IoData was NULL\r | |
97 | @retval EFI_DEVICE_ERROR There was a device fault or the device was not present.\r | |
98 | **/ \r | |
99 | typedef\r | |
100 | EFI_STATUS\r | |
101 | (EFIAPI *EFI_PEI_SIO_REGISTER_WRITE)(\r | |
9a8eb9a2 | 102 | IN EFI_PEI_SERVICES **PeiServices,\r |
42c9d9f8 RN |
103 | IN CONST EFI_SIO_PPI *This,\r |
104 | IN BOOLEAN ExitCfgMode,\r | |
105 | IN EFI_SIO_REGISTER Register,\r | |
106 | IN UINT8 IoData\r | |
107 | );\r | |
108 | \r | |
109 | /**\r | |
110 | Provides an interface for a table based programming of the Super I/O registers.\r | |
111 | \r | |
112 | The Modify() function provides an interface for table based programming of the\r | |
113 | Super I/O registers. This function can be used to perform programming of\r | |
114 | multiple Super I/O registers with a single function call. For each table entry,\r | |
115 | the Register is read, its content is bitwise ANDed with AndMask, and then ORed\r | |
116 | with OrMask before being written back to the Register. The Super I/O driver\r | |
117 | must track the current state of the Super I/O and enable the configuration mode\r | |
118 | of Super I/O if necessary prior to table processing. Once the table is processed,\r | |
119 | the Super I/O device must be returned to the original state.\r | |
120 | \r | |
121 | @param This A pointer to this instance of the EFI_SIO_PPI.\r | |
122 | @param Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY\r | |
123 | structures. Each structure specifies a single Super I/O register\r | |
124 | modify operation.\r | |
125 | @param NumberOfCommands The number of elements in the Command array.\r | |
126 | \r | |
127 | @retval EFI_SUCCESS The operation completed successfully.\r | |
128 | @retval EFI_INVALID_PARAMETERS Command is NULL.\r | |
129 | **/ \r | |
130 | typedef\r | |
131 | EFI_STATUS\r | |
132 | (EFIAPI *EFI_PEI_SIO_REGISTER_MODIFY)(\r | |
9a8eb9a2 | 133 | IN EFI_PEI_SERVICES **PeiServices,\r |
42c9d9f8 RN |
134 | IN CONST EFI_SIO_PPI *This,\r |
135 | IN CONST EFI_SIO_REGISTER_MODIFY *Command,\r | |
136 | IN UINTN NumberOfCommands\r | |
137 | );\r | |
138 | \r | |
139 | ///\r | |
140 | /// Specifies the end of the information list.\r | |
141 | ///\r | |
142 | #define EFI_ACPI_PNP_HID_END 0\r | |
143 | \r | |
144 | typedef UINT32 EFI_ACPI_HID;\r | |
145 | typedef UINT32 EFI_ACPI_UID;\r | |
146 | #pragma pack(1)\r | |
147 | typedef struct _EFI_SIO_INFO {\r | |
148 | EFI_ACPI_HID Hid;\r | |
149 | EFI_ACPI_UID Uid;\r | |
150 | UINT8 Ldn;\r | |
151 | } EFI_SIO_INFO, *PEFI_SIO_INFO;\r | |
152 | #pragma pack()\r | |
153 | \r | |
154 | ///\r | |
155 | /// This PPI provides low-level access to Super I/O registers using Read() and\r | |
156 | /// Write(). It also uniquely identifies this Super I/O controller using a GUID\r | |
157 | /// and provides mappings between ACPI style PNP IDs and the logical device numbers.\r | |
158 | /// There is one instance of this PPI per Super I/O device.\r | |
159 | ///\r | |
160 | struct _EFI_SIO_PPI {\r | |
161 | ///\r | |
162 | /// This function reads a register's value from the Super I/O controller.\r | |
163 | ///\r | |
164 | EFI_PEI_SIO_REGISTER_READ Read;\r | |
165 | ///\r | |
166 | /// This function writes a value to a register in the Super I/O controller.\r | |
167 | ///\r | |
168 | EFI_PEI_SIO_REGISTER_WRITE Write;\r | |
169 | ///\r | |
170 | /// This function modifies zero or more registers in the Super I/O controller\r | |
171 | /// using a table.\r | |
172 | ///\r | |
173 | EFI_PEI_SIO_REGISTER_MODIFY Modify;\r | |
174 | ///\r | |
175 | /// This GUID uniquely identifies the Super I/O controller.\r | |
176 | ///\r | |
177 | EFI_GUID SioGuid;\r | |
178 | ///\r | |
179 | /// This pointer is to an array which maps EISA identifiers to logical devices numbers.\r | |
180 | ///\r | |
181 | PEFI_SIO_INFO Info;\r | |
182 | };\r | |
183 | \r | |
184 | extern EFI_GUID gEfiSioPpiGuid;\r | |
185 | \r | |
186 | #endif \r |