lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectAw: [PATCH 0/2] Add MUSB for MT7623
Date
Hi,

> Gesendet: Dienstag, 03. August 2021 um 17:13 Uhr
> Von: "Sungbo Eo" <mans0n@gorani.run>
> An: linux-mediatek@lists.infradead.org
> Cc: "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>, "Frank Wunderlich" <frank-w@public-files.de>, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Sungbo Eo" <mans0n@gorani.run>
> Betreff: [PATCH 0/2] Add MUSB for MT7623
>
> These patches add support for the MUSB controller on Mediatek MT7623.
> Tested on Mercury RUSH-318AC Wi-Fi router.
>
> I got to know this from a BPI-R2 forum post [1], and managed to make it work on OpenWrt snapshot.
> I'd like to know if this also works on BPI-R2, I can happily share the details if needed.
> And I've just copy & pasted nodes from mt2701, please let me know if I missed some big differences between SoCs...
>
> [1] http://forum.banana-pi.org/t/bpi-r2-otg-port/10551

thanks for working on it. do both otg-roles (host/client) work on your device?

unfortunately at least host-mode does not work (do not know how to test client mode). i guess because iddig and vusb nodes are missing.

i took your Patchset and enabled the usb-node for bpi-r2.

+&usb3 {
+ status = "okay";
+};

and added these config-symbols:

+CONFIG_USB_CONN_GPIO=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_MEDIATEK=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_USB_CONFIGFS=y
+#CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+#CONFIG_PHY_MTK_TPHY=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_MUSB_DUAL_ROLE=y
+CONFIG_USB_INVENTRA_DMA=y

btw. imho otg-node should be named usb0 as other dts (kernel 4.4) also use usb0, else i think it's confusing.

in my last attempt i had these below usb-node in boards devicetree:

+ usb_vbus: regulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&pio 237 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ connector{
+ compatible = "gpio-usb-b-connector", "usb-b-connector";
+ type = "micro";
+ id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
+ vbus-supply = <&usb_vbus>;
+ };

after adding these i see the connection of otg-cable with usb-stick in dmesg:

[ 53.656304] usb-conn-gpio 11200000.usb:connector: repeated rot
[ 53.696324] usb-conn-gpio 11200000.usb:connector: repeated role: host

but usb-stick is not powered (led of the stick is off) and of course i see no mass-storage device.

and now i'm back on the traceback on power down i've reported Author of musb driver some time ago

[ 156.785185] WARNING: CPU: 0 PID: 1 at drivers/power/reset/mt6323-poweroff.c:4
[ 156.795156] Unable to power off system

[ 156.884496] [<c0cca1ec>] (warn_slowpath_fmt) from [<c090562c>] (mt6323_do_pw)
[ 156.893203] r8:c3296d40 r7:00000024 r6:0ccccb60 r5:c10fe3d8 r4:00000000
[ 156.900030] [<c09054b0>] (mt6323_do_pwroff) from [<c010ba68>] (machine_power)
[ 156.908558] r8:fee1dead r7:c1312590 r6:92f61d00 r5:00000000 r4:4321fedc
[ 156.915385] [<c010ba34>] (machine_power_off) from [<c01524bc>] (kernel_power)

i guess it's related to the usb_vbus.

regards Frank

\
 
 \ /
  Last update: 2021-08-03 19:16    [W:0.208 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site