Skip to contentSkip to conversation

add Meson8/Meson8b serial core clock handling

PATCH New Martin Blumenstingl 2 participants 4 messages Nov 17, 2017 – Dec 7, 2017

Subsystems (2)
lore
Share & tools
lore

Martin Blumenstingl

author reviewer
#0 lore raw

v2 cover add Meson8/Meson8b serial core clock handling

This patchset adds the tty/serial core clock handling to the UARTs on Meson8 and Meson8b.

Basically this is the Meson8 and Meson8b version of a patchset from Helmut Klein and Neil Armstrong, who implemented this for Meson GX (see [0]). Back then I asked Neil to drop Meson8b from his patchset because I was working on the Meson8 clock controller at that time.

This also removes the last users that rely on the "amlogic,meson-uart" binding. Removing that binding from the meson_uart driver is not part of this series though.

changes since v1 at [1]:
- moved the "baud" clock to the first position because the meson_uart driver currently chooses the first clock as baud clock (this is until the legacy clock handling is removed from the driver). in v1 the xtal clock was the first clock, which means that (other than before) the xtal clock was used to generate the baudrate.
- added Jerome's Acked-by (thank you!)

[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-June/004173.html
[1] http://lists.infradead.org/pipermail/linux-amlogic/2017-October/005144.html

Martin Blumenstingl (2):
ARM: dts: meson8: use stable UART bindings with correct gate clock
ARM: dts: meson8b: use stable UART bindings with correct gate clock

 arch/arm/boot/dts/meson8.dtsi  | 16 ++++++++++++----
 arch/arm/boot/dts/meson8b.dtsi | 16 ++++++++++++----
 2 files changed, 24 insertions(+), 8 deletions(-)
Signature · 1 line
2.15.0
author reviewer
#1 lore raw

PATCH v2 1/2 ARM: dts: meson8: use stable UART bindings with correct gate clock

Switch to the stable UART bindings and add the correct gate clocks to the non-AO UART nodes.
This fixes the non-AO UARTs if the bootloader didn't un-gate the clocks.

---
 arch/arm/boot/dts/meson8.dtsi | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
arch/arm/boot/dts/meson8.dtsi +12 -4
index 2d7a0752a460..1cab1d7dccde 100644
@@ -337,19 +337,27 @@
 };
 
 &uart_AO {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_A {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART0>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_B {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART1>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_C {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART2>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &usb0 {
Signature · 1 line
2.15.0
author reviewer
#2 lore raw

PATCH v2 2/2 ARM: dts: meson8b: use stable UART bindings with correct gate clock

In reply to Martin Blumenstingl

Switch to the stable UART bindings and add the correct gate clocks to the non-AO UART nodes.
This fixes the non-AO UARTs if the bootloader didn't un-gate the clocks.

---
 arch/arm/boot/dts/meson8b.dtsi | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
arch/arm/boot/dts/meson8b.dtsi +12 -4
index d75e0ceda8bb..db296e5bd88a 100644
@@ -248,19 +248,27 @@
 };
 
 &uart_AO {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_A {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART0>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_B {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART1>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &uart_C {
-	clocks = <&clkc CLKID_CLK81>;
+	compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
+	clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART2>;
+	clock-names = "baud", "xtal", "pclk";
 };
 
 &usb0 {
Signature · 1 line
2.15.0
maintainer
#3 lore raw

v2 cover add Meson8/Meson8b serial core clock handling

In reply to Martin Blumenstingl
Quoted 11 lines · Martin Blumenstingl

This patchset adds the tty/serial core clock handling to the UARTs on Meson8 and Meson8b.

Basically this is the Meson8 and Meson8b version of a patchset from Helmut Klein and Neil Armstrong, who implemented this for Meson GX (see [0]). Back then I asked Neil to drop Meson8b from his patchset because I was working on the Meson8 clock controller at that time.

This also removes the last users that rely on the "amlogic,meson-uart" binding. Removing that binding from the meson_uart driver is not part of this series though.

I mistakenly replied to the v1 of this series. It's this version (v2) that I applied to v4.16/dt.

Sorry for the confusion, and thanks for the patches!

Kevin