Devicetree
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
To: "wens-jdAy2FN1RRM@public.gmane.org" <wens-jdAy2FN1RRM@public.gmane.org>
Cc: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: [PATCH 2/3] ARM: dts: sun8i: add usb_otg and OHCI/EHCI for usbc0 on H3
Date: Wed, 01 Mar 2017 00:07:48 +0800	[thread overview]
Message-ID: <59571488298068@web6j.yandex.ru> (raw)
In-Reply-To: <CAGb2v67fsuhRnGp7X8PDkH_t_gb+gPb6VrY-pVu0B4HhD6d8qA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>



28.02.2017, 23:46, "Chen-Yu Tsai" <wens-jdAy2FN1RRM@public.gmane.org>:
> On Tue, Feb 28, 2017 at 11:27 PM, Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org> wrote:
>>  Allwinner H3 have a dual-routed USB PHY0 -- routed to either OHCI/EHCI
>>  or MUSB controller.
>>
>>  Add device nodes for these controllers.
>>
>>  Signed-off-by: Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
>>  ---
>>   arch/arm/boot/dts/sun8i-h3.dtsi | 36 ++++++++++++++++++++++++++++++++++++
>>   1 file changed, 36 insertions(+)
>>
>>  diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
>>  index 27780b97c863..bc9a53edf371 100644
>>  --- a/arch/arm/boot/dts/sun8i-h3.dtsi
>>  +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
>>  @@ -206,6 +206,19 @@
>>                          #size-cells = <0>;
>>                  };
>>
>>  + usb_otg: usb@01c19000 {
>>  + compatible = "allwinner,sun8i-h3-musb";
>>  + reg = <0x01c19000 0x0400>;
>>  + clocks = <&ccu CLK_BUS_OTG>;
>>  + resets = <&ccu RST_BUS_OTG>;
>>  + interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
>>  + interrupt-names = "mc";
>>  + phys = <&usbphy 0>;
>>  + phy-names = "usb";
>>  + extcon = <&usbphy 0>;
>>  + status = "disabled";
>>  + };
>>  +
>>                  usbphy: phy@01c19400 {
>>                          compatible = "allwinner,sun8i-h3-usb-phy";
>>                          reg = <0x01c19400 0x2c>,
>>  @@ -238,6 +251,29 @@
>>                          #phy-cells = <1>;
>>                  };
>>
>>  + ehci0: usb@01c1a000 {
>>  + compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
>>  + reg = <0x01c1a000 0x100>;
>>  + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
>>  + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
>>  + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
>>  + phys = <&usbphy 0>;
>>  + phy-names = "usb";
>
> So this bit is slightly concerning. IIRC the xHCI drivers power on the phy when
> probed, which means VBUS is _always_ going to be powered on, even when it's
> supposed to be in peripheral mode. You're probably going to need to rework
> either the phy or the musb driver to cope with this.
>
> Or maybe just dropping the phy handle here and letting the musb driver handle
> it would work, but that requires the musb driver be loaded.

Tested this solution.

I may choose it in the next version.

Hans, how do you think of this solution?

>
> ChenYu
>
>>  + status = "disabled";
>>  + };
>>  +
>>  + ohci0: usb@01c1a400 {
>>  + compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
>>  + reg = <0x01c1a400 0x100>;
>>  + interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
>>  + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
>>  + <&ccu CLK_USB_OHCI0>;
>>  + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
>>  + phys = <&usbphy 0>;
>>  + phy-names = "usb";
>>  + status = "disabled";
>>  + };
>>  +
>>                  ehci1: usb@01c1b000 {
>>                          compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
>>                          reg = <0x01c1b000 0x100>;
>>  --
>>  2.11.1
>>
>>  --
>>  You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>  For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

  parent reply	other threads:[~2017-02-28 16:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 15:27 [PATCH 1/3] phy: sun4i-usb: support automatically switch PHY0 route to MUSB/HCI Icenowy Zheng
     [not found] ` <20170228152702.42602-1-icenowy-ymACFijhrKM@public.gmane.org>
2017-02-28 15:27   ` [PATCH 2/3] ARM: dts: sun8i: add usb_otg and OHCI/EHCI for usbc0 on H3 Icenowy Zheng
     [not found]     ` <20170228152702.42602-2-icenowy-ymACFijhrKM@public.gmane.org>
2017-02-28 15:46       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v67fsuhRnGp7X8PDkH_t_gb+gPb6VrY-pVu0B4HhD6d8qA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-28 15:57           ` Icenowy Zheng
     [not found]             ` <244591488297463-TUpq1W2QCG9xpj1cXAZ9Bg@public.gmane.org>
2017-02-28 16:10               ` Chen-Yu Tsai
     [not found]                 ` <CAGb2v64cu8Jz6PZ7mZ7Atw9jS7xaaG+8MSv+NX_6nKNmyyXotQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-28 16:23                   ` Icenowy Zheng
2017-02-28 16:07           ` Icenowy Zheng [this message]
2017-02-28 15:27   ` [PATCH 3/3] ARM: dts: sun8i: enable USB OTG on Orange Pi One Icenowy Zheng
2017-02-28 15:42   ` [PATCH 1/3] phy: sun4i-usb: support automatically switch PHY0 route to MUSB/HCI Chen-Yu Tsai
2017-02-28 23:46   ` Hans de Goede

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=59571488298068@web6j.yandex.ru \
    --to=icenowy-ymacfijhrkm@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox