Skip to contentSkip to conversation

arm: dts: zynq: Move crystal freq. to board level

PATCH In review Peter Crosthwaite 3 participants 11 messages Nov 9, 2014 – Nov 28, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: dts: zynq: Move crystal freq. to board level

The fact that all supported boards use the same 33MHz crystal is a co-incidence. The Zynq PS support a range of crystal freqs so the hardcoded setting should be removed from the dtsi. Re-implement it on the board level.

This prepares support for Zynq boards with different crystal frequencies (e.g. the Digilent ZYBO).

---
Im guessing long term this should be converted to a fixed clock. But I think this at least steps in that direction.

---
 arch/arm/boot/dts/zynq-7000.dtsi      | 1 -
 arch/arm/boot/dts/zynq-parallella.dts | 4 ++++
 arch/arm/boot/dts/zynq-zc702.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zc706.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zed.dts        | 4 ++++
 5 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/boot/dts/zynq-7000.dtsi +0 -1
index ce2ef5b..ee3e5d6 100644
@@ -243,7 +243,6 @@
 			clkc: clkc@100 {
 				#clock-cells = <1>;
 				compatible = "xlnx,ps7-clkc";
-				ps-clk-frequency = <33333333>;
 				fclk-enable = <0>;
 				clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
 						"cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
arch/arm/boot/dts/zynq-parallella.dts +4 -0
index e1f51ca..cd84d45 100644
@@ -83,3 +83,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc702.dts +4 -0
index 94e2cda..24dcece 100644
@@ -135,3 +135,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc706.dts +4 -0
index a8bbdfb..7b88399 100644
@@ -114,3 +114,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zed.dts +4 -0
index 697779a..4662da2 100644
@@ -46,3 +46,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 arm: dts: zynq: Add Digilent ZYBO board

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with a 50MHz crystal instead of 33MHz.

---
 arch/arm/boot/dts/Makefile      |  3 ++-
 arch/arm/boot/dts/zynq-zybo.dts | 52 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/zynq-zybo.dts
arch/arm/boot/dts/Makefile +2 -1
index d872062..e5e77f3 100644
@@ -500,7 +500,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \
 	zynq-parallella.dtb \
 	zynq-zc702.dtb \
 	zynq-zc706.dtb \
-	zynq-zed.dtb
+	zynq-zed.dtb \
+	zynq-zybo.dtb
 dtb-$(CONFIG_MACH_ARMADA_370) += \
 	armada-370-db.dtb \
 	armada-370-mirabox.dtb \
arch/arm/boot/dts/zynq-zybo.dts new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+	model = "Zynq ZYBO Development Board";
+	compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be a digilent vendor prefix.

Everything else looks pretty straight forward and good.

Soren

#3 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Quoted 7 lines · Sören Brinkmann

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

Quoted 8 lines

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+     model = "Zynq ZYBO Development Board";
+     compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be a digilent vendor prefix.

Was going for consistency with ZED which also makes this mistake:

    model = "Zynq Zed Development Board";
    compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";

We have to choose between consistency and correctness. If we do fix it though, what is Diglent's four-letter vendor prefix?

Regards,
Peter

Quoted 3 lines

Everything else looks pretty straight forward and good.

Soren

#4 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Quoted 18 lines · Peter Crosthwaite
Quoted 7 lines · Sören Brinkmann

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

Quoted 8 lines

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+     model = "Zynq ZYBO Development Board";
+     compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be a digilent vendor prefix.

Quoted 7 lines

Was going for consistency with ZED which also makes this mistake:

    model = "Zynq Zed Development Board";
    compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";

We have to choose between consistency and correctness. If we do fix it though, what is Diglent's four-letter vendor prefix?

Since Digilent is the board vendor, I'm for using the appropriate prefix. Vendor prefixes are found in Documentation/devicetree/bindings/vendor-prefixes.txt.

Soren

#5 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Quoted 24 lines · Sören Brinkmann
Quoted 23 lines · Peter Crosthwaite
Quoted 7 lines · Sören Brinkmann

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

Quoted 8 lines

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+     model = "Zynq ZYBO Development Board";
+     compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be a digilent vendor prefix.

Was going for consistency with ZED which also makes this mistake:

    model = "Zynq Zed Development Board";
    compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";
Quoted 7 lines
Quoted 2 lines

We have to choose between consistency and correctness. If we do fix it though, what is Diglent's four-letter vendor prefix?

Since Digilent is the board vendor, I'm for using the appropriate prefix. Vendor prefixes are found in Documentation/devicetree/bindings/vendor-prefixes.txt.

It's not there,

Steven, does Digilent have a preferred dts vendor prefix?

Regards,
Peter

Quoted 1 line

Soren

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Hi,

I think you can simple use "digilent".
The first step is to send the patch with add digilent to Documentation/devicetree/bindings/vendor-prefixes.txt

and then feel free to send patch for fixing digilent,zed
+ zybo dts.

Thanks,
Michal

Quoted 64 lines · Steve Wang

Hi, Peter,

According to naming convention, I think "dglnt" is good enough ^.^

By the way, I think there is a need to address another issue that needs to be addressed for ZYBO as well (maybe in a separate thread):
MAC address pre-load from on-board EEPROM.
I think ZYBO might still be the only Zynq-based board that has an on-board EEPROM for MAC address as well.

Regards,
Steve

-----Peter Crosthwaite <[email protected]> wrote: -----
To: Sören Brinkmann <[email protected]>, Steve Wang <[email protected]>
From: Peter Crosthwaite <[email protected]>
Date: 11/10/2014 02:56PM
Cc: [email protected], [email protected], [email protected]
Subject: Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Quoted 24 lines · Sören Brinkmann
Quoted 23 lines · Peter Crosthwaite
Quoted 7 lines · Sören Brinkmann

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

Quoted 8 lines

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+     model = "Zynq ZYBO Development Board";
+     compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be a digilent vendor prefix.

Was going for consistency with ZED which also makes this mistake:

    model = "Zynq Zed Development Board";
    compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";
Quoted 7 lines
Quoted 2 lines

We have to choose between consistency and correctness. If we do fix it though, what is Diglent's four-letter vendor prefix?

Since Digilent is the board vendor, I'm for using the appropriate prefix. Vendor prefixes are found in Documentation/devicetree/bindings/vendor-prefixes.txt.

It's not there,

Steven, does Digilent have a preferred dts vendor prefix?

Regards,
Peter

Quoted 1 line

Soren

#8 lore raw

Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

In reply to a message not in the archive

Hi Steve,

Quoted 7 lines · Steve Wang

Hi, Peter,

According to naming convention, I think "dglnt" is good enough ^.^

By the way, I think there is a need to address another issue that needs to be addressed for ZYBO as well (maybe in a separate thread):
MAC address pre-load from on-board EEPROM.

So i'm not doing any networking work so I don't have visibility of this feature. My understanding though is its an extra feature and default networking behaviour provided by the SoC should still be functional making this follow up work?

The alternative would be to disable gem in the dts on first commit.

Quoted 3 lines

I think ZYBO might still be the only Zynq-based board that has an on-board EEPROM for MAC address as well.

Is that just software policy though? Should there be DTS level awareness of MAC address via EEPROM contents or should the dts just describe the EEPROM?

Regards,
Peter

Quoted 55 lines

Regards,
Steve

-----Peter Crosthwaite <[email protected]> wrote: -----
To: Sören Brinkmann <[email protected]>, Steve Wang <[email protected]>
From: Peter Crosthwaite <[email protected]>
Date: 11/10/2014 02:56PM
Cc: [email protected], [email protected], [email protected]
Subject: Re: [PATCH 2/2] arm: dts: zynq: Add Digilent ZYBO board

Quoted 25 lines · Sören Brinkmann
Quoted 24 lines · Peter Crosthwaite
Quoted 7 lines · Sören Brinkmann

Hi Peter,

Quoted 1 line · Peter Crosthwaite

Add a DTS describing the Digilent ZYBO board. Similar to ZED but with

"Digilent ZYBO" here...

Quoted 9 lines

[...]

arch/arm/boot/dts/zynq-zybo.dts line 19

Quoted 3 lines
arch/arm/boot/dts/zynq-zybo.dts new file +3 -0
+/ {
+     model = "Zynq ZYBO Development Board";
+     compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";

... "xlnx,zynq-zybo" here. Seems inconsistent. IMHO, there should rather be
a digilent vendor prefix.

Was going for consistency with ZED which also makes this mistake:

    model = "Zynq Zed Development Board";
    compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";
Quoted 7 lines
Quoted 2 lines

We have to choose between consistency and correctness. If we do fix it though, what is Diglent's four-letter vendor prefix?

Since Digilent is the board vendor, I'm for using the appropriate prefix. Vendor prefixes are found in Documentation/devicetree/bindings/vendor-prefixes.txt.

It's not there,

Steven, does Digilent have a preferred dts vendor prefix?

Regards,
Peter

Quoted 1 line

Soren

Acked-by on v1 1/2
#9 lore raw
In reply to Peter Crosthwaite
Quoted 7 lines · Peter Crosthwaite

The fact that all supported boards use the same 33MHz crystal is a co-incidence. The Zynq PS support a range of crystal freqs so the hardcoded setting should be removed from the dtsi. Re-implement it on the board level.

This prepares support for Zynq boards with different crystal frequencies (e.g. the Digilent ZYBO).

Even with the 33MHz in the dtsi you can override it on the board-level. Just like the 'status' property is overriden in board dts files.

Quoted 6 lines

---
Im guessing long term this should be converted to a fixed clock. But I think this at least steps in that direction.

I was against that since it makes juggling with clock names more difficult. The problem is that the CCF uses a global name space of clock names. Not having the oscillator as fixed-clock in DT removed that additional complexity. But it would be possible, I guess.

Quoted 61 lines
---
 arch/arm/boot/dts/zynq-7000.dtsi      | 1 -
 arch/arm/boot/dts/zynq-parallella.dts | 4 ++++
 arch/arm/boot/dts/zynq-zc702.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zc706.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zed.dts        | 4 ++++
 5 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/boot/dts/zynq-7000.dtsi +0 -1
index ce2ef5b..ee3e5d6 100644
@@ -243,7 +243,6 @@
 			clkc: clkc@100 {
 				#clock-cells = <1>;
 				compatible = "xlnx,ps7-clkc";
-				ps-clk-frequency = <33333333>;
 				fclk-enable = <0>;
 				clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
 						"cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
arch/arm/boot/dts/zynq-parallella.dts +4 -0
index e1f51ca..cd84d45 100644
@@ -83,3 +83,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc702.dts +4 -0
index 94e2cda..24dcece 100644
@@ -135,3 +135,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc706.dts +4 -0
index a8bbdfb..7b88399 100644
@@ -114,3 +114,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zed.dts +0 -0
index 697779a..4662da2 100644

arch/arm/boot/dts/zynq-zed.dts line 52

Quoted 7 lines
arch/arm/boot/dts/zynq-zed.dts +4 -0
@@ -46,3 +46,7 @@
 &uart1 {
 	status = "okay";
 };
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};

I think we currently have the nodes more or less in alphabetical order. I'd prefer if we maintained that.

Other than that:

Soren

#10 lore raw
Quoted 6 lines · Sören Brinkmann
Quoted 5 lines · Peter Crosthwaite

The fact that all supported boards use the same 33MHz crystal is a co-incidence. The Zynq PS support a range of crystal freqs so the hardcoded setting should be removed from the dtsi. Re-implement it on the board level.

Quoted 6 lines
Quoted 2 lines

This prepares support for Zynq boards with different crystal frequencies (e.g. the Digilent ZYBO).

Even with the 33MHz in the dtsi you can override it on the board-level. Just like the 'status' property is overriden in board dts files.

Do you want the deletion undone? Even with override capability I think it should be removed as the number is board level specific and the dtsi should be limited to SoC level information.

My understanding is the driver will default to 33MHz as well as a catch-all, so anyone rolling their own top level OOT DTS is going to be ok too.

Quoted 10 lines
Quoted 6 lines

---
Im guessing long term this should be converted to a fixed clock. But I think this at least steps in that direction.

I was against that since it makes juggling with clock names more difficult. The problem is that the CCF uses a global name space of clock names.

I thought it was just a

clocks = < &phandle >

Where's the namespacing issue?

Btw I think the clocks=phandle would be populated the the dts as well. So the DTSI would have no clocks = node, and the dts must populate it. This allows support for an on-board off-soc clock controller controlling the PS clock (which is in theory supported by the SoC).

Not having the oscillator as fixed-clock in DT removed that

Quoted 65 lines

additional complexity. But it would be possible, I guess.

Quoted 63 lines
---
 arch/arm/boot/dts/zynq-7000.dtsi      | 1 -
 arch/arm/boot/dts/zynq-parallella.dts | 4 ++++
 arch/arm/boot/dts/zynq-zc702.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zc706.dts      | 4 ++++
 arch/arm/boot/dts/zynq-zed.dts        | 4 ++++
 5 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/boot/dts/zynq-7000.dtsi +0 -1
index ce2ef5b..ee3e5d6 100644
@@ -243,7 +243,6 @@
                      clkc: clkc@100 {
                              #clock-cells = <1>;
                              compatible = "xlnx,ps7-clkc";
-                             ps-clk-frequency = <33333333>;
                              fclk-enable = <0>;
                              clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
                                              "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
arch/arm/boot/dts/zynq-parallella.dts +4 -0
index e1f51ca..cd84d45 100644
@@ -83,3 +83,7 @@
 &uart1 {
      status = "okay";
 };
+
+&clkc {
+     ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc702.dts +4 -0
index 94e2cda..24dcece 100644
@@ -135,3 +135,7 @@
 &uart1 {
      status = "okay";
 };
+
+&clkc {
+     ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zc706.dts +4 -0
index a8bbdfb..7b88399 100644
@@ -114,3 +114,7 @@
 &uart1 {
      status = "okay";
 };
+
+&clkc {
+     ps-clk-frequency = <33333333>;
+};
arch/arm/boot/dts/zynq-zed.dts +0 -0
index 697779a..4662da2 100644
@@ -46,3 +46,7 @@
 &uart1 {
      status = "okay";
Quoted 9 lines

arch/arm/boot/dts/zynq-zed.dts line 52

Quoted 5 lines
arch/arm/boot/dts/zynq-zed.dts +4 -0
 };
+
+&clkc {
+     ps-clk-frequency = <33333333>;
+};

I think we currently have the nodes more or less in alphabetical order. I'd prefer if we maintained that.

Will fix.

Regards,
Peter

Quoted 4 lines

Other than that:

Soren

#11 lore raw
Quoted 11 lines · Peter Crosthwaite
Quoted 9 lines · Sören Brinkmann
Quoted 7 lines · Peter Crosthwaite

The fact that all supported boards use the same 33MHz crystal is a co-incidence. The Zynq PS support a range of crystal freqs so the hardcoded setting should be removed from the dtsi. Re-implement it on the board level.

This prepares support for Zynq boards with different crystal frequencies (e.g. the Digilent ZYBO).

Quoted 7 lines
Quoted 3 lines

Even with the 33MHz in the dtsi you can override it on the board-level. Just like the 'status' property is overriden in board dts files.

Do you want the deletion undone? Even with override capability I think it should be removed as the number is board level specific and the dtsi should be limited to SoC level information.

I'm fine with it. Just wanted to point out that patch 2 does not strictly require this change and can stand on its own.

[...]

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Im guessing long term this should be converted to a fixed clock. But I think this at least steps in that direction.

I was against that since it makes juggling with clock names more difficult. The problem is that the CCF uses a global name space of clock names.

I thought it was just a

Quoted 8 lines

clocks = < &phandle >

Where's the namespacing issue?

Btw I think the clocks=phandle would be populated the the dts as well. So the DTSI would have no clocks = node, and the dts must populate it. This allows support for an on-board off-soc clock controller controlling the PS clock (which is in theory supported by the SoC).

Every call to clk_register needs to be passed in the clock's parent (unless it's a root clock). That parent is specified by its name. You won't see it as user/consumer, but when implementing a clock-provider. I think there is nothing preventing such a change, but it would make things more complicated for no good reason. Even if you have an off-chip clock controller, if that one doesn't provide a fixed clock input to Zynq, things are likely to break.

Sören