Julius Werner has posted comments on this change. ( https://review.coreboot.org/27477 )
Change subject: libpayload/generic_hub: Detect port disconnect after reset
......................................................................
Patch Set 1:
I don't understand what this patch is needed for. The general concept for libpayload's USB stack is that the payload keeps calling usb_poll() in regular intervals. So if a device transforms upon reset like this, the new SuperSpeed port should just get enumerated as part of the next usb_poll(). Why do we need to add a bunch of custom code to enumerate it right now? Calling code should generally not be written in a way that relies on all USB devices being enumerated immediately with the first usb_poll().
--
To view, visit https://review.coreboot.org/27477
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iad899544684312df1bef08d69b5c7f41eac3a21c
Gerrit-Change-Number: 27477
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Julius Werner <jwerner(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-Comment-Date: Fri, 13 Jul 2018 22:28:18 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
Julius Werner has posted comments on this change. ( https://review.coreboot.org/27476 )
Change subject: libpayload: Add UNKNOWN_SPEED to usb_speed enum
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/27476/1/payloads/libpayload/drivers/usb/gen…
File payloads/libpayload/drivers/usb/generic_hub.c:
https://review.coreboot.org/#/c/27476/1/payloads/libpayload/drivers/usb/gen…
PS1, Line 174: speed);
usb_attach_device() already reports this in a human-readable way, so I don't think you really need it here.
--
To view, visit https://review.coreboot.org/27476
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98a373717d52dfb6ca4dcc53a00dc1b4c240a919
Gerrit-Change-Number: 27476
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Julius Werner <jwerner(a)chromium.org>
Gerrit-Comment-Date: Fri, 13 Jul 2018 22:20:00 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
Julius Werner has posted comments on this change. ( https://review.coreboot.org/27474 )
Change subject: libpayload/xhci: Document struct offsets on xhci_t
......................................................................
Patch Set 1: Code-Review+2
Not sure this is really necessary since these offsets are in the XHCI spec and people usually know the registers by name anyway... but I guess it doesn't hurt either.
--
To view, visit https://review.coreboot.org/27474
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I92dcbd463ceb4dd8edbbd97b51a4e9aa32a983a6
Gerrit-Change-Number: 27474
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 13 Jul 2018 22:16:06 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/27477
Change subject: libpayload/generic_hub: Detect port disconnect after reset
......................................................................
libpayload/generic_hub: Detect port disconnect after reset
If a port disconnects after a reset we should abort any initialization
on the port. At the same time this might mean the device has
re-enumerated as a 3.0 device so we should rescan all the ports.
I decided to not add a return status enum since that would require a lot
of changes. I opted to just return 2 as the magic reenum value.
BUG=b:76831439
TEST=Verified USB-C devices that get detected correctly in depthcharge.
Change-Id: Iad899544684312df1bef08d69b5c7f41eac3a21c
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
---
M payloads/libpayload/drivers/usb/generic_hub.c
1 file changed, 26 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/27477/1
diff --git a/payloads/libpayload/drivers/usb/generic_hub.c b/payloads/libpayload/drivers/usb/generic_hub.c
index 89da934..a2aea7c 100644
--- a/payloads/libpayload/drivers/usb/generic_hub.c
+++ b/payloads/libpayload/drivers/usb/generic_hub.c
@@ -157,6 +157,15 @@
if (hub->ops->reset_port) {
if (hub->ops->reset_port(dev, port) < 0)
return -1;
+
+ if (!hub->ops->port_connected(dev, port)) {
+ usb_debug(
+ "generic_hub: Port %d disconnected after "
+ "reset. Possibly upgraded, rescan required.\n",
+ port);
+ return 2;
+ }
+
/* after reset the port will be enabled automatically */
const int ret = generic_hub_wait_for_port(
/* time out after 1,000 * 10us = 10ms */
@@ -214,15 +223,24 @@
hub->ops->hub_status_changed(dev) != 1)
return;
- int port;
- for (port = 1; port <= hub->num_ports; ++port) {
- const int ret = hub->ops->port_status_changed(dev, port);
- if (ret < 0) {
- return;
- } else if (ret == 1) {
- usb_debug("generic_hub: Port change at %d\n", port);
- if (generic_hub_scanport(dev, port) < 0)
+ int reenum_limit = 1;
+ for (int i = 0; i < reenum_limit && i < 2; ++i) {
+ for (int port = 1; port <= hub->num_ports; ++port) {
+ const int ret =
+ hub->ops->port_status_changed(dev, port);
+ if (ret < 0) {
return;
+ } else if (ret == 1) {
+ usb_debug("generic_hub: Port change at %d\n",
+ port);
+ int rtn = generic_hub_scanport(dev, port);
+ if (rtn == 2) {
+ reenum_limit++;
+ continue;
+ } else if (rtn < 0) {
+ return;
+ }
+ }
}
}
}
--
To view, visit https://review.coreboot.org/27477
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad899544684312df1bef08d69b5c7f41eac3a21c
Gerrit-Change-Number: 27477
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/27398 )
Change subject: Documentation/mb/sifive: Update TODO list; UART driver has been merged
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/27398
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I035c238beba28ecafd296f18c0ccda167126ab94
Gerrit-Change-Number: 27398
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
Gerrit-Reviewer: Ronald G. Minnich <rminnich(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Philipp Hug <philipp(a)hug.cx>
Gerrit-Comment-Date: Fri, 13 Jul 2018 13:35:26 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes