From a3d1e6c4806e6c0e2e744be3a03fce12f21778d1 Mon Sep 17 00:00:00 2001 From: Keith Hui Date: Tue, 31 Dec 2024 18:19:31 -0500 Subject: [PATCH] sb/intel/bd82x6x: Apply EHCI mapping to xhci_overcurrent_mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As xHCI ports 1-4 and OC pins 0-3 are all shared with EHCI, xhci_overcurrent_mapping should never deviate from the USB 2 (EHCI) overcurrent mapping specified in the USB port config in the devicetree. Get the mapping from EHCI and free mainboards from specifying it separately. A Ghidra inspection of MRC binary indicates it is doing the same. After this patch xhci_overcurrent_mapping becomes redundant and will be removed in a follow-up. Change-Id: Iab30a07c8df223e4053c5f28df5e5ed926f278f7 Signed-off-by: Keith Hui Reviewed-on: https://review.coreboot.org/c/coreboot/+/85922 Tested-by: build bot (Jenkins) Reviewed-by: Jérémy Compostella Reviewed-by: Elyes Haouas Reviewed-by: Patrick Rudolph --- src/southbridge/intel/bd82x6x/usb_xhci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/southbridge/intel/bd82x6x/usb_xhci.c b/src/southbridge/intel/bd82x6x/usb_xhci.c index f71a50550b..358d107552 100644 --- a/src/southbridge/intel/bd82x6x/usb_xhci.c +++ b/src/southbridge/intel/bd82x6x/usb_xhci.c @@ -7,6 +7,7 @@ #include "pch.h" #include #include +#include #include "chip.h" static void usb_xhci_init(struct device *dev) @@ -16,8 +17,8 @@ static void usb_xhci_init(struct device *dev) printk(BIOS_DEBUG, "XHCI: Setting up controller.. "); - if (config->xhci_overcurrent_mapping) - pci_write_config32(dev, XOCM, config->xhci_overcurrent_mapping); + reg32 = RCBA32(USBOCM1) & 0x0f0f0f0f; + pci_write_config32(dev, XOCM, reg32); /* lock overcurrent map */ pci_or_config32(dev, 0x44, 1);