]>
Commit | Line | Data |
---|---|---|
0591696e FT |
1 | /** @file\r |
2 | UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller\r | |
3 | MMIO base, to upper layer UFS drivers.\r | |
4 | \r | |
095f0779 | 5 | Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r |
0591696e FT |
6 | This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _EFI_UFS_HOST_CONTROLLER_H_\r | |
17 | #define _EFI_UFS_HOST_CONTROLLER_H_\r | |
18 | \r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <IndustryStandard/Pci.h>\r | |
095f0779 | 22 | #include <IndustryStandard/Acpi.h>\r |
0591696e FT |
23 | \r |
24 | #include <Protocol/ComponentName.h>\r | |
25 | #include <Protocol/ComponentName2.h>\r | |
26 | #include <Protocol/DriverBinding.h>\r | |
27 | #include <Protocol/LoadedImage.h>\r | |
28 | #include <Protocol/DevicePath.h>\r | |
29 | #include <Protocol/PciIo.h>\r | |
30 | #include <Protocol/UfsHostController.h>\r | |
31 | \r | |
32 | #include <Library/BaseLib.h>\r | |
33 | #include <Library/DebugLib.h>\r | |
34 | #include <Library/UefiLib.h>\r | |
35 | #include <Library/DevicePathLib.h>\r | |
36 | #include <Library/MemoryAllocationLib.h>\r | |
37 | #include <Library/UefiBootServicesTableLib.h>\r | |
38 | #include <Library/UefiDriverEntryPoint.h>\r | |
39 | \r | |
40 | extern EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding;\r | |
41 | extern EFI_COMPONENT_NAME_PROTOCOL gUfsHcComponentName;\r | |
42 | extern EFI_COMPONENT_NAME2_PROTOCOL gUfsHcComponentName2;\r | |
43 | \r | |
44 | //\r | |
45 | // Unique signature for private data structure.\r | |
46 | //\r | |
47 | #define UFS_HC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('U','F','S','H')\r | |
48 | \r | |
49 | typedef struct _UFS_HOST_CONTROLLER_PRIVATE_DATA UFS_HOST_CONTROLLER_PRIVATE_DATA;\r | |
50 | \r | |
51 | //\r | |
52 | // Nvme private data structure.\r | |
53 | //\r | |
54 | struct _UFS_HOST_CONTROLLER_PRIVATE_DATA {\r | |
55 | UINT32 Signature;\r | |
56 | EFI_HANDLE Handle;\r | |
57 | \r | |
58 | EDKII_UFS_HOST_CONTROLLER_PROTOCOL UfsHc;\r | |
59 | EFI_PCI_IO_PROTOCOL *PciIo; \r | |
095f0779 | 60 | UINT8 BarIndex;\r |
0591696e FT |
61 | UINT64 PciAttributes;\r |
62 | };\r | |
63 | \r | |
64 | #define UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC(a) \\r | |
65 | CR (a, \\r | |
66 | UFS_HOST_CONTROLLER_PRIVATE_DATA, \\r | |
67 | UfsHc, \\r | |
68 | UFS_HC_PRIVATE_DATA_SIGNATURE \\r | |
69 | )\r | |
70 | \r | |
71 | /**\r | |
72 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
73 | \r | |
74 | This function retrieves the user readable name of a driver in the form of a\r | |
75 | Unicode string. If the driver specified by This has a user readable name in\r | |
76 | the language specified by Language, then a pointer to the driver name is\r | |
77 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
78 | by This does not support the language specified by Language,\r | |
79 | then EFI_UNSUPPORTED is returned.\r | |
80 | \r | |
81 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
82 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
83 | \r | |
84 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
85 | array indicating the language. This is the\r | |
86 | language of the driver name that the caller is\r | |
87 | requesting, and it must match one of the\r | |
88 | languages specified in SupportedLanguages. The\r | |
89 | number of languages supported by a driver is up\r | |
90 | to the driver writer. Language is specified\r | |
91 | in RFC 4646 or ISO 639-2 language code format.\r | |
92 | \r | |
93 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
94 | This Unicode string is the name of the\r | |
95 | driver specified by This in the language\r | |
96 | specified by Language.\r | |
97 | \r | |
98 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
99 | This and the language specified by Language was\r | |
100 | returned in DriverName.\r | |
101 | \r | |
102 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
103 | \r | |
104 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
105 | \r | |
106 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
107 | the language specified by Language.\r | |
108 | \r | |
109 | **/\r | |
110 | EFI_STATUS\r | |
111 | EFIAPI\r | |
112 | UfsHcComponentNameGetDriverName (\r | |
113 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
114 | IN CHAR8 *Language,\r | |
115 | OUT CHAR16 **DriverName\r | |
116 | );\r | |
117 | \r | |
118 | /**\r | |
119 | Retrieves a Unicode string that is the user readable name of the controller\r | |
120 | that is being managed by a driver.\r | |
121 | \r | |
122 | This function retrieves the user readable name of the controller specified by\r | |
123 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
124 | driver specified by This has a user readable name in the language specified by\r | |
125 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
126 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
127 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
128 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
129 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
130 | \r | |
131 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
132 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
133 | \r | |
134 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
135 | specified by This is managing. This handle\r | |
136 | specifies the controller whose name is to be\r | |
137 | returned.\r | |
138 | \r | |
139 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
140 | the name of. This is an optional parameter that\r | |
141 | may be NULL. It will be NULL for device\r | |
142 | drivers. It will also be NULL for a bus drivers\r | |
143 | that wish to retrieve the name of the bus\r | |
144 | controller. It will not be NULL for a bus\r | |
145 | driver that wishes to retrieve the name of a\r | |
146 | child controller.\r | |
147 | \r | |
148 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
149 | array indicating the language. This is the\r | |
150 | language of the driver name that the caller is\r | |
151 | requesting, and it must match one of the\r | |
152 | languages specified in SupportedLanguages. The\r | |
153 | number of languages supported by a driver is up\r | |
154 | to the driver writer. Language is specified in\r | |
155 | RFC 4646 or ISO 639-2 language code format.\r | |
156 | \r | |
157 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
158 | This Unicode string is the name of the\r | |
159 | controller specified by ControllerHandle and\r | |
160 | ChildHandle in the language specified by\r | |
161 | Language from the point of view of the driver\r | |
162 | specified by This.\r | |
163 | \r | |
164 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
165 | the language specified by Language for the\r | |
166 | driver specified by This was returned in\r | |
167 | DriverName.\r | |
168 | \r | |
169 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
170 | \r | |
171 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
172 | EFI_HANDLE.\r | |
173 | \r | |
174 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
175 | \r | |
176 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
177 | \r | |
178 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
179 | managing the controller specified by\r | |
180 | ControllerHandle and ChildHandle.\r | |
181 | \r | |
182 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
183 | the language specified by Language.\r | |
184 | \r | |
185 | **/\r | |
186 | EFI_STATUS\r | |
187 | EFIAPI\r | |
188 | UfsHcComponentNameGetControllerName (\r | |
189 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
190 | IN EFI_HANDLE ControllerHandle,\r | |
191 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
192 | IN CHAR8 *Language,\r | |
193 | OUT CHAR16 **ControllerName\r | |
194 | );\r | |
195 | \r | |
196 | /**\r | |
197 | Tests to see if this driver supports a given controller. If a child device is provided,\r | |
198 | it further tests to see if this driver supports creating a handle for the specified child device.\r | |
199 | \r | |
200 | This function checks to see if the driver specified by This supports the device specified by\r | |
201 | ControllerHandle. Drivers will typically use the device path attached to\r | |
202 | ControllerHandle and/or the services from the bus I/O abstraction attached to\r | |
203 | ControllerHandle to determine if the driver supports ControllerHandle. This function\r | |
204 | may be called many times during platform initialization. In order to reduce boot times, the tests\r | |
205 | performed by this function must be very small, and take as little time as possible to execute. This\r | |
206 | function must not change the state of any hardware devices, and this function must be aware that the\r | |
207 | device specified by ControllerHandle may already be managed by the same driver or a\r | |
208 | different driver. This function must match its calls to AllocatePages() with FreePages(),\r | |
209 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r | |
210 | Since ControllerHandle may have been previously started by the same driver, if a protocol is\r | |
211 | already in the opened state, then it must not be closed with CloseProtocol(). This is required\r | |
212 | to guarantee the state of ControllerHandle is not modified by this function.\r | |
213 | \r | |
214 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
215 | @param[in] ControllerHandle The handle of the controller to test. This handle\r | |
216 | must support a protocol interface that supplies\r | |
217 | an I/O abstraction to the driver.\r | |
218 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r | |
219 | parameter is ignored by device drivers, and is optional for bus\r | |
220 | drivers. For bus drivers, if this parameter is not NULL, then\r | |
221 | the bus driver must determine if the bus controller specified\r | |
222 | by ControllerHandle and the child controller specified\r | |
223 | by RemainingDevicePath are both supported by this\r | |
224 | bus driver.\r | |
225 | \r | |
226 | @retval EFI_SUCCESS The device specified by ControllerHandle and\r | |
227 | RemainingDevicePath is supported by the driver specified by This.\r | |
228 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r | |
229 | RemainingDevicePath is already being managed by the driver\r | |
230 | specified by This.\r | |
231 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r | |
232 | RemainingDevicePath is already being managed by a different\r | |
233 | driver or an application that requires exclusive access.\r | |
234 | Currently not implemented.\r | |
235 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r | |
236 | RemainingDevicePath is not supported by the driver specified by This.\r | |
237 | **/\r | |
238 | EFI_STATUS\r | |
239 | EFIAPI\r | |
240 | UfsHcDriverBindingSupported (\r | |
241 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
242 | IN EFI_HANDLE Controller,\r | |
243 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
244 | );\r | |
245 | \r | |
246 | /**\r | |
247 | Starts a device controller or a bus controller.\r | |
248 | \r | |
249 | The Start() function is designed to be invoked from the EFI boot service ConnectController().\r | |
250 | As a result, much of the error checking on the parameters to Start() has been moved into this\r | |
251 | common boot service. It is legal to call Start() from other locations,\r | |
252 | but the following calling restrictions must be followed or the system behavior will not be deterministic.\r | |
253 | 1. ControllerHandle must be a valid EFI_HANDLE.\r | |
254 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r | |
255 | EFI_DEVICE_PATH_PROTOCOL.\r | |
256 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r | |
257 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r | |
258 | \r | |
259 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
260 | @param[in] ControllerHandle The handle of the controller to start. This handle\r | |
261 | must support a protocol interface that supplies\r | |
262 | an I/O abstraction to the driver.\r | |
263 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r | |
264 | parameter is ignored by device drivers, and is optional for bus\r | |
265 | drivers. For a bus driver, if this parameter is NULL, then handles\r | |
266 | for all the children of Controller are created by this driver.\r | |
267 | If this parameter is not NULL and the first Device Path Node is\r | |
268 | not the End of Device Path Node, then only the handle for the\r | |
269 | child device specified by the first Device Path Node of\r | |
270 | RemainingDevicePath is created by this driver.\r | |
271 | If the first Device Path Node of RemainingDevicePath is\r | |
272 | the End of Device Path Node, no child handle is created by this\r | |
273 | driver.\r | |
274 | \r | |
275 | @retval EFI_SUCCESS The device was started.\r | |
276 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
277 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
278 | @retval Others The driver failded to start the device.\r | |
279 | \r | |
280 | **/\r | |
281 | EFI_STATUS\r | |
282 | EFIAPI\r | |
283 | UfsHcDriverBindingStart (\r | |
284 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
285 | IN EFI_HANDLE Controller,\r | |
286 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
287 | );\r | |
288 | \r | |
289 | /**\r | |
290 | Stops a device controller or a bus controller.\r | |
291 | \r | |
292 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r | |
293 | As a result, much of the error checking on the parameters to Stop() has been moved\r | |
294 | into this common boot service. It is legal to call Stop() from other locations,\r | |
295 | but the following calling restrictions must be followed or the system behavior will not be deterministic.\r | |
296 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r | |
297 | same driver's Start() function.\r | |
298 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r | |
299 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r | |
300 | Start() function, and the Start() function must have called OpenProtocol() on\r | |
301 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
302 | \r | |
303 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
304 | @param[in] ControllerHandle A handle to the device being stopped. The handle must\r | |
305 | support a bus specific I/O protocol for the driver\r | |
306 | to use to stop the device.\r | |
307 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r | |
308 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r | |
309 | if NumberOfChildren is 0.\r | |
310 | \r | |
311 | @retval EFI_SUCCESS The device was stopped.\r | |
312 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
313 | \r | |
314 | **/\r | |
315 | EFI_STATUS\r | |
316 | EFIAPI\r | |
317 | UfsHcDriverBindingStop (\r | |
318 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
319 | IN EFI_HANDLE Controller,\r | |
320 | IN UINTN NumberOfChildren,\r | |
321 | IN EFI_HANDLE *ChildHandleBuffer\r | |
322 | );\r | |
323 | \r | |
324 | /**\r | |
325 | Get the MMIO base of the UFS host controller.\r | |
326 | \r | |
327 | @param[in] This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.\r | |
328 | @param[out] MmioBar The MMIO base address of UFS host controller.\r | |
329 | \r | |
330 | @retval EFI_SUCCESS The operation succeeds.\r | |
331 | @retval others The operation fails.\r | |
332 | **/\r | |
333 | EFI_STATUS\r | |
334 | EFIAPI\r | |
335 | UfsHcGetMmioBar (\r | |
336 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
337 | OUT UINTN *MmioBar\r | |
338 | );\r | |
339 | \r | |
340 | /** \r | |
341 | Provides the UFS controller-specific addresses needed to access system memory.\r | |
342 | \r | |
343 | @param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.\r | |
344 | @param Operation Indicates if the bus master is going to read or write to system memory.\r | |
345 | @param HostAddress The system memory address to map to the UFS controller.\r | |
346 | @param NumberOfBytes On input the number of bytes to map. On output the number of bytes\r | |
347 | that were mapped. \r | |
348 | @param DeviceAddress The resulting map address for the bus master UFS controller to use to\r | |
349 | access the hosts HostAddress. \r | |
350 | @param Mapping A resulting value to pass to Unmap().\r | |
351 | \r | |
352 | @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r | |
353 | @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. \r | |
354 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
355 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
356 | @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.\r | |
357 | \r | |
358 | **/\r | |
359 | EFI_STATUS\r | |
360 | EFIAPI\r | |
361 | UfsHcMap (\r | |
362 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
363 | IN EDKII_UFS_HOST_CONTROLLER_OPERATION Operation,\r | |
364 | IN VOID *HostAddress,\r | |
365 | IN OUT UINTN *NumberOfBytes,\r | |
366 | OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r | |
367 | OUT VOID **Mapping\r | |
368 | );\r | |
369 | \r | |
370 | /** \r | |
371 | Completes the Map() operation and releases any corresponding resources.\r | |
372 | \r | |
373 | @param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance. \r | |
374 | @param Mapping The mapping value returned from Map().\r | |
375 | \r | |
376 | @retval EFI_SUCCESS The range was unmapped.\r | |
377 | @retval EFI_DEVICE_ERROR The data was not committed to the target system memory.\r | |
378 | \r | |
379 | **/\r | |
380 | EFI_STATUS\r | |
381 | EFIAPI\r | |
382 | UfsHcUnmap (\r | |
383 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
384 | IN VOID *Mapping\r | |
385 | );\r | |
386 | \r | |
387 | /** \r | |
388 | Allocates pages that are suitable for an EfiUfsHcOperationBusMasterCommonBuffer\r | |
389 | mapping. \r | |
390 | \r | |
391 | @param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.\r | |
392 | @param Type This parameter is not used and must be ignored.\r | |
393 | @param MemoryType The type of memory to allocate, EfiBootServicesData or\r | |
394 | EfiRuntimeServicesData. \r | |
395 | @param Pages The number of pages to allocate. \r | |
396 | @param HostAddress A pointer to store the base system memory address of the\r | |
397 | allocated range. \r | |
398 | @param Attributes The requested bit mask of attributes for the allocated range.\r | |
399 | \r | |
400 | @retval EFI_SUCCESS The requested memory pages were allocated.\r | |
401 | @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are\r | |
402 | MEMORY_WRITE_COMBINE and MEMORY_CACHED. \r | |
403 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
404 | @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. \r | |
405 | \r | |
406 | **/\r | |
407 | EFI_STATUS\r | |
408 | EFIAPI\r | |
409 | UfsHcAllocateBuffer (\r | |
410 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
411 | IN EFI_ALLOCATE_TYPE Type,\r | |
412 | IN EFI_MEMORY_TYPE MemoryType,\r | |
413 | IN UINTN Pages,\r | |
414 | OUT VOID **HostAddress,\r | |
415 | IN UINT64 Attributes\r | |
416 | );\r | |
417 | \r | |
418 | /** \r | |
419 | Frees memory that was allocated with AllocateBuffer().\r | |
420 | \r | |
421 | @param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance. \r | |
422 | @param Pages The number of pages to free. \r | |
423 | @param HostAddress The base system memory address of the allocated range. \r | |
424 | \r | |
425 | @retval EFI_SUCCESS The requested memory pages were freed.\r | |
426 | @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r | |
427 | was not allocated with AllocateBuffer().\r | |
428 | \r | |
429 | **/\r | |
430 | EFI_STATUS\r | |
431 | EFIAPI\r | |
432 | UfsHcFreeBuffer (\r | |
433 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
434 | IN UINTN Pages,\r | |
435 | IN VOID *HostAddress\r | |
436 | );\r | |
437 | \r | |
438 | /** \r | |
439 | Flushes all posted write transactions from the UFS bus to attached UFS device.\r | |
440 | \r | |
441 | @param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance. \r | |
442 | \r | |
443 | @retval EFI_SUCCESS The posted write transactions were flushed from the UFS bus\r | |
444 | to attached UFS device. \r | |
445 | @retval EFI_DEVICE_ERROR The posted write transactions were not flushed from the UFS\r | |
446 | bus to attached UFS device due to a hardware error. \r | |
447 | \r | |
448 | **/\r | |
449 | EFI_STATUS\r | |
450 | EFIAPI\r | |
451 | UfsHcFlush (\r | |
452 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This\r | |
453 | );\r | |
454 | \r | |
095f0779 FT |
455 | /** \r |
456 | Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.\r | |
457 | \r | |
458 | @param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.\r | |
459 | @param Width Signifies the width of the memory operations.\r | |
460 | @param Offset The offset within the UFS Host Controller MMIO space to start the\r | |
461 | memory operation.\r | |
462 | @param Count The number of memory operations to perform.\r | |
463 | @param Buffer For read operations, the destination buffer to store the results.\r | |
464 | For write operations, the source buffer to write data from.\r | |
465 | \r | |
466 | @retval EFI_SUCCESS The data was read from or written to the UFS host controller.\r | |
467 | @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not\r | |
468 | valid for the UFS Host Controller memory space.\r | |
469 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
470 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
471 | \r | |
472 | **/\r | |
473 | EFI_STATUS\r | |
474 | EFIAPI\r | |
475 | UfsHcMmioRead (\r | |
476 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
477 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL_WIDTH Width,\r | |
478 | IN UINT64 Offset,\r | |
479 | IN UINTN Count,\r | |
480 | IN OUT VOID *Buffer\r | |
481 | );\r | |
482 | \r | |
483 | /** \r | |
484 | Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.\r | |
485 | \r | |
486 | @param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.\r | |
487 | @param Width Signifies the width of the memory operations.\r | |
488 | @param Offset The offset within the UFS Host Controller MMIO space to start the\r | |
489 | memory operation.\r | |
490 | @param Count The number of memory operations to perform.\r | |
491 | @param Buffer For read operations, the destination buffer to store the results.\r | |
492 | For write operations, the source buffer to write data from.\r | |
493 | \r | |
494 | @retval EFI_SUCCESS The data was read from or written to the UFS host controller.\r | |
495 | @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not\r | |
496 | valid for the UFS Host Controller memory space.\r | |
497 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
498 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
499 | \r | |
500 | **/\r | |
501 | EFI_STATUS\r | |
502 | EFIAPI\r | |
503 | UfsHcMmioWrite (\r | |
504 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,\r | |
505 | IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL_WIDTH Width,\r | |
506 | IN UINT64 Offset,\r | |
507 | IN UINTN Count,\r | |
508 | IN OUT VOID *Buffer\r | |
509 | );\r | |
510 | \r | |
0591696e | 511 | #endif\r |