From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sat, 19 Dec 2015 21:16:58 +0100 Subject: [U-Boot] [PATCH 2/2 v2] usb: musb: Fix hub port number for SPLIT transactions In-Reply-To: <1450556218-26067-1-git-send-email-stefan.bruens@rwth-aachen.de> References: <5675A1A6.2000607@redhat.com> <1450556218-26067-1-git-send-email-stefan.bruens@rwth-aachen.de> Message-ID: <1450556218-26067-2-git-send-email-stefan.bruens@rwth-aachen.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The ifdef'ed Linux kernel code uses the 1 based port number, whereas U-Boot puts a 0 based port number into the register. The reason the 0 based port number apparently works can probably be taken from the USB 2.0 spec: 8.4.2.2 Start-Split Transaction Token ... The host must correctly set the port field for single and multiple TT hub implementations. A single TT hub implementation *may ignore* the port field. Actually, as far as I unterstand, a multi TT hub defaults to single TT (bAlternateSetting: 0) until switched via SetInterface, so even "port 42" would work. The change was verified by hardcoding the port number to a wrong value, SPLIT transactions kept working (although using a DWC2 instead of MUSB). Tested hubs are the RPi onboard SMC9514 and an external "05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB". The former is a multi TT hub, the latter single TT only. Signed-off-by: Stefan Br?ns --- drivers/usb/musb-new/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb-new/musb_host.c b/drivers/usb/musb-new/musb_host.c index fc4ba62..5c028d4 100644 --- a/drivers/usb/musb-new/musb_host.c +++ b/drivers/usb/musb-new/musb_host.c @@ -2096,7 +2096,7 @@ int musb_urb_enqueue( uint8_t hubaddr = 0; usb_find_usb2_hub_address_port(udev, &hubaddr, &portnr) qh->h_addr_reg = hubaddr; - qh->h_port_reg = portnr - 1; + qh->h_port_reg = portnr; } #endif } -- 2.1.4