]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Library/I2CLibPei/I2CIoLibPei.h
MdeModulePkg CapsuleApp: Check capsule header for -D and -N options
[mirror_edk2.git] / Vlv2TbltDevicePkg / Library / I2CLibPei / I2CIoLibPei.h
CommitLineData
4e522096
DW
1/** @file\r
2 Functions for access I2C MMIO register.\r
3\r
4 Copyright (c) 2006 - 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**/\r
14\r
15#ifndef __I2C_IOLIB_PEI__\r
16\r
17#define __I2C_IOLIB_PEI__\r
18#include <PiPei.h>\r
19\r
20\r
21/**\r
22 Reads an 8-bit MMIO register.\r
23\r
24 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is\r
25 returned. This function must guarantee that all MMIO read and write\r
26 operations are serialized.\r
27\r
28 If 8-bit MMIO register operations are not supported, then ASSERT().\r
29\r
30 @param Address The MMIO register to read.\r
31\r
32 @return The value read.\r
33\r
34**/\r
35\r
36UINT8\r
37EFIAPI\r
38I2CLibPeiMmioRead8 (\r
39 IN UINTN Address\r
40 );\r
41\r
42\r
43/**\r
44 Reads a 16-bit MMIO register.\r
45\r
46 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is\r
47 returned. This function must guarantee that all MMIO read and write\r
48 operations are serialized.\r
49\r
50 If 16-bit MMIO register operations are not supported, then ASSERT().\r
51 If Address is not aligned on a 16-bit boundary, then ASSERT().\r
52\r
53 @param Address The MMIO register to read.\r
54\r
55 @return The value read.\r
56\r
57**/\r
58UINT16\r
59EFIAPI\r
60I2CLibPeiMmioRead16 (\r
61 IN UINTN Address\r
62 );\r
63\r
64\r
65/**\r
66 Writes a 16-bit MMIO register.\r
67\r
68 Writes the 16-bit MMIO register specified by Address with the value specified\r
69 by Value and returns Value. This function must guarantee that all MMIO read\r
70 and write operations are serialized.\r
71\r
72 If 16-bit MMIO register operations are not supported, then ASSERT().\r
73 If Address is not aligned on a 16-bit boundary, then ASSERT().\r
74\r
75 @param Address The MMIO register to write.\r
76 @param Value The value to write to the MMIO register.\r
77\r
78 @return Value.\r
79\r
80**/\r
81UINT16\r
82EFIAPI\r
83I2CLibPeiMmioWrite16 (\r
84 IN UINTN Address,\r
85 IN UINT16 Value\r
86 );\r
87\r
88\r
89/**\r
90 Reads a 32-bit MMIO register.\r
91\r
92 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is\r
93 returned. This function must guarantee that all MMIO read and write\r
94 operations are serialized.\r
95\r
96 If 32-bit MMIO register operations are not supported, then ASSERT().\r
97 If Address is not aligned on a 32-bit boundary, then ASSERT().\r
98\r
99 @param Address The MMIO register to read.\r
100\r
101 @return The value read.\r
102\r
103**/\r
104UINT32\r
105EFIAPI\r
106I2CLibPeiMmioRead32 (\r
107 IN UINTN Address\r
108 );\r
109\r
110\r
111/**\r
112 Writes a 32-bit MMIO register.\r
113\r
114 Writes the 32-bit MMIO register specified by Address with the value specified\r
115 by Value and returns Value. This function must guarantee that all MMIO read\r
116 and write operations are serialized.\r
117\r
118 If 32-bit MMIO register operations are not supported, then ASSERT().\r
119 If Address is not aligned on a 32-bit boundary, then ASSERT().\r
120\r
121 @param Address The MMIO register to write.\r
122 @param Value The value to write to the MMIO register.\r
123\r
124 @return Value.\r
125\r
126**/\r
127UINT32\r
128EFIAPI\r
129I2CLibPeiMmioWrite32 (\r
130 IN UINTN Address,\r
131 IN UINT32 Value\r
132 );\r
133\r
134\r
135/**\r
136 OR a 32-bit MMIO register.\r
137\r
138 OR the 32-bit MMIO register specified by Address with the value specified\r
139 by Value and returns Value. This function must guarantee that all MMIO read\r
140 and write operations are serialized.\r
141\r
142 If 32-bit MMIO register operations are not supported, then ASSERT().\r
143 If Address is not aligned on a 32-bit boundary, then ASSERT().\r
144\r
145 @param Address The MMIO register to write OR.\r
146 @param Value The value to OR to the MMIO register.\r
147\r
148 @return Value.\r
149\r
150**/\r
151UINT32\r
152EFIAPI\r
153I2CLibPeiMmioOr32 (\r
154 IN UINTN Address,\r
155 IN UINT32 OrData\r
156 );\r
157\r
158\r
159#endif\r