LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sungbo Eo <mans0n@gorani.run>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: linux-mediatek@lists.infradead.org,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Min Guo <min.guo@mediatek.com>,
	devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: Aw: Re: [PATCH 0/2] Add MUSB for MT7623
Date: Thu, 5 Aug 2021 10:34:35 +0900	[thread overview]
Message-ID: <a6f4d24f-c79b-35e4-43fb-90eb75623dc2@gorani.run> (raw)
In-Reply-To: <trinity-8910c659-6e4e-4979-a6d0-eaf5b8bee213-1628064668849@3c-app-gmx-bap67>

On 2021-08-04 17:11, Frank Wunderlich wrote:
>> Gesendet: Mittwoch, 04. August 2021 um 02:14 Uhr
>> Von: "Sungbo Eo" <mans0n@gorani.run>
> 
>>> 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, <SessEnd), retry #0, port1 00000104
>>
>> 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 = <MT7623_PIN_237_EXT_SDIO2_FUNC_DRV_VBUS>;
>> +               };
>> +       };
>> +};
> 
> 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
>>

  reply	other threads:[~2021-08-05  1:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 15:13 Sungbo Eo
2021-08-03 15:13 ` [PATCH 1/2] dt-bindings: usb: mtk-musb: add MT7623 compatible Sungbo Eo
2021-08-04 15:01   ` Matthias Brugger
2021-08-03 15:13 ` [PATCH 2/2] arm: dts: mt7623: add musb device nodes Sungbo Eo
2021-08-03 17:15 ` Aw: [PATCH 0/2] Add MUSB for MT7623 Frank Wunderlich
2021-08-04  0:14   ` Sungbo Eo
2021-08-04  8:11     ` Aw: " Frank Wunderlich
2021-08-05  1:34       ` Sungbo Eo [this message]
2021-08-04 11:33     ` Frank Wunderlich
2021-08-04 15:01 ` Matthias Brugger
2021-08-05  1:36   ` Sungbo Eo
2021-08-08 12:38 ` [PATCH v2 " Sungbo Eo
2021-08-08 12:38   ` [PATCH v2 1/2] dt-bindings: usb: mtk-musb: add MT7623 compatible Sungbo Eo
2021-08-13 20:49     ` Rob Herring
2021-08-08 12:38   ` [PATCH v2 2/2] arm: dts: mt7623: add musb device nodes Sungbo Eo
2021-08-13 20:48     ` Rob Herring
2021-08-22  4:13   ` [PATCH v3 0/1] Add MUSB for MT7623 Sungbo Eo
2021-08-22  4:13     ` [PATCH v3 1/1] arm: dts: mt7623: add musb device nodes Sungbo Eo
2021-08-30 15:17       ` Aw: " Frank Wunderlich
2021-08-30 15:59     ` [PATCH v4 0/2] Add MUSB for MT7623 Sungbo Eo
2021-08-30 15:59       ` [PATCH v4 1/2] arm: dts: mt7623: add musb device nodes Sungbo Eo
2021-08-31  6:27         ` Chunfeng Yun (云春峰)
2021-08-31  8:59           ` Frank Wunderlich
2021-08-31 11:02             ` Sungbo Eo
2021-08-31 11:08               ` Aw: " Frank Wunderlich
2021-09-20 10:48         ` Aw: " Frank Wunderlich
2021-09-20 12:01         ` Matthias Brugger
2021-08-30 15:59       ` [PATCH v4 2/2] usb: musb: mediatek: Expose role-switch control to userspace Sungbo Eo
2021-08-31  6:15         ` Chunfeng Yun (云春峰)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6f4d24f-c79b-35e4-43fb-90eb75623dc2@gorani.run \
    --to=mans0n@gorani.run \
    --cc=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frank-w@public-files.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=min.guo@mediatek.com \
    --cc=robh+dt@kernel.org \
    --subject='Re: Aw: Re: [PATCH 0/2] Add MUSB for MT7623' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).