From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Dack Subject: Re: [PATCH] ARM: dts: sun8i-h3-orangepi-plus: Enable USB host controllers Date: Mon, 23 Nov 2015 14:20:10 -0800 (PST) Message-ID: References: <1447616777-24660-1-git-send-email-hdegoede@redhat.com> <1447616777-24660-5-git-send-email-hdegoede@redhat.com> <56498FA8.3050908@redhat.com> <564B51D7.7090500@gmail.com> Reply-To: troy-yfroEPzt3eC6c6uEtOJ/EA@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6910_766272508.1448317210926" Return-path: In-Reply-To: <564B51D7.7090500-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: linux-sunxi Cc: hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, wens-jdAy2FN1RRM@public.gmane.org, kishon-l0cyMroinI0@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org, patchesrdh-I1/eAgTnXDYAvxtiuMwx3w@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org ------=_Part_6910_766272508.1448317210926 Content-Type: multipart/alternative; boundary="----=_Part_6911_518773576.1448317210927" ------=_Part_6911_518773576.1448317210927 Content-Type: text/plain; charset=UTF-8 On Wednesday, 18 November 2015 03:12:11 UTC+11, Jens Kuske wrote: > > Enable the 2 USB host controllers used on the Orange Pi Plus > and add the necessary regulators. > > Signed-off-by: Reinder de Haan > > Signed-off-by: Hans de Goede > > Signed-off-by: Jens Kuske > > --- > > Hi Hans, > > with these regulators USB works on the Orange Pi Plus too. > I don't know if adding the regulators in the dts is okay, since most > regulators are defined in the sunxi-common-regulators.dtsi, but > we use different pins. > > Jens > > > arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 44 > ++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts > b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts > index e67df59..1cb6c66 100644 > --- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts > +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts > @@ -58,6 +58,35 @@ > chosen { > stdout-path = "serial0:115200n8"; > }; > + > + reg_usb3_vbus: usb3-vbus { > + compatible = "regulator-fixed"; > + pinctrl-names = "default"; > + pinctrl-0 = <&usb3_vbus_pin_a>; > + regulator-name = "usb3-vbus"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + regulator-boot-on; > + enable-active-high; > + gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; > + }; > +}; > + > +&ehci1 { > + status = "okay"; > +}; > + > +&ehci3 { > + status = "okay"; > +}; > + > +&pio { > + usb3_vbus_pin_a: usb3_vbus_pin@0 { > + allwinner,pins = "PG11"; > + allwinner,function = "gpio_out"; > + allwinner,drive = ; > + allwinner,pull = ; > + }; > }; > > &mmc0 { > @@ -70,8 +99,23 @@ > status = "okay"; > }; > > +®_usb1_vbus { > + gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; > + status = "okay"; > +}; > + > &uart0 { > pinctrl-names = "default"; > pinctrl-0 = <&uart0_pins_a>; > status = "okay"; > }; > + > +&usb1_vbus_pin_a { > + allwinner,pins = "PG13"; > +}; > + > +&usbphy { > + usb1_vbus-supply = <®_usb1_vbus>; > + usb3_vbus-supply = <®_usb3_vbus>; > + status = "okay"; > +}; > I've been trying to test these patches by using Hans' github sunxi-wip branches of the kernel and U-Boot. U-Boot at commit 7e17fd2 "suxni: Add support for Orangepi Plus and Orangepi PC boards" Kernel at commit cb45b8 "ARM: dts: sun8i-h3-orangepi-plus: Enable USB host controllers" Both have been built using the default defconfig for an OrangePi Plus U-Boot starts and successfully boots the kernel, but the kernel does not appear to boot fully and hangs at: [ 0.861175] cpu cpu0: failed to get cpu0 clock: -2 [ 0.865973] cpufreq-dt: probe of cpufreq-dt failed with error -2 [ 0.872017] Registering SWP/SWPB emulation handler Full boot log: http://pastebin.com/VGkEix9p Building the kernel (or just using a dab) with the dts from commit 0a8c01 "ARM: dts: sun8i: Add Orange Pi Plus support" results in the kernel booting fully to a login prompt. Of course without enabled/working USB. There is a fair chance I've done something wrong that is causing this. Any advice on how to get a bootable kernel? Thanks, Troy -- 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. ------=_Part_6911_518773576.1448317210927 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Wednesday, 18 November 2015 03:12:11 UTC+11, Jens Kuske wrote:<= blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord= er-left: 1px #ccc solid;padding-left: 1ex;">Enable the 2 USB host controlle= rs used on the Orange Pi Plus
and add the necessary regulators.

Signed-off-by: Reinder de Haan <patch...-I1/eAgTnXDYAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Hans de Goede <hdeg...-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jens Kuske <jens...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

Hi Hans,

with these regulators USB works on the Orange Pi Plus too.
I don't know if adding the regulators in the dts is okay, since mos= t
regulators are defined in the sunxi-common-regulators.dtsi, but
we use different pins.

Jens


=C2=A0arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 44 ++++++++++= ++++++++++++++++++
=C2=A01 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/a= rm/boot/dts/sun8i-h3-orangepi-plus.dts
index e67df59..1cb6c66 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -58,6 +58,35 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0chosen {
=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=A0stdout-path =3D "serial0:115200n8&quo= t;;
=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_usb3_vbus: usb3-vb= us {
+=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 "regulator-fixed";
+=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=A0pinctrl-names =3D "default";
+=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=A0pinctrl-0 =3D <&usb3_vbus_pin_a>;
+=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=A0regulator-name =3D "usb3-vbus";
+=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=A0regulator-min-microvolt =3D <5000000>= ;
+=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=A0regulator-max-microvolt =3D <5000000>= ;
+=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=A0regulator-boot-on;
+=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=A0enable-active-high;
+=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=A0gpio =3D <&pio 6 11 GPIO_ACTIVE_HIGH>;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0};
+};
+
+&ehci1 {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "okay&= quot;;
+};
+
+&ehci3 {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "okay&= quot;;
+};
+
+&pio {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0usb3_vbus_pin_a: usb3_= vbus_pin@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=A0allwinner,pins =3D "PG11";
+=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=A0allwinner,function =3D "gpio_out"= ;
+=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=A0allwinner,drive =3D <SUN4I_PINCTRL_10_MA= >;
+=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=A0allwinner,pull =3D <SUN4I_PINCTRL_NO_PUL= L>;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0};
=C2=A0};
=C2=A0
=C2=A0&mmc0 {
@@ -70,8 +99,23 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "= okay";
=C2=A0};
=C2=A0
+&reg_usb1_vbus {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0gpio =3D <&pio = 6 13 GPIO_ACTIVE_HIGH>;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "okay&= quot;;
+};
+
=C2=A0&uart0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pinctrl-names =3D= "default";
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pinctrl-0 =3D <= ;&uart0_pins_a>;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "= okay";
=C2=A0};
+
+&usb1_vbus_pin_a {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0allwinner,pins =3D &qu= ot;PG13";
+};
+
+&usbphy {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0usb1_vbus-supply =3D &= lt;&reg_usb1_vbus>;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0usb3_vbus-supply =3D &= lt;&reg_usb3_vbus>;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0status =3D "okay&= quot;;
+};

I've been trying to test these pat= ches by using Hans' github sunxi-wip branches of the kernel and U-Boot.=

U-Boot at commit=C2=A07e17fd2 "suxni: Add su= pport for Orangepi Plus and Orangepi PC boards"
Kernel at co= mmit=C2=A0cb45b8 =C2=A0"ARM: dts: sun8i-h3-orangepi-plus: Enable USB h= ost controllers"

Both have been built using t= he default defconfig for an OrangePi Plus

U-Boot s= tarts and successfully boots the kernel, but the kernel does not appear to = boot fully and hangs at:

[ =C2=A0 =C2=A00.861= 175] cpu cpu0: failed to get cpu0 clock: -2
[ =C2=A0 =C2=A00.8659= 73] cpufreq-dt: probe of cpufreq-dt failed with error -2
[ =C2=A0= =C2=A00.872017] Registering SWP/SWPB emulation handler
Full boot log:=C2=A0http://pastebin.com/VGkEix9p

=
Building the kernel (or just using a dab) with the dts from comm= it=C2=A00a8c01 "ARM: dts: sun8i: Add Orange Pi Plus support" resu= lts in the kernel booting fully to a login prompt. =C2=A0Of course without = enabled/working USB.

There is a fair chance I'= ve done something wrong that is causing this. =C2=A0Any advice on how to ge= t a bootable kernel?

Thanks,
=C2=A0 =C2= =A0Troy

--
You received this message because you are subscribed to the Google Groups &= quot;linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to linux-s= unxi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_6911_518773576.1448317210927-- ------=_Part_6910_766272508.1448317210926--