2019-02-17 07:02:57

by Måns Rullgård

[permalink] [raw]
Subject: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

This adds pinctrl settings for various missing uart options.

Signed-off-by: Mans Rullgard <[email protected]>
---
arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index af5b067a5f83..2295ff5adf48 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -944,6 +944,31 @@
function = "uart0";
};

+ uart0_pf_pins: uart0-pf-pins {
+ pins = "PF2", "PF4";
+ function = "uart0";
+ };
+
+ uart1_pa_pins: uart1-pa-pins {
+ pins = "PA10", "PA11";
+ function = "uart1";
+ };
+
+ uart1_cts_rts_pa_pins: uart1-cts-rts-pa-pins {
+ pins = "PA12", "PIA13";
+ function = "uart2";
+ };
+
+ uart2_pa_pins: uart2-pa-pins {
+ pins = "PIA2", "PIA3";
+ function = "uart2";
+ };
+
+ uart2_cts_rts_pa_pins: uart2-cts-rts-pa-pins {
+ pins = "PA0", "PIA1";
+ function = "uart2";
+ };
+
uart2_pi_pins: uart2-pi-pins {
pins = "PI18", "PI19";
function = "uart2";
@@ -969,6 +994,11 @@
function = "uart3";
};

+ uart3_cts_rts_ph_pins: uart3-cts-rts-ph-pins {
+ pins = "PH2", "PH3";
+ function = "uart3";
+ };
+
uart4_pg_pins: uart4-pg-pins {
pins = "PG10", "PG11";
function = "uart4";
@@ -979,16 +1009,31 @@
function = "uart4";
};

+ uart5_ph_pins: uart5-ph-pins {
+ pins = "PH6", "PH7";
+ function = "uart5";
+ };
+
uart5_pi_pins: uart5-pi-pins {
pins = "PI10", "PI11";
function = "uart5";
};

+ uart6_pa_pins: uart6-pa-pins {
+ pins = "PA12", "PA13";
+ function = "uart6";
+ };
+
uart6_pi_pins: uart6-pi-pins {
pins = "PI12", "PI13";
function = "uart6";
};

+ uart7_pa_pins: uart7-pa-pins {
+ pins = "PA14", "PA15";
+ function = "uart7";
+ };
+
uart7_pi_pins: uart7-pi-pins {
pins = "PI20", "PI21";
function = "uart7";
--
2.20.1



2019-02-20 09:00:06

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

On Sun, Feb 17, 2019 at 2:21 AM Mans Rullgard <[email protected]> wrote:
>
> This adds pinctrl settings for various missing uart options.
>
> Signed-off-by: Mans Rullgard <[email protected]>
> ---
> arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
> index af5b067a5f83..2295ff5adf48 100644
> --- a/arch/arm/boot/dts/sun7i-a20.dtsi
> +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
> @@ -944,6 +944,31 @@
> function = "uart0";
> };
>
> + uart0_pf_pins: uart0-pf-pins {
> + pins = "PF2", "PF4";
> + function = "uart0";
> + };

We've had the policy of not adding pinctrl nodes that aren't used in-tree,
to avoid bloating up the blob size. However DTC 1.4.7 introduced the new
/omit-if-no-ref/ directive, which would make the compiler discard marked
nodes if they aren't referenced.

So please add this to all the new nodes. It seems to work regardless whether
you add it before or after the label, though having it after the label seems
to make vim syntax highlighting happier.

Regards
ChenYu

2019-02-20 09:07:35

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

On Wed, Feb 20, 2019 at 04:58:49PM +0800, Chen-Yu Tsai wrote:
> On Sun, Feb 17, 2019 at 2:21 AM Mans Rullgard <[email protected]> wrote:
> >
> > This adds pinctrl settings for various missing uart options.
> >
> > Signed-off-by: Mans Rullgard <[email protected]>
> > ---
> > arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
> > 1 file changed, 45 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
> > index af5b067a5f83..2295ff5adf48 100644
> > --- a/arch/arm/boot/dts/sun7i-a20.dtsi
> > +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
> > @@ -944,6 +944,31 @@
> > function = "uart0";
> > };
> >
> > + uart0_pf_pins: uart0-pf-pins {
> > + pins = "PF2", "PF4";
> > + function = "uart0";
> > + };
>
> We've had the policy of not adding pinctrl nodes that aren't used in-tree,
> to avoid bloating up the blob size. However DTC 1.4.7 introduced the new
> /omit-if-no-ref/ directive, which would make the compiler discard marked
> nodes if they aren't referenced.
>
> So please add this to all the new nodes. It seems to work regardless whether
> you add it before or after the label, though having it after the label seems
> to make vim syntax highlighting happier.

It also works (both for dtc and vim) if we put it on the previous
line, so something like:

/omit-if-no-ref/
uart0_pf_pins: uart0-pf-pins {
};

And it does have the advantage of keeping the same line width, which
could get pretty long on some nodes.

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (1.74 kB)
signature.asc (235.00 B)
Download all attachments

2019-02-20 10:18:00

by Måns Rullgård

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

Maxime Ripard <[email protected]> writes:

> On Wed, Feb 20, 2019 at 04:58:49PM +0800, Chen-Yu Tsai wrote:
>> On Sun, Feb 17, 2019 at 2:21 AM Mans Rullgard <[email protected]> wrote:
>> >
>> > This adds pinctrl settings for various missing uart options.
>> >
>> > Signed-off-by: Mans Rullgard <[email protected]>
>> > ---
>> > arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
>> > 1 file changed, 45 insertions(+)
>> >
>> > diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
>> > index af5b067a5f83..2295ff5adf48 100644
>> > --- a/arch/arm/boot/dts/sun7i-a20.dtsi
>> > +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
>> > @@ -944,6 +944,31 @@
>> > function = "uart0";
>> > };
>> >
>> > + uart0_pf_pins: uart0-pf-pins {
>> > + pins = "PF2", "PF4";
>> > + function = "uart0";
>> > + };
>>
>> We've had the policy of not adding pinctrl nodes that aren't used in-tree,
>> to avoid bloating up the blob size. However DTC 1.4.7 introduced the new
>> /omit-if-no-ref/ directive, which would make the compiler discard marked
>> nodes if they aren't referenced.
>>
>> So please add this to all the new nodes. It seems to work regardless whether
>> you add it before or after the label, though having it after the label seems
>> to make vim syntax highlighting happier.
>
> It also works (both for dtc and vim) if we put it on the previous
> line, so something like:
>
> /omit-if-no-ref/
> uart0_pf_pins: uart0-pf-pins {
> };
>
> And it does have the advantage of keeping the same line width, which
> could get pretty long on some nodes.

Thanks, I'd missed that directive. It always seems needlessly annoying
to make everybody working on a new board to add those nodes separately.

--
M?ns Rullg?rd

2019-02-20 11:02:16

by Måns Rullgård

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

Maxime Ripard <[email protected]> writes:

> On Wed, Feb 20, 2019 at 04:58:49PM +0800, Chen-Yu Tsai wrote:
>> On Sun, Feb 17, 2019 at 2:21 AM Mans Rullgard <[email protected]> wrote:
>> >
>> > This adds pinctrl settings for various missing uart options.
>> >
>> > Signed-off-by: Mans Rullgard <[email protected]>
>> > ---
>> > arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
>> > 1 file changed, 45 insertions(+)
>> >
>> > diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
>> > index af5b067a5f83..2295ff5adf48 100644
>> > --- a/arch/arm/boot/dts/sun7i-a20.dtsi
>> > +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
>> > @@ -944,6 +944,31 @@
>> > function = "uart0";
>> > };
>> >
>> > + uart0_pf_pins: uart0-pf-pins {
>> > + pins = "PF2", "PF4";
>> > + function = "uart0";
>> > + };
>>
>> We've had the policy of not adding pinctrl nodes that aren't used in-tree,
>> to avoid bloating up the blob size. However DTC 1.4.7 introduced the new
>> /omit-if-no-ref/ directive, which would make the compiler discard marked
>> nodes if they aren't referenced.
>>
>> So please add this to all the new nodes. It seems to work regardless whether
>> you add it before or after the label, though having it after the label seems
>> to make vim syntax highlighting happier.

Should we also add this to existing nodes?

BTW, I really do need all those uart pin options.

--
M?ns Rullg?rd

2019-02-20 12:08:23

by Måns Rullgård

[permalink] [raw]
Subject: [PATCH v2] ARM: dts: sun7i: add pinctrl for missing uart mux options

This adds pinctrl settings for various missing uart options.

Signed-off-by: Mans Rullgard <[email protected]>
---
Changed in v2:
- add /omit-if-no-ref/ tags to new nodes
---
arch/arm/boot/dts/sun7i-a20.dtsi | 54 ++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index af5b067a5f83..76d0c961f01e 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -944,6 +944,36 @@
function = "uart0";
};

+ /omit-if-no-ref/
+ uart0_pf_pins: uart0-pf-pins {
+ pins = "PF2", "PF4";
+ function = "uart0";
+ };
+
+ /omit-if-no-ref/
+ uart1_pa_pins: uart1-pa-pins {
+ pins = "PA10", "PA11";
+ function = "uart1";
+ };
+
+ /omit-if-no-ref/
+ uart1_cts_rts_pa_pins: uart1-cts-rts-pa-pins {
+ pins = "PA12", "PIA13";
+ function = "uart2";
+ };
+
+ /omit-if-no-ref/
+ uart2_pa_pins: uart2-pa-pins {
+ pins = "PIA2", "PIA3";
+ function = "uart2";
+ };
+
+ /omit-if-no-ref/
+ uart2_cts_rts_pa_pins: uart2-cts-rts-pa-pins {
+ pins = "PA0", "PIA1";
+ function = "uart2";
+ };
+
uart2_pi_pins: uart2-pi-pins {
pins = "PI18", "PI19";
function = "uart2";
@@ -969,6 +999,12 @@
function = "uart3";
};

+ /omit-if-no-ref/
+ uart3_cts_rts_ph_pins: uart3-cts-rts-ph-pins {
+ pins = "PH2", "PH3";
+ function = "uart3";
+ };
+
uart4_pg_pins: uart4-pg-pins {
pins = "PG10", "PG11";
function = "uart4";
@@ -979,16 +1015,34 @@
function = "uart4";
};

+ /omit-if-no-ref/
+ uart5_ph_pins: uart5-ph-pins {
+ pins = "PH6", "PH7";
+ function = "uart5";
+ };
+
uart5_pi_pins: uart5-pi-pins {
pins = "PI10", "PI11";
function = "uart5";
};

+ /omit-if-no-ref/
+ uart6_pa_pins: uart6-pa-pins {
+ pins = "PA12", "PA13";
+ function = "uart6";
+ };
+
uart6_pi_pins: uart6-pi-pins {
pins = "PI12", "PI13";
function = "uart6";
};

+ /omit-if-no-ref/
+ uart7_pa_pins: uart7-pa-pins {
+ pins = "PA14", "PA15";
+ function = "uart7";
+ };
+
uart7_pi_pins: uart7-pi-pins {
pins = "PI20", "PI21";
function = "uart7";
--
2.20.1


2019-02-20 15:23:32

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: sun7i: add pinctrl for missing uart mux options

On Wed, Feb 20, 2019 at 7:00 PM Måns Rullgård <[email protected]> wrote:
>
> Maxime Ripard <[email protected]> writes:
>
> > On Wed, Feb 20, 2019 at 04:58:49PM +0800, Chen-Yu Tsai wrote:
> >> On Sun, Feb 17, 2019 at 2:21 AM Mans Rullgard <[email protected]> wrote:
> >> >
> >> > This adds pinctrl settings for various missing uart options.
> >> >
> >> > Signed-off-by: Mans Rullgard <[email protected]>
> >> > ---
> >> > arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++
> >> > 1 file changed, 45 insertions(+)
> >> >
> >> > diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
> >> > index af5b067a5f83..2295ff5adf48 100644
> >> > --- a/arch/arm/boot/dts/sun7i-a20.dtsi
> >> > +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
> >> > @@ -944,6 +944,31 @@
> >> > function = "uart0";
> >> > };
> >> >
> >> > + uart0_pf_pins: uart0-pf-pins {
> >> > + pins = "PF2", "PF4";
> >> > + function = "uart0";
> >> > + };
> >>
> >> We've had the policy of not adding pinctrl nodes that aren't used in-tree,
> >> to avoid bloating up the blob size. However DTC 1.4.7 introduced the new
> >> /omit-if-no-ref/ directive, which would make the compiler discard marked
> >> nodes if they aren't referenced.
> >>
> >> So please add this to all the new nodes. It seems to work regardless whether
> >> you add it before or after the label, though having it after the label seems
> >> to make vim syntax highlighting happier.
>
> Should we also add this to existing nodes?
>
> BTW, I really do need all those uart pin options.

Note that /omit-if-no-ref/ does not work with dtc -@,
as in the node will be removed if no references to it
are found within the same file. It will not result in
a symbol being created.

I have a patch for that but haven't sent it out yet.

ChenYu