From: Neil Armstrong Date: Mon, 9 Sep 2019 18:03:45 +0200 Subject: [U-Boot] [usb dwc3] xHCI driver -- a hint needed. In-Reply-To: References: <326b9803-1ee5-7c1e-22aa-eadd364821a1@baylibre.com> <0b68cee0-3514-3dc7-4039-748d3d4de3fc@baylibre.com> Message-ID: <59bfc37b-8870-3413-269b-c874b81666f3@baylibre.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi Bin, On 08/09/2019 14:35, Bin Meng wrote: > Hi Neil, > > On Sun, Sep 8, 2019 at 8:33 PM Neil Armstrong wrote: >> >> Hi Bin, >> >> Le 07/09/2019 à 05:44, Bin Meng a écrit : >>> Hi Neil, >>> >>> On Thu, Sep 5, 2019 at 11:48 PM Neil Armstrong wrote: >>>> >>>> Hi Bin, >>>> >>>> I've been having the same behavior on the Amlogic S905X SoC with a DWC3 XHCI controller >>>> connected to 2 HS-only PHYs and no SS PHY. >>>> >>>> When a device is connected on the second PHY, I have the same BUG(), >>>> but no more when a device is also connected on the first PHY, and no issues >>>> at all on the first PHY. >>>> >>>> XHCI timeout on event type 33... cannot recover. >>>> >>>> What kind of debug output would you need to debug this ? >>>> >>>> => When Port 1 is disconnected, but Port 2 is populated: >>>> usb_control_msg: request: 0x1, requesttype: 0x23, value 0x10 index 0x2 length 0x0 >>>> clear port connect change, actual port 2 status = 0x6e1 >>>> ... >>>> usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x2 length 0x0 >>>> ... >>>> usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4 >>>> SPEED = FULLSPEED >>>> ... >>>> usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x2 length 0x0 >>>> ... >>>> usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4 >>>> SPEED = FULLSPEED >>>> ... >>>> usb_control_msg: request: 0x1, requesttype: 0x23, value 0x14 index 0x2 length 0x0 >>>> clear port reset change, actual port 2 status = 0x603 >>>> >>>> >>>> => When Port 1 is populated: >>>> usb_control_msg: request: 0x1, requesttype: 0x23, value 0x10 index 0x2 length 0x0 >>>> clear port connect change, actual port 2 status = 0x6e1 >>>> ... >>>> usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x2 length 0x0 >>>> ... >>>> usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4 >>>> SPEED = FULLSPEED >>>> ... >>>> usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x2 length 0x0 >>>> ... >>>> usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4 >>>> SPEED = HIGHSPEED >>>> ... >>>> usb_control_msg: request: 0x1, requesttype: 0x23, value 0x14 index 0x2 length 0x0 >>>> clear port reset change, actual port 2 status = 0xe03 >>>> >>>> When Port 1 is populated, Port 2 status correctly switches to HIGHSPEED, >>>> but why ? >>>> >>> >>> This looks really strange. Sounds like a hardware internal state >>> depends on the first USB port. Do you know if Linux works? >> >> Yes, Linux works fine, is it worth tracing the Linux XHCI driver aswell ? > > Yes, that will definitely help. I did a extensive debug and print session today agains the amlogic u-boot release and Linux, and only : clrbits_le32(&dwc3_reg->g_usb2phycfg, DWC3_GUSB2PHYCFG_SUSPHY); was missing in drivers/usb/host/xhci-dwc3.c because xhci-dwc3 is not using the dwc3 core init. it should use the dwc3 core init instead of a copy, that correctly handles the quirks. Neil > > Regards, > Bin >