diff mbox series

[v1,5/6] arm64: dts: meson: a1: introduce UART_AO mux definitions

Message ID 20230607201641.20982-6-ddrokosov@sberdevices.ru (mailing list archive)
State New, archived
Headers show
Series arm64: dts: meson: a1: introduce several peripheral IPs | expand

Commit Message

Dmitry Rokosov June 7, 2023, 8:16 p.m. UTC
From: Oleg Lyovin <ovlevin@sberdevices.ru>

The Amlogic A1 has a UART_AO port, which can be used, for example, for
BT HCI H4 connection.

This patch adds mux definitions for it.

Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Martin Blumenstingl June 25, 2023, 9:07 p.m. UTC | #1
On Wed, Jun 7, 2023 at 10:16 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
>
> From: Oleg Lyovin <ovlevin@sberdevices.ru>
>
> The Amlogic A1 has a UART_AO port, which can be used, for example, for
> BT HCI H4 connection.
>
> This patch adds mux definitions for it.
In the past we've only taken the pinctrl definitions if we have a
board that uses them.
Neil, do we still have the same policy in place? If so this patch
should be sent with the series that adds support for your A1 board.

> Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
>  arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> index 0efd922ca7e1..3eb6aa9c00e0 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> @@ -118,6 +118,22 @@ gpio: bank@400 {
>                                         gpio-ranges = <&periphs_pinctrl 0 0 62>;
>                                 };
>
> +                               uart_a_pins: uart_a {
Only our newer .dtsi (e.g. meson-g12-common.dtsi) are following the
pattern where node names should use dashes instead of underscores.
So please use: uart_a_pins: uart-a { ...

[...]
> +                               uart_a_cts_rts_pins: uart_a_cts_rts {
similar to the comment from above:
uart_a_cts_rts_pins: uart-a-cts-rts { ...

> +                                       mux {
> +                                               groups = "uart_a_cts",
> +                                                        "uart_a_rts";
> +                                               function = "uart_a";
> +                                               bias-pull-down;
Out of curiosity: is this pull down needed on all boards or just specific ones?
It seems like all other SoCs use bias-disable for the RTS/CTS pins.


Best regards,
Martin
Neil Armstrong June 26, 2023, 1:34 p.m. UTC | #2
Hi,

On 25/06/2023 23:07, Martin Blumenstingl wrote:
> On Wed, Jun 7, 2023 at 10:16 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
>>
>> From: Oleg Lyovin <ovlevin@sberdevices.ru>
>>
>> The Amlogic A1 has a UART_AO port, which can be used, for example, for
>> BT HCI H4 connection.
>>
>> This patch adds mux definitions for it.
> In the past we've only taken the pinctrl definitions if we have a
> board that uses them.
> Neil, do we still have the same policy in place? If so this patch
> should be sent with the series that adds support for your A1 board.

Yes and no, if the work is done I'll take it, but yeah since upstream linux
hates dead code, let's only define what's necessary.

> 
>> Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
>> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
>> ---
>>   arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
>> index 0efd922ca7e1..3eb6aa9c00e0 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
>> @@ -118,6 +118,22 @@ gpio: bank@400 {
>>                                          gpio-ranges = <&periphs_pinctrl 0 0 62>;
>>                                  };
>>
>> +                               uart_a_pins: uart_a {
> Only our newer .dtsi (e.g. meson-g12-common.dtsi) are following the
> pattern where node names should use dashes instead of underscores.
> So please use: uart_a_pins: uart-a { ...

The new scheme which should be use should be:

uart_a_pins: uart-a-pins-state {

but it wasn't enforced in the pinctrl yaml pushed by heiner, but for sure
no underscores in the node name.

> 
> [...]
>> +                               uart_a_cts_rts_pins: uart_a_cts_rts {
> similar to the comment from above:
> uart_a_cts_rts_pins: uart-a-cts-rts { ...
> 
>> +                                       mux {
>> +                                               groups = "uart_a_cts",
>> +                                                        "uart_a_rts";
>> +                                               function = "uart_a";
>> +                                               bias-pull-down;
> Out of curiosity: is this pull down needed on all boards or just specific ones?
> It seems like all other SoCs use bias-disable for the RTS/CTS pins.
> 
> 
> Best regards,
> Martin
Dmitry Rokosov June 28, 2023, 2:49 p.m. UTC | #3
Martin,

On Sun, Jun 25, 2023 at 11:07:51PM +0200, Martin Blumenstingl wrote:
> On Wed, Jun 7, 2023 at 10:16 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> >
> > From: Oleg Lyovin <ovlevin@sberdevices.ru>
> >
> > The Amlogic A1 has a UART_AO port, which can be used, for example, for
> > BT HCI H4 connection.
> >
> > This patch adds mux definitions for it.
> In the past we've only taken the pinctrl definitions if we have a
> board that uses them.
> Neil, do we still have the same policy in place? If so this patch
> should be sent with the series that adds support for your A1 board.
> 
> > Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > index 0efd922ca7e1..3eb6aa9c00e0 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > @@ -118,6 +118,22 @@ gpio: bank@400 {
> >                                         gpio-ranges = <&periphs_pinctrl 0 0 62>;
> >                                 };
> >
> > +                               uart_a_pins: uart_a {
> Only our newer .dtsi (e.g. meson-g12-common.dtsi) are following the
> pattern where node names should use dashes instead of underscores.
> So please use: uart_a_pins: uart-a { ...
> 

Okay, no problem. I'll rename the nodes in the next patch series
version.

> [...]
> > +                               uart_a_cts_rts_pins: uart_a_cts_rts {
> similar to the comment from above:
> uart_a_cts_rts_pins: uart-a-cts-rts { ...
> 

Ok

> > +                                       mux {
> > +                                               groups = "uart_a_cts",
> > +                                                        "uart_a_rts";
> > +                                               function = "uart_a";
> > +                                               bias-pull-down;
> Out of curiosity: is this pull down needed on all boards or just specific ones?
> It seems like all other SoCs use bias-disable for the RTS/CTS pins.
> 

That's a good question. The Amlogic custom kernel DTSI declares
bias-pull-down for CTS/RTS pins in UART_A. There is no information about
this in the A1 datasheet. However, from my understanding, it is related
to the usage of the UART_A. Typically, the UART_A endpoint on A1 boards
is used for BT connections, which is why Amlogic applies bias-pull-down
in the common DTSI. If my assumption is correct, it would be better to
move the bias-pull-down node parameter to the custom board DTS. I will
investigate this further and rework it in the next version if necessary.
Dmitry Rokosov June 28, 2023, 2:51 p.m. UTC | #4
Neil, Martin,

On Mon, Jun 26, 2023 at 03:34:38PM +0200, neil.armstrong@linaro.org wrote:
> Hi,
> 
> On 25/06/2023 23:07, Martin Blumenstingl wrote:
> > On Wed, Jun 7, 2023 at 10:16 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> > > 
> > > From: Oleg Lyovin <ovlevin@sberdevices.ru>
> > > 
> > > The Amlogic A1 has a UART_AO port, which can be used, for example, for
> > > BT HCI H4 connection.
> > > 
> > > This patch adds mux definitions for it.
> > In the past we've only taken the pinctrl definitions if we have a
> > board that uses them.
> > Neil, do we still have the same policy in place? If so this patch
> > should be sent with the series that adds support for your A1 board.
> 
> Yes and no, if the work is done I'll take it, but yeah since upstream linux
> hates dead code, let's only define what's necessary.
> 

I'll prepare the patches for ad401 reference board, and share the in the
next patch series version.

> > 
> > > Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
> > > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> > > ---
> > >   arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 16 ++++++++++++++++
> > >   1 file changed, 16 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > > index 0efd922ca7e1..3eb6aa9c00e0 100644
> > > --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > > +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> > > @@ -118,6 +118,22 @@ gpio: bank@400 {
> > >                                          gpio-ranges = <&periphs_pinctrl 0 0 62>;
> > >                                  };
> > > 
> > > +                               uart_a_pins: uart_a {
> > Only our newer .dtsi (e.g. meson-g12-common.dtsi) are following the
> > pattern where node names should use dashes instead of underscores.
> > So please use: uart_a_pins: uart-a { ...
> 
> The new scheme which should be use should be:
> 
> uart_a_pins: uart-a-pins-state {
> 
> but it wasn't enforced in the pinctrl yaml pushed by heiner, but for sure
> no underscores in the node name.
> 

Okay, got it

> > 
> > [...]
> > > +                               uart_a_cts_rts_pins: uart_a_cts_rts {
> > similar to the comment from above:
> > uart_a_cts_rts_pins: uart-a-cts-rts { ...
> > 
> > > +                                       mux {
> > > +                                               groups = "uart_a_cts",
> > > +                                                        "uart_a_rts";
> > > +                                               function = "uart_a";
> > > +                                               bias-pull-down;
> > Out of curiosity: is this pull down needed on all boards or just specific ones?
> > It seems like all other SoCs use bias-disable for the RTS/CTS pins.
> > 
> > 
> > Best regards,
> > Martin
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index 0efd922ca7e1..3eb6aa9c00e0 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -118,6 +118,22 @@  gpio: bank@400 {
 					gpio-ranges = <&periphs_pinctrl 0 0 62>;
 				};
 
+				uart_a_pins: uart_a {
+					mux {
+						groups = "uart_a_tx",
+							 "uart_a_rx";
+						function = "uart_a";
+					};
+				};
+
+				uart_a_cts_rts_pins: uart_a_cts_rts {
+					mux {
+						groups = "uart_a_cts",
+							 "uart_a_rts";
+						function = "uart_a";
+						bias-pull-down;
+					};
+				};
 			};
 
 			uart_AO: serial@1c00 {