From a3d79292e7a6adc0c5dc4c53117feb5225bc6225 Mon Sep 17 00:00:00 2001 From: Kangheui Won Date: Fri, 24 Jan 2020 21:53:01 +1100 Subject: libpayload/xhci: Fix MPS handling in set_address We set MPS to speed_to_default_mps(speed) initially but later compare maxpacketsize with 8 to change mps. So compare with speed_to_default_mps(speed) to determine if we need to change settings here. BUG=b:147783572 BRANCH=none TEST=works with 12Mbps/8MPS USB device Signed-off-by: Kangheui Won Change-Id: I32455483fceec56f14af6118b77615c14b3f9f39 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38556 Reviewed-by: Edward O'Callaghan Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- payloads/libpayload/drivers/usb/xhci_devconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads') diff --git a/payloads/libpayload/drivers/usb/xhci_devconf.c b/payloads/libpayload/drivers/usb/xhci_devconf.c index 3f50caa512..51ff29f5c8 100644 --- a/payloads/libpayload/drivers/usb/xhci_devconf.c +++ b/payloads/libpayload/drivers/usb/xhci_devconf.c @@ -227,7 +227,7 @@ xhci_set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr) } dev->endpoints[0].maxpacketsize = usb_decode_mps0(speed, buf[7]); - if (dev->endpoints[0].maxpacketsize != 8) { + if (dev->endpoints[0].maxpacketsize != speed_to_default_mps(speed)) { memset((void *)ic->dev.ep0, 0x00, ctxsize); *ic->add = (1 << 1); /* EP0 Context */ EC_SET(MPS, ic->dev.ep0, dev->endpoints[0].maxpacketsize); -- cgit v1.2.3