summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@amd.com>2023-01-11 11:10:06 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-16 02:34:53 +0000
commit8147fe090fb566f9a1ed8fde24098bbe425026be (patch)
treeea69a93513360dee649f9ad0c2a997b2ad6f5cef /MdeModulePkg/Bus/Pci
parent7cd55f300915af8759bdf1687af7e3a7f4d4f13c (diff)
downloadedk2-8147fe090fb566f9a1ed8fde24098bbe425026be.tar.gz
edk2-8147fe090fb566f9a1ed8fde24098bbe425026be.tar.bz2
edk2-8147fe090fb566f9a1ed8fde24098bbe425026be.zip
MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
Initialize XHCI DCI slot's context entries value. Signed-off-by: Jiangang He <jiangang.he@amd.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Bus/Pci')
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c7
-rw-r--r--MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13247f7b0d..4b7462704a 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -4,6 +4,7 @@
Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>
Copyright (c) Microsoft Corporation.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -2807,6 +2808,9 @@ XhcInitializeEndpointContext (
MaxDci = 0;
NumEp = IfDesc->NumEndpoints;
+ if (NumEp == 0) {
+ MaxDci = 1;
+ }
EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -3006,6 +3010,9 @@ XhcInitializeEndpointContext64 (
MaxDci = 0;
NumEp = IfDesc->NumEndpoints;
+ if (NumEp == 0) {
+ MaxDci = 1;
+ }
EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
index cc597a4371..8400c90f7a 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
which is used to enable recovery function from USB Drivers.
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -1752,6 +1753,9 @@ XhcPeiSetConfigCmd (
}
NumEp = IfDesc->NumEndpoints;
+ if ((NumEp == 0) && (MaxDci == 0)) {
+ MaxDci = 1;
+ }
EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -1974,6 +1978,9 @@ XhcPeiSetConfigCmd64 (
}
NumEp = IfDesc->NumEndpoints;
+ if ((NumEp == 0) && (MaxDci == 0)) {
+ MaxDci = 1;
+ }
EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {