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/SdMmcOverride.h>
39 #include <Protocol/SdMmcPassThru.h>
41 #include "SdMmcPciHci.h"
43 extern EFI_COMPONENT_NAME_PROTOCOL gSdMmcPciHcComponentName
;
44 extern EFI_COMPONENT_NAME2_PROTOCOL gSdMmcPciHcComponentName2
;
45 extern EFI_DRIVER_BINDING_PROTOCOL gSdMmcPciHcDriverBinding
;
47 extern EDKII_SD_MMC_OVERRIDE
*mOverride
;
49 #define SD_MMC_HC_PRIVATE_SIGNATURE SIGNATURE_32 ('s', 'd', 't', 'f')
51 #define SD_MMC_HC_PRIVATE_FROM_THIS(a) \
52 CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)
55 // Generic time out value, 1 microsecond as unit.
57 #define SD_MMC_HC_GENERIC_TIMEOUT 1 * 1000 * 1000
60 // SD/MMC async transfer timer interval, set by experience.
61 // The unit is 100us, takes 1ms as interval.
63 #define SD_MMC_HC_ASYNC_TIMER EFI_TIMER_PERIOD_MILLISECONDS(1)
65 // SD/MMC removable device enumeration timer interval, set by experience.
66 // The unit is 100us, takes 100ms as interval.
68 #define SD_MMC_HC_ENUM_TIMER EFI_TIMER_PERIOD_MILLISECONDS(100)
83 } EFI_SD_MMC_SLOT_TYPE
;
87 EFI_SD_MMC_SLOT_TYPE SlotType
;
90 SD_MMC_CARD_TYPE CardType
;
96 EFI_HANDLE ControllerHandle
;
97 EFI_PCI_IO_PROTOCOL
*PciIo
;
99 EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru
;
101 UINT64 PciAttributes
;
103 // The field is used to record the previous slot in GetNextSlot().
107 // For Non-blocking operation.
109 EFI_EVENT TimerEvent
;
111 // For Sd removable device enumeration.
113 EFI_EVENT ConnectEvent
;
116 SD_MMC_HC_SLOT Slot
[SD_MMC_HC_MAX_SLOT
];
117 SD_MMC_HC_SLOT_CAP Capability
[SD_MMC_HC_MAX_SLOT
];
118 UINT64 MaxCurrent
[SD_MMC_HC_MAX_SLOT
];
120 UINT32 ControllerVersion
;
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_DESC_LINE
*AdmaDesc
;
154 EFI_PHYSICAL_ADDRESS AdmaDescPhy
;
158 SD_MMC_HC_PRIVATE_DATA
*Private
;
161 #define SD_MMC_HC_TRB_FROM_THIS(a) \
162 CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
165 // Task for Non-blocking mode.
172 EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
;
176 BOOLEAN InfiniteWait
;
185 Execute card identification procedure.
187 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
188 @param[in] Slot The slot number of the SD card to send the command to.
190 @retval EFI_SUCCESS The card is identified correctly.
191 @retval Others The card can't be identified.
196 (*CARD_TYPE_DETECT_ROUTINE
) (
197 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
202 Sends SD command to an SD card that is attached to the SD controller.
204 The PassThru() function sends the SD command specified by Packet to the SD card
207 If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.
209 If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.
211 If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER
214 If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL,
215 EFI_INVALID_PARAMETER is returned.
217 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
218 @param[in] Slot The slot number of the SD card to send the command to.
219 @param[in,out] Packet A pointer to the SD command data structure.
220 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
221 not NULL, then nonblocking I/O is performed, and Event
222 will be signaled when the Packet completes.
224 @retval EFI_SUCCESS The SD Command Packet was sent by the host.
225 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SD
227 @retval EFI_INVALID_PARAMETER Packet, Slot, or the contents of the Packet is invalid.
228 @retval EFI_INVALID_PARAMETER Packet defines a data command but both InDataBuffer and
229 OutDataBuffer are NULL.
230 @retval EFI_NO_MEDIA SD Device not present in the Slot.
231 @retval EFI_UNSUPPORTED The command described by the SD Command Packet is not
232 supported by the host controller.
233 @retval EFI_BAD_BUFFER_SIZE The InTransferLength or OutTransferLength exceeds the
234 limit supported by SD card ( i.e. if the number of bytes
235 exceed the Last LBA).
240 SdMmcPassThruPassThru (
241 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
243 IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
244 IN EFI_EVENT Event OPTIONAL
248 Used to retrieve next slot numbers supported by the SD controller. The function
249 returns information about all available slots (populated or not-populated).
251 The GetNextSlot() function retrieves the next slot number on an SD controller.
252 If on input Slot is 0xFF, then the slot number of the first slot on the SD controller
255 If Slot is a slot number that was returned on a previous call to GetNextSlot(), then
256 the slot number of the next slot on the SD controller is returned.
258 If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(),
259 EFI_INVALID_PARAMETER is returned.
261 If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND
264 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
265 @param[in,out] Slot On input, a pointer to a slot number on the SD controller.
266 On output, a pointer to the next slot number on the SD controller.
267 An input value of 0xFF retrieves the first slot number on the SD
270 @retval EFI_SUCCESS The next slot number on the SD controller was returned in Slot.
271 @retval EFI_NOT_FOUND There are no more slots on this SD controller.
272 @retval EFI_INVALID_PARAMETER Slot is not 0xFF and Slot was not returned on a previous call
278 SdMmcPassThruGetNextSlot (
279 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
284 Used to allocate and build a device path node for an SD card on the SD controller.
286 The BuildDevicePath() function allocates and builds a single device node for the SD
287 card specified by Slot.
289 If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND
292 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
294 If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES
297 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
298 DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is
301 @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
302 @param[in] Slot Specifies the slot number of the SD card for which a device
303 path node is to be allocated and built.
304 @param[in,out] DevicePath A pointer to a single device path node that describes the SD
305 card specified by Slot. This function is responsible for
306 allocating the buffer DevicePath with the boot service
307 AllocatePool(). It is the caller's responsibility to free
308 DevicePath when the caller is finished with DevicePath.
310 @retval EFI_SUCCESS The device path node that describes the SD card specified by
311 Slot was allocated and returned in DevicePath.
312 @retval EFI_NOT_FOUND The SD card specified by Slot does not exist on the SD controller.
313 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
314 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
319 SdMmcPassThruBuildDevicePath (
320 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
322 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
326 This function retrieves an SD card slot number based on the input device path.
328 The GetSlotNumber() function retrieves slot number for the SD card specified by
329 the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.
331 If DevicePath is not a device path node type that the SD Pass Thru driver supports,
332 EFI_UNSUPPORTED is returned.
334 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
335 @param[in] DevicePath A pointer to the device path node that describes a SD
336 card on the SD controller.
337 @param[out] Slot On return, points to the slot number of an SD card on
340 @retval EFI_SUCCESS SD card slot number is returned in Slot.
341 @retval EFI_INVALID_PARAMETER Slot or DevicePath is NULL.
342 @retval EFI_UNSUPPORTED DevicePath is not a device path node type that the SD
343 Pass Thru driver supports.
348 SdMmcPassThruGetSlotNumber (
349 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
350 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
355 Resets an SD card that is connected to the SD controller.
357 The ResetDevice() function resets the SD card specified by Slot.
359 If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is
362 If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER
365 If the device reset operation is completed, EFI_SUCCESS is returned.
367 @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
368 @param[in] Slot Specifies the slot number of the SD card to be reset.
370 @retval EFI_SUCCESS The SD card specified by Slot was reset.
371 @retval EFI_UNSUPPORTED The SD controller does not support a device reset operation.
372 @retval EFI_INVALID_PARAMETER Slot number is invalid.
373 @retval EFI_NO_MEDIA SD Device not present in the Slot.
374 @retval EFI_DEVICE_ERROR The reset command failed due to a device error
379 SdMmcPassThruResetDevice (
380 IN EFI_SD_MMC_PASS_THRU_PROTOCOL
*This
,
385 // Driver model protocol interfaces
388 Tests to see if this driver supports a given controller. If a child device is provided,
389 it further tests to see if this driver supports creating a handle for the specified child device.
391 This function checks to see if the driver specified by This supports the device specified by
392 ControllerHandle. Drivers will typically use the device path attached to
393 ControllerHandle and/or the services from the bus I/O abstraction attached to
394 ControllerHandle to determine if the driver supports ControllerHandle. This function
395 may be called many times during platform initialization. In order to reduce boot times, the tests
396 performed by this function must be very small, and take as little time as possible to execute. This
397 function must not change the state of any hardware devices, and this function must be aware that the
398 device specified by ControllerHandle may already be managed by the same driver or a
399 different driver. This function must match its calls to AllocatePages() with FreePages(),
400 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
401 Since ControllerHandle may have been previously started by the same driver, if a protocol is
402 already in the opened state, then it must not be closed with CloseProtocol(). This is required
403 to guarantee the state of ControllerHandle is not modified by this function.
405 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
406 @param[in] ControllerHandle The handle of the controller to test. This handle
407 must support a protocol interface that supplies
408 an I/O abstraction to the driver.
409 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
410 parameter is ignored by device drivers, and is optional for bus
411 drivers. For bus drivers, if this parameter is not NULL, then
412 the bus driver must determine if the bus controller specified
413 by ControllerHandle and the child controller specified
414 by RemainingDevicePath are both supported by this
417 @retval EFI_SUCCESS The device specified by ControllerHandle and
418 RemainingDevicePath is supported by the driver specified by This.
419 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
420 RemainingDevicePath is already being managed by the driver
422 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
423 RemainingDevicePath is already being managed by a different
424 driver or an application that requires exclusive access.
425 Currently not implemented.
426 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
427 RemainingDevicePath is not supported by the driver specified by This.
431 SdMmcPciHcDriverBindingSupported (
432 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
433 IN EFI_HANDLE Controller
,
434 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
438 Starts a device controller or a bus controller.
440 The Start() function is designed to be invoked from the EFI boot service ConnectController().
441 As a result, much of the error checking on the parameters to Start() has been moved into this
442 common boot service. It is legal to call Start() from other locations,
443 but the following calling restrictions must be followed or the system behavior will not be deterministic.
444 1. ControllerHandle must be a valid EFI_HANDLE.
445 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
446 EFI_DEVICE_PATH_PROTOCOL.
447 3. Prior to calling Start(), the Supported() function for the driver specified by This must
448 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
450 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
451 @param[in] ControllerHandle The handle of the controller to start. This handle
452 must support a protocol interface that supplies
453 an I/O abstraction to the driver.
454 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
455 parameter is ignored by device drivers, and is optional for bus
456 drivers. For a bus driver, if this parameter is NULL, then handles
457 for all the children of Controller are created by this driver.
458 If this parameter is not NULL and the first Device Path Node is
459 not the End of Device Path Node, then only the handle for the
460 child device specified by the first Device Path Node of
461 RemainingDevicePath is created by this driver.
462 If the first Device Path Node of RemainingDevicePath is
463 the End of Device Path Node, no child handle is created by this
466 @retval EFI_SUCCESS The device was started.
467 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
468 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
469 @retval Others The driver failded to start the device.
474 SdMmcPciHcDriverBindingStart (
475 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
476 IN EFI_HANDLE Controller
,
477 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
481 Stops a device controller or a bus controller.
483 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
484 As a result, much of the error checking on the parameters to Stop() has been moved
485 into this common boot service. It is legal to call Stop() from other locations,
486 but the following calling restrictions must be followed or the system behavior will not be deterministic.
487 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
488 same driver's Start() function.
489 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
490 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
491 Start() function, and the Start() function must have called OpenProtocol() on
492 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
494 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
495 @param[in] ControllerHandle A handle to the device being stopped. The handle must
496 support a bus specific I/O protocol for the driver
497 to use to stop the device.
498 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
499 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
500 if NumberOfChildren is 0.
502 @retval EFI_SUCCESS The device was stopped.
503 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
508 SdMmcPciHcDriverBindingStop (
509 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
510 IN EFI_HANDLE Controller
,
511 IN UINTN NumberOfChildren
,
512 IN EFI_HANDLE
*ChildHandleBuffer
516 // EFI Component Name Functions
519 Retrieves a Unicode string that is the user readable name of the driver.
521 This function retrieves the user readable name of a driver in the form of a
522 Unicode string. If the driver specified by This has a user readable name in
523 the language specified by Language, then a pointer to the driver name is
524 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
525 by This does not support the language specified by Language,
526 then EFI_UNSUPPORTED is returned.
528 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
529 EFI_COMPONENT_NAME_PROTOCOL instance.
531 @param Language[in] A pointer to a Null-terminated ASCII string
532 array indicating the language. This is the
533 language of the driver name that the caller is
534 requesting, and it must match one of the
535 languages specified in SupportedLanguages. The
536 number of languages supported by a driver is up
537 to the driver writer. Language is specified
538 in RFC 4646 or ISO 639-2 language code format.
540 @param DriverName[out] A pointer to the Unicode string to return.
541 This Unicode string is the name of the
542 driver specified by This in the language
543 specified by Language.
545 @retval EFI_SUCCESS The Unicode string for the Driver specified by
546 This and the language specified by Language was
547 returned in DriverName.
549 @retval EFI_INVALID_PARAMETER Language is NULL.
551 @retval EFI_INVALID_PARAMETER DriverName is NULL.
553 @retval EFI_UNSUPPORTED The driver specified by This does not support
554 the language specified by Language.
559 SdMmcPciHcComponentNameGetDriverName (
560 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
562 OUT CHAR16
**DriverName
566 Retrieves a Unicode string that is the user readable name of the controller
567 that is being managed by a driver.
569 This function retrieves the user readable name of the controller specified by
570 ControllerHandle and ChildHandle in the form of a Unicode string. If the
571 driver specified by This has a user readable name in the language specified by
572 Language, then a pointer to the controller name is returned in ControllerName,
573 and EFI_SUCCESS is returned. If the driver specified by This is not currently
574 managing the controller specified by ControllerHandle and ChildHandle,
575 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
576 support the language specified by Language, then EFI_UNSUPPORTED is returned.
578 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
579 EFI_COMPONENT_NAME_PROTOCOL instance.
581 @param ControllerHandle[in] The handle of a controller that the driver
582 specified by This is managing. This handle
583 specifies the controller whose name is to be
586 @param ChildHandle[in] The handle of the child controller to retrieve
587 the name of. This is an optional parameter that
588 may be NULL. It will be NULL for device
589 drivers. It will also be NULL for a bus drivers
590 that wish to retrieve the name of the bus
591 controller. It will not be NULL for a bus
592 driver that wishes to retrieve the name of a
595 @param Language[in] A pointer to a Null-terminated ASCII string
596 array indicating the language. This is the
597 language of the driver name that the caller is
598 requesting, and it must match one of the
599 languages specified in SupportedLanguages. The
600 number of languages supported by a driver is up
601 to the driver writer. Language is specified in
602 RFC 4646 or ISO 639-2 language code format.
604 @param ControllerName[out] A pointer to the Unicode string to return.
605 This Unicode string is the name of the
606 controller specified by ControllerHandle and
607 ChildHandle in the language specified by
608 Language from the point of view of the driver
611 @retval EFI_SUCCESS The Unicode string for the user readable name in
612 the language specified by Language for the
613 driver specified by This was returned in
616 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
618 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
621 @retval EFI_INVALID_PARAMETER Language is NULL.
623 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
625 @retval EFI_UNSUPPORTED The driver specified by This is not currently
626 managing the controller specified by
627 ControllerHandle and ChildHandle.
629 @retval EFI_UNSUPPORTED The driver specified by This does not support
630 the language specified by Language.
635 SdMmcPciHcComponentNameGetControllerName (
636 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
637 IN EFI_HANDLE ControllerHandle
,
638 IN EFI_HANDLE ChildHandle
, OPTIONAL
640 OUT CHAR16
**ControllerName
644 Create a new TRB for the SD/MMC cmd request.
646 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
647 @param[in] Slot The slot number of the SD card to send the command to.
648 @param[in] Packet A pointer to the SD command data structure.
649 @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
650 not NULL, then nonblocking I/O is performed, and Event
651 will be signaled when the Packet completes.
653 @return Created Trb or NULL.
658 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
660 IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
*Packet
,
665 Free the resource used by the TRB.
667 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
672 IN SD_MMC_HC_TRB
*Trb
676 Check if the env is ready for execute specified TRB.
678 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
679 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
681 @retval EFI_SUCCESS The env is ready for TRB execution.
682 @retval EFI_NOT_READY The env is not ready for TRB execution.
683 @retval Others Some erros happen.
688 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
689 IN SD_MMC_HC_TRB
*Trb
693 Wait for the env to be ready for execute specified TRB.
695 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
696 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
698 @retval EFI_SUCCESS The env is ready for TRB execution.
699 @retval EFI_TIMEOUT The env is not ready for TRB execution in time.
700 @retval Others Some erros happen.
705 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
706 IN SD_MMC_HC_TRB
*Trb
710 Execute the specified TRB.
712 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
713 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
715 @retval EFI_SUCCESS The TRB is sent to host controller successfully.
716 @retval Others Some erros happen when sending this request to the host controller.
721 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
722 IN SD_MMC_HC_TRB
*Trb
726 Check the TRB execution result.
728 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
729 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
731 @retval EFI_SUCCESS The TRB is executed successfully.
732 @retval EFI_NOT_READY The TRB is not completed for execution.
733 @retval Others Some erros happen when executing this request.
737 SdMmcCheckTrbResult (
738 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
739 IN SD_MMC_HC_TRB
*Trb
743 Wait for the TRB execution result.
745 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
746 @param[in] Trb The pointer to the SD_MMC_HC_TRB instance.
748 @retval EFI_SUCCESS The TRB is executed successfully.
749 @retval Others Some erros happen when executing this request.
754 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
755 IN SD_MMC_HC_TRB
*Trb
759 Execute EMMC device identification procedure.
761 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
763 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
764 @param[in] Slot The slot number of the SD card to send the command to.
766 @retval EFI_SUCCESS There is a EMMC card.
767 @retval Others There is not a EMMC card.
772 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
777 Execute EMMC device identification procedure.
779 Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.
781 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
782 @param[in] Slot The slot number of the SD card to send the command to.
784 @retval EFI_SUCCESS There is a EMMC card.
785 @retval Others There is not a EMMC card.
789 SdCardIdentification (
790 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
795 Software reset the specified SD/MMC host controller.
797 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
798 @param[in] Slot The slot number of the SD card to send the command to.
800 @retval EFI_SUCCESS The software reset executes successfully.
801 @retval Others The software reset fails.
806 IN SD_MMC_HC_PRIVATE_DATA
*Private
,
811 Initial SD/MMC host controller with lowest clock frequency, max power and max timeout value
814 @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA instance.
815 @param[in] Slot The slot number of the SD card to send the command to.
817 @retval EFI_SUCCESS The host controller is initialized successfully.
818 @retval Others The host controller isn't initialized successfully.
823 IN SD_MMC_HC_PRIVATE_DATA
*Private
,