Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp250186pxt; Wed, 4 Aug 2021 21:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvIz/9195FhEY/Xx5fwRJDPz6CG4EsgGSwiSvBqehEJilqWDM0Xcgfitw4GnSMjVvZesS8 X-Received: by 2002:a17:907:76a3:: with SMTP id jw3mr2849336ejc.345.1628138714771; Wed, 04 Aug 2021 21:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628138714; cv=none; d=google.com; s=arc-20160816; b=UubFMFFHznyb79MANYacZG6GcTLIFAMNJkYl4TGtWZ1cKFTR98Y/1c8qm5CbUTaP+X awozs8JEBZJffuPLrJgqZovq8tVrInV8Ej0VHHXyCOd7++pYQyOvHFWwBcSuUdfqjx+E c8eVX4aH9iyqlkYKtluVTupx7jXCLJ/Xox0anMcBlg7h0o2ZdnVSE1p425UySEb7XVBB WqM2Dg3tg++qVudTyo2RVwFpZCqK7h2r3dzNk7062bu93ROE1cSaU3SZgrzfaCBr2ASs j4Azni+rj5udwpnZRvpRtgJ2d4dyX6ylTGu4c14TQ5nvk/2LhVV3xocp6AGDVhfaKqPP SLRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:date:message-id:from:references:cc:to:subject :dkim-signature; bh=ZE+O5cegW+iGebRWUhEH5E4wIAzdvgqgde4doV7RxnQ=; b=p0SUkwoSsj4o488Fn6oPg+3ORrpkLqzk1KStGkIEUN/a3QBbC4tKJfNcbWFSntfes4 7nirQeL+mcwsQCOZegPTpRBWwKydxmrktuNChu+CC3PTpERkr8XdZhVMvNxNld5X/MKP O9T8I76Di0uz5KXiR0ZI6wKiMmGPMyxXJJeFS0bwifAufxWWOR5cHqttITLp1f8pyrQz 0s+vglECIwOwvoBuIAasoL1vT9DFu3+4ZQT/SH+O7v5tA+vYLdwZEu5zMyCn7lwM53b/ +WBqKuvCHpNfGPOocD3LRCMIBjJzqO6pBYqxL84sPTWUoYpcnCsbAWtfAuQlxgj6aKeS aLRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gorani.run header.s=MBO0001 header.b=vTi3Q3bM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gorani.run Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y31si5359215edy.561.2021.08.04.21.44.52; Wed, 04 Aug 2021 21:45:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gorani.run header.s=MBO0001 header.b=vTi3Q3bM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gorani.run Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237652AbhHEBfK (ORCPT + 99 others); Wed, 4 Aug 2021 21:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234640AbhHEBfI (ORCPT ); Wed, 4 Aug 2021 21:35:08 -0400 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F75C061765; Wed, 4 Aug 2021 18:34:55 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4GgB4B36xPzQk2m; Thu, 5 Aug 2021 03:34:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gorani.run; s=MBO0001; t=1628127286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZE+O5cegW+iGebRWUhEH5E4wIAzdvgqgde4doV7RxnQ=; b=vTi3Q3bMHhE54KV89e8W4EIYg7qQRDhTc58ZeJ0z1tt+6aDO+XQ6B/FMOvSOpgdS1NrvLi UlXbHDDn6yTwNJ8Kxp0Rq4ikcIl35uwBFRBVQuJOEwH3wn9U4VXJO6/nQXhRKGdDkbLgvi pDmT0bvrKUWzAkOcyMHdGnc8Y5bypaKdDX9CKkDc5JWyLMAlZemAQuYIj6osPdbQcBe1xD sqjNvXTmGAgRrBnP2DxemGDX4mgM+UYNjSP2w6EhUKw+Xb6nNGyonL9R52NdSfnTuItalD sKUBkehXbmmMqvcHzmoeEASFCXoced4ojdrp+zMzUn6mxptWLhRnBI6XrCUNWA== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id gunOhzsQxFz4; Thu, 5 Aug 2021 03:34:45 +0200 (CEST) Subject: Re: Aw: Re: [PATCH 0/2] Add MUSB for MT7623 To: Frank Wunderlich Cc: linux-mediatek@lists.infradead.org, Chunfeng Yun , Greg Kroah-Hartman , Rob Herring , Matthias Brugger , Min Guo , devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210803151320.71531-1-mans0n@gorani.run> From: Sungbo Eo Message-ID: Date: Thu, 5 Aug 2021 10:34:35 +0900 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6EE5B1887 X-Rspamd-UID: ce070d Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-04 17:11, Frank Wunderlich wrote: >> Gesendet: Mittwoch, 04. August 2021 um 02:14 Uhr >> Von: "Sungbo Eo" > >>> thanks for working on it. do both otg-roles (host/client) work on your device? >> >> Yes, I tested it with host mode and device mode. >> I also tried manual role-switch via sysfs and it worked with some prior setup. >> Note that my device has a USB Type-A connector and not micro B, so I can't help with id pin stuff... > >>> but usb-stick is not powered (led of the stick is off) and of course i see no mass-storage device. >> >> I observed the same symptom (but different error log). >> >> [ 2.722253] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_idle (80, > >> In my case adding `regulator-always-on;` in the regulator node solved the problem temporarily. >> But after that I switched to relying on pinctrl. > > i've found out that usb-stick is powered if i first connect otg-cable and then the stick to the cable...regulator always on does not change anything for me (only supporess "disabling vusb" message on boot). traceback on poweroff is still there. I tried to reproduce your usb-conn-gpio message on my machine but I failed. Probably because my USB port does not have ID pin... Currently OpenWrt does not enable CONFIG_POWER_RESET_MT6323 so I was not aware of the poweroff error. After I enabled it I got the same error and I could not resolve it... I'd better disable it for now. > > role switch happen on inserting stick into cable, not before (insert cable into r2) as i expected. > > need to figure out which CONFIG options i need to get USB-Stick as mass storage working. Do you mean that vbus turns on but your usb stick is not detected? Does that change if you use `dr_mode = "host"`? > > i wonder why it works on your board without the vusb/connector subnodes Do you mean vbus subnode in musb or vusb subnode in pmic? I've never used vusb node, it did not affect me in any way. When I used usb_vbus regulator node to enable vbus line, it did not turn on the line unless I added `regulator-always-on`... It seems the connector node is not really required for me. > >> +&pio { >> + musb_pins: musb { >> + pins-musb { >> + pinmux = ; >> + }; >> + }; >> +}; > > imho it's the same gpio used for regulator, right? whats the difference? > i tried this instead of the regulator-node => not powered (cable first, then stick). I don't really know how it does work, but for me it does turn on vbus in host mode and turn it off in device mode. I imagined DRV_VBUS setup will make the musb controller itself (and not kernel) control the line as needed, but it's just my guess. > >> +&usb3 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&musb_pins>; >> + status = "okay"; >> + >> + dr_mode = "host"; >> + >> + connector { >> + compatible = "usb-a-connector"; >> + }; >> +}; >> >> root@OpenWrt:~# lsusb -t >> /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M >> |__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 480M >> /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M >> /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 480M >>