MdeModulePkg: Add bRefClkFreq card attribute programming support

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3851

When the UFS card comes out of Manufacturer, bRefClkFreq attribute is set
to 1h on the UFS card as per the Manufacturer Default Value
specified by the spec JESD220*. However, depends on the UFS host system
environment, it need to be set to the correct value.

Reference Clock Frequency value
0h:19.2 MHz
1h: 26 MHz
2h: 38.4 MHz
3h: Obsolete
Others: Reserved

Cc: Wu Hao A <hao.a.wu@intel.com>
Cc: Albecki Mateusz <mateusz.albecki@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Purna Chandra Rao Bandaru <purna.chandra.rao.bandaru@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Bandaru, Purna Chandra Rao
2022-03-08 20:19:35 +08:00
committed by mergify[bot]
parent c63ef58698
commit f06941cc46
3 changed files with 74 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
/** @file
EDKII_UFS_HC_PLATFORM_PROTOCOL definition.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -11,7 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/UfsHostController.h>
#define EDKII_UFS_HC_PLATFORM_PROTOCOL_VERSION 1
#define EDKII_UFS_HC_PLATFORM_PROTOCOL_VERSION 2
extern EFI_GUID gEdkiiUfsHcPlatformProtocolGuid;
@@ -83,6 +83,13 @@ typedef enum {
EdkiiUfsHcPostLinkStartup
} EDKII_UFS_HC_PLATFORM_CALLBACK_PHASE;
typedef enum {
EdkiiUfsCardRefClkFreq19p2Mhz,
EdkiiUfsCardRefClkFreq26Mhz,
EdkiiUfsCardRefClkFreq38p4Mhz,
EdkiiUfsCardRefClkFreqObsolete
} EDKII_UFS_CARD_REF_CLK_FREQ_ATTRIBUTE;
/**
Callback function for platform driver.
@@ -118,6 +125,10 @@ struct _EDKII_UFS_HC_PLATFORM_PROTOCOL {
/// for host controller.
///
EDKII_UFS_HC_PLATFORM_CALLBACK Callback;
///
/// Reference Clock Frequency Ufs Card Attribute that need to be set in this Ufs Host Environment.
///
EDKII_UFS_CARD_REF_CLK_FREQ_ATTRIBUTE RefClkFreq;
};
#endif