PchEmmcTuning.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /** @file
  2. PCH eMMC HS400 Tuning Protocol
  3. Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _PCH_EMMC_TUNING_PROTOCOL_H_
  7. #define _PCH_EMMC_TUNING_PROTOCOL_H_
  8. #define PCH_EMMC_TUNING_PROTOCOL_REVISION 1
  9. //
  10. // Extern the GUID for protocol users.
  11. //
  12. extern EFI_GUID gPchEmmcTuningProtocolGuid;
  13. //
  14. // Forward declaration for PCH_EMMC_TUNING_PROTOCOL
  15. //
  16. typedef struct _PCH_EMMC_TUNING_PROTOCOL PCH_EMMC_TUNING_PROTOCOL;
  17. /**
  18. This structure decribes the required Emmc info for HS400 tuning
  19. **/
  20. typedef struct {
  21. EFI_HANDLE PartitionHandle; ///< eMMC partition handle for block read/write
  22. EFI_LBA Lba; ///< Logical Block Address for HS400 Tuning block read/write
  23. UINT32 RelativeDevAddress; ///< Device system address, dynamically assigned by the host during initialization.
  24. UINT8 HS200BusWidth; ///< The value to be programmed for BUS_WIDTH[183] byte
  25. } EMMC_INFO;
  26. ///
  27. /// This structure describes the return value after HS400 tuning
  28. ///
  29. typedef struct {
  30. UINT8 Hs400DataValid; ///< Set if Hs400 Tuning Data is valid after tuning
  31. UINT8 Hs400RxStrobe1Dll; ///< Rx Strobe Delay Control - Rx Strobe Delay DLL 1 (HS400 Mode)
  32. UINT8 Hs400TxDataDll; ///< Tx Data Delay Control 1 - Tx Data Delay (HS400 Mode)
  33. } EMMC_TUNING_DATA;
  34. ///
  35. /// EMMC HS400 TUNING INTERFACE
  36. ///
  37. typedef EFI_STATUS (EFIAPI *EMMC_TUNE) (
  38. IN PCH_EMMC_TUNING_PROTOCOL *This, ///< This pointer to PCH_EMMC_TUNING_PROTOCOL
  39. /**
  40. Revision parameter is used to verify the layout of EMMC_INFO and TUNINGDATA.
  41. If the revision is not matched, means the revision of EMMC_INFO and TUNINGDATA is not matched.
  42. And function will return immediately.
  43. **/
  44. IN UINT8 Revision,
  45. IN EMMC_INFO *EmmcInfo, ///< Pointer to EMMC_INFO
  46. OUT EMMC_TUNING_DATA *EmmcTuningData ///< Pointer to EMMC_TUNING_DATA
  47. );
  48. /**
  49. PCH EMMC TUNING PROTOCOL INTERFACE
  50. Platform code uses this protocol to configure Emmc Hs400 mode, by passing the EMMC_INFO information.
  51. PCH will setting EMMC controller based on EMMC_INFO and return EMMC_TUNING_DATA to platform code.
  52. Platform should keep values of EMMC_TUNING_DATA and uses to configure EMMC through policies, to
  53. prevent from doing EMMC tuning every boot.
  54. **/
  55. struct _PCH_EMMC_TUNING_PROTOCOL {
  56. EMMC_TUNE EmmcTune; ///< Emmc Hs400 Tuning Interface
  57. };
  58. #endif