Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp891248imu; Wed, 23 Jan 2019 07:27:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN5JXFv3uu7g3hfS6jQQnEIhtOhiBRGg9o4Jb2x4lnbreXXzq1QYXzTGwE4NyWYUlfPnyYpA X-Received: by 2002:a63:e545:: with SMTP id z5mr2324484pgj.195.1548257264491; Wed, 23 Jan 2019 07:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548257264; cv=none; d=google.com; s=arc-20160816; b=OvOcY+AIicv/srdxF9un73yFLffjCbDMSxRpMxhq/Bm1NAu3gPZxVpOP2wT8A8XKbv cSX/Jipp44NcmxCjapNF8PXN397C/X8wR5SVW3mEGQ+IrI9eltNWof5F8FHKmWGgHMf+ uPC0zQ48nKJRVDbGKGamDTNn/L69ZsbXRVji/HRJBYgp+yrd0/VKPXZ1ttQdAhbrQC5W qxvuqMx6hn/3k8BAPbHG9J0/jRKjOOxZIcI8vmdHWvI0ujeDszZll7AUdhNmycSqkuXS Q6/QDnO0fNz6jlTBOErrKX7kKdo1LwoM3TPf06RK00JtD84/yPRBgKNBlYRjbCAkVY+/ OPTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PeJ1lzHyz15Q+LQw+4xFJCCYkmt41gRzhJUcmx397lo=; b=oFLNzqe9jKi1nnBXxIQ2yW8NeI1c3/zC9MUuJbs3aYR3nEgovqHmrOWUNm9rwZSRJH 2iI92UBMIBnXScCUAk7pj+TQ1R/i9/5gzqquLwm24OB4Wl1tC8aCq21jGtCfR8QMp7XE /GfXcRuXsOQH6g9DboK3wtIXuurjnRUub02+5coXoB3ynhL6PfAuBxzl2qwSuzTA1pfs iFqY4PzxOrkCJt5lAEzPgY7C4ee5jADKUoj6SSvwuvD5cOJnpH1yOS+4tqKgyrWK9lf1 JPepaddxSFmX+XF1lGFLKYL5KOMNwD/SwM+amGHIYZN95aogYQ1n4J7IAK4c93raLQ8y VbnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KML8GqdS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si5174927pgk.405.2019.01.23.07.27.27; Wed, 23 Jan 2019 07:27:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KML8GqdS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbfAWPZg (ORCPT + 99 others); Wed, 23 Jan 2019 10:25:36 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:46314 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfAWPZf (ORCPT ); Wed, 23 Jan 2019 10:25:35 -0500 Received: by mail-ot1-f68.google.com with SMTP id w25so2189584otm.13; Wed, 23 Jan 2019 07:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PeJ1lzHyz15Q+LQw+4xFJCCYkmt41gRzhJUcmx397lo=; b=KML8GqdSLOIxG7OjxbwNZCcYQgovMt28NiQKf/VrU5oaaOFkrhJsbAOuhIKr932LNE vTRcm1Qv/1MCpannQaZt3BiAVMkNUTOpbaeblCapIcCZW8aG/tm9q291+WYeYecIliqT 3p/UL/xdXKYcFSY5drz/sYWs+wRKu0lESoIIREpQgBoSCC2jTH6IllXkD8yvg0KXqRkH 9OtMxpN0TinppFUQ7NZhVEh9BMDvy8c3tkJ/2X67ISXaWzOi0JUkSC/ownN+ywZepIvQ QEuftmb+vUL5aaRmEP3tX/OQsc3eLewb/MMYn+a2TIXDb8V8JBZ8rEn8gth1ZWzzwsMx rP+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PeJ1lzHyz15Q+LQw+4xFJCCYkmt41gRzhJUcmx397lo=; b=bESxWZAJgKuYwoAIO2CONAeFGhu3vJnqa3jUIY0sS84QM5GPnEH/u3g5mcJjpAhGG4 j5L4PdiYEfwxuNvObKPnXMhNnJoQeGPSd0embTEYnGe+cIpN+09kS4gqAcESjTAbn3rC YjTTPg5TNnJH/fJ5hZQ+CwRGI+Poywy7vzSeGCWrGQlGc5F2/RAAyUMbb+4LWMFNLwfA EAzaHIsdhgfoDmEM98pkTSW+HXa2nZdN95NOE5U2m5DUD1PC0oD6UrYOsj8BbByPNUSi otQgup0Q8k7mFiMti8RuNuF/H9t1zEK9c/lw6yKAtZFY8ASQNeFAVxAX+dX4VNfbp5eK emMw== X-Gm-Message-State: AJcUukeL52p4prtw8lPnR8kHZcLbBCw+dBQMQGqLGkWn6mioDiqDreIx TFX8lZIEYJ8uxxZustHLE4CBixLIYXS1/UXjbhA= X-Received: by 2002:a9d:3424:: with SMTP id v33mr1625714otb.167.1548257134167; Wed, 23 Jan 2019 07:25:34 -0800 (PST) MIME-Version: 1.0 References: <20190113181808.5768-1-linux.amoon@gmail.com> In-Reply-To: From: Anand Moon Date: Wed, 23 Jan 2019 20:55:21 +0530 Message-ID: Subject: Re: [PATCH 1/2] ARM: dts: meson8b: odroidc1: Enable usb phy node To: Martin Blumenstingl Cc: devicetree , linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel , Rob Herring , Kevin Hilman , Jerome Brunet , Neil Armstrong , Emiliano Ingrassia Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, On Tue, 22 Jan 2019 at 00:22, Martin Blumenstingl wrote: > > Hi Anand, > > On Mon, Jan 21, 2019 at 7:37 AM Anand Moon wrote: > > > > Hi Martin, > > > > Thanks for you comments. > > > > On Mon, 21 Jan 2019 at 03:21, Martin Blumenstingl > > wrote: > > > > > > Hi Anand, > > > > > > On Sun, Jan 20, 2019 at 7:44 PM Anand Moon wrote: > > > > > > > > Hi Martin, > > > > > > > > Thanks for your review comments. > > > > > > > > On Sat, 19 Jan 2019 at 03:59, Martin Blumenstingl > > > > wrote: > > > > > > > > > > Hi Anand, > > > > > > > > > > thank you for this patch! > > > > > > > > > > On Sun, Jan 13, 2019 at 7:18 PM Anand Moon wrote: > > > > > > > > > > > > Add missing vbus-supply link to phy controller for usb_phy0 > > > > > > and usb_phy1 nodes, this changes fixed the power issue > > > > > > on usb ports usb, changes help fix usb reset warning. > > > > > I trust you on the fact that GPIOAO_5 controls VBUS of USB0 and USB1 > > > > > > > > > > to me the schematics are not 100% clear or I'm bad at interpreting them: > > > > > - I'll refer to odroid-c1+_rev0.4_20150615.pdf > > > > > - page 1 lists GPIOAO.BIT5 as input for the PWREN signal of the > > > > > USB_OTG controller (usb0) > > > > > - page 1 also shows a PWREN signal in the USB_HOST controller (usb1) > > > > > but not it's input > > > > > - based on your patch I assume that PWREN is the same signal for both > > > > > USB controllers > > > > > > > > > As per the schematics odroid-c1+_rev0.4_20150615.pdf > > > > > > > > It seem that their vbus setting for *OTG* port. *Bus 01.Port 1* using > > > > *GPIOAO.BIT5* gpio > > > that matches my interpretation of the schematics > > > > Yep, I feel that GPIOAO.BIT5 enable the PWREN power on Bus 02.Port (usb1) > > But I could not get this to enable on Bus 01.Port (usb0). > > > > usb hot-plug of devices is working fine on *usb1* but not on *usb0*. > > I have tried different combination but it's not working for me. > > > > I am attaching small changes to phy which enables the Bus 01.Port > > (usb0) on Odroid C1+/Odroidc2. > > we need to set dr_mode="otg" to enable this bus in dts. > I need to get my multimeter out and measure on my own Odroid-C1 > I *believe* to have observed that toggling GPIOAO.BIT5 changes the > voltage at at the OTG port, but it's been a few weeks since then... > let me know if you want me to do the measurements on my Odroid-C1+ again > > > > > But we also need set power supply for *USB_B* port. *Bus 02.Port 1* ? > > > > I don't know but I will try to find solution. > > > I assume we also have to enable VBUS for the host only port, but I > > > don't know how > > > > > > > We need to enable some bit in phy driver ? > > > I'm not aware of any bit in the PHY driver which can toggle VBUS > > > > > > (trying to be creative here) maybe the GPIO is incorrectly configured > > > to pull up or down? > > > > I have tried this but no luck. > OK, too bad > > [...] > > > > After fix the phy driver code and dts changes I am getting this changes. > > > > # cat /sys/kernel/debug/regulator/regulator_summary | grep USB_VBUS > > > > USB_VBUS 1 2 0 unknown 5000mV > > > > 0mA 5000mV 5000mV > > > > > > > > Now I am able to enable both *Bus 01.Port 1* and *Bus 02.Port 1* > > > > > > > > # lsusb -t > > > > /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M > > > > |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M > > > > |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M > > > > |__ Port 3: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M > > > > |__ Port 3: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M > > > > |__ Port 3: Dev 3, If 2, Class=Audio, Driver=snd-usb-audio, 480M > > > > |__ Port 3: Dev 3, If 3, Class=Audio, Driver=snd-usb-audio, 480M > > > so this is the host-only controller (usb1) and it's working fine for > > > you - very nice! > > > > > > > /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M > > > > > > > > But not usb device are getting enable on *Bus 01.Port 1* > > > so you have something plugged into the OTG capable controller (usb0) > > > using an OTG cable? > > > > Yes I have connected USB-OTG cable with storage device attached, > > led lights on the device is blinking, but no power to the port is enable. > > so not hotplug of device is working on this port. > thanks for confirming this! > can you please send an updated version of both patches? if you want > someone else to test and/or review the patches before they are applied > you can use the subject prefix "RFT PATCH n/m" or "RFC PATCH n/m" (RFT > means "request for testing", "RFC" means "request for comments") > I have tried to address the issue in the next series of patches. > > > I've not tried this before on my Odroid-C1 because I'm using the micro > > > USB connector to power the board > > > > Correct me if I am wrong, we need to tune USB phy driver to enable as > > power the board ? > so far I have seen two designs on Amlogic boards: > - VBUS is hardwired to +5V > - VBUS is controlled by a regulator/current limiting switch/etc. which > can be toggled using a GPIO > > the PHY is involved in this because for the OTG port it senses the ID > line to decide whether the controller has to go into host or device > (peripheral) mode. > however, this part is not implemented in the mainline phy-meson8b-usb2 > driver yet > > in case someone is interested in *why* dwc2 doesn't do OTG on the > Amlogic SoCs yet - here are the notes from the top of my head: > - the dwc2 controller doesn't get an interrupt when switching between > host and peripheral mode > - instead the Amlogic vendor kernel has a timer which polls the PHY registers > - if the timer handler detects a "mode change" in the PHY registers it > changes the dwc2 mode > - however, in mainline the PHY can't notify the USB controller driver > (dwc2) to change the mode (yet) > Thanks for your input. Yep I tired to study the code changes in the u-boot from amlogic. I tried to enable few bit in the phy to test enable of usb otg port but no success. I have tested that otg port is used to power on the board. > > > > > > do you get VBUS (maybe you have a USB thumb drive with an LED which > > > lights up when you connect it)? > > > do you get any errors or warnings from the dwc2 driver during boot? > > > > > > > Please find the boot log of my Odroid C1+ here > > [0]: https://pastebin.com/PiDmVmEC > > > > I dont see any major error on usb side. > that looks very good indeed. as I already mentioned above: please send > an updated version of the patches so I can try to reproduce your test > results! > > > > > > on which board revision have you tested this patch? > > > > > > > > > > > > > I have with me for testing > > > > > > > > ODROID-C0 REV 0.4 20151217 > > > > ODROID-C1+ REV 0.4 20150615 ----> current testing on > > > I have the exact same Odroid-C1+ board revision > > > this is my u-boot version: > > > U-boot-00000-gb7b8dc2-dirty(odroidc@b7b8dc21) (Sep 01 2017 - 01:18:22) > > > -> b7b8dc21 is the lastest commit of the hardkernel odroidc-v2011.03 > > > u-boot branch at the time of writing > > > > > > > I am using the the u-boot from archlinux. > > If their is another u-boot for Odroid c1 plz let me know, I will try > > to install this on my system. > I don't remember where I got my u-boot version from. > maybe I should switch to the Arch Linux ARM one instead (so I'm back > to a well-known state). but let's wait for the test results from your > updated patches first. > > > Regards > Martin Best Regards -Anand