summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaraneedharan Anbazhagan <anbazhagan@hp.com>2022-09-07 23:23:32 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-09-13 02:51:27 +0000
commitdb7afaee91423e988df3160624d04c3c534f294d (patch)
tree141de8edbe083b7857e5ed872ac363f6a32a0127
parent970e26294905d2d27369cf4041c6778105754f5e (diff)
downloadedk2-db7afaee91423e988df3160624d04c3c534f294d.tar.gz
edk2-db7afaee91423e988df3160624d04c3c534f294d.tar.bz2
edk2-db7afaee91423e988df3160624d04c3c534f294d.zip
MdeModulePkg: Use configurable PCD for AHCI command retries
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4011 AHCI commands are retried internally which prevents platform feature like drive password to process correctly entered password on subsequent attempts. PCD allows the platform to determine the number of retries. Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h2
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf3
-rw-r--r--MdeModulePkg/MdeModulePkg.dec4
-rw-r--r--MdeModulePkg/MdeModulePkg.uni4
4 files changed, 11 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h
index 7802ebd200..d7434b408c 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h
@@ -193,7 +193,7 @@ typedef union {
#define AHCI_PORT_DEVSLP_DITO_MASK 0x01FF8000
#define AHCI_PORT_DEVSLP_DM_MASK 0x1E000000
-#define AHCI_COMMAND_RETRIES 5
+#define AHCI_COMMAND_RETRIES (PcdGet32 (PcdAhciCommandRetryCount))
#pragma pack(1)
//
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
index a3e42a9ab4..78caa3c458 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
@@ -65,7 +65,8 @@
gEdkiiAtaAtapiPolicyProtocolGuid ## CONSUMES
[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable ## SOMETIMES_CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable ## SOMETIMES_CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAhciCommandRetryCount ## SOMETIMES_CONSUMES
# [Event]
# EVENT_TYPE_PERIODIC_TIMER ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 7d98910832..58e6ab0048 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1574,6 +1574,10 @@
# @Prompt SD/MMC Host Controller Operations Timeout (us).
gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT32|0x00000031
+ ## The Retry Count of AHCI command if there is a failure
+ # @Prompt The value of Retry Count, Default value is 5.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAhciCommandRetryCount|5|UINT32|0x00000032
+
[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 b070f15ff2..33ce9f6198 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1166,6 +1166,10 @@
"in the DXE phase. Minimum value is 1. Sections nested more deeply are<BR>"
"rejected."
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAhciCommandRetryCount_PROMPT #language en-US "Retry Count of AHCI command if there is a failure"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAhciCommandRetryCount_HELP #language en-US "This value is used to configure number of retries on AHCI commands, if there is a failure."
+
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleInRamSupport_PROMPT #language en-US "Enable Capsule In Ram support"
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleInRamSupport_HELP #language en-US "Capsule In Ram is to use memory to deliver the capsules that will be processed after system reset.<BR><BR>"