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