3 Provides some data structure definitions used by the SD/MMC host controller driver.
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _SD_MMC_PCI_HC_DXE_H_
17 #define _SD_MMC_PCI_HC_DXE_H_
21 #include <IndustryStandard/Pci.h>
22 #include <IndustryStandard/Emmc.h>
23 #include <IndustryStandard/Sd.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/DebugLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/BaseMemoryLib.h>
29 #include <Library/MemoryAllocationLib.h>
30 #include <Library/UefiLib.h>
31 #include <Library/DevicePathLib.h>
33 #include <Protocol/DevicePath.h>
34 #include <Protocol/PciIo.h>
35 #include <Protocol/DriverBinding.h>
36 #include <Protocol/ComponentName.h>
37 #include <Protocol/ComponentName2.h>
38 #include <Protocol/SdMmcPassThru.h>
40 #include "SdMmcPciHci.h"
42 extern EFI_COMPONENT_NAME_PROTOCOL gSdMmcPciHcComponentName
;
43 extern EFI_COMPONENT_NAME2_PROTOCOL gSdMmcPciHcComponentName2
;
44 extern EFI_DRIVER_BINDING_PROTOCOL gSdMmcPciHcDriverBinding
;
46 #define SD_MMC_HC_PRIVATE_SIGNATURE SIGNATURE_32 ('s', 'd', 't', 'f')
48 #define SD_MMC_HC_PRIVATE_FROM_THIS(a) \
49 CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)
52 // Generic time out value, 1 microsecond as unit.
54 #define SD_MMC_HC_GENERIC_TIMEOUT 1 * 1000 * 1000
57 // SD/MMC async transfer timer interval, set by experience.
58 // The unit is 100us, takes 1ms as interval.
60 #define SD_MMC_HC_ASYNC_TIMER EFI_TIMER_PERIOD_MILLISECONDS(1)
62 // SD/MMC removable device enumeration timer interval, set by experience.
63 // The unit is 100us, takes 100ms as interval.
65 #define SD_MMC_HC_ENUM_TIMER EFI_TIMER_PERIOD_MILLISECONDS(100)
80 } EFI_SD_MMC_SLOT_TYPE
;
84 EFI_SD_MMC_SLOT_TYPE SlotType
;
87 SD_MMC_CARD_TYPE CardType
;
93 EFI_HANDLE ControllerHandle
;
94 EFI_PCI_IO_PROTOCOL
*PciIo
;
96 EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru
;
100 // The field is used to record the previous slot in GetNextSlot().
104 // For Non-blocking operation.
106 EFI_EVENT TimerEvent
;
108 // For Sd removable device enumeration.
110 EFI_EVENT ConnectEvent
;
113 SD_MMC_HC_SLOT Slot
[SD_MMC_HC_MAX_SLOT
];
114 SD_MMC_HC_SLOT_CAP Capability
[SD_MMC_HC_MAX_SLOT
];
115 UINT64 MaxCurrent
[SD_MMC_HC_MAX_SLOT
];
117 UINT32 ControllerVersion
;
118 } SD_MMC_HC_PRIVATE_DATA
;
120 #define SD_MMC_HC_TRB_SIG SIGNATURE_32 ('T', 'R', 'B', 'T')
123 // TRB (Transfer Request Block) contains information for the cmd request.
132 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
136 EFI_PHYSICAL_ADDRESS DataPhy
;
138 SD_MMC_HC_TRANSFER_MODE Mode
;
144 SD_MMC_HC_ADMA_DESC_LINE
*AdmaDesc
;
145 EFI_PHYSICAL_ADDRESS AdmaDescPhy
;
149 SD_MMC_HC_PRIVATE_DATA
*Private
;
152 #define SD_MMC_HC_TRB_FROM_THIS(a) \
153 CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
156 // Task for Non-blocking mode.
163 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
167 BOOLEAN InfiniteWait
;
176 Execute card identification procedure.
178 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
179 @param[in] Slot The slot number of the SD card to send the command to.
181 @retval EFI_SUCCESS The card is identified correctly.
182 @retval Others The card can't be identified.
187 (*CARD_TYPE_DETECT_ROUTINE
) (
188 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
193 Sends SD command to an SD card that is attached to the SD controller.
195 The PassThru() function sends the SD command specified by Packet to the SD card
198 If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.
200 If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.
202 If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER
205 If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL,
206 EFI_INVALID_PARAMETER is returned.
208 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
209 @param[in] Slot The slot number of the SD card to send the command to.
210 @param[in,out] Packet A pointer to the SD command data structure.
211 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
212 not NULL, then nonblocking I/O is performed, and Event
213 will be signaled when the Packet completes.
215 @retval EFI_SUCCESS The SD Command Packet was sent by the host.
216 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SD
218 @retval EFI_INVALID_PARAMETER Packet, Slot, or the contents of the Packet is invalid.
219 @retval EFI_INVALID_PARAMETER Packet defines a data command but both InDataBuffer and
220 OutDataBuffer are NULL.
221 @retval EFI_NO_MEDIA SD Device not present in the Slot.
222 @retval EFI_UNSUPPORTED The command described by the SD Command Packet is not
223 supported by the host controller.
224 @retval EFI_BAD_BUFFER_SIZE The InTransferLength or OutTransferLength exceeds the
225 limit supported by SD card ( i.e. if the number of bytes
226 exceed the Last LBA).
231 SdMmcPassThruPassThru (
232 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
234 IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
235 IN EFI_EVENT Event OPTIONAL
239 Used to retrieve next slot numbers supported by the SD controller. The function
240 returns information about all available slots (populated or not-populated).
242 The GetNextSlot() function retrieves the next slot number on an SD controller.
243 If on input Slot is 0xFF, then the slot number of the first slot on the SD controller
246 If Slot is a slot number that was returned on a previous call to GetNextSlot(), then
247 the slot number of the next slot on the SD controller is returned.
249 If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(),
250 EFI_INVALID_PARAMETER is returned.
252 If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND
255 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
256 @param[in,out] Slot On input, a pointer to a slot number on the SD controller.
257 On output, a pointer to the next slot number on the SD controller.
258 An input value of 0xFF retrieves the first slot number on the SD
261 @retval EFI_SUCCESS The next slot number on the SD controller was returned in Slot.
262 @retval EFI_NOT_FOUND There are no more slots on this SD controller.
263 @retval EFI_INVALID_PARAMETER Slot is not 0xFF and Slot was not returned on a previous call
269 SdMmcPassThruGetNextSlot (
270 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
275 Used to allocate and build a device path node for an SD card on the SD controller.
277 The BuildDevicePath() function allocates and builds a single device node for the SD
278 card specified by Slot.
280 If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND
283 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
285 If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES
288 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
289 DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is
292 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
293 @param[in] Slot Specifies the slot number of the SD card for which a device
294 path node is to be allocated and built.
295 @param[in,out] DevicePath A pointer to a single device path node that describes the SD
296 card specified by Slot. This function is responsible for
297 allocating the buffer DevicePath with the boot service
298 AllocatePool(). It is the caller's responsibility to free
299 DevicePath when the caller is finished with DevicePath.
301 @retval EFI_SUCCESS The device path node that describes the SD card specified by
302 Slot was allocated and returned in DevicePath.
303 @retval EFI_NOT_FOUND The SD card specified by Slot does not exist on the SD controller.
304 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
305 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
310 SdMmcPassThruBuildDevicePath (
311 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
313 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
317 This function retrieves an SD card slot number based on the input device path.
319 The GetSlotNumber() function retrieves slot number for the SD card specified by
320 the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.
322 If DevicePath is not a device path node type that the SD Pass Thru driver supports,
323 EFI_UNSUPPORTED is returned.
325 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
326 @param[in] DevicePath A pointer to the device path node that describes a SD
327 card on the SD controller.
328 @param[out] Slot On return, points to the slot number of an SD card on
331 @retval EFI_SUCCESS SD card slot number is returned in Slot.
332 @retval EFI_INVALID_PARAMETER Slot or DevicePath is NULL.
333 @retval EFI_UNSUPPORTED DevicePath is not a device path node type that the SD
334 Pass Thru driver supports.
339 SdMmcPassThruGetSlotNumber (
340 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
341 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
346 Resets an SD card that is connected to the SD controller.
348 The ResetDevice() function resets the SD card specified by Slot.
350 If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is
353 If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER
356 If the device reset operation is completed, EFI_SUCCESS is returned.
358 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
359 @param[in] Slot Specifies the slot number of the SD card to be reset.
361 @retval EFI_SUCCESS The SD card specified by Slot was reset.
362 @retval EFI_UNSUPPORTED The SD controller does not support a device reset operation.
363 @retval EFI_INVALID_PARAMETER Slot number is invalid.
364 @retval EFI_NO_MEDIA SD Device not present in the Slot.
365 @retval EFI_DEVICE_ERROR The reset command failed due to a device error
370 SdMmcPassThruResetDevice (
371 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
376 // Driver model protocol interfaces
379 Tests to see if this driver supports a given controller. If a child device is provided,
380 it further tests to see if this driver supports creating a handle for the specified child device.
382 This function checks to see if the driver specified by This supports the device specified by
383 ControllerHandle. Drivers will typically use the device path attached to
384 ControllerHandle and/or the services from the bus I/O abstraction attached to
385 ControllerHandle to determine if the driver supports ControllerHandle. This function
386 may be called many times during platform initialization. In order to reduce boot times, the tests
387 performed by this function must be very small, and take as little time as possible to execute. This
388 function must not change the state of any hardware devices, and this function must be aware that the
389 device specified by ControllerHandle may already be managed by the same driver or a
390 different driver. This function must match its calls to AllocatePages() with FreePages(),
391 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
392 Since ControllerHandle may have been previously started by the same driver, if a protocol is
393 already in the opened state, then it must not be closed with CloseProtocol(). This is required
394 to guarantee the state of ControllerHandle is not modified by this function.
396 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
397 @param[in] ControllerHandle The handle of the controller to test. This handle
398 must support a protocol interface that supplies
399 an I/O abstraction to the driver.
400 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
401 parameter is ignored by device drivers, and is optional for bus
402 drivers. For bus drivers, if this parameter is not NULL, then
403 the bus driver must determine if the bus controller specified
404 by ControllerHandle and the child controller specified
405 by RemainingDevicePath are both supported by this
408 @retval EFI_SUCCESS The device specified by ControllerHandle and
409 RemainingDevicePath is supported by the driver specified by This.
410 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
411 RemainingDevicePath is already being managed by the driver
413 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
414 RemainingDevicePath is already being managed by a different
415 driver or an application that requires exclusive access.
416 Currently not implemented.
417 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
418 RemainingDevicePath is not supported by the driver specified by This.
422 SdMmcPciHcDriverBindingSupported (
423 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
424 IN EFI_HANDLE Controller
,
425 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
429 Starts a device controller or a bus controller.
431 The Start() function is designed to be invoked from the EFI boot service ConnectController().
432 As a result, much of the error checking on the parameters to Start() has been moved into this
433 common boot service. It is legal to call Start() from other locations,
434 but the following calling restrictions must be followed or the system behavior will not be deterministic.
435 1. ControllerHandle must be a valid EFI_HANDLE.
436 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
437 EFI_DEVICE_PATH_PROTOCOL.
438 3. Prior to calling Start(), the Supported() function for the driver specified by This must
439 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
441 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
442 @param[in] ControllerHandle The handle of the controller to start. This handle
443 must support a protocol interface that supplies
444 an I/O abstraction to the driver.
445 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
446 parameter is ignored by device drivers, and is optional for bus
447 drivers. For a bus driver, if this parameter is NULL, then handles
448 for all the children of Controller are created by this driver.
449 If this parameter is not NULL and the first Device Path Node is
450 not the End of Device Path Node, then only the handle for the
451 child device specified by the first Device Path Node of
452 RemainingDevicePath is created by this driver.
453 If the first Device Path Node of RemainingDevicePath is
454 the End of Device Path Node, no child handle is created by this
457 @retval EFI_SUCCESS The device was started.
458 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
459 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
460 @retval Others The driver failded to start the device.
465 SdMmcPciHcDriverBindingStart (
466 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
467 IN EFI_HANDLE Controller
,
468 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
472 Stops a device controller or a bus controller.
474 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
475 As a result, much of the error checking on the parameters to Stop() has been moved
476 into this common boot service. It is legal to call Stop() from other locations,
477 but the following calling restrictions must be followed or the system behavior will not be deterministic.
478 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
479 same driver's Start() function.
480 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
481 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
482 Start() function, and the Start() function must have called OpenProtocol() on
483 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
485 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
486 @param[in] ControllerHandle A handle to the device being stopped. The handle must
487 support a bus specific I/O protocol for the driver
488 to use to stop the device.
489 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
490 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
491 if NumberOfChildren is 0.
493 @retval EFI_SUCCESS The device was stopped.
494 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
499 SdMmcPciHcDriverBindingStop (
500 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
501 IN EFI_HANDLE Controller
,
502 IN UINTN NumberOfChildren
,
503 IN EFI_HANDLE
*ChildHandleBuffer
507 // EFI Component Name Functions
510 Retrieves a Unicode string that is the user readable name of the driver.
512 This function retrieves the user readable name of a driver in the form of a
513 Unicode string. If the driver specified by This has a user readable name in
514 the language specified by Language, then a pointer to the driver name is
515 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
516 by This does not support the language specified by Language,
517 then EFI_UNSUPPORTED is returned.
519 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
520 EFI_COMPONENT_NAME_PROTOCOL instance.
522 @param Language[in] A pointer to a Null-terminated ASCII string
523 array indicating the language. This is the
524 language of the driver name that the caller is
525 requesting, and it must match one of the
526 languages specified in SupportedLanguages. The
527 number of languages supported by a driver is up
528 to the driver writer. Language is specified
529 in RFC 4646 or ISO 639-2 language code format.
531 @param DriverName[out] A pointer to the Unicode string to return.
532 This Unicode string is the name of the
533 driver specified by This in the language
534 specified by Language.
536 @retval EFI_SUCCESS The Unicode string for the Driver specified by
537 This and the language specified by Language was
538 returned in DriverName.
540 @retval EFI_INVALID_PARAMETER Language is NULL.
542 @retval EFI_INVALID_PARAMETER DriverName is NULL.
544 @retval EFI_UNSUPPORTED The driver specified by This does not support
545 the language specified by Language.
550 SdMmcPciHcComponentNameGetDriverName (
551 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
553 OUT CHAR16
**DriverName
557 Retrieves a Unicode string that is the user readable name of the controller
558 that is being managed by a driver.
560 This function retrieves the user readable name of the controller specified by
561 ControllerHandle and ChildHandle in the form of a Unicode string. If the
562 driver specified by This has a user readable name in the language specified by
563 Language, then a pointer to the controller name is returned in ControllerName,
564 and EFI_SUCCESS is returned. If the driver specified by This is not currently
565 managing the controller specified by ControllerHandle and ChildHandle,
566 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
567 support the language specified by Language, then EFI_UNSUPPORTED is returned.
569 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
570 EFI_COMPONENT_NAME_PROTOCOL instance.
572 @param ControllerHandle[in] The handle of a controller that the driver
573 specified by This is managing. This handle
574 specifies the controller whose name is to be
577 @param ChildHandle[in] The handle of the child controller to retrieve
578 the name of. This is an optional parameter that
579 may be NULL. It will be NULL for device
580 drivers. It will also be NULL for a bus drivers
581 that wish to retrieve the name of the bus
582 controller. It will not be NULL for a bus
583 driver that wishes to retrieve the name of a
586 @param Language[in] A pointer to a Null-terminated ASCII string
587 array indicating the language. This is the
588 language of the driver name that the caller is
589 requesting, and it must match one of the
590 languages specified in SupportedLanguages. The
591 number of languages supported by a driver is up
592 to the driver writer. Language is specified in
593 RFC 4646 or ISO 639-2 language code format.
595 @param ControllerName[out] A pointer to the Unicode string to return.
596 This Unicode string is the name of the
597 controller specified by ControllerHandle and
598 ChildHandle in the language specified by
599 Language from the point of view of the driver
602 @retval EFI_SUCCESS The Unicode string for the user readable name in
603 the language specified by Language for the
604 driver specified by This was returned in
607 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
609 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
612 @retval EFI_INVALID_PARAMETER Language is NULL.
614 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
616 @retval EFI_UNSUPPORTED The driver specified by This is not currently
617 managing the controller specified by
618 ControllerHandle and ChildHandle.
620 @retval EFI_UNSUPPORTED The driver specified by This does not support
621 the language specified by Language.
626 SdMmcPciHcComponentNameGetControllerName (
627 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
628 IN EFI_HANDLE ControllerHandle
,
629 IN EFI_HANDLE ChildHandle
, OPTIONAL
631 OUT CHAR16
**ControllerName
635 Create a new TRB for the SD/MMC cmd request.
637 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
638 @param[in] Slot The slot number of the SD card to send the command to.
639 @param[in] Packet A pointer to the SD command data structure.
640 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
641 not NULL, then nonblocking I/O is performed, and Event
642 will be signaled when the Packet completes.
644 @return Created Trb or NULL.
649 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
651 IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
656 Free the resource used by the TRB.
658 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
663 IN SD_MMC_HC_TRB
*Trb
667 Check if the env is ready for execute specified TRB.
669 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
670 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
672 @retval EFI_SUCCESS The env is ready for TRB execution.
673 @retval EFI_NOT_READY The env is not ready for TRB execution.
674 @retval Others Some erros happen.
679 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
680 IN SD_MMC_HC_TRB
*Trb
684 Wait for the env to be ready for execute specified TRB.
686 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
687 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
689 @retval EFI_SUCCESS The env is ready for TRB execution.
690 @retval EFI_TIMEOUT The env is not ready for TRB execution in time.
691 @retval Others Some erros happen.
696 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
697 IN SD_MMC_HC_TRB
*Trb
701 Execute the specified TRB.
703 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
704 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
706 @retval EFI_SUCCESS The TRB is sent to host controller successfully.
707 @retval Others Some erros happen when sending this request to the host controller.
712 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
713 IN SD_MMC_HC_TRB
*Trb
717 Check the TRB execution result.
719 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
720 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
722 @retval EFI_SUCCESS The TRB is executed successfully.
723 @retval EFI_NOT_READY The TRB is not completed for execution.
724 @retval Others Some erros happen when executing this request.
728 SdMmcCheckTrbResult (
729 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
730 IN SD_MMC_HC_TRB
*Trb
734 Wait for the TRB execution result.
736 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
737 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
739 @retval EFI_SUCCESS The TRB is executed successfully.
740 @retval Others Some erros happen when executing this request.
745 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
746 IN SD_MMC_HC_TRB
*Trb
750 Execute EMMC device identification procedure.
752 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
754 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
755 @param[in] Slot The slot number of the SD card to send the command to.
757 @retval EFI_SUCCESS There is a EMMC card.
758 @retval Others There is not a EMMC card.
763 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
768 Execute EMMC device identification procedure.
770 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
772 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
773 @param[in] Slot The slot number of the SD card to send the command to.
775 @retval EFI_SUCCESS There is a EMMC card.
776 @retval Others There is not a EMMC card.
780 SdCardIdentification (
781 IN SD_MMC_HC_PRIVATE_DATA
*Private
,