summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorNeo Hsueh <Hong-Chih.Hsueh@amd.com>2023-06-02 13:05:11 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-07 03:13:56 +0000
commit67fc78d026490ea4c375eeb19724abb40e7be8f2 (patch)
treecc4cf858803b683288bf04ba7de759537a8d08db /MdeModulePkg/Bus
parentded0b489af09cde5afa05d74acdb12cd4b4f8394 (diff)
downloadedk2-67fc78d026490ea4c375eeb19724abb40e7be8f2.tar.gz
edk2-67fc78d026490ea4c375eeb19724abb40e7be8f2.tar.bz2
edk2-67fc78d026490ea4c375eeb19724abb40e7be8f2.zip
MdeModulePkg/Bus: Fix port multiplier port in AhciPei PEIM
If there is no port multiplier, PortMultiplierPort should be converted to 0 to follow AHCI spec. The same logic already applied in AtaAtapiPassThruDxe driver. Signed-off-by: Neo Hsueh <Hong-Chih.Hsueh@amd.com> Acked-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
index cd55272c96..7bd04661d0 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
@@ -3,6 +3,7 @@
mode at PEI phase.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -92,6 +93,15 @@ AhciPassThruExecute (
{
EFI_STATUS Status;
+ if (PortMultiplierPort == 0xFFFF) {
+ //
+ // If there is no port multiplier, PortMultiplierPort will be 0xFFFF
+ // according to UEFI spec. Here, we convert its value to 0 to follow
+ // AHCI spec.
+ //
+ PortMultiplierPort = 0;
+ }
+
switch (Packet->Protocol) {
case EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA:
Status = AhciNonDataTransfer (