2018-03-07 08:52:35

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH v3 0/3] Fix STi aliases property name

From: Patrice Chotard <[email protected]>

Since dtc v1.4.6-9-gaadd0b65c987, when compiling dtb with W=1 option,
the following warnings are triggered :

arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'

_ Patch 1, convert the aliases property name in lowercase in
all STi board dts files.

_ Patch 2, remove "console=serialN" from bootargs property

_ Patch 3, rework the tty driver st-asc accordingly, as aliases id is retrieved
using of_alias_get_id() with a defined string with is not lowercase only.

v3: Fix Rob Herring's remarks :
_ remove "console=serialN,115200" from bootargs and use prefered stdout-path property
_ update st-asc driver with "serial" alias prefix and keep "ttyAS" in second choice

v2: Fix Rob Herring's remarks :
_ use serialN instead of ttyasN aliases to not break ABI
_ remove useless stdout-path property
_ update st-asc driver with "serial" alias prefix

Patrice Chotard (3):
ARM: dts: STi: Fix aliases property name for STi boards
ARM: dts: STi: Remove console=serialN from bootargs for STi boards
tty: st-asc: Update tty alias

arch/arm/boot/dts/stih407-b2120.dts | 4 ++--
arch/arm/boot/dts/stih410-b2120.dts | 4 ++--
arch/arm/boot/dts/stih410-b2260.dts | 4 ++--
arch/arm/boot/dts/stih418-b2199.dts | 4 ++--
drivers/tty/serial/st-asc.c | 4 +++-
5 files changed, 11 insertions(+), 9 deletions(-)

--
1.9.1



2018-03-07 08:51:49

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH v3 3/3] tty: st-asc: Update tty alias

From: Patrice Chotard <[email protected]>

Since dtc v1.4.6-9-gaadd0b65c987, aliases property name
must include only lowercase and '-'.

After having updated all STi boards serial aliases from "ttyASN"
to "serialN", st-asc driver need to be updated accordingly as tty
aliases id is retrieved using of_alias_get_id().

Signed-off-by: Patrice Chotard <[email protected]>
---
v3: _ update st-asc driver with "serial" alias prefix and keep "ttyAS" in second choice
v2: _ update st-asc driver with "serial" alias prefix

drivers/tty/serial/st-asc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index c763253514e9..5f9f01fac6dd 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -782,7 +782,9 @@ static struct asc_port *asc_of_get_asc_port(struct platform_device *pdev)
if (!np)
return NULL;

- id = of_alias_get_id(np, ASC_SERIAL_NAME);
+ id = of_alias_get_id(np, "serial");
+ if (id < 0)
+ id = of_alias_get_id(np, ASC_SERIAL_NAME);

if (id < 0)
id = 0;
--
1.9.1


2018-03-07 08:51:55

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH v3 2/3] ARM: dts: STi: Remove console=serialN from bootargs for STi boards

From: Patrice Chotard <[email protected]>

As serial interface is already specified into stdout-path property,
"console=serialN,115200" from bootargs can be removed.

Signed-off-by: Patrice Chotard <[email protected]>
---
v3: _ remove "console=serialN,115200" from bootargs and use prefered
stdout-path property
v2: _ none

arch/arm/boot/dts/stih407-b2120.dts | 2 +-
arch/arm/boot/dts/stih410-b2120.dts | 2 +-
arch/arm/boot/dts/stih410-b2260.dts | 2 +-
arch/arm/boot/dts/stih418-b2199.dts | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-b2120.dts b/arch/arm/boot/dts/stih407-b2120.dts
index 2c4d6033b448..62ce1cecbb1f 100644
--- a/arch/arm/boot/dts/stih407-b2120.dts
+++ b/arch/arm/boot/dts/stih407-b2120.dts
@@ -14,7 +14,7 @@
compatible = "st,stih407-b2120", "st,stih407";

chosen {
- bootargs = "console=serial0,115200 clk_ignore_unused";
+ bootargs = "clk_ignore_unused";
stdout-path = &sbc_serial0;
};

diff --git a/arch/arm/boot/dts/stih410-b2120.dts b/arch/arm/boot/dts/stih410-b2120.dts
index 5422850641e8..2a5a9802a5ec 100644
--- a/arch/arm/boot/dts/stih410-b2120.dts
+++ b/arch/arm/boot/dts/stih410-b2120.dts
@@ -14,7 +14,7 @@
compatible = "st,stih410-b2120", "st,stih410";

chosen {
- bootargs = "console=serial0,115200 clk_ignore_unused";
+ bootargs = "clk_ignore_unused";
stdout-path = &sbc_serial0;
};

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index ca347160e35d..155caa8c002a 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -15,7 +15,7 @@
compatible = "st,stih410-b2260", "st,stih410";

chosen {
- bootargs = "console=serial1,115200 clk_ignore_unused";
+ bootargs = "clk_ignore_unused";
stdout-path = &uart1;
};

diff --git a/arch/arm/boot/dts/stih418-b2199.dts b/arch/arm/boot/dts/stih418-b2199.dts
index dbf7bb704a1a..cd0d719e31b7 100644
--- a/arch/arm/boot/dts/stih418-b2199.dts
+++ b/arch/arm/boot/dts/stih418-b2199.dts
@@ -14,7 +14,7 @@
compatible = "st,stih418-b2199", "st,stih418";

chosen {
- bootargs = "console=serial0,115200 clk_ignore_unused";
+ bootargs = "clk_ignore_unused";
stdout-path = &sbc_serial0;
};

--
1.9.1


2018-03-07 08:52:35

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH v3 1/3] ARM: dts: STi: Fix aliases property name for STi boards

From: Patrice Chotard <[email protected]>

Update serial aliases from "ttyASN" to more common "serialN".

Since dtc v1.4.6-9-gaadd0b65c987, aliases property name must
be lowercase only. This allows to fix following dtc warnings:

arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'

Signed-off-by: Patrice Chotard <[email protected]>
---

v3: _ none
v2: _ use serialN instead of ttyasN aliases to not break ABI

arch/arm/boot/dts/stih407-b2120.dts | 4 ++--
arch/arm/boot/dts/stih410-b2120.dts | 4 ++--
arch/arm/boot/dts/stih410-b2260.dts | 4 ++--
arch/arm/boot/dts/stih418-b2199.dts | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-b2120.dts b/arch/arm/boot/dts/stih407-b2120.dts
index de3c8bf129b5..2c4d6033b448 100644
--- a/arch/arm/boot/dts/stih407-b2120.dts
+++ b/arch/arm/boot/dts/stih407-b2120.dts
@@ -14,7 +14,7 @@
compatible = "st,stih407-b2120", "st,stih407";

chosen {
- bootargs = "console=ttyAS0,115200 clk_ignore_unused";
+ bootargs = "console=serial0,115200 clk_ignore_unused";
stdout-path = &sbc_serial0;
};

@@ -24,7 +24,7 @@
};

aliases {
- ttyAS0 = &sbc_serial0;
+ serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

diff --git a/arch/arm/boot/dts/stih410-b2120.dts b/arch/arm/boot/dts/stih410-b2120.dts
index 0a59b7b0f4b2..5422850641e8 100644
--- a/arch/arm/boot/dts/stih410-b2120.dts
+++ b/arch/arm/boot/dts/stih410-b2120.dts
@@ -14,7 +14,7 @@
compatible = "st,stih410-b2120", "st,stih410";

chosen {
- bootargs = "console=ttyAS0,115200 clk_ignore_unused";
+ bootargs = "console=serial0,115200 clk_ignore_unused";
stdout-path = &sbc_serial0;
};

@@ -24,7 +24,7 @@
};

aliases {
- ttyAS0 = &sbc_serial0;
+ serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index feb8834478fa..ca347160e35d 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -15,7 +15,7 @@
compatible = "st,stih410-b2260", "st,stih410";

chosen {
- bootargs = "console=ttyAS1,115200 clk_ignore_unused";
+ bootargs = "console=serial1,115200 clk_ignore_unused";
stdout-path = &uart1;
};

@@ -25,7 +25,7 @@
};

aliases {
- ttyAS1 = &uart1;
+ serial1 = &uart1;
ethernet0 = &ethernet0;
};

diff --git a/arch/arm/boot/dts/stih418-b2199.dts b/arch/arm/boot/dts/stih418-b2199.dts
index 39b4db2e3507..dbf7bb704a1a 100644
--- a/arch/arm/boot/dts/stih418-b2199.dts
+++ b/arch/arm/boot/dts/stih418-b2199.dts
@@ -14,7 +14,7 @@
compatible = "st,stih418-b2199", "st,stih418";

chosen {
- bootargs = "console=ttyAS0,115200 clk_ignore_unused";
+ bootargs = "console=serial0,115200 clk_ignore_unused";
stdout-path = &sbc_serial0;
};

@@ -24,7 +24,7 @@
};

aliases {
- ttyAS0 = &sbc_serial0;
+ serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

--
1.9.1


2018-03-07 16:16:26

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] tty: st-asc: Update tty alias

On Wed, Mar 7, 2018 at 2:49 AM, <[email protected]> wrote:
> From: Patrice Chotard <[email protected]>
>
> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name
> must include only lowercase and '-'.
>
> After having updated all STi boards serial aliases from "ttyASN"
> to "serialN", st-asc driver need to be updated accordingly as tty
> aliases id is retrieved using of_alias_get_id().
>
> Signed-off-by: Patrice Chotard <[email protected]>
> ---
> v3: _ update st-asc driver with "serial" alias prefix and keep "ttyAS" in second choice
> v2: _ update st-asc driver with "serial" alias prefix
>
> drivers/tty/serial/st-asc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Rob Herring <[email protected]>

2018-03-07 16:17:54

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] ARM: dts: STi: Fix aliases property name for STi boards

On Wed, Mar 7, 2018 at 2:49 AM, <[email protected]> wrote:
> From: Patrice Chotard <[email protected]>
>
> Update serial aliases from "ttyASN" to more common "serialN".
>
> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name must
> be lowercase only. This allows to fix following dtc warnings:
>
> arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>
> Signed-off-by: Patrice Chotard <[email protected]>
> ---
>
> v3: _ none
> v2: _ use serialN instead of ttyasN aliases to not break ABI
>
> arch/arm/boot/dts/stih407-b2120.dts | 4 ++--
> arch/arm/boot/dts/stih410-b2120.dts | 4 ++--
> arch/arm/boot/dts/stih410-b2260.dts | 4 ++--
> arch/arm/boot/dts/stih418-b2199.dts | 4 ++--
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/boot/dts/stih407-b2120.dts b/arch/arm/boot/dts/stih407-b2120.dts
> index de3c8bf129b5..2c4d6033b448 100644
> --- a/arch/arm/boot/dts/stih407-b2120.dts
> +++ b/arch/arm/boot/dts/stih407-b2120.dts
> @@ -14,7 +14,7 @@
> compatible = "st,stih407-b2120", "st,stih407";
>
> chosen {
> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
> + bootargs = "console=serial0,115200 clk_ignore_unused";

These hunks for bootargs are still wrong. You wouldn't boot with a
console if you only apply patch 1. These hunks should be squashed with
patch 2.

> stdout-path = &sbc_serial0;
> };
>
> @@ -24,7 +24,7 @@
> };
>
> aliases {
> - ttyAS0 = &sbc_serial0;
> + serial0 = &sbc_serial0;
> ethernet0 = &ethernet0;
> };
>
> diff --git a/arch/arm/boot/dts/stih410-b2120.dts b/arch/arm/boot/dts/stih410-b2120.dts
> index 0a59b7b0f4b2..5422850641e8 100644
> --- a/arch/arm/boot/dts/stih410-b2120.dts
> +++ b/arch/arm/boot/dts/stih410-b2120.dts
> @@ -14,7 +14,7 @@
> compatible = "st,stih410-b2120", "st,stih410";
>
> chosen {
> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
> + bootargs = "console=serial0,115200 clk_ignore_unused";
> stdout-path = &sbc_serial0;
> };
>
> @@ -24,7 +24,7 @@
> };
>
> aliases {
> - ttyAS0 = &sbc_serial0;
> + serial0 = &sbc_serial0;
> ethernet0 = &ethernet0;
> };
>
> diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
> index feb8834478fa..ca347160e35d 100644
> --- a/arch/arm/boot/dts/stih410-b2260.dts
> +++ b/arch/arm/boot/dts/stih410-b2260.dts
> @@ -15,7 +15,7 @@
> compatible = "st,stih410-b2260", "st,stih410";
>
> chosen {
> - bootargs = "console=ttyAS1,115200 clk_ignore_unused";
> + bootargs = "console=serial1,115200 clk_ignore_unused";
> stdout-path = &uart1;
> };
>
> @@ -25,7 +25,7 @@
> };
>
> aliases {
> - ttyAS1 = &uart1;
> + serial1 = &uart1;
> ethernet0 = &ethernet0;
> };
>
> diff --git a/arch/arm/boot/dts/stih418-b2199.dts b/arch/arm/boot/dts/stih418-b2199.dts
> index 39b4db2e3507..dbf7bb704a1a 100644
> --- a/arch/arm/boot/dts/stih418-b2199.dts
> +++ b/arch/arm/boot/dts/stih418-b2199.dts
> @@ -14,7 +14,7 @@
> compatible = "st,stih418-b2199", "st,stih418";
>
> chosen {
> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
> + bootargs = "console=serial0,115200 clk_ignore_unused";
> stdout-path = &sbc_serial0;
> };
>
> @@ -24,7 +24,7 @@
> };
>
> aliases {
> - ttyAS0 = &sbc_serial0;
> + serial0 = &sbc_serial0;
> ethernet0 = &ethernet0;
> };
>
> --
> 1.9.1
>

2018-03-07 17:14:03

by Patrice CHOTARD

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] ARM: dts: STi: Fix aliases property name for STi boards

Hi Rob

On 03/07/2018 05:15 PM, Rob Herring wrote:
> On Wed, Mar 7, 2018 at 2:49 AM, <[email protected]> wrote:
>> From: Patrice Chotard <[email protected]>
>>
>> Update serial aliases from "ttyASN" to more common "serialN".
>>
>> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name must
>> be lowercase only. This allows to fix following dtc warnings:
>>
>> arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>> arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>> arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>> arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>>
>> Signed-off-by: Patrice Chotard <[email protected]>
>> ---
>>
>> v3: _ none
>> v2: _ use serialN instead of ttyasN aliases to not break ABI
>>
>> arch/arm/boot/dts/stih407-b2120.dts | 4 ++--
>> arch/arm/boot/dts/stih410-b2120.dts | 4 ++--
>> arch/arm/boot/dts/stih410-b2260.dts | 4 ++--
>> arch/arm/boot/dts/stih418-b2199.dts | 4 ++--
>> 4 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/stih407-b2120.dts b/arch/arm/boot/dts/stih407-b2120.dts
>> index de3c8bf129b5..2c4d6033b448 100644
>> --- a/arch/arm/boot/dts/stih407-b2120.dts
>> +++ b/arch/arm/boot/dts/stih407-b2120.dts
>> @@ -14,7 +14,7 @@
>> compatible = "st,stih407-b2120", "st,stih407";
>>
>> chosen {
>> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
>> + bootargs = "console=serial0,115200 clk_ignore_unused";
>
> These hunks for bootargs are still wrong. You wouldn't boot with a
> console if you only apply patch 1. These hunks should be squashed with
> patch 2.

Thanks for pointing this, i even noticed that patches must be reordered,
first st-asc driver update and then DTS patches.

Thanks

Patrice

>
>> stdout-path = &sbc_serial0;
>> };
>>
>> @@ -24,7 +24,7 @@
>> };
>>
>> aliases {
>> - ttyAS0 = &sbc_serial0;
>> + serial0 = &sbc_serial0;
>> ethernet0 = &ethernet0;
>> };
>>
>> diff --git a/arch/arm/boot/dts/stih410-b2120.dts b/arch/arm/boot/dts/stih410-b2120.dts
>> index 0a59b7b0f4b2..5422850641e8 100644
>> --- a/arch/arm/boot/dts/stih410-b2120.dts
>> +++ b/arch/arm/boot/dts/stih410-b2120.dts
>> @@ -14,7 +14,7 @@
>> compatible = "st,stih410-b2120", "st,stih410";
>>
>> chosen {
>> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
>> + bootargs = "console=serial0,115200 clk_ignore_unused";
>> stdout-path = &sbc_serial0;
>> };
>>
>> @@ -24,7 +24,7 @@
>> };
>>
>> aliases {
>> - ttyAS0 = &sbc_serial0;
>> + serial0 = &sbc_serial0;
>> ethernet0 = &ethernet0;
>> };
>>
>> diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
>> index feb8834478fa..ca347160e35d 100644
>> --- a/arch/arm/boot/dts/stih410-b2260.dts
>> +++ b/arch/arm/boot/dts/stih410-b2260.dts
>> @@ -15,7 +15,7 @@
>> compatible = "st,stih410-b2260", "st,stih410";
>>
>> chosen {
>> - bootargs = "console=ttyAS1,115200 clk_ignore_unused";
>> + bootargs = "console=serial1,115200 clk_ignore_unused";
>> stdout-path = &uart1;
>> };
>>
>> @@ -25,7 +25,7 @@
>> };
>>
>> aliases {
>> - ttyAS1 = &uart1;
>> + serial1 = &uart1;
>> ethernet0 = &ethernet0;
>> };
>>
>> diff --git a/arch/arm/boot/dts/stih418-b2199.dts b/arch/arm/boot/dts/stih418-b2199.dts
>> index 39b4db2e3507..dbf7bb704a1a 100644
>> --- a/arch/arm/boot/dts/stih418-b2199.dts
>> +++ b/arch/arm/boot/dts/stih418-b2199.dts
>> @@ -14,7 +14,7 @@
>> compatible = "st,stih418-b2199", "st,stih418";
>>
>> chosen {
>> - bootargs = "console=ttyAS0,115200 clk_ignore_unused";
>> + bootargs = "console=serial0,115200 clk_ignore_unused";
>> stdout-path = &sbc_serial0;
>> };
>>
>> @@ -24,7 +24,7 @@
>> };
>>
>> aliases {
>> - ttyAS0 = &sbc_serial0;
>> + serial0 = &sbc_serial0;
>> ethernet0 = &ethernet0;
>> };
>>
>> --
>> 1.9.1
>>