From mboxrd@z Thu Jan 1 00:00:00 1970 From: Icenowy Zheng Subject: Re: [PATCH 2/3] ARM: dts: sun8i: add usb_otg and OHCI/EHCI for usbc0 on H3 Date: Tue, 28 Feb 2017 23:57:43 +0800 Message-ID: <244591488297463@web16h.yandex.ru> References: <20170228152702.42602-1-icenowy@aosc.xyz> <20170228152702.42602-2-icenowy@aosc.xyz> Reply-To: icenowy-ymACFijhrKM@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: "wens-jdAy2FN1RRM@public.gmane.org" Cc: Maxime Ripard , Kishon Vijay Abraham I , Hans de Goede , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi List-Id: devicetree@vger.kernel.org 28.02.2017, 23:46, "Chen-Yu Tsai" : > On Tue, Feb 28, 2017 at 11:27 PM, Icenowy Zheng wrote: >> =C2=A0Allwinner H3 have a dual-routed USB PHY0 -- routed to either OHCI/= EHCI >> =C2=A0or MUSB controller. >> >> =C2=A0Add device nodes for these controllers. >> >> =C2=A0Signed-off-by: Icenowy Zheng >> =C2=A0--- >> =C2=A0=C2=A0arch/arm/boot/dts/sun8i-h3.dtsi | 36 +++++++++++++++++++++++= +++++++++++++ >> =C2=A0=C2=A01 file changed, 36 insertions(+) >> >> =C2=A0diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/s= un8i-h3.dtsi >> =C2=A0index 27780b97c863..bc9a53edf371 100644 >> =C2=A0--- a/arch/arm/boot/dts/sun8i-h3.dtsi >> =C2=A0+++ b/arch/arm/boot/dts/sun8i-h3.dtsi >> =C2=A0@@ -206,6 +206,19 @@ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0#size-cells =3D <0>; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}; >> >> =C2=A0+ usb_otg: usb@01c19000 { >> =C2=A0+ compatible =3D "allwinner,sun8i-h3-musb"; >> =C2=A0+ reg =3D <0x01c19000 0x0400>; >> =C2=A0+ clocks =3D <&ccu CLK_BUS_OTG>; >> =C2=A0+ resets =3D <&ccu RST_BUS_OTG>; >> =C2=A0+ interrupts =3D ; >> =C2=A0+ interrupt-names =3D "mc"; >> =C2=A0+ phys =3D <&usbphy 0>; >> =C2=A0+ phy-names =3D "usb"; >> =C2=A0+ extcon =3D <&usbphy 0>; >> =C2=A0+ status =3D "disabled"; >> =C2=A0+ }; >> =C2=A0+ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0usbphy: phy@01c19400 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0compatible =3D "allwinner,sun8i-h3-usb-phy"; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0reg =3D <0x01c19400 0x2c>, >> =C2=A0@@ -238,6 +251,29 @@ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0#phy-cells =3D <1>; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}; >> >> =C2=A0+ ehci0: usb@01c1a000 { >> =C2=A0+ compatible =3D "allwinner,sun8i-h3-ehci", "generic-ehci"; >> =C2=A0+ reg =3D <0x01c1a000 0x100>; >> =C2=A0+ interrupts =3D ; >> =C2=A0+ clocks =3D <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; >> =C2=A0+ resets =3D <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; >> =C2=A0+ phys =3D <&usbphy 0>; >> =C2=A0+ phy-names =3D "usb"; > > So this bit is slightly concerning. IIRC the xHCI drivers power on the ph= y 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 rewor= k > either the phy or the musb driver to cope with this. > > Or maybe just dropping the phy handle here and letting the musb driver ha= ndle > it would work, but that requires the musb driver be loaded. In fact the MUSB driver is always needed -- to set the dr_mode. And currently MUSB driver can take over the USB bus even if it's host-only = by forcing its mode in sysfs.=20 > > ChenYu > >> =C2=A0+ status =3D "disabled"; >> =C2=A0+ }; >> =C2=A0+ >> =C2=A0+ ohci0: usb@01c1a400 { >> =C2=A0+ compatible =3D "allwinner,sun8i-h3-ohci", "generic-ohci"; >> =C2=A0+ reg =3D <0x01c1a400 0x100>; >> =C2=A0+ interrupts =3D ; >> =C2=A0+ clocks =3D <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, >> =C2=A0+ <&ccu CLK_USB_OHCI0>; >> =C2=A0+ resets =3D <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; >> =C2=A0+ phys =3D <&usbphy 0>; >> =C2=A0+ phy-names =3D "usb"; >> =C2=A0+ status =3D "disabled"; >> =C2=A0+ }; >> =C2=A0+ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ehci1: usb@01c1b000 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0compatible =3D "allwinner,sun8i-h3-ehci", "generic-ehci"; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0reg =3D <0x01c1b000 0x100>; >> =C2=A0-- >> =C2=A02.11.1 >> >> =C2=A0-- >> =C2=A0You received this message because you are subscribed to the Google= Groups "linux-sunxi" group. >> =C2=A0To unsubscribe from this group and stop receiving emails from it, = send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> =C2=A0For 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. --=20 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 e= mail to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout.