Keith Short has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33671
Change subject: libpayload/usb: Increase the SET ADDRESS timeout
......................................................................
libpayload/usb: Increase the SET ADDRESS timeout
The SET ADDRESS timeout was set to only 100 ms for the xHCI driver. The
USB specification indicates a maximum response time of 50 ms for the SET
ADDRESS request, but this does not account for propagation time of the
request through USB hubs.
Analysis of other USB host driver timeouts:
EHCI: 3 seconds
OHCI: 2 seconds
UHCI: 30 ms
DWC: 3 seconds
BUG=b:124730179
BRANCH=none
TEST=Build libpayload and depthcharge on sarien/arcada.
TEST=Without change replicate USB set address timeouts in depthcharge
when dock and 4K monitor connected (which includes a total of 4 USB
hubs). With timeout fix, depthcharge boots OS with no USB errors and
the same USB topology.
Change-Id: I53e3e67d893420e7c9e8b52c47dd0edb979e5468
Signed-off-by: Keith Short <keithshort(a)chromium.org>
---
M payloads/libpayload/drivers/usb/xhci_events.c
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/33671/1
diff --git a/payloads/libpayload/drivers/usb/xhci_events.c b/payloads/libpayload/drivers/usb/xhci_events.c
index dacb5d86..e2c124f 100644
--- a/payloads/libpayload/drivers/usb/xhci_events.c
+++ b/payloads/libpayload/drivers/usb/xhci_events.c
@@ -281,12 +281,13 @@
const int clear_event)
{
/*
- * The Address Device Command should take most time, as it has to
- * communicate with the USB device. Set address processing shouldn't
- * take longer than 50ms (at the slave). Let's take a timeout of
- * 100ms.
+ * The USB specification indicates that maximum response time to a SET
+ * ADDRESS request is 50 ms. However, this time does not account for
+ * the propagation delay to send the request through any hubs connected
+ * between the device and the root hub. Set the timeout to the maximum
+ * USB processing time, 5 seconds, to allow for complex USB topologies.
*/
- unsigned long timeout_us = 100 * 1000; /* 100ms */
+ unsigned long timeout_us = 5 * 1000 * 1000; /* 5s */
int cc = TIMEOUT;
while (xhci_wait_for_event_type(xhci, TRB_EV_CMD_CMPL, &timeout_us)) {
if ((xhci->er.cur->ptr_low == virt_to_phys(address)) &&
--
To view, visit https://review.coreboot.org/c/coreboot/+/33671
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I53e3e67d893420e7c9e8b52c47dd0edb979e5468
Gerrit-Change-Number: 33671
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Short <keithshort(a)chromium.org>
Gerrit-MessageType: newchange
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34002
Change subject: aopen/dxplplusu: Replace use of dev_find_slot()
......................................................................
aopen/dxplplusu: Replace use of dev_find_slot()
To use fixed PCI bus numbers is always invalid.
Change-Id: Ia2ffdb1f5e0ff398674a016ad4cb94f622c057ff
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/mainboard/aopen/dxplplusu/acpi_tables.c
D src/mainboard/aopen/dxplplusu/bus.h
2 files changed, 22 insertions(+), 55 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/34002/1
diff --git a/src/mainboard/aopen/dxplplusu/acpi_tables.c b/src/mainboard/aopen/dxplplusu/acpi_tables.c
index 039e4ec..769f434 100644
--- a/src/mainboard/aopen/dxplplusu/acpi_tables.c
+++ b/src/mainboard/aopen/dxplplusu/acpi_tables.c
@@ -20,13 +20,17 @@
#include <arch/acpi.h>
#include <device/pci.h>
-#include <assert.h>
-#include "bus.h"
+
+#define IOAPIC_ICH4 2
+#define IOAPIC_P64H2_BUS_B 3 /* IOAPIC 3 at 02:1c.0 MBAR = fe300000 DataAddr = fe300010 */
+#define IOAPIC_P64H2_BUS_A 4 /* IOAPIC 4 at 02:1e.0 MBAR = fe301000 DataAddr = fe301010 */
+
+#define INTEL_IOAPIC_NUM_INTERRUPTS 24 /* Both ICH-4 and P64-H2 */
unsigned long acpi_fill_madt(unsigned long current)
{
unsigned int irq_start = 0;
- struct device *dev = NULL;
+ struct device *bdev, *dev = NULL;
struct resource* res = NULL;
/* SJM: Hard-code CPU LAPIC entries for now */
@@ -39,22 +43,24 @@
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_ICH4, 0xfec00000, irq_start);
irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
+ bdev = pcidev_on_root(2, 0);
/* P64H2 Bus B IOAPIC */
- dev = dev_find_slot(PCI_BUS_E7501_HI_B, PCI_DEVFN(28, 0));
- if (!dev)
- BUG(); /* Config.lb error? */
- res = find_resource(dev, PCI_BASE_ADDRESS_0);
- current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_P64H2_BUS_B, res->base, irq_start);
- irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
+ if (bdev)
+ dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(28, 0));
+ if (dev) {
+ res = find_resource(dev, PCI_BASE_ADDRESS_0);
+ current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_P64H2_BUS_B, res->base, irq_start);
+ irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
+ }
/* P64H2 Bus A IOAPIC */
- dev = dev_find_slot(PCI_BUS_E7501_HI_B, PCI_DEVFN(30, 0));
- if (!dev)
- BUG(); /* Config.lb error? */
- res = find_resource(dev, PCI_BASE_ADDRESS_0);
- current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_P64H2_BUS_A, res->base, irq_start);
- irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
-
+ if (bdev)
+ dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(28, 0));
+ if (dev) {
+ res = find_resource(dev, PCI_BASE_ADDRESS_0);
+ current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_P64H2_BUS_A, res->base, irq_start);
+ irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
+ }
/* Map ISA IRQ 0 to IRQ 2 */
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)current, 1, 0, 2, 0);
diff --git a/src/mainboard/aopen/dxplplusu/bus.h b/src/mainboard/aopen/dxplplusu/bus.h
deleted file mode 100644
index 12eef12..0000000
--- a/src/mainboard/aopen/dxplplusu/bus.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2011 Kyösti Mälkki <kyosti.malkki(a)gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef DXPLPLUSU_BUS_H_INCLUDED
-#define DXPLPLUSU_BUS_H_INCLUDED
-
-/* These were determined by seeing how coreboot enumerates the various
- * PCI (and PCI-like) buses on the board.
- */
-
-#define PCI_BUS_ROOT 0
-#define PCI_BUS_AGP 1 /* AGP */
-#define PCI_BUS_E7501_HI_B 2 /* P64H2#1 */
-#define PCI_BUS_P64H2_B 3 /* P64H2#1 bus B */
-#define PCI_BUS_P64H2_A 4 /* P64H2#1 bus A */
-#define PCI_BUS_ICH4 5 /* ICH4 */
-
-/* IOAPIC addresses determined by coreboot enumeration. */
-/* Someday add functions to get APIC IDs and versions from the chips themselves. */
-
-#define IOAPIC_ICH4 2
-#define IOAPIC_P64H2_BUS_B 3 /* IOAPIC 3 at 02:1c.0 MBAR = fe300000 DataAddr = fe300010 */
-#define IOAPIC_P64H2_BUS_A 4 /* IOAPIC 4 at 02:1e.0 MBAR = fe301000 DataAddr = fe301010 */
-
-#define INTEL_IOAPIC_NUM_INTERRUPTS 24 /* Both ICH-4 and P64-H2 */
-
-#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/34002
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia2ffdb1f5e0ff398674a016ad4cb94f622c057ff
Gerrit-Change-Number: 34002
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange