Skip to contentSkip to conversation

dts: meson: add clock controllers input clocks

PATCH Applied Jerome Brunet 3 participants 7 messages Dec 3, 2018 – Dec 5, 2018

Subsystems (4)
lore
Share & tools
lore

Jerome Brunet

author maintainer
#0 lore raw

v3 cover dts: meson: add clock controllers input clocks

This patchset is the first step that needs to be done so the amlogic clock controllers properly claim their input clocks through DT instead of relying on fixed names.

I'll be waiting for this hit mainline before sending the related driver changes.

Changes since v1: [0]
- add clock-names for the main clock controller

Changes since v2: [1]
- add more inputs for the gx family external 32k references

[0]: https://lkml.kernel.org/r/[email protected]
[1]: https://lkml.kernel.org/r/[email protected]

Jerome Brunet (3):
dt-bindings: clk: meson: add ao controller clock inputs
dt-bindings: clk: meson: add main controller clock input
arm64: dts: meson: add clock controller clock inputs

 .../devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt  | 10 +++++++++-
 .../devicetree/bindings/clock/amlogic,gxbb-clkc.txt    |  5 +++++
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi             |  4 ++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi            |  4 ++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi             |  4 ++++
 5 files changed, 26 insertions(+), 1 deletion(-)
Signature · 1 line
2.19.1
author maintainer
#1 lore raw

PATCH v3 1/3 dt-bindings: clk: meson: add ao controller clock inputs

Add the clock inputs of amlogic AO clock controller

---

Stephen,

Since I made some changes here, I did not pick your previous Reviewed-by tag, in case you did not agree with this version.

Cheers
Jerome

 .../devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt +9 -1
index 3a880528030e..79511d7bb321 100644
@@ -11,6 +11,13 @@ Required Properties:
 	- GXM (S912) : "amlogic,meson-gxm-aoclkc"
 	- AXG (A113D, A113X) : "amlogic,meson-axg-aoclkc"
 	followed by the common "amlogic,meson-gx-aoclkc"
+- clocks: list of clock phandle, one for each entry clock-names.
+- clock-names: should contain the following:
+  * "xtal"     : the platform xtal
+  * "mpeg-clk" : the main clock controller mother clock (aka clk81)
+  * "ext-32k-0"  : external 32kHz reference #0 if any (optional)
+  * "ext-32k-1"  : external 32kHz reference #1 if any (optional - gx only)
+  * "ext-32k-2"  : external 32kHz reference #2 if any (optional - gx only)
 
 - #clock-cells: should be 1.
 
@@ -40,8 +47,9 @@ ao_sysctrl: sys-ctrl@0 {
 		compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc";
 		#clock-cells = <1>;
 		#reset-cells = <1>;
+		clocks = <&xtal>, <&clkc CLKID_CLK81>;
+		clock-names = "xtal", "mpeg-clk";
 	};
-};
 
 Example: UART controller node that consumes the clock and reset generated
   by the clock controller:
Signature · 1 line
2.19.1
author maintainer
#3 lore raw

PATCH v3 2/3 dt-bindings: clk: meson: add main controller clock input

In reply to Jerome Brunet

Add the clock input of the main clock controller

---
 .../devicetree/bindings/clock/amlogic,gxbb-clkc.txt          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt +5 -0
index e950599566a9..a6871953bf04 100644
@@ -9,6 +9,9 @@ Required Properties:
 		"amlogic,gxbb-clkc" for GXBB SoC,
 		"amlogic,gxl-clkc" for GXL and GXM SoC,
 		"amlogic,axg-clkc" for AXG SoC.
+- clocks : list of clock phandle, one for each entry clock-names.
+- clock-names : should contain the following:
+  * "xtal": the platform xtal
 
 - #clock-cells: should be 1.
 
@@ -31,6 +34,8 @@ sysctrl: system-controller@0 {
 	clkc: clock-controller {
 		#clock-cells = <1>;
 		compatible = "amlogic,gxbb-clkc";
+		clocks = <&xtal>;
+		clock-names = "xtal";
 	};
 };
 
Signature · 1 line
2.19.1
author maintainer
#5 lore raw

PATCH v3 3/3 arm64: dts: meson: add clock controller clock inputs

In reply to Jerome Brunet

Add the clock inputs of the clock controllers

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi  | 4 ++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 4 ++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 4 ++++
 3 files changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +4 -0
index 5f512c91471e..5f3ac275f1ab 100644
@@ -1089,6 +1089,8 @@
 				clkc: clock-controller {
 					compatible = "amlogic,axg-clkc";
 					#clock-cells = <1>;
+					clocks = <&xtal>;
+					clock-names = "xtal";
 				};
 			};
 		};
@@ -1334,6 +1336,8 @@
 					compatible = "amlogic,meson-axg-aoclkc";
 					#clock-cells = <1>;
 					#reset-cells = <1>;
+					clocks = <&xtal>, <&clkc CLKID_CLK81>;
+					clock-names = "xtal", "mpeg-clk";
 				};
 			};
 
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +4 -0
index 6796d250985a..a7b883ced0a8 100644
@@ -299,6 +299,8 @@
 
 &clkc_AO {
 	compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc";
+	clocks = <&xtal>, <&clkc CLKID_CLK81>;
+	clock-names = "xtal", "mpeg-clk";
 };
 
 &efuse {
@@ -334,6 +336,8 @@
 	clkc: clock-controller {
 		compatible = "amlogic,gxbb-clkc";
 		#clock-cells = <1>;
+		clocks = <&xtal>;
+		clock-names = "xtal";
 	};
 };
 
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +4 -0
index ed278097825b..d5c3d78aafeb 100644
@@ -260,6 +260,8 @@
 
 &clkc_AO {
 	compatible = "amlogic,meson-gxl-aoclkc", "amlogic,meson-gx-aoclkc";
+	clocks = <&xtal>, <&clkc CLKID_CLK81>;
+	clock-names = "xtal", "mpeg-clk";
 };
 
 &gpio_intc {
@@ -284,6 +286,8 @@
 	clkc: clock-controller {
 		compatible = "amlogic,gxl-clkc";
 		#clock-cells = <1>;
+		clocks = <&xtal>;
+		clock-names = "xtal";
 	};
 };
 
Signature · 1 line
2.19.1
maintainer Applied
#6 lore raw
In reply to Jerome Brunet
Quoted 6 lines · Jerome Brunet

This patchset is the first step that needs to be done so the amlogic clock controllers properly claim their input clocks through DT instead of relying on fixed names.

I'll be waiting for this hit mainline before sending the related driver changes.

Queued for v4.21 (branch: v4.21/dt64) with Stephen's tags.

nit: $SUBJECT on this cover letter is missing arm64 prefix (v2 had it) and, some lazy maintainenrs like me are starting to rely on the new new patchwork-bot which will auto-superseed series when a new version is posted, but that relies on matching subjects.

Kevin