3 Provides some data structure definitions used by the SD/MMC host controller driver.
5 Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
6 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _SD_MMC_PCI_HC_DXE_H_
18 #define _SD_MMC_PCI_HC_DXE_H_
22 #include <IndustryStandard/Pci.h>
23 #include <IndustryStandard/Emmc.h>
24 #include <IndustryStandard/Sd.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/DebugLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29 #include <Library/BaseMemoryLib.h>
30 #include <Library/MemoryAllocationLib.h>
31 #include <Library/UefiLib.h>
32 #include <Library/DevicePathLib.h>
34 #include <Protocol/DevicePath.h>
35 #include <Protocol/PciIo.h>
36 #include <Protocol/DriverBinding.h>
37 #include <Protocol/ComponentName.h>
38 #include <Protocol/ComponentName2.h>
39 #include <Protocol/SdMmcOverride.h>
40 #include <Protocol/SdMmcPassThru.h>
42 #include "SdMmcPciHci.h"
44 extern EFI_COMPONENT_NAME_PROTOCOL gSdMmcPciHcComponentName
;
45 extern EFI_COMPONENT_NAME2_PROTOCOL gSdMmcPciHcComponentName2
;
46 extern EFI_DRIVER_BINDING_PROTOCOL gSdMmcPciHcDriverBinding
;
48 extern EDKII_SD_MMC_OVERRIDE
*mOverride
;
50 #define SD_MMC_HC_PRIVATE_SIGNATURE SIGNATURE_32 ('s', 'd', 't', 'f')
52 #define SD_MMC_HC_PRIVATE_FROM_THIS(a) \
53 CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)
56 // Generic time out value, 1 microsecond as unit.
58 #define SD_MMC_HC_GENERIC_TIMEOUT 1 * 1000 * 1000
61 // SD/MMC async transfer timer interval, set by experience.
62 // The unit is 100us, takes 1ms as interval.
64 #define SD_MMC_HC_ASYNC_TIMER EFI_TIMER_PERIOD_MILLISECONDS(1)
66 // SD/MMC removable device enumeration timer interval, set by experience.
67 // The unit is 100us, takes 100ms as interval.
69 #define SD_MMC_HC_ENUM_TIMER EFI_TIMER_PERIOD_MILLISECONDS(100)
84 } EFI_SD_MMC_SLOT_TYPE
;
88 EFI_SD_MMC_SLOT_TYPE SlotType
;
91 SD_MMC_CARD_TYPE CardType
;
97 EFI_HANDLE ControllerHandle
;
98 EFI_PCI_IO_PROTOCOL
*PciIo
;
100 EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru
;
102 UINT64 PciAttributes
;
104 // The field is used to record the previous slot in GetNextSlot().
108 // For Non-blocking operation.
110 EFI_EVENT TimerEvent
;
112 // For Sd removable device enumeration.
114 EFI_EVENT ConnectEvent
;
117 SD_MMC_HC_SLOT Slot
[SD_MMC_HC_MAX_SLOT
];
118 SD_MMC_HC_SLOT_CAP Capability
[SD_MMC_HC_MAX_SLOT
];
119 UINT64 MaxCurrent
[SD_MMC_HC_MAX_SLOT
];
120 UINT16 ControllerVersion
[SD_MMC_HC_MAX_SLOT
];
123 // Some controllers may require to override base clock frequency
124 // value stored in Capabilities Register 1.
126 UINT32 BaseClkFreq
[SD_MMC_HC_MAX_SLOT
];
127 } SD_MMC_HC_PRIVATE_DATA
;
129 #define SD_MMC_HC_TRB_SIG SIGNATURE_32 ('T', 'R', 'B', 'T')
132 // TRB (Transfer Request Block) contains information for the cmd request.
141 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
145 EFI_PHYSICAL_ADDRESS DataPhy
;
147 SD_MMC_HC_TRANSFER_MODE Mode
;
153 SD_MMC_HC_ADMA_32_DESC_LINE
*Adma32Desc
;
154 SD_MMC_HC_ADMA_64_DESC_LINE
*Adma64Desc
;
155 EFI_PHYSICAL_ADDRESS AdmaDescPhy
;
159 SD_MMC_HC_PRIVATE_DATA
*Private
;
162 #define SD_MMC_HC_TRB_FROM_THIS(a) \
163 CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
166 // Task for Non-blocking mode.
173 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
177 BOOLEAN InfiniteWait
;
186 Execute card identification procedure.
188 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
189 @param[in] Slot The slot number of the SD card to send the command to.
191 @retval EFI_SUCCESS The card is identified correctly.
192 @retval Others The card can't be identified.
197 (*CARD_TYPE_DETECT_ROUTINE
) (
198 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
203 Sends SD command to an SD card that is attached to the SD controller.
205 The PassThru() function sends the SD command specified by Packet to the SD card
208 If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.
210 If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.
212 If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER
215 If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL,
216 EFI_INVALID_PARAMETER is returned.
218 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
219 @param[in] Slot The slot number of the SD card to send the command to.
220 @param[in,out] Packet A pointer to the SD command data structure.
221 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
222 not NULL, then nonblocking I/O is performed, and Event
223 will be signaled when the Packet completes.
225 @retval EFI_SUCCESS The SD Command Packet was sent by the host.
226 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SD
228 @retval EFI_INVALID_PARAMETER Packet, Slot, or the contents of the Packet is invalid.
229 @retval EFI_INVALID_PARAMETER Packet defines a data command but both InDataBuffer and
230 OutDataBuffer are NULL.
231 @retval EFI_NO_MEDIA SD Device not present in the Slot.
232 @retval EFI_UNSUPPORTED The command described by the SD Command Packet is not
233 supported by the host controller.
234 @retval EFI_BAD_BUFFER_SIZE The InTransferLength or OutTransferLength exceeds the
235 limit supported by SD card ( i.e. if the number of bytes
236 exceed the Last LBA).
241 SdMmcPassThruPassThru (
242 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
244 IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
245 IN EFI_EVENT Event OPTIONAL
249 Used to retrieve next slot numbers supported by the SD controller. The function
250 returns information about all available slots (populated or not-populated).
252 The GetNextSlot() function retrieves the next slot number on an SD controller.
253 If on input Slot is 0xFF, then the slot number of the first slot on the SD controller
256 If Slot is a slot number that was returned on a previous call to GetNextSlot(), then
257 the slot number of the next slot on the SD controller is returned.
259 If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(),
260 EFI_INVALID_PARAMETER is returned.
262 If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND
265 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
266 @param[in,out] Slot On input, a pointer to a slot number on the SD controller.
267 On output, a pointer to the next slot number on the SD controller.
268 An input value of 0xFF retrieves the first slot number on the SD
271 @retval EFI_SUCCESS The next slot number on the SD controller was returned in Slot.
272 @retval EFI_NOT_FOUND There are no more slots on this SD controller.
273 @retval EFI_INVALID_PARAMETER Slot is not 0xFF and Slot was not returned on a previous call
279 SdMmcPassThruGetNextSlot (
280 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
285 Used to allocate and build a device path node for an SD card on the SD controller.
287 The BuildDevicePath() function allocates and builds a single device node for the SD
288 card specified by Slot.
290 If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND
293 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
295 If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES
298 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
299 DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is
302 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
303 @param[in] Slot Specifies the slot number of the SD card for which a device
304 path node is to be allocated and built.
305 @param[in,out] DevicePath A pointer to a single device path node that describes the SD
306 card specified by Slot. This function is responsible for
307 allocating the buffer DevicePath with the boot service
308 AllocatePool(). It is the caller's responsibility to free
309 DevicePath when the caller is finished with DevicePath.
311 @retval EFI_SUCCESS The device path node that describes the SD card specified by
312 Slot was allocated and returned in DevicePath.
313 @retval EFI_NOT_FOUND The SD card specified by Slot does not exist on the SD controller.
314 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
315 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
320 SdMmcPassThruBuildDevicePath (
321 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
323 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
327 This function retrieves an SD card slot number based on the input device path.
329 The GetSlotNumber() function retrieves slot number for the SD card specified by
330 the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.
332 If DevicePath is not a device path node type that the SD Pass Thru driver supports,
333 EFI_UNSUPPORTED is returned.
335 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
336 @param[in] DevicePath A pointer to the device path node that describes a SD
337 card on the SD controller.
338 @param[out] Slot On return, points to the slot number of an SD card on
341 @retval EFI_SUCCESS SD card slot number is returned in Slot.
342 @retval EFI_INVALID_PARAMETER Slot or DevicePath is NULL.
343 @retval EFI_UNSUPPORTED DevicePath is not a device path node type that the SD
344 Pass Thru driver supports.
349 SdMmcPassThruGetSlotNumber (
350 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
351 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
356 Resets an SD card that is connected to the SD controller.
358 The ResetDevice() function resets the SD card specified by Slot.
360 If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is
363 If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER
366 If the device reset operation is completed, EFI_SUCCESS is returned.
368 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
369 @param[in] Slot Specifies the slot number of the SD card to be reset.
371 @retval EFI_SUCCESS The SD card specified by Slot was reset.
372 @retval EFI_UNSUPPORTED The SD controller does not support a device reset operation.
373 @retval EFI_INVALID_PARAMETER Slot number is invalid.
374 @retval EFI_NO_MEDIA SD Device not present in the Slot.
375 @retval EFI_DEVICE_ERROR The reset command failed due to a device error
380 SdMmcPassThruResetDevice (
381 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
386 // Driver model protocol interfaces
389 Tests to see if this driver supports a given controller. If a child device is provided,
390 it further tests to see if this driver supports creating a handle for the specified child device.
392 This function checks to see if the driver specified by This supports the device specified by
393 ControllerHandle. Drivers will typically use the device path attached to
394 ControllerHandle and/or the services from the bus I/O abstraction attached to
395 ControllerHandle to determine if the driver supports ControllerHandle. This function
396 may be called many times during platform initialization. In order to reduce boot times, the tests
397 performed by this function must be very small, and take as little time as possible to execute. This
398 function must not change the state of any hardware devices, and this function must be aware that the
399 device specified by ControllerHandle may already be managed by the same driver or a
400 different driver. This function must match its calls to AllocatePages() with FreePages(),
401 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
402 Since ControllerHandle may have been previously started by the same driver, if a protocol is
403 already in the opened state, then it must not be closed with CloseProtocol(). This is required
404 to guarantee the state of ControllerHandle is not modified by this function.
406 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
407 @param[in] ControllerHandle The handle of the controller to test. This handle
408 must support a protocol interface that supplies
409 an I/O abstraction to the driver.
410 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
411 parameter is ignored by device drivers, and is optional for bus
412 drivers. For bus drivers, if this parameter is not NULL, then
413 the bus driver must determine if the bus controller specified
414 by ControllerHandle and the child controller specified
415 by RemainingDevicePath are both supported by this
418 @retval EFI_SUCCESS The device specified by ControllerHandle and
419 RemainingDevicePath is supported by the driver specified by This.
420 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
421 RemainingDevicePath is already being managed by the driver
423 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
424 RemainingDevicePath is already being managed by a different
425 driver or an application that requires exclusive access.
426 Currently not implemented.
427 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
428 RemainingDevicePath is not supported by the driver specified by This.
432 SdMmcPciHcDriverBindingSupported (
433 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
434 IN EFI_HANDLE Controller
,
435 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
439 Starts a device controller or a bus controller.
441 The Start() function is designed to be invoked from the EFI boot service ConnectController().
442 As a result, much of the error checking on the parameters to Start() has been moved into this
443 common boot service. It is legal to call Start() from other locations,
444 but the following calling restrictions must be followed or the system behavior will not be deterministic.
445 1. ControllerHandle must be a valid EFI_HANDLE.
446 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
447 EFI_DEVICE_PATH_PROTOCOL.
448 3. Prior to calling Start(), the Supported() function for the driver specified by This must
449 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
451 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
452 @param[in] ControllerHandle The handle of the controller to start. This handle
453 must support a protocol interface that supplies
454 an I/O abstraction to the driver.
455 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
456 parameter is ignored by device drivers, and is optional for bus
457 drivers. For a bus driver, if this parameter is NULL, then handles
458 for all the children of Controller are created by this driver.
459 If this parameter is not NULL and the first Device Path Node is
460 not the End of Device Path Node, then only the handle for the
461 child device specified by the first Device Path Node of
462 RemainingDevicePath is created by this driver.
463 If the first Device Path Node of RemainingDevicePath is
464 the End of Device Path Node, no child handle is created by this
467 @retval EFI_SUCCESS The device was started.
468 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
469 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
470 @retval Others The driver failded to start the device.
475 SdMmcPciHcDriverBindingStart (
476 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
477 IN EFI_HANDLE Controller
,
478 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
482 Stops a device controller or a bus controller.
484 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
485 As a result, much of the error checking on the parameters to Stop() has been moved
486 into this common boot service. It is legal to call Stop() from other locations,
487 but the following calling restrictions must be followed or the system behavior will not be deterministic.
488 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
489 same driver's Start() function.
490 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
491 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
492 Start() function, and the Start() function must have called OpenProtocol() on
493 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
495 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
496 @param[in] ControllerHandle A handle to the device being stopped. The handle must
497 support a bus specific I/O protocol for the driver
498 to use to stop the device.
499 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
500 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
501 if NumberOfChildren is 0.
503 @retval EFI_SUCCESS The device was stopped.
504 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
509 SdMmcPciHcDriverBindingStop (
510 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
511 IN EFI_HANDLE Controller
,
512 IN UINTN NumberOfChildren
,
513 IN EFI_HANDLE
*ChildHandleBuffer
517 // EFI Component Name Functions
520 Retrieves a Unicode string that is the user readable name of the driver.
522 This function retrieves the user readable name of a driver in the form of a
523 Unicode string. If the driver specified by This has a user readable name in
524 the language specified by Language, then a pointer to the driver name is
525 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
526 by This does not support the language specified by Language,
527 then EFI_UNSUPPORTED is returned.
529 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
530 EFI_COMPONENT_NAME_PROTOCOL instance.
532 @param Language[in] A pointer to a Null-terminated ASCII string
533 array indicating the language. This is the
534 language of the driver name that the caller is
535 requesting, and it must match one of the
536 languages specified in SupportedLanguages. The
537 number of languages supported by a driver is up
538 to the driver writer. Language is specified
539 in RFC 4646 or ISO 639-2 language code format.
541 @param DriverName[out] A pointer to the Unicode string to return.
542 This Unicode string is the name of the
543 driver specified by This in the language
544 specified by Language.
546 @retval EFI_SUCCESS The Unicode string for the Driver specified by
547 This and the language specified by Language was
548 returned in DriverName.
550 @retval EFI_INVALID_PARAMETER Language is NULL.
552 @retval EFI_INVALID_PARAMETER DriverName is NULL.
554 @retval EFI_UNSUPPORTED The driver specified by This does not support
555 the language specified by Language.
560 SdMmcPciHcComponentNameGetDriverName (
561 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
563 OUT CHAR16
**DriverName
567 Retrieves a Unicode string that is the user readable name of the controller
568 that is being managed by a driver.
570 This function retrieves the user readable name of the controller specified by
571 ControllerHandle and ChildHandle in the form of a Unicode string. If the
572 driver specified by This has a user readable name in the language specified by
573 Language, then a pointer to the controller name is returned in ControllerName,
574 and EFI_SUCCESS is returned. If the driver specified by This is not currently
575 managing the controller specified by ControllerHandle and ChildHandle,
576 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
577 support the language specified by Language, then EFI_UNSUPPORTED is returned.
579 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
580 EFI_COMPONENT_NAME_PROTOCOL instance.
582 @param ControllerHandle[in] The handle of a controller that the driver
583 specified by This is managing. This handle
584 specifies the controller whose name is to be
587 @param ChildHandle[in] The handle of the child controller to retrieve
588 the name of. This is an optional parameter that
589 may be NULL. It will be NULL for device
590 drivers. It will also be NULL for a bus drivers
591 that wish to retrieve the name of the bus
592 controller. It will not be NULL for a bus
593 driver that wishes to retrieve the name of a
596 @param Language[in] A pointer to a Null-terminated ASCII string
597 array indicating the language. This is the
598 language of the driver name that the caller is
599 requesting, and it must match one of the
600 languages specified in SupportedLanguages. The
601 number of languages supported by a driver is up
602 to the driver writer. Language is specified in
603 RFC 4646 or ISO 639-2 language code format.
605 @param ControllerName[out] A pointer to the Unicode string to return.
606 This Unicode string is the name of the
607 controller specified by ControllerHandle and
608 ChildHandle in the language specified by
609 Language from the point of view of the driver
612 @retval EFI_SUCCESS The Unicode string for the user readable name in
613 the language specified by Language for the
614 driver specified by This was returned in
617 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
619 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
622 @retval EFI_INVALID_PARAMETER Language is NULL.
624 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
626 @retval EFI_UNSUPPORTED The driver specified by This is not currently
627 managing the controller specified by
628 ControllerHandle and ChildHandle.
630 @retval EFI_UNSUPPORTED The driver specified by This does not support
631 the language specified by Language.
636 SdMmcPciHcComponentNameGetControllerName (
637 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
638 IN EFI_HANDLE ControllerHandle
,
639 IN EFI_HANDLE ChildHandle
, OPTIONAL
641 OUT CHAR16
**ControllerName
645 Create a new TRB for the SD/MMC cmd request.
647 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
648 @param[in] Slot The slot number of the SD card to send the command to.
649 @param[in] Packet A pointer to the SD command data structure.
650 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
651 not NULL, then nonblocking I/O is performed, and Event
652 will be signaled when the Packet completes.
654 @return Created Trb or NULL.
659 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
661 IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
666 Free the resource used by the TRB.
668 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
673 IN SD_MMC_HC_TRB
*Trb
677 Check if the env is ready for execute specified TRB.
679 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
680 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
682 @retval EFI_SUCCESS The env is ready for TRB execution.
683 @retval EFI_NOT_READY The env is not ready for TRB execution.
684 @retval Others Some erros happen.
689 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
690 IN SD_MMC_HC_TRB
*Trb
694 Wait for the env to be ready for execute specified TRB.
696 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
697 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
699 @retval EFI_SUCCESS The env is ready for TRB execution.
700 @retval EFI_TIMEOUT The env is not ready for TRB execution in time.
701 @retval Others Some erros happen.
706 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
707 IN SD_MMC_HC_TRB
*Trb
711 Execute the specified TRB.
713 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
714 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
716 @retval EFI_SUCCESS The TRB is sent to host controller successfully.
717 @retval Others Some erros happen when sending this request to the host controller.
722 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
723 IN SD_MMC_HC_TRB
*Trb
727 Check the TRB execution result.
729 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
730 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
732 @retval EFI_SUCCESS The TRB is executed successfully.
733 @retval EFI_NOT_READY The TRB is not completed for execution.
734 @retval Others Some erros happen when executing this request.
738 SdMmcCheckTrbResult (
739 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
740 IN SD_MMC_HC_TRB
*Trb
744 Wait for the TRB execution result.
746 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
747 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
749 @retval EFI_SUCCESS The TRB is executed successfully.
750 @retval Others Some erros happen when executing this request.
755 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
756 IN SD_MMC_HC_TRB
*Trb
760 Execute EMMC device identification procedure.
762 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
764 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
765 @param[in] Slot The slot number of the SD card to send the command to.
767 @retval EFI_SUCCESS There is a EMMC card.
768 @retval Others There is not a EMMC card.
773 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
778 Execute EMMC device identification procedure.
780 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
782 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
783 @param[in] Slot The slot number of the SD card to send the command to.
785 @retval EFI_SUCCESS There is a EMMC card.
786 @retval Others There is not a EMMC card.
790 SdCardIdentification (
791 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
796 Software reset the specified SD/MMC host controller.
798 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
799 @param[in] Slot The slot number of the SD card to send the command to.
801 @retval EFI_SUCCESS The software reset executes successfully.
802 @retval Others The software reset fails.
807 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
812 Initial SD/MMC host controller with lowest clock frequency, max power and max timeout value
815 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
816 @param[in] Slot The slot number of the SD card to send the command to.
818 @retval EFI_SUCCESS The host controller is initialized successfully.
819 @retval Others The host controller isn't initialized successfully.
824 IN SD_MMC_HC_PRIVATE_DATA
*Private
,