From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932662AbcLIHc0 (ORCPT ); Fri, 9 Dec 2016 02:32:26 -0500 Received: from mail-oi0-f42.google.com ([209.85.218.42]:36615 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbcLIHcZ (ORCPT ); Fri, 9 Dec 2016 02:32:25 -0500 MIME-Version: 1.0 In-Reply-To: <68d72b37-9836-621b-84ee-050b8b584fa8@huawei.com> References: <1481075278-17600-1-git-send-email-john.stultz@linaro.org> <30669194-dc9c-503b-b84d-a7cfd23bbfa6@synopsys.com> <88c3d4f7-5a52-b5ad-12b6-c368ddc32ce5@synopsys.com> <68d72b37-9836-621b-84ee-050b8b584fa8@huawei.com> From: John Stultz Date: Thu, 8 Dec 2016 23:32:23 -0800 Message-ID: Subject: Re: [RFC][PATCH] HACK: usb: dwc2: Workaround case where GOTGCTL state is wrong To: Chen Yu Cc: John Youn , Biggo Wang , lkml , Wei Xu , Guodong Xu , Amit Pundir , Rob Herring , Douglas Anderson , Kishon Vijay Abraham I , Felipe Balbi , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uB97WV0G005021 On Thu, Dec 8, 2016 at 11:09 PM, Chen Yu wrote: > On 2016/12/9 7:29, John Youn wrote: >> On 12/8/2016 2:43 PM, John Stultz wrote: >>> On Tue, Dec 6, 2016 at 7:52 PM, John Youn wrote: >>>> On 12/6/2016 5:48 PM, John Stultz wrote: >>>>> This patch works around the issue by re-reading the GOTGCTL >>>>> state to check if the GOTGCTL_CONID_B is still set and if not >>>>> restarting the change status logic. >>>> >>>> This also seems weird. The connector id status shouldn't go back to A, >>>> assuming you've left the cable unplugged. >>> >>> So I suspect this has something to do with the way the USB-A host >>> ports on the board are wired up. As removing the usb-b plug seems to >>> switch the device back into A mode. >>> >>> One quirk with this board is that the USB-A ports on the board do not >>> function if anything is in the OTG/B plug (which is frustrating to use >>> at times). >>> >> >> Do you mean there are multiple A-ports on the board hooked up to the >> same controller? >> >> If so, that would go a long way towards explaining things. Because the >> hsotg is a single-port OTG controller. If there are multiple A-ports, >> that means a hub has to be hard-wired internally to the port. But if >> that's the case the OTG function won't work because OTG doesn't work >> through a hub. It must go directly to the otg port. So there must be >> some external logic kicking-in to switch routing to the OTG port or to >> the HUB. >> >> This would explain this behavior with the ID pin status. Since hooking >> up the HUB would make the controller an A-device whereas normally it >> would be a B-device. >> >>> Guodong or Chen Yu understand the hardware details a bit better, and >>> might be able to explain more if you need more information. >>> >> >> Yeah it would be good to get some insight into this from a hardware >> point of view. >> > > Actually, I'm not very clear about the hardware details. > > In simple terms, there are two Type A USB 2.0 host ports and one microUSB OTG port on the front edge of the board. > The two Type A USB 2.0 host ports connect to a high-speed hub and the hub connect to a USB Switch to which the microUSB OTG port > also connect. > If the Vbus of the microUSB OTG port was high or the ID of the microUSB OTG port was low, the Switch will switch the DP and DM of the SOC > to microUSB OTG port. If no cable was inserted to microUSB OTG port, the Switch will switch the DP and DM of the SOC to the high-speed hub. > There is another import point, the ID pin of soc will be pulled high in both cases: > 1.no cable is inserted to microUSB OTG port > 2.cable is inserted to microUSB OTG port and ID of microUSB OTG port is low. > > If my explanation confuse you, maybe these documents can be helpful. > > 1、https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey/HardwareDocs/HardwareNotes.md > > USB Ports > > There are multiple USB ports on the HiKey board: > > One microUSB OTG port on the front edge of the board > Two Type A USB 2.0 host ports on the front edge of the board > One USB 2.0 host port on the high-speed expansion bus > > 2、https://github.com/96boards/documentation/tree/master/ConsumerEdition/HiKey/AdditionalDocs > Hardware User Guide Yea, Page 12 in this pdf seems to explain it: https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey/AdditionalDocs/HiKey_Hardware_User_Manual_Rev0.2.pdf There is a usb switch which enables the micro-usb-b port if a cable is present, or switches to using the hub(which has its own limitations wrt multi-speed support) for the usb-a ports. thanks -john