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
;
86 SD_MMC_CARD_TYPE CardType
;
92 EFI_HANDLE ControllerHandle
;
93 EFI_PCI_IO_PROTOCOL
*PciIo
;
95 EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru
;
99 // The field is used to record the previous slot in GetNextSlot().
103 // For Non-blocking operation.
105 EFI_EVENT TimerEvent
;
107 // For Sd removable device enumeration.
109 EFI_EVENT ConnectEvent
;
112 SD_MMC_HC_SLOT Slot
[SD_MMC_HC_MAX_SLOT
];
113 SD_MMC_HC_SLOT_CAP Capability
[SD_MMC_HC_MAX_SLOT
];
114 UINT64 MaxCurrent
[SD_MMC_HC_MAX_SLOT
];
116 UINT32 ControllerVersion
;
117 } SD_MMC_HC_PRIVATE_DATA
;
119 #define SD_MMC_HC_TRB_SIG SIGNATURE_32 ('T', 'R', 'B', 'T')
122 // TRB (Transfer Request Block) contains information for the cmd request.
131 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
135 EFI_PHYSICAL_ADDRESS DataPhy
;
137 SD_MMC_HC_TRANSFER_MODE Mode
;
143 SD_MMC_HC_ADMA_DESC_LINE
*AdmaDesc
;
144 EFI_PHYSICAL_ADDRESS AdmaDescPhy
;
148 SD_MMC_HC_PRIVATE_DATA
*Private
;
151 #define SD_MMC_HC_TRB_FROM_THIS(a) \
152 CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
155 // Task for Non-blocking mode.
162 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
166 BOOLEAN InfiniteWait
;
175 Execute card identification procedure.
177 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
178 @param[in] Slot The slot number of the SD card to send the command to.
180 @retval EFI_SUCCESS The card is identified correctly.
181 @retval Others The card can't be identified.
186 (*CARD_TYPE_DETECT_ROUTINE
) (
187 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
192 Sends SD command to an SD card that is attached to the SD controller.
194 The PassThru() function sends the SD command specified by Packet to the SD card
197 If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.
199 If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.
201 If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER
204 If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL,
205 EFI_INVALID_PARAMETER is returned.
207 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
208 @param[in] Slot The slot number of the SD card to send the command to.
209 @param[in,out] Packet A pointer to the SD command data structure.
210 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
211 not NULL, then nonblocking I/O is performed, and Event
212 will be signaled when the Packet completes.
214 @retval EFI_SUCCESS The SD Command Packet was sent by the host.
215 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SD
217 @retval EFI_INVALID_PARAMETER Packet, Slot, or the contents of the Packet is invalid.
218 @retval EFI_INVALID_PARAMETER Packet defines a data command but both InDataBuffer and
219 OutDataBuffer are NULL.
220 @retval EFI_NO_MEDIA SD Device not present in the Slot.
221 @retval EFI_UNSUPPORTED The command described by the SD Command Packet is not
222 supported by the host controller.
223 @retval EFI_BAD_BUFFER_SIZE The InTransferLength or OutTransferLength exceeds the
224 limit supported by SD card ( i.e. if the number of bytes
225 exceed the Last LBA).
230 SdMmcPassThruPassThru (
231 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
233 IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
234 IN EFI_EVENT Event OPTIONAL
238 Used to retrieve next slot numbers supported by the SD controller. The function
239 returns information about all available slots (populated or not-populated).
241 The GetNextSlot() function retrieves the next slot number on an SD controller.
242 If on input Slot is 0xFF, then the slot number of the first slot on the SD controller
245 If Slot is a slot number that was returned on a previous call to GetNextSlot(), then
246 the slot number of the next slot on the SD controller is returned.
248 If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(),
249 EFI_INVALID_PARAMETER is returned.
251 If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND
254 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
255 @param[in,out] Slot On input, a pointer to a slot number on the SD controller.
256 On output, a pointer to the next slot number on the SD controller.
257 An input value of 0xFF retrieves the first slot number on the SD
260 @retval EFI_SUCCESS The next slot number on the SD controller was returned in Slot.
261 @retval EFI_NOT_FOUND There are no more slots on this SD controller.
262 @retval EFI_INVALID_PARAMETER Slot is not 0xFF and Slot was not returned on a previous call
268 SdMmcPassThruGetNextSlot (
269 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
274 Used to allocate and build a device path node for an SD card on the SD controller.
276 The BuildDevicePath() function allocates and builds a single device node for the SD
277 card specified by Slot.
279 If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND
282 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
284 If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES
287 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
288 DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is
291 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
292 @param[in] Slot Specifies the slot number of the SD card for which a device
293 path node is to be allocated and built.
294 @param[in,out] DevicePath A pointer to a single device path node that describes the SD
295 card specified by Slot. This function is responsible for
296 allocating the buffer DevicePath with the boot service
297 AllocatePool(). It is the caller's responsibility to free
298 DevicePath when the caller is finished with DevicePath.
300 @retval EFI_SUCCESS The device path node that describes the SD card specified by
301 Slot was allocated and returned in DevicePath.
302 @retval EFI_NOT_FOUND The SD card specified by Slot does not exist on the SD controller.
303 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
304 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
309 SdMmcPassThruBuildDevicePath (
310 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
312 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
316 This function retrieves an SD card slot number based on the input device path.
318 The GetSlotNumber() function retrieves slot number for the SD card specified by
319 the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.
321 If DevicePath is not a device path node type that the SD Pass Thru driver supports,
322 EFI_UNSUPPORTED is returned.
324 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
325 @param[in] DevicePath A pointer to the device path node that describes a SD
326 card on the SD controller.
327 @param[out] Slot On return, points to the slot number of an SD card on
330 @retval EFI_SUCCESS SD card slot number is returned in Slot.
331 @retval EFI_INVALID_PARAMETER Slot or DevicePath is NULL.
332 @retval EFI_UNSUPPORTED DevicePath is not a device path node type that the SD
333 Pass Thru driver supports.
338 SdMmcPassThruGetSlotNumber (
339 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
340 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
345 Resets an SD card that is connected to the SD controller.
347 The ResetDevice() function resets the SD card specified by Slot.
349 If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is
352 If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER
355 If the device reset operation is completed, EFI_SUCCESS is returned.
357 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
358 @param[in] Slot Specifies the slot number of the SD card to be reset.
360 @retval EFI_SUCCESS The SD card specified by Slot was reset.
361 @retval EFI_UNSUPPORTED The SD controller does not support a device reset operation.
362 @retval EFI_INVALID_PARAMETER Slot number is invalid.
363 @retval EFI_NO_MEDIA SD Device not present in the Slot.
364 @retval EFI_DEVICE_ERROR The reset command failed due to a device error
369 SdMmcPassThruResetDevice (
370 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
375 // Driver model protocol interfaces
378 Tests to see if this driver supports a given controller. If a child device is provided,
379 it further tests to see if this driver supports creating a handle for the specified child device.
381 This function checks to see if the driver specified by This supports the device specified by
382 ControllerHandle. Drivers will typically use the device path attached to
383 ControllerHandle and/or the services from the bus I/O abstraction attached to
384 ControllerHandle to determine if the driver supports ControllerHandle. This function
385 may be called many times during platform initialization. In order to reduce boot times, the tests
386 performed by this function must be very small, and take as little time as possible to execute. This
387 function must not change the state of any hardware devices, and this function must be aware that the
388 device specified by ControllerHandle may already be managed by the same driver or a
389 different driver. This function must match its calls to AllocatePages() with FreePages(),
390 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
391 Since ControllerHandle may have been previously started by the same driver, if a protocol is
392 already in the opened state, then it must not be closed with CloseProtocol(). This is required
393 to guarantee the state of ControllerHandle is not modified by this function.
395 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
396 @param[in] ControllerHandle The handle of the controller to test. This handle
397 must support a protocol interface that supplies
398 an I/O abstraction to the driver.
399 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
400 parameter is ignored by device drivers, and is optional for bus
401 drivers. For bus drivers, if this parameter is not NULL, then
402 the bus driver must determine if the bus controller specified
403 by ControllerHandle and the child controller specified
404 by RemainingDevicePath are both supported by this
407 @retval EFI_SUCCESS The device specified by ControllerHandle and
408 RemainingDevicePath is supported by the driver specified by This.
409 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
410 RemainingDevicePath is already being managed by the driver
412 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
413 RemainingDevicePath is already being managed by a different
414 driver or an application that requires exclusive access.
415 Currently not implemented.
416 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
417 RemainingDevicePath is not supported by the driver specified by This.
421 SdMmcPciHcDriverBindingSupported (
422 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
423 IN EFI_HANDLE Controller
,
424 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
428 Starts a device controller or a bus controller.
430 The Start() function is designed to be invoked from the EFI boot service ConnectController().
431 As a result, much of the error checking on the parameters to Start() has been moved into this
432 common boot service. It is legal to call Start() from other locations,
433 but the following calling restrictions must be followed or the system behavior will not be deterministic.
434 1. ControllerHandle must be a valid EFI_HANDLE.
435 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
436 EFI_DEVICE_PATH_PROTOCOL.
437 3. Prior to calling Start(), the Supported() function for the driver specified by This must
438 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
440 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
441 @param[in] ControllerHandle The handle of the controller to start. This handle
442 must support a protocol interface that supplies
443 an I/O abstraction to the driver.
444 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
445 parameter is ignored by device drivers, and is optional for bus
446 drivers. For a bus driver, if this parameter is NULL, then handles
447 for all the children of Controller are created by this driver.
448 If this parameter is not NULL and the first Device Path Node is
449 not the End of Device Path Node, then only the handle for the
450 child device specified by the first Device Path Node of
451 RemainingDevicePath is created by this driver.
452 If the first Device Path Node of RemainingDevicePath is
453 the End of Device Path Node, no child handle is created by this
456 @retval EFI_SUCCESS The device was started.
457 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
458 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
459 @retval Others The driver failded to start the device.
464 SdMmcPciHcDriverBindingStart (
465 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
466 IN EFI_HANDLE Controller
,
467 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
471 Stops a device controller or a bus controller.
473 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
474 As a result, much of the error checking on the parameters to Stop() has been moved
475 into this common boot service. It is legal to call Stop() from other locations,
476 but the following calling restrictions must be followed or the system behavior will not be deterministic.
477 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
478 same driver's Start() function.
479 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
480 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
481 Start() function, and the Start() function must have called OpenProtocol() on
482 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
484 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
485 @param[in] ControllerHandle A handle to the device being stopped. The handle must
486 support a bus specific I/O protocol for the driver
487 to use to stop the device.
488 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
489 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
490 if NumberOfChildren is 0.
492 @retval EFI_SUCCESS The device was stopped.
493 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
498 SdMmcPciHcDriverBindingStop (
499 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
500 IN EFI_HANDLE Controller
,
501 IN UINTN NumberOfChildren
,
502 IN EFI_HANDLE
*ChildHandleBuffer
506 // EFI Component Name Functions
509 Retrieves a Unicode string that is the user readable name of the driver.
511 This function retrieves the user readable name of a driver in the form of a
512 Unicode string. If the driver specified by This has a user readable name in
513 the language specified by Language, then a pointer to the driver name is
514 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
515 by This does not support the language specified by Language,
516 then EFI_UNSUPPORTED is returned.
518 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
519 EFI_COMPONENT_NAME_PROTOCOL instance.
521 @param Language[in] A pointer to a Null-terminated ASCII string
522 array indicating the language. This is the
523 language of the driver name that the caller is
524 requesting, and it must match one of the
525 languages specified in SupportedLanguages. The
526 number of languages supported by a driver is up
527 to the driver writer. Language is specified
528 in RFC 4646 or ISO 639-2 language code format.
530 @param DriverName[out] A pointer to the Unicode string to return.
531 This Unicode string is the name of the
532 driver specified by This in the language
533 specified by Language.
535 @retval EFI_SUCCESS The Unicode string for the Driver specified by
536 This and the language specified by Language was
537 returned in DriverName.
539 @retval EFI_INVALID_PARAMETER Language is NULL.
541 @retval EFI_INVALID_PARAMETER DriverName is NULL.
543 @retval EFI_UNSUPPORTED The driver specified by This does not support
544 the language specified by Language.
549 SdMmcPciHcComponentNameGetDriverName (
550 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
552 OUT CHAR16
**DriverName
556 Retrieves a Unicode string that is the user readable name of the controller
557 that is being managed by a driver.
559 This function retrieves the user readable name of the controller specified by
560 ControllerHandle and ChildHandle in the form of a Unicode string. If the
561 driver specified by This has a user readable name in the language specified by
562 Language, then a pointer to the controller name is returned in ControllerName,
563 and EFI_SUCCESS is returned. If the driver specified by This is not currently
564 managing the controller specified by ControllerHandle and ChildHandle,
565 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
566 support the language specified by Language, then EFI_UNSUPPORTED is returned.
568 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
569 EFI_COMPONENT_NAME_PROTOCOL instance.
571 @param ControllerHandle[in] The handle of a controller that the driver
572 specified by This is managing. This handle
573 specifies the controller whose name is to be
576 @param ChildHandle[in] The handle of the child controller to retrieve
577 the name of. This is an optional parameter that
578 may be NULL. It will be NULL for device
579 drivers. It will also be NULL for a bus drivers
580 that wish to retrieve the name of the bus
581 controller. It will not be NULL for a bus
582 driver that wishes to retrieve the name of a
585 @param Language[in] A pointer to a Null-terminated ASCII string
586 array indicating the language. This is the
587 language of the driver name that the caller is
588 requesting, and it must match one of the
589 languages specified in SupportedLanguages. The
590 number of languages supported by a driver is up
591 to the driver writer. Language is specified in
592 RFC 4646 or ISO 639-2 language code format.
594 @param ControllerName[out] A pointer to the Unicode string to return.
595 This Unicode string is the name of the
596 controller specified by ControllerHandle and
597 ChildHandle in the language specified by
598 Language from the point of view of the driver
601 @retval EFI_SUCCESS The Unicode string for the user readable name in
602 the language specified by Language for the
603 driver specified by This was returned in
606 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
608 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
611 @retval EFI_INVALID_PARAMETER Language is NULL.
613 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
615 @retval EFI_UNSUPPORTED The driver specified by This is not currently
616 managing the controller specified by
617 ControllerHandle and ChildHandle.
619 @retval EFI_UNSUPPORTED The driver specified by This does not support
620 the language specified by Language.
625 SdMmcPciHcComponentNameGetControllerName (
626 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
627 IN EFI_HANDLE ControllerHandle
,
628 IN EFI_HANDLE ChildHandle
, OPTIONAL
630 OUT CHAR16
**ControllerName
634 Create a new TRB for the SD/MMC cmd request.
636 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
637 @param[in] Slot The slot number of the SD card to send the command to.
638 @param[in] Packet A pointer to the SD command data structure.
639 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
640 not NULL, then nonblocking I/O is performed, and Event
641 will be signaled when the Packet completes.
643 @return Created Trb or NULL.
648 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
650 IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
655 Free the resource used by the TRB.
657 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
662 IN SD_MMC_HC_TRB
*Trb
666 Check if the env is ready for execute specified TRB.
668 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
669 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
671 @retval EFI_SUCCESS The env is ready for TRB execution.
672 @retval EFI_NOT_READY The env is not ready for TRB execution.
673 @retval Others Some erros happen.
678 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
679 IN SD_MMC_HC_TRB
*Trb
683 Wait for the env to be ready for execute specified TRB.
685 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
686 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
688 @retval EFI_SUCCESS The env is ready for TRB execution.
689 @retval EFI_TIMEOUT The env is not ready for TRB execution in time.
690 @retval Others Some erros happen.
695 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
696 IN SD_MMC_HC_TRB
*Trb
700 Execute the specified TRB.
702 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
703 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
705 @retval EFI_SUCCESS The TRB is sent to host controller successfully.
706 @retval Others Some erros happen when sending this request to the host controller.
711 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
712 IN SD_MMC_HC_TRB
*Trb
716 Check the TRB execution result.
718 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
719 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
721 @retval EFI_SUCCESS The TRB is executed successfully.
722 @retval EFI_NOT_READY The TRB is not completed for execution.
723 @retval Others Some erros happen when executing this request.
727 SdMmcCheckTrbResult (
728 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
729 IN SD_MMC_HC_TRB
*Trb
733 Wait for the TRB execution result.
735 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
736 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
738 @retval EFI_SUCCESS The TRB is executed successfully.
739 @retval Others Some erros happen when executing this request.
744 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
745 IN SD_MMC_HC_TRB
*Trb
749 Execute EMMC device identification procedure.
751 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
753 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
754 @param[in] Slot The slot number of the SD card to send the command to.
756 @retval EFI_SUCCESS There is a EMMC card.
757 @retval Others There is not a EMMC card.
762 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
767 Execute EMMC device identification procedure.
769 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
771 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
772 @param[in] Slot The slot number of the SD card to send the command to.
774 @retval EFI_SUCCESS There is a EMMC card.
775 @retval Others There is not a EMMC card.
779 SdCardIdentification (
780 IN SD_MMC_HC_PRIVATE_DATA
*Private
,