]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Make timeout for SD card configurable
authorSean Rhodes <sean@starlabs.systems>
Thu, 24 Feb 2022 07:58:51 +0000 (00:58 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 17 Mar 2022 16:13:22 +0000 (16:13 +0000)
The default 1s timeout can delay boot splash on some hardware with no
benefit.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

index 85e09cf1145befb47df678c666d26dd49fa161ce..b76c7cffa279324b5449066ac02cf48179d4e552 100644 (file)
@@ -24,6 +24,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/DevicePathLib.h>\r
+#include <Library/PcdLib.h>\r
 \r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/PciIo.h>\r
@@ -49,7 +50,7 @@ extern EDKII_SD_MMC_OVERRIDE  *mOverride;
 //\r
 // Generic time out value, 1 microsecond as unit.\r
 //\r
-#define SD_MMC_HC_GENERIC_TIMEOUT  1 * 1000 * 1000\r
+#define SD_MMC_HC_GENERIC_TIMEOUT  (PcdGet32 (PcdSdMmcGenericTimeoutValue))\r
 \r
 //\r
 // SD/MMC async transfer timer interval, set by experience.\r
index 453ecde7fdfc80d6c79656607832cc3781fda35b..e502443ddd5bac929a3277cc04cf9a4d699df739 100644 (file)
@@ -56,6 +56,7 @@
   BaseLib\r
   UefiDriverEntryPoint\r
   DebugLib\r
+  PcdLib\r
 \r
 [Protocols]\r
   gEdkiiSdMmcOverrideProtocolGuid               ## SOMETIMES_CONSUMES\r
@@ -68,3 +69,6 @@
 \r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   SdMmcPciHcDxeExtra.uni\r
+\r
+[Pcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue  ## CONSUMES\r
index 463e889e9a688799cf8ee3bffa1ef679925e5dda..40601c95832b8be23e5519e53e98c135caf4e943 100644 (file)
   # @Prompt Maximum permitted FwVol section nesting depth (exclusive).\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth|0x10|UINT32|0x00000030\r
 \r
+  ## Indicates the default timeout value for SD/MMC Host Controller operations in microseconds.\r
+  # @Prompt SD/MMC Host Controller Operations Timeout (us).\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT32|0x00000031\r
+\r
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
   ## This PCD defines the Console output row. The default value is 25 according to UEFI spec.\r
   #  This PCD could be set to 0 then console output would be at max column and max row.\r
index 27889a728058fa460c3f26086f79edd8d29ef91a..b070f15ff23efeef9d1b0606f16b272fed60d968 100644 (file)
                                                                                           " TRUE  - Capsule In Ram is supported.<BR>"\r
                                                                                           " FALSE - Capsule In Ram is not supported."\r
 \r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_PROMPT #language en-US "SD/MMC Host Controller Operations Timeout (us)."\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_HELP   #language en-US "Indicates the default timeout value for SD/MMC Host Controller operations in microseconds."\r
+\r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT  #language en-US "Capsule On Disk relocation device path."\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP  #language en-US   "Full device path of platform specific device to store Capsule On Disk temp relocation file.<BR>"\r