summaryrefslogtreecommitdiff
path: root/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-01-14 20:24:00 +0000
committerLeah Rowe <leah@libreboot.org>2025-01-14 20:34:16 +0000
commit64d3c7b5150c8556361cede3d12b4fd6a6ff546e (patch)
tree4c5263f5c10aa495bbe475ae3d7a3cce882d5f61 /config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
parent7bf0d4c2ed5a6efe0a09cbd7ea75962e7a618095 (diff)
grub/xhci: Add xHCI non-root-hub fixes from NitrokeyHEADmaster
See: https://github.com/Nitrokey/nethsm-grub/commits/nethsm-z790?since=2025-01-13&until=2025-01-13 And more generally, see branch: https://github.com/Nitrokey/nethsm-grub/commits/nethsm-z790 This brings in a few minor fixes, and also a not-so-minor fix: Add TT (transaction translation) handling for non-SuperSpeed devices in xhci.c More generally, this patchset will improve non-root hub support in the xHCI code. There is also a patch to work around a quirk on the MSI Z790-P mainboard, which I'm planning to add to Libreboot at a later date. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch')
-rw-r--r--config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch b/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
new file mode 100644
index 00000000..83427fcc
--- /dev/null
+++ b/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
@@ -0,0 +1,43 @@
+From c455091ce40ffd8218802aaadeacf2039fea5036 Mon Sep 17 00:00:00 2001
+From: Sven Anderson <sven@anderson.de>
+Date: Mon, 13 Jan 2025 19:51:41 +0100
+Subject: [PATCH 22/26] xhci: fix port indexing
+
+---
+ grub-core/bus/usb/xhci.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/grub-core/bus/usb/xhci.c b/grub-core/bus/usb/xhci.c
+index f4591ffb5..dc89b9619 100644
+--- a/grub-core/bus/usb/xhci.c
++++ b/grub-core/bus/usb/xhci.c
+@@ -2250,7 +2250,7 @@ grub_xhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
+
+ *changed = 0;
+ grub_dprintf("xhci", "%s: dev=%p USB%d_%d port %d\n", __func__, dev,
+- x->psids[port-1].major, x->psids[port-1].minor, port);
++ x->psids[port].major, x->psids[port].minor, port);
+
+ /* On shutdown advertise all ports as disconnected. This will trigger
+ * a gracefull detatch. */
+@@ -2285,13 +2285,13 @@ grub_xhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
+ if (!(portsc & GRUB_XHCI_PORTSC_CCS))
+ return GRUB_USB_SPEED_NONE;
+
+- for (grub_uint8_t i = 0; i < 16 && x->psids[port-1].psids[i].id > 0; i++)
++ for (grub_uint8_t i = 0; i < 16 && x->psids[port].psids[i].id > 0; i++)
+ {
+- if (x->psids[port-1].psids[i].id == speed)
++ if (x->psids[port].psids[i].id == speed)
+ {
+ grub_dprintf("xhci", "%s: grub_usb_speed = %d\n", __func__,
+- x->psids[port-1].psids[i].grub_usb_speed );
+- return x->psids[port-1].psids[i].grub_usb_speed;
++ x->psids[port].psids[i].grub_usb_speed );
++ return x->psids[port].psids[i].grub_usb_speed;
+ }
+ }
+
+--
+2.39.5
+