linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] meson-uart: Use "divide XTAL by 2" bit on G12A
@ 2023-03-07 22:26 Martin Blumenstingl
  2023-03-07 22:26 ` [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A Martin Blumenstingl
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Martin Blumenstingl @ 2023-03-07 22:26 UTC (permalink / raw)
  To: linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby, neil.armstrong,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt,
	Martin Blumenstingl

This series improves support for UART attached Bluetooth modules on
Amlogic Meson G12A and newer SoCs. These SoCs also support the "divide
XTAL by 2" bit which (greatly) reduces jitter when generating baud
rates such as 1500000 (which is used by the Bluetooth part of the
RTL8822CS SDIO WiFi and UART Bluetooth combo chip).

Without this the baud rate calculation is based on the XTAL clock
(running at 24MHz) divided by 3 (meaning: 8MHz). 8MHz cannot be divided
with integer division to a 1500000 baud rate. Using the "divide XTAL
by 2" bit however means that we can achieve 1500000 cleanly, without any
jitter.

In future we should allow dynamic switching of these UART controller
internal dividers to pick the best divider automatically for the
requested baud rate. This however still requires the new compatible
string - which is added by this series - to enable the "divide XTAL
by 2" logic on SoCs that support it (G12A and newer).

Changes since v1 at [1]:
- make meson-gx-uart a valid fallback compatible string for the newer
  meson-g12a-uart
- rebased on top of v6.3-rc1

Changes since v2 at [2]:
- simplify the dt-bindings patch as suggested by Krzysztof Kozlowski
  (thank you!) which actually uncovers an unwanted change


[0] https://lore.kernel.org/linux-bluetooth/3B9D4DB2-D2CD-44FE-817A-F6EA8A0AD734@gmail.com/
[1] https://lore.kernel.org/lkml/20230222210425.626474-1-martin.blumenstingl@googlemail.com/
[2] https://lore.kernel.org/lkml/20230306194223.1869814-1-martin.blumenstingl@googlemail.com/


Martin Blumenstingl (3):
  dt-bindings: serial: amlogic,meson-uart: Add compatible string for
    G12A
  tty: serial: meson: Add a new compatible string for the G12A SoC
  arm64: dts: meson-g12-common: Use the G12A UART compatible string

 .../bindings/serial/amlogic,meson-uart.yaml       |  9 +++++++++
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 15 ++++++++++-----
 drivers/tty/serial/meson_uart.c                   |  8 ++++++--
 3 files changed, 25 insertions(+), 7 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A
  2023-03-07 22:26 [PATCH v3 0/3] meson-uart: Use "divide XTAL by 2" bit on G12A Martin Blumenstingl
@ 2023-03-07 22:26 ` Martin Blumenstingl
  2023-03-08 11:02   ` Krzysztof Kozlowski
  2023-03-07 22:26 ` [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC Martin Blumenstingl
  2023-03-07 22:26 ` [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string Martin Blumenstingl
  2 siblings, 1 reply; 9+ messages in thread
From: Martin Blumenstingl @ 2023-03-07 22:26 UTC (permalink / raw)
  To: linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby, neil.armstrong,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt,
	Martin Blumenstingl

Amlogic G12A SoCs gained a new "divide XTAL by 2" bit. Everything else
(we know about) is identical to the UART IP on GX (GXBB/GXL/GXM) SoCs.
Add a new compatible string for this SoC so this new bit can be managed
accordingly while keeping "amlogic,meson-gx-uart" as fallback compatible
string.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
Changes from v1 -> v2:
- make meson-gx-uart a valid compatible string for meson-g12a-uart

Changes from v2 -> v3:
- don't add extra oneOf as all of the entries are enclosed in oneOf
  already
- don't allow amlogic,meson-g12a-uart as standalone compatible string
  (which slipped through in v2 due to all of the formatting changes
  that the extra oneOf required)


 .../devicetree/bindings/serial/amlogic,meson-uart.yaml   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
index 3cbdde85ed71..22656efe8ddc 100644
--- a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
+++ b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
@@ -34,6 +34,11 @@ properties:
               - amlogic,meson-gx-uart
               - amlogic,meson-s4-uart
           - const: amlogic,meson-ao-uart
+      - description: Always-on power domain UART controller on G12A SoCs
+        items:
+          - const: amlogic,meson-g12a-uart
+          - const: amlogic,meson-gx-uart
+          - const: amlogic,meson-ao-uart
       - description: Everything-Else power domain UART controller
         enum:
           - amlogic,meson6-uart
@@ -41,6 +46,10 @@ properties:
           - amlogic,meson8b-uart
           - amlogic,meson-gx-uart
           - amlogic,meson-s4-uart
+      - description: Everything-Else power domain UART controller on G12A SoCs
+        items:
+          - const: amlogic,meson-g12a-uart
+          - const: amlogic,meson-gx-uart
 
   reg:
     maxItems: 1
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC
  2023-03-07 22:26 [PATCH v3 0/3] meson-uart: Use "divide XTAL by 2" bit on G12A Martin Blumenstingl
  2023-03-07 22:26 ` [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A Martin Blumenstingl
@ 2023-03-07 22:26 ` Martin Blumenstingl
  2023-03-08 12:19   ` neil.armstrong
  2023-03-07 22:26 ` [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string Martin Blumenstingl
  2 siblings, 1 reply; 9+ messages in thread
From: Martin Blumenstingl @ 2023-03-07 22:26 UTC (permalink / raw)
  To: linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby, neil.armstrong,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt,
	Martin Blumenstingl

Amlogic Meson G12A (and later) SoCs also have the "divide XTAL by 2" bit
as the S4 UART controllers. Add a new compatible string for these SoCs
and enable the has_xtal_div2 flag for them.

Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
Changes from v1 -> v2:
- none

Changes from v2 -> v3:
- none


 drivers/tty/serial/meson_uart.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 74110017988a..2501db5a7aaf 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -779,7 +779,7 @@ static int meson_uart_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct meson_uart_data s4_uart_data = {
+static struct meson_uart_data meson_g12a_uart_data = {
 	.has_xtal_div2 = true,
 };
 
@@ -788,9 +788,13 @@ static const struct of_device_id meson_uart_dt_match[] = {
 	{ .compatible = "amlogic,meson8-uart" },
 	{ .compatible = "amlogic,meson8b-uart" },
 	{ .compatible = "amlogic,meson-gx-uart" },
+	{
+		.compatible = "amlogic,meson-g12a-uart",
+		.data = (void *)&meson_g12a_uart_data,
+	},
 	{
 		.compatible = "amlogic,meson-s4-uart",
-		.data = (void *)&s4_uart_data,
+		.data = (void *)&meson_g12a_uart_data,
 	},
 	{ /* sentinel */ },
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string
  2023-03-07 22:26 [PATCH v3 0/3] meson-uart: Use "divide XTAL by 2" bit on G12A Martin Blumenstingl
  2023-03-07 22:26 ` [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A Martin Blumenstingl
  2023-03-07 22:26 ` [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC Martin Blumenstingl
@ 2023-03-07 22:26 ` Martin Blumenstingl
  2023-03-08 12:19   ` neil.armstrong
  2023-03-08 12:21   ` neil.armstrong
  2 siblings, 2 replies; 9+ messages in thread
From: Martin Blumenstingl @ 2023-03-07 22:26 UTC (permalink / raw)
  To: linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby, neil.armstrong,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt,
	Martin Blumenstingl

Switch meson-12-common.dtsi to use the Meson G12A specific UART
compatible string. This enables the "divide XTAL by 2" divider which
improves support for UART attached Bluetooth modules (for example
RTL8822CS) running at a baud rate of 1500000. Without dividing XTAL
(24MHz) by 2 a baud rate of 1500000 cannot be generated cleanly and the
resulting jitter breaks communication with the module.

Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
Greg, please don't take this through your tree. I included this patch
to show the overall goal of this series. If Neil won't take this as
part of another series then I'll send it separately.

Changes from v1 -> v2:
- keep meson-gx-uart as fallback compatible string

Changes from v2 -> v3:
- none


 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 123a56f7f818..904bcd4d2acf 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -2046,7 +2046,8 @@ pwm_AO_cd: pwm@2000 {
 			};
 
 			uart_AO: serial@3000 {
-				compatible = "amlogic,meson-gx-uart",
+				compatible = "amlogic,meson-g12a-uart",
+					     "amlogic,meson-gx-uart",
 					     "amlogic,meson-ao-uart";
 				reg = <0x0 0x3000 0x0 0x18>;
 				interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
@@ -2056,7 +2057,8 @@ uart_AO: serial@3000 {
 			};
 
 			uart_AO_B: serial@4000 {
-				compatible = "amlogic,meson-gx-uart",
+				compatible = "amlogic,meson-g12a-uart",
+					     "amlogic,meson-gx-uart",
 					     "amlogic,meson-ao-uart";
 				reg = <0x0 0x4000 0x0 0x18>;
 				interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
@@ -2293,7 +2295,8 @@ clk_msr: clock-measure@18000 {
 			};
 
 			uart_C: serial@22000 {
-				compatible = "amlogic,meson-gx-uart";
+				compatible = "amlogic,meson-g12a-uart",
+					     "amlogic,meson-gx-uart";
 				reg = <0x0 0x22000 0x0 0x18>;
 				interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
 				clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>;
@@ -2302,7 +2305,8 @@ uart_C: serial@22000 {
 			};
 
 			uart_B: serial@23000 {
-				compatible = "amlogic,meson-gx-uart";
+				compatible = "amlogic,meson-g12a-uart",
+					     "amlogic,meson-gx-uart";
 				reg = <0x0 0x23000 0x0 0x18>;
 				interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
 				clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>;
@@ -2311,7 +2315,8 @@ uart_B: serial@23000 {
 			};
 
 			uart_A: serial@24000 {
-				compatible = "amlogic,meson-gx-uart";
+				compatible = "amlogic,meson-g12a-uart",
+					     "amlogic,meson-gx-uart";
 				reg = <0x0 0x24000 0x0 0x18>;
 				interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
 				clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A
  2023-03-07 22:26 ` [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A Martin Blumenstingl
@ 2023-03-08 11:02   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-08 11:02 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby, neil.armstrong,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt

On 07/03/2023 23:26, Martin Blumenstingl wrote:
> Amlogic G12A SoCs gained a new "divide XTAL by 2" bit. Everything else
> (we know about) is identical to the UART IP on GX (GXBB/GXL/GXM) SoCs.
> Add a new compatible string for this SoC so this new bit can be managed
> accordingly while keeping "amlogic,meson-gx-uart" as fallback compatible
> string.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> Changes from v1 -> v2:
> - make meson-gx-uart a valid compatible string for meson-g12a-uart
> 
> Changes from v2 -> v3:
> - don't add extra oneOf as all of the entries are enclosed in oneOf
>   already
> - don't allow amlogic,meson-g12a-uart as standalone compatible string
>   (which slipped through in v2 due to all of the formatting changes
>   that the extra oneOf required)
> 


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC
  2023-03-07 22:26 ` [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC Martin Blumenstingl
@ 2023-03-08 12:19   ` neil.armstrong
  0 siblings, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2023-03-08 12:19 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt

On 07/03/2023 23:26, Martin Blumenstingl wrote:
> Amlogic Meson G12A (and later) SoCs also have the "divide XTAL by 2" bit
> as the S4 UART controllers. Add a new compatible string for these SoCs
> and enable the has_xtal_div2 flag for them.
> 
> Tested-by: Christian Hewitt <christianshewitt@gmail.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> Changes from v1 -> v2:
> - none
> 
> Changes from v2 -> v3:
> - none
> 
> 
>   drivers/tty/serial/meson_uart.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 74110017988a..2501db5a7aaf 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -779,7 +779,7 @@ static int meson_uart_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static struct meson_uart_data s4_uart_data = {
> +static struct meson_uart_data meson_g12a_uart_data = {
>   	.has_xtal_div2 = true,
>   };
>   
> @@ -788,9 +788,13 @@ static const struct of_device_id meson_uart_dt_match[] = {
>   	{ .compatible = "amlogic,meson8-uart" },
>   	{ .compatible = "amlogic,meson8b-uart" },
>   	{ .compatible = "amlogic,meson-gx-uart" },
> +	{
> +		.compatible = "amlogic,meson-g12a-uart",
> +		.data = (void *)&meson_g12a_uart_data,
> +	},
>   	{
>   		.compatible = "amlogic,meson-s4-uart",
> -		.data = (void *)&s4_uart_data,
> +		.data = (void *)&meson_g12a_uart_data,
>   	},
>   	{ /* sentinel */ },
>   };

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string
  2023-03-07 22:26 ` [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string Martin Blumenstingl
@ 2023-03-08 12:19   ` neil.armstrong
  2023-03-08 12:21   ` neil.armstrong
  1 sibling, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2023-03-08 12:19 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt

On 07/03/2023 23:26, Martin Blumenstingl wrote:
> Switch meson-12-common.dtsi to use the Meson G12A specific UART
> compatible string. This enables the "divide XTAL by 2" divider which
> improves support for UART attached Bluetooth modules (for example
> RTL8822CS) running at a baud rate of 1500000. Without dividing XTAL
> (24MHz) by 2 a baud rate of 1500000 cannot be generated cleanly and the
> resulting jitter breaks communication with the module.
> 
> Tested-by: Christian Hewitt <christianshewitt@gmail.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> Greg, please don't take this through your tree. I included this patch
> to show the overall goal of this series. If Neil won't take this as
> part of another series then I'll send it separately.
> 
> Changes from v1 -> v2:
> - keep meson-gx-uart as fallback compatible string
> 
> Changes from v2 -> v3:
> - none
> 
> 
>   arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 123a56f7f818..904bcd4d2acf 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -2046,7 +2046,8 @@ pwm_AO_cd: pwm@2000 {
>   			};
>   
>   			uart_AO: serial@3000 {
> -				compatible = "amlogic,meson-gx-uart",
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart",
>   					     "amlogic,meson-ao-uart";
>   				reg = <0x0 0x3000 0x0 0x18>;
>   				interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
> @@ -2056,7 +2057,8 @@ uart_AO: serial@3000 {
>   			};
>   
>   			uart_AO_B: serial@4000 {
> -				compatible = "amlogic,meson-gx-uart",
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart",
>   					     "amlogic,meson-ao-uart";
>   				reg = <0x0 0x4000 0x0 0x18>;
>   				interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
> @@ -2293,7 +2295,8 @@ clk_msr: clock-measure@18000 {
>   			};
>   
>   			uart_C: serial@22000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x22000 0x0 0x18>;
>   				interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>;
> @@ -2302,7 +2305,8 @@ uart_C: serial@22000 {
>   			};
>   
>   			uart_B: serial@23000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x23000 0x0 0x18>;
>   				interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>;
> @@ -2311,7 +2315,8 @@ uart_B: serial@23000 {
>   			};
>   
>   			uart_A: serial@24000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x24000 0x0 0x18>;
>   				interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string
  2023-03-07 22:26 ` [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string Martin Blumenstingl
  2023-03-08 12:19   ` neil.armstrong
@ 2023-03-08 12:21   ` neil.armstrong
  2023-03-09 11:00     ` Greg KH
  1 sibling, 1 reply; 9+ messages in thread
From: neil.armstrong @ 2023-03-08 12:21 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, devicetree
  Cc: linux-kernel, linux-arm-kernel, jirislaby,
	krzysztof.kozlowski+dt, robh+dt, gregkh, Christian Hewitt

On 07/03/2023 23:26, Martin Blumenstingl wrote:
> Switch meson-12-common.dtsi to use the Meson G12A specific UART
> compatible string. This enables the "divide XTAL by 2" divider which
> improves support for UART attached Bluetooth modules (for example
> RTL8822CS) running at a baud rate of 1500000. Without dividing XTAL
> (24MHz) by 2 a baud rate of 1500000 cannot be generated cleanly and the
> resulting jitter breaks communication with the module.
> 
> Tested-by: Christian Hewitt <christianshewitt@gmail.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> Greg, please don't take this through your tree. I included this patch
> to show the overall goal of this series. If Neil won't take this as
> part of another series then I'll send it separately.

Actually I'm ok if Greg takes the whole patchset, including this one, via
the tty tree.

Neil

> 
> Changes from v1 -> v2:
> - keep meson-gx-uart as fallback compatible string
> 
> Changes from v2 -> v3:
> - none
> 
> 
>   arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 123a56f7f818..904bcd4d2acf 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -2046,7 +2046,8 @@ pwm_AO_cd: pwm@2000 {
>   			};
>   
>   			uart_AO: serial@3000 {
> -				compatible = "amlogic,meson-gx-uart",
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart",
>   					     "amlogic,meson-ao-uart";
>   				reg = <0x0 0x3000 0x0 0x18>;
>   				interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
> @@ -2056,7 +2057,8 @@ uart_AO: serial@3000 {
>   			};
>   
>   			uart_AO_B: serial@4000 {
> -				compatible = "amlogic,meson-gx-uart",
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart",
>   					     "amlogic,meson-ao-uart";
>   				reg = <0x0 0x4000 0x0 0x18>;
>   				interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
> @@ -2293,7 +2295,8 @@ clk_msr: clock-measure@18000 {
>   			};
>   
>   			uart_C: serial@22000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x22000 0x0 0x18>;
>   				interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>;
> @@ -2302,7 +2305,8 @@ uart_C: serial@22000 {
>   			};
>   
>   			uart_B: serial@23000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x23000 0x0 0x18>;
>   				interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>;
> @@ -2311,7 +2315,8 @@ uart_B: serial@23000 {
>   			};
>   
>   			uart_A: serial@24000 {
> -				compatible = "amlogic,meson-gx-uart";
> +				compatible = "amlogic,meson-g12a-uart",
> +					     "amlogic,meson-gx-uart";
>   				reg = <0x0 0x24000 0x0 0x18>;
>   				interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
>   				clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string
  2023-03-08 12:21   ` neil.armstrong
@ 2023-03-09 11:00     ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2023-03-09 11:00 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Martin Blumenstingl, linux-amlogic, devicetree, linux-kernel,
	linux-arm-kernel, jirislaby, krzysztof.kozlowski+dt, robh+dt,
	Christian Hewitt

On Wed, Mar 08, 2023 at 01:21:21PM +0100, neil.armstrong@linaro.org wrote:
> On 07/03/2023 23:26, Martin Blumenstingl wrote:
> > Switch meson-12-common.dtsi to use the Meson G12A specific UART
> > compatible string. This enables the "divide XTAL by 2" divider which
> > improves support for UART attached Bluetooth modules (for example
> > RTL8822CS) running at a baud rate of 1500000. Without dividing XTAL
> > (24MHz) by 2 a baud rate of 1500000 cannot be generated cleanly and the
> > resulting jitter breaks communication with the module.
> > 
> > Tested-by: Christian Hewitt <christianshewitt@gmail.com>
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > ---
> > Greg, please don't take this through your tree. I included this patch
> > to show the overall goal of this series. If Neil won't take this as
> > part of another series then I'll send it separately.
> 
> Actually I'm ok if Greg takes the whole patchset, including this one, via
> the tty tree.

Ok, I'll take them all, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-09 11:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 22:26 [PATCH v3 0/3] meson-uart: Use "divide XTAL by 2" bit on G12A Martin Blumenstingl
2023-03-07 22:26 ` [PATCH v3 1/3] dt-bindings: serial: amlogic,meson-uart: Add compatible string for G12A Martin Blumenstingl
2023-03-08 11:02   ` Krzysztof Kozlowski
2023-03-07 22:26 ` [PATCH v3 2/3] tty: serial: meson: Add a new compatible string for the G12A SoC Martin Blumenstingl
2023-03-08 12:19   ` neil.armstrong
2023-03-07 22:26 ` [PATCH v3 3/3] arm64: dts: meson-g12-common: Use the G12A UART compatible string Martin Blumenstingl
2023-03-08 12:19   ` neil.armstrong
2023-03-08 12:21   ` neil.armstrong
2023-03-09 11:00     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).