[edk2-devel] [PATCH 1/2] MdeModulePkg/SdMmcPciHcDxe: Make timeout for SD card configurable

Wu, Hao A hao.a.wu at intel.com
Wed Mar 2 02:10:33 UTC 2022


Thanks,
Reviewed-by: Hao A Wu <hao.a.wu at intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Sean Rhodes <sean at starlabs.systems>
> Sent: Thursday, February 24, 2022 3:59 PM
> To: devel at edk2.groups.io
> Cc: Dong, Guo <guo.dong at intel.com>; Rhodes, Sean
> <sean at starlabs.systems>; Wu, Hao A <hao.a.wu at intel.com>; Ni, Ray
> <ray.ni at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Gao, Liming
> <gaoliming at byosoft.com.cn>; Matt DeVillier <matt.devillier at gmail.com>
> Subject: [PATCH 1/2] MdeModulePkg/SdMmcPciHcDxe: Make timeout for
> SD card configurable
> 
> The default 1s timeout can delay boot splash on some hardware with no
> benefit.
> 
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Signed-off-by: Matt DeVillier <matt.devillier at gmail.com>
> Signed-off-by: Sean Rhodes <sean at starlabs.systems>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h   | 3 ++-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf | 4 ++++
>  MdeModulePkg/MdeModulePkg.dec                        | 4 ++++
>  MdeModulePkg/MdeModulePkg.uni                        | 4 ++++
>  4 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> index 85e09cf114..b76c7cffa2 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> @@ -24,6 +24,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Library/MemoryAllocationLib.h>
> 
>  #include <Library/UefiLib.h>
> 
>  #include <Library/DevicePathLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> 
> 
>  #include <Protocol/DevicePath.h>
> 
>  #include <Protocol/PciIo.h>
> 
> @@ -49,7 +50,7 @@ extern EDKII_SD_MMC_OVERRIDE  *mOverride;
>  //
> 
>  // Generic time out value, 1 microsecond as unit.
> 
>  //
> 
> -#define SD_MMC_HC_GENERIC_TIMEOUT  1 * 1000 * 1000
> 
> +#define SD_MMC_HC_GENERIC_TIMEOUT  (PcdGet32
> (PcdSdMmcGenericTimeoutValue))
> 
> 
> 
>  //
> 
>  // SD/MMC async transfer timer interval, set by experience.
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
> index 453ecde7fd..e502443ddd 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
> @@ -56,6 +56,7 @@
>    BaseLib
> 
>    UefiDriverEntryPoint
> 
>    DebugLib
> 
> +  PcdLib
> 
> 
> 
>  [Protocols]
> 
>    gEdkiiSdMmcOverrideProtocolGuid               ## SOMETIMES_CONSUMES
> 
> @@ -68,3 +69,6 @@
> 
> 
>  [UserExtensions.TianoCore."ExtraFiles"]
> 
>    SdMmcPciHcDxeExtra.uni
> 
> +
> 
> +[Pcd]
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue  ##
> CONSUMES
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 463e889e9a..40601c9583 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1559,6 +1559,10 @@
>    # @Prompt Maximum permitted FwVol section nesting depth (exclusive).
> 
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth|
> 0x10|UINT32|0x00000030
> 
> 
> 
> +  ## Indicates the default timeout value for SD/MMC Host Controller
> operations in microseconds.
> 
> +  # @Prompt SD/MMC Host Controller Operations Timeout (us).
> 
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000
> 000|UINT32|0x00000031
> 
> +
> 
>  [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> 
>    ## This PCD defines the Console output row. The default value is 25
> according to UEFI spec.
> 
>    #  This PCD could be set to 0 then console output would be at max column
> and max row.
> 
> diff --git a/MdeModulePkg/MdeModulePkg.uni
> b/MdeModulePkg/MdeModulePkg.uni
> index 27889a7280..b070f15ff2 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1173,6 +1173,10 @@
>                                                                                            " TRUE  - Capsule In Ram is
> supported.<BR>"
> 
>                                                                                            " FALSE - Capsule In Ram is not
> supported."
> 
> 
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue
> _PROMPT #language en-US "SD/MMC Host Controller Operations Timeout
> (us)."
> 
> +
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue
> _HELP   #language en-US "Indicates the default timeout value for SD/MMC
> Host Controller operations in microseconds."
> 
> +
> 
>  #string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PRO
> MPT  #language en-US "Capsule On Disk relocation device path."
> 
> 
> 
>  #string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP
> #language en-US   "Full device path of platform specific device to store
> Capsule On Disk temp relocation file.<BR>"
> 
> --
> 2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87185): https://edk2.groups.io/g/devel/message/87185
Mute This Topic: https://groups.io/mt/89228249/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list