diff mbox

ARM: zynq: DT: Add USB to device tree

Message ID 1417459352-23401-1-git-send-email-soren.brinkmann@xilinx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Soren Brinkmann Dec. 1, 2014, 6:42 p.m. UTC
Add USB nodes to zc702, zc706 and zed device trees.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
 arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
 arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
 arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
 arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
 4 files changed, 52 insertions(+), 1 deletion(-)

Comments

Andreas Färber Dec. 1, 2014, 8:26 p.m. UTC | #1
Hi Sören,

Am 01.12.2014 um 19:42 schrieb Soren Brinkmann:
> Add USB nodes to zc702, zc706 and zed device trees.
> 
> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> ---
>  arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
>  arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
>  arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
>  arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
>  4 files changed, 52 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
> index ce2ef5bec4f2..9ed60938f301 100644
> --- a/arch/arm/boot/dts/zynq-7000.dtsi
> +++ b/arch/arm/boot/dts/zynq-7000.dtsi
> @@ -315,6 +315,26 @@
>  			clocks = <&clkc 4>;
>  		};
>  
> +		usb0: usb@e0002000 {
> +			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
> +			status = "disabled";
> +			clocks = <&clkc 28>;
> +			interrupt-parent = <&intc>;
> +			interrupts = <0 21 4>;
> +			reg = <0xe0002000 0x1000>;
> +			phy_type = "ulpi";
> +		};
> +
> +		usb1: usb@e0003000 {
> +			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
> +			status = "disabled";
> +			clocks = <&clkc 29>;
> +			interrupt-parent = <&intc>;
> +			interrupts = <0 44 4>;
> +			reg = <0xe0003000 0x1000>;
> +			phy_type = "ulpi";
> +		};
> +
>  		watchdog0: watchdog@f8005000 {
>  			clocks = <&clkc 45>;
>  			compatible = "xlnx,zynq-wdt-r1p2";

This part looks good.

> @@ -324,6 +344,6 @@
>  			reg = <0xf8005000 0x1000>;
>  			reset = <0>;
>  			timeout-sec = <10>;
> -		};
> +		} ;
>  	};
>  };

Unrelated accidental change here though. :)

Did I miss a matching series actually implementing the driver? I'd need
to test the latest version to determine how to update the Parallella
device tree - I assume that USB0 is in dr_mode="host", but with the
previous patchsets I was unable to verify. CC'ing Ola.

Regards,
Andreas
Soren Brinkmann Dec. 1, 2014, 9:24 p.m. UTC | #2
On Mon, 2014-12-01 at 09:26PM +0100, Andreas Färber wrote:
> Hi Sören,
> 
> Am 01.12.2014 um 19:42 schrieb Soren Brinkmann:
> > Add USB nodes to zc702, zc706 and zed device trees.
> > 
> > Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> > ---
> >  arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
> >  arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
> >  arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
> >  arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
> >  4 files changed, 52 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
> > index ce2ef5bec4f2..9ed60938f301 100644
> > --- a/arch/arm/boot/dts/zynq-7000.dtsi
> > +++ b/arch/arm/boot/dts/zynq-7000.dtsi
> > @@ -315,6 +315,26 @@
> >  			clocks = <&clkc 4>;
> >  		};
> >  
> > +		usb0: usb@e0002000 {
> > +			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
> > +			status = "disabled";
> > +			clocks = <&clkc 28>;
> > +			interrupt-parent = <&intc>;
> > +			interrupts = <0 21 4>;
> > +			reg = <0xe0002000 0x1000>;
> > +			phy_type = "ulpi";
> > +		};
> > +
> > +		usb1: usb@e0003000 {
> > +			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
> > +			status = "disabled";
> > +			clocks = <&clkc 29>;
> > +			interrupt-parent = <&intc>;
> > +			interrupts = <0 44 4>;
> > +			reg = <0xe0003000 0x1000>;
> > +			phy_type = "ulpi";
> > +		};
> > +
> >  		watchdog0: watchdog@f8005000 {
> >  			clocks = <&clkc 45>;
> >  			compatible = "xlnx,zynq-wdt-r1p2";
> 
> This part looks good.
> 
> > @@ -324,6 +344,6 @@
> >  			reg = <0xf8005000 0x1000>;
> >  			reset = <0>;
> >  			timeout-sec = <10>;
> > -		};
> > +		} ;
> >  	};
> >  };
> 
> Unrelated accidental change here though. :)
> 
> Did I miss a matching series actually implementing the driver? I'd need
> to test the latest version to determine how to update the Parallella
> device tree - I assume that USB0 is in dr_mode="host", but with the
> previous patchsets I was unable to verify. CC'ing Ola.

It was merged to the USB tree recently. I tested this on linux-next.

	Sören
Arnd Bergmann Dec. 1, 2014, 9:26 p.m. UTC | #3
On Monday 01 December 2014 10:42:32 Soren Brinkmann wrote:
> +       usb_phy0: usb-phy@0 {
> +               compatible = "usb-nop-xceiv";
> +               #phy-cells = <0>;
> +       };
>  };

As discussed in an unrelated thread today, please drop the "@0" in the
node name, since the device has no 'reg' property.

Otherwise looks good.

	Arnd
Soren Brinkmann Dec. 1, 2014, 9:51 p.m. UTC | #4
Hi Arnd,

On Mon, 2014-12-01 at 10:26PM +0100, Arnd Bergmann wrote:
> On Monday 01 December 2014 10:42:32 Soren Brinkmann wrote:
> > +       usb_phy0: usb-phy@0 {
> > +               compatible = "usb-nop-xceiv";
> > +               #phy-cells = <0>;
> > +       };
> >  };
> 
> As discussed in an unrelated thread today, please drop the "@0" in the
> node name, since the device has no 'reg' property.

What is the best practice for naming such nodes then? On these boards
it's not the case, but Zynq has two USB cores. So, there may be DTs that
will have two phys in there. Would we just do 'usb-phy-0'?

	Thanks,
	Sören
Soren Brinkmann Dec. 1, 2014, 10:56 p.m. UTC | #5
On Mon, 2014-12-01 at 01:24PM -0800, Sören Brinkmann wrote:
> On Mon, 2014-12-01 at 09:26PM +0100, Andreas Färber wrote:
> > Hi Sören,
> > 
> > Am 01.12.2014 um 19:42 schrieb Soren Brinkmann:
> > > Add USB nodes to zc702, zc706 and zed device trees.
> > > 
> > > Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> > > ---
> > >  arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
> > >  arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
> > >  arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
> > >  arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
> > >  4 files changed, 52 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
> > > index ce2ef5bec4f2..9ed60938f301 100644
> > > --- a/arch/arm/boot/dts/zynq-7000.dtsi
> > > +++ b/arch/arm/boot/dts/zynq-7000.dtsi
[...]
> > > @@ -324,6 +344,6 @@
> > >  			reg = <0xf8005000 0x1000>;
> > >  			reset = <0>;
> > >  			timeout-sec = <10>;
> > > -		};
> > > +		} ;
> > >  	};
> > >  };
> > 
> > Unrelated accidental change here though. :)

Since a v2 is needed now, does this really require a dedicated patch to
fix this bogus space here or do we just look the other way?

	Thanks,
	Sören
Andreas Färber Dec. 1, 2014, 11:14 p.m. UTC | #6
Am 01.12.2014 um 23:56 schrieb Sören Brinkmann:
> On Mon, 2014-12-01 at 01:24PM -0800, Sören Brinkmann wrote:
>> On Mon, 2014-12-01 at 09:26PM +0100, Andreas Färber wrote:
>>> Am 01.12.2014 um 19:42 schrieb Soren Brinkmann:
>>>> Add USB nodes to zc702, zc706 and zed device trees.
>>>>
>>>> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
>>>> ---
>>>>  arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
>>>>  arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
>>>>  arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
>>>>  arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
>>>>  4 files changed, 52 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
>>>> index ce2ef5bec4f2..9ed60938f301 100644
>>>> --- a/arch/arm/boot/dts/zynq-7000.dtsi
>>>> +++ b/arch/arm/boot/dts/zynq-7000.dtsi
> [...]
>>>> @@ -324,6 +344,6 @@
>>>>  			reg = <0xf8005000 0x1000>;
>>>>  			reset = <0>;
>>>>  			timeout-sec = <10>;
>>>> -		};
>>>> +		} ;
>>>>  	};
>>>>  };
>>>
>>> Unrelated accidental change here though. :)
> 
> Since a v2 is needed now, does this really require a dedicated patch to
> fix this bogus space here or do we just look the other way?

Sorry, I don't understand the question: If as you say a v2 is needed,
why knowingly introduce a space between } and ; in your patch? Maybe I'm
missing something or you're looking at the patch in reverse...?

Andreas
Soren Brinkmann Dec. 1, 2014, 11:16 p.m. UTC | #7
On Tue, 2014-12-02 at 12:14AM +0100, Andreas Färber wrote:
> Am 01.12.2014 um 23:56 schrieb Sören Brinkmann:
> > On Mon, 2014-12-01 at 01:24PM -0800, Sören Brinkmann wrote:
> >> On Mon, 2014-12-01 at 09:26PM +0100, Andreas Färber wrote:
> >>> Am 01.12.2014 um 19:42 schrieb Soren Brinkmann:
> >>>> Add USB nodes to zc702, zc706 and zed device trees.
> >>>>
> >>>> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> >>>> ---
> >>>>  arch/arm/boot/dts/zynq-7000.dtsi | 22 +++++++++++++++++++++-
> >>>>  arch/arm/boot/dts/zynq-zc702.dts | 11 +++++++++++
> >>>>  arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++
> >>>>  arch/arm/boot/dts/zynq-zed.dts   | 10 ++++++++++
> >>>>  4 files changed, 52 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
> >>>> index ce2ef5bec4f2..9ed60938f301 100644
> >>>> --- a/arch/arm/boot/dts/zynq-7000.dtsi
> >>>> +++ b/arch/arm/boot/dts/zynq-7000.dtsi
> > [...]
> >>>> @@ -324,6 +344,6 @@
> >>>>  			reg = <0xf8005000 0x1000>;
> >>>>  			reset = <0>;
> >>>>  			timeout-sec = <10>;
> >>>> -		};
> >>>> +		} ;
> >>>>  	};
> >>>>  };
> >>>
> >>> Unrelated accidental change here though. :)
> > 
> > Since a v2 is needed now, does this really require a dedicated patch to
> > fix this bogus space here or do we just look the other way?
> 
> Sorry, I don't understand the question: If as you say a v2 is needed,
> why knowingly introduce a space between } and ; in your patch? Maybe I'm
> missing something or you're looking at the patch in reverse...?

Oh, I thought I was removing it... That must have been some merge error.
Forget what I said. This part will vanish.

	Sören
Arnd Bergmann Dec. 2, 2014, 9:13 a.m. UTC | #8
On Monday 01 December 2014 13:51:26 Sören Brinkmann wrote:
> Hi Arnd,
> 
> On Mon, 2014-12-01 at 10:26PM +0100, Arnd Bergmann wrote:
> > On Monday 01 December 2014 10:42:32 Soren Brinkmann wrote:
> > > +       usb_phy0: usb-phy@0 {
> > > +               compatible = "usb-nop-xceiv";
> > > +               #phy-cells = <0>;
> > > +       };
> > >  };
> > 
> > As discussed in an unrelated thread today, please drop the "@0" in the
> > node name, since the device has no 'reg' property.
> 
> What is the best practice for naming such nodes then? On these boards
> it's not the case, but Zynq has two USB cores. So, there may be DTs that
> will have two phys in there. Would we just do 'usb-phy-0'?
> 
> 

Grant recommended naming them "phy0" and "phy1" in this case.
The recommended node name for a phy is "phy", not "usb-phy" (I didn't
notice that earlier, but it makes sense to change both), and
I would not use a dash for the number there.

	Arnd
diff mbox

Patch

diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index ce2ef5bec4f2..9ed60938f301 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -315,6 +315,26 @@ 
 			clocks = <&clkc 4>;
 		};
 
+		usb0: usb@e0002000 {
+			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
+			status = "disabled";
+			clocks = <&clkc 28>;
+			interrupt-parent = <&intc>;
+			interrupts = <0 21 4>;
+			reg = <0xe0002000 0x1000>;
+			phy_type = "ulpi";
+		};
+
+		usb1: usb@e0003000 {
+			compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
+			status = "disabled";
+			clocks = <&clkc 29>;
+			interrupt-parent = <&intc>;
+			interrupts = <0 44 4>;
+			reg = <0xe0003000 0x1000>;
+			phy_type = "ulpi";
+		};
+
 		watchdog0: watchdog@f8005000 {
 			clocks = <&clkc 45>;
 			compatible = "xlnx,zynq-wdt-r1p2";
@@ -324,6 +344,6 @@ 
 			reg = <0xf8005000 0x1000>;
 			reset = <0>;
 			timeout-sec = <10>;
-		};
+		} ;
 	};
 };
diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts
index 94e2cda6f9b6..690d2b6bbada 100644
--- a/arch/arm/boot/dts/zynq-zc702.dts
+++ b/arch/arm/boot/dts/zynq-zc702.dts
@@ -36,6 +36,11 @@ 
 			linux,default-trigger = "heartbeat";
 		};
 	};
+
+	usb_phy0: usb-phy@0 {
+		compatible = "usb-nop-xceiv";
+		#phy-cells = <0>;
+	};
 };
 
 &can0 {
@@ -135,3 +140,9 @@ 
 &uart1 {
 	status = "okay";
 };
+
+&usb0 {
+	status = "okay";
+	dr_mode = "host";
+	usb-phy = <&usb_phy0>;
+};
diff --git a/arch/arm/boot/dts/zynq-zc706.dts b/arch/arm/boot/dts/zynq-zc706.dts
index a8bbdfbc7093..e383c0a3f314 100644
--- a/arch/arm/boot/dts/zynq-zc706.dts
+++ b/arch/arm/boot/dts/zynq-zc706.dts
@@ -27,6 +27,10 @@ 
 		bootargs = "console=ttyPS0,115200 earlyprintk";
 	};
 
+	usb_phy0: usb-phy@0 {
+		compatible = "usb-nop-xceiv";
+		#phy-cells = <0>;
+	};
 };
 
 &gem0 {
@@ -114,3 +118,9 @@ 
 &uart1 {
 	status = "okay";
 };
+
+&usb0 {
+	status = "okay";
+	dr_mode = "host";
+	usb-phy = <&usb_phy0>;
+};
diff --git a/arch/arm/boot/dts/zynq-zed.dts b/arch/arm/boot/dts/zynq-zed.dts
index 697779a353ed..b08ae18ad854 100644
--- a/arch/arm/boot/dts/zynq-zed.dts
+++ b/arch/arm/boot/dts/zynq-zed.dts
@@ -27,6 +27,10 @@ 
 		bootargs = "console=ttyPS0,115200 earlyprintk";
 	};
 
+	usb_phy0: usb-phy@0 {
+		compatible = "usb-nop-xceiv";
+		#phy-cells = <0>;
+	};
 };
 
 &gem0 {
@@ -46,3 +50,9 @@ 
 &uart1 {
 	status = "okay";
 };
+
+&usb0 {
+	status = "okay";
+	dr_mode = "host";
+	usb-phy = <&usb_phy0>;
+};