diff mbox

[LEDE-DEV,4/4] ramips/RT5350F-OLINUXINO(-EVB) dts: enable ttyS1

Message ID 20170826195401.11224-5-mr.zoltan.gyarmati@gmail.com
State Changes Requested
Headers show

Commit Message

Zoltan Gyarmati Aug. 26, 2017, 7:54 p.m. UTC
The RT5350F's second UART pins are available on the base module and on
the EVB as well, so enable it in the device tree.
 Additionaly, the uartlite@c00 and uart@500 nodes swapped in rt5350.dtsi
to keep the serial console as ttyS0.

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
---
 target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
 target/linux/ramips/dts/rt5350.dtsi            | 30 +++++++++++++-------------
 2 files changed, 25 insertions(+), 16 deletions(-)

Comments

John Crispin Aug. 29, 2017, 7:37 a.m. UTC | #1
Hi,

comment inline


On 26/08/17 21:54, Zoltan Gyarmati wrote:
>   The RT5350F's second UART pins are available on the base module and on
> the EVB as well, so enable it in the device tree.
>   Additionaly, the uartlite@c00 and uart@500 nodes swapped in rt5350.dtsi
> to keep the serial console as ttyS0.
>
> Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
> ---
>   target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
>   target/linux/ramips/dts/rt5350.dtsi            | 30 +++++++++++++-------------
>   2 files changed, 25 insertions(+), 16 deletions(-)
>
> diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
> index 955a13cddd..1632f3c085 100644
> --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
> +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
> @@ -46,9 +46,13 @@
>   &pinctrl {
>   	state_default: pinctrl0 {
>   		gpio {
> -			ralink,group = "jtag", "rgmii", "mdio", "uartf";
> +			ralink,group = "jtag", "rgmii", "mdio";
>   			ralink,function = "gpio";
>   		};
> +		uartf_gpio {
> +			ralink,group = "uartf";
> +			ralink,function = "gpio uartf";
> +		};
>   	};
>   };
>   
> @@ -77,3 +81,8 @@
>   &i2c {
>   	status = "okay";
>   };
> +
> +&uart {
> +	status = "okay";
> +};
> +
> diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
> index a92c113043..f027e17d9d 100644
> --- a/target/linux/ramips/dts/rt5350.dtsi
> +++ b/target/linux/ramips/dts/rt5350.dtsi
> @@ -83,21 +83,6 @@
>   			interrupts = <3>;
>   		};
>   
> -		uart: uart@500 {
> -			compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
> -			reg = <0x500 0x100>;
> -
> -			resets = <&rstctrl 12>;
> -			reset-names = "uart";
> -
> -			interrupt-parent = <&intc>;
> -			interrupts = <5>;
> -
> -			reg-shift = <2>;
> -
> -			status = "disabled";
> -		};
> -
>   		gpio0: gpio@600 {
>   			compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
>   			reg = <0x600 0x34>;
> @@ -221,6 +206,21 @@
>   			reg-shift = <2>;
>   		};
>   
> +		uart: uart@500 {
> +			compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
> +			reg = <0x500 0x100>;
> +
> +			resets = <&rstctrl 12>;
> +			reset-names = "uart";
> +
> +			interrupt-parent = <&intc>;
> +			interrupts = <5>;
> +
> +			reg-shift = <2>;
> +
> +			status = "disabled";
> +		};

moving the node makes no sense. the change is a no-op. please remove it 
and update the patch description

     John

> +
>   		systick: systick@d00 {
>   			compatible = "ralink,rt5350-systick", "ralink,cevt-systick";
>   			reg = <0xd00 0x10>;
Zoltan Gyarmati Sept. 6, 2017, 12:25 a.m. UTC | #2
Dear John&All,

thanks for the review, see my response inline

On 08/29/2017 09:37 AM, John Crispin wrote:
> Hi,
>
> comment inline
>
>
> On 26/08/17 21:54, Zoltan Gyarmati wrote:
>>   The RT5350F's second UART pins are available on the base module and on
>> the EVB as well, so enable it in the device tree.
>>   Additionaly, the uartlite@c00 and uart@500 nodes swapped in
>> rt5350.dtsi
>> to keep the serial console as ttyS0.
>>
>> Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
>> ---
>>   target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
>>   target/linux/ramips/dts/rt5350.dtsi            | 30
>> +++++++++++++-------------
>>   2 files changed, 25 insertions(+), 16 deletions(-)
>>
>> diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>> b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>> index 955a13cddd..1632f3c085 100644
>> --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>> +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>> @@ -46,9 +46,13 @@
>>   &pinctrl {
>>       state_default: pinctrl0 {
>>           gpio {
>> -            ralink,group = "jtag", "rgmii", "mdio", "uartf";
>> +            ralink,group = "jtag", "rgmii", "mdio";
>>               ralink,function = "gpio";
>>           };
>> +        uartf_gpio {
>> +            ralink,group = "uartf";
>> +            ralink,function = "gpio uartf";
>> +        };
>>       };
>>   };
>>   @@ -77,3 +81,8 @@
>>   &i2c {
>>       status = "okay";
>>   };
>> +
>> +&uart {
>> +    status = "okay";
>> +};
>> +
>> diff --git a/target/linux/ramips/dts/rt5350.dtsi
>> b/target/linux/ramips/dts/rt5350.dtsi
>> index a92c113043..f027e17d9d 100644
>> --- a/target/linux/ramips/dts/rt5350.dtsi
>> +++ b/target/linux/ramips/dts/rt5350.dtsi
>> @@ -83,21 +83,6 @@
>>               interrupts = <3>;
>>           };
>>   -        uart: uart@500 {
>> -            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>> "ns16550a";
>> -            reg = <0x500 0x100>;
>> -
>> -            resets = <&rstctrl 12>;
>> -            reset-names = "uart";
>> -
>> -            interrupt-parent = <&intc>;
>> -            interrupts = <5>;
>> -
>> -            reg-shift = <2>;
>> -
>> -            status = "disabled";
>> -        };
>> -
>>           gpio0: gpio@600 {
>>               compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
>>               reg = <0x600 0x34>;
>> @@ -221,6 +206,21 @@
>>               reg-shift = <2>;
>>           };
>>   +        uart: uart@500 {
>> +            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>> "ns16550a";
>> +            reg = <0x500 0x100>;
>> +
>> +            resets = <&rstctrl 12>;
>> +            reset-names = "uart";
>> +
>> +            interrupt-parent = <&intc>;
>> +            interrupts = <5>;
>> +
>> +            reg-shift = <2>;
>> +
>> +            status = "disabled";
>> +        };
>
> moving the node makes no sense. the change is a no-op. please remove
> it and update the patch description


I've just double checked it now, and the order of these nodes does
change the order of the serial port numbering, therefore it's not no-op.
Please see the relevant sections from both dmesg outputs:

#### With original rt5350.dtsi, uart@500 enabled
[    0.565407] gpio-export gpio_export: 3 gpio(s) exported
[    0.576247] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.590942] console [ttyS0] disabled
[    0.598130] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13,
base_baud = 2500000) is a Palmchip BK-3103
[    0.617160] console [ttyS0] enabled
[    0.630939] bootconsole [early0] disabled
[    0.647968] 10000c00.uartlite: ttyS1 at MMIO 0x10000c00 (irq = 20,
base_baud = 2500000) is a Palmchip BK-3103
[    0.680207] spi spi0.0: force spi mode3

#### With swapped items in rt5350.dtsi
[    0.564356] gpio-export gpio_export: 3 gpio(s) exported
[    0.575201] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.590006] console [ttyS0] disabled
[    0.597183] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20,
base_baud = 2500000) is a Palmchip BK-3103
[    0.616906] console [ttyS0] enabled
[    0.630692] bootconsole [early0] disabled
[    0.647677] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13,
base_baud = 2500000) is a Palmchip BK-3103
[    0.678972] spi spi0.0: force spi mode3

Consequently (given that ttyS0 is configured as console in the kernel
command line),
the serial console moves to the pins of uart500 in the second (swapped)
case.
 Do you have any suggestion how to solve this on the level of
RT5350F-OLINUXINO.dtsi, without touching rt5350.dtsi?


>
>     John
>
>> +
>>           systick: systick@d00 {
>>               compatible = "ralink,rt5350-systick",
>> "ralink,cevt-systick";
>>               reg = <0xd00 0x10>;
>

Thanks, regards,

Zoltan Gyarmati
https://zgyarmati.de
Zoltan Gyarmati Sept. 16, 2017, 1:16 p.m. UTC | #3
Dear John & All,

do you have any update regarding to your patch review below?


Thanks, regards,

Zoltan Gyarmati
https://zgyarmati.de

On 09/06/2017 02:25 AM, Zoltan Gyarmati wrote:
> Dear John&All,
>
> thanks for the review, see my response inline
>
> On 08/29/2017 09:37 AM, John Crispin wrote:
>> Hi,
>>
>> comment inline
>>
>>
>> On 26/08/17 21:54, Zoltan Gyarmati wrote:
>>>   The RT5350F's second UART pins are available on the base module and on
>>> the EVB as well, so enable it in the device tree.
>>>   Additionaly, the uartlite@c00 and uart@500 nodes swapped in
>>> rt5350.dtsi
>>> to keep the serial console as ttyS0.
>>>
>>> Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
>>> ---
>>>   target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
>>>   target/linux/ramips/dts/rt5350.dtsi            | 30
>>> +++++++++++++-------------
>>>   2 files changed, 25 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> index 955a13cddd..1632f3c085 100644
>>> --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> @@ -46,9 +46,13 @@
>>>   &pinctrl {
>>>       state_default: pinctrl0 {
>>>           gpio {
>>> -            ralink,group = "jtag", "rgmii", "mdio", "uartf";
>>> +            ralink,group = "jtag", "rgmii", "mdio";
>>>               ralink,function = "gpio";
>>>           };
>>> +        uartf_gpio {
>>> +            ralink,group = "uartf";
>>> +            ralink,function = "gpio uartf";
>>> +        };
>>>       };
>>>   };
>>>   @@ -77,3 +81,8 @@
>>>   &i2c {
>>>       status = "okay";
>>>   };
>>> +
>>> +&uart {
>>> +    status = "okay";
>>> +};
>>> +
>>> diff --git a/target/linux/ramips/dts/rt5350.dtsi
>>> b/target/linux/ramips/dts/rt5350.dtsi
>>> index a92c113043..f027e17d9d 100644
>>> --- a/target/linux/ramips/dts/rt5350.dtsi
>>> +++ b/target/linux/ramips/dts/rt5350.dtsi
>>> @@ -83,21 +83,6 @@
>>>               interrupts = <3>;
>>>           };
>>>   -        uart: uart@500 {
>>> -            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>> "ns16550a";
>>> -            reg = <0x500 0x100>;
>>> -
>>> -            resets = <&rstctrl 12>;
>>> -            reset-names = "uart";
>>> -
>>> -            interrupt-parent = <&intc>;
>>> -            interrupts = <5>;
>>> -
>>> -            reg-shift = <2>;
>>> -
>>> -            status = "disabled";
>>> -        };
>>> -
>>>           gpio0: gpio@600 {
>>>               compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
>>>               reg = <0x600 0x34>;
>>> @@ -221,6 +206,21 @@
>>>               reg-shift = <2>;
>>>           };
>>>   +        uart: uart@500 {
>>> +            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>> "ns16550a";
>>> +            reg = <0x500 0x100>;
>>> +
>>> +            resets = <&rstctrl 12>;
>>> +            reset-names = "uart";
>>> +
>>> +            interrupt-parent = <&intc>;
>>> +            interrupts = <5>;
>>> +
>>> +            reg-shift = <2>;
>>> +
>>> +            status = "disabled";
>>> +        };
>> moving the node makes no sense. the change is a no-op. please remove
>> it and update the patch description
>
> I've just double checked it now, and the order of these nodes does
> change the order of the serial port numbering, therefore it's not no-op.
> Please see the relevant sections from both dmesg outputs:
>
> #### With original rt5350.dtsi, uart@500 enabled
> [    0.565407] gpio-export gpio_export: 3 gpio(s) exported
> [    0.576247] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> [    0.590942] console [ttyS0] disabled
> [    0.598130] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.617160] console [ttyS0] enabled
> [    0.630939] bootconsole [early0] disabled
> [    0.647968] 10000c00.uartlite: ttyS1 at MMIO 0x10000c00 (irq = 20,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.680207] spi spi0.0: force spi mode3
>
> #### With swapped items in rt5350.dtsi
> [    0.564356] gpio-export gpio_export: 3 gpio(s) exported
> [    0.575201] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> [    0.590006] console [ttyS0] disabled
> [    0.597183] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.616906] console [ttyS0] enabled
> [    0.630692] bootconsole [early0] disabled
> [    0.647677] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.678972] spi spi0.0: force spi mode3
>
> Consequently (given that ttyS0 is configured as console in the kernel
> command line),
> the serial console moves to the pins of uart500 in the second (swapped)
> case.
>  Do you have any suggestion how to solve this on the level of
> RT5350F-OLINUXINO.dtsi, without touching rt5350.dtsi?
>
>
>>     John
>>
>>> +
>>>           systick: systick@d00 {
>>>               compatible = "ralink,rt5350-systick",
>>> "ralink,cevt-systick";
>>>               reg = <0xd00 0x10>;
> Thanks, regards,
>
> Zoltan Gyarmati
> https://zgyarmati.de
>
>
Michael Yartys via Lede-dev Sept. 16, 2017, 2:20 p.m. UTC | #4
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Hi Zoltan,

On Wed, Sep 6, 2017 at 2:25 AM, Zoltan Gyarmati
<mr.zoltan.gyarmati@gmail.com> wrote:
> Dear John&All,
>
> thanks for the review, see my response inline
>
> On 08/29/2017 09:37 AM, John Crispin wrote:
>> Hi,
>>
>> comment inline
>>
>>
>> On 26/08/17 21:54, Zoltan Gyarmati wrote:
>>>   The RT5350F's second UART pins are available on the base module and on
>>> the EVB as well, so enable it in the device tree.
>>>   Additionaly, the uartlite@c00 and uart@500 nodes swapped in
>>> rt5350.dtsi
>>> to keep the serial console as ttyS0.
>>>
>>> Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
>>> ---
>>>   target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
>>>   target/linux/ramips/dts/rt5350.dtsi            | 30
>>> +++++++++++++-------------
>>>   2 files changed, 25 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> index 955a13cddd..1632f3c085 100644
>>> --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>> @@ -46,9 +46,13 @@
>>>   &pinctrl {
>>>       state_default: pinctrl0 {
>>>           gpio {
>>> -            ralink,group = "jtag", "rgmii", "mdio", "uartf";
>>> +            ralink,group = "jtag", "rgmii", "mdio";
>>>               ralink,function = "gpio";
>>>           };
>>> +        uartf_gpio {
>>> +            ralink,group = "uartf";
>>> +            ralink,function = "gpio uartf";
>>> +        };
>>>       };
>>>   };
>>>   @@ -77,3 +81,8 @@
>>>   &i2c {
>>>       status = "okay";
>>>   };
>>> +
>>> +&uart {
>>> +    status = "okay";
>>> +};
>>> +
>>> diff --git a/target/linux/ramips/dts/rt5350.dtsi
>>> b/target/linux/ramips/dts/rt5350.dtsi
>>> index a92c113043..f027e17d9d 100644
>>> --- a/target/linux/ramips/dts/rt5350.dtsi
>>> +++ b/target/linux/ramips/dts/rt5350.dtsi
>>> @@ -83,21 +83,6 @@
>>>               interrupts = <3>;
>>>           };
>>>   -        uart: uart@500 {
>>> -            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>> "ns16550a";
>>> -            reg = <0x500 0x100>;
>>> -
>>> -            resets = <&rstctrl 12>;
>>> -            reset-names = "uart";
>>> -
>>> -            interrupt-parent = <&intc>;
>>> -            interrupts = <5>;
>>> -
>>> -            reg-shift = <2>;
>>> -
>>> -            status = "disabled";
>>> -        };
>>> -
>>>           gpio0: gpio@600 {
>>>               compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
>>>               reg = <0x600 0x34>;
>>> @@ -221,6 +206,21 @@
>>>               reg-shift = <2>;
>>>           };
>>>   +        uart: uart@500 {
>>> +            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>> "ns16550a";
>>> +            reg = <0x500 0x100>;
>>> +
>>> +            resets = <&rstctrl 12>;
>>> +            reset-names = "uart";
>>> +
>>> +            interrupt-parent = <&intc>;
>>> +            interrupts = <5>;
>>> +
>>> +            reg-shift = <2>;
>>> +
>>> +            status = "disabled";
>>> +        };
>>
>> moving the node makes no sense. the change is a no-op. please remove
>> it and update the patch description
>
>
> I've just double checked it now, and the order of these nodes does
> change the order of the serial port numbering, therefore it's not no-op.
> Please see the relevant sections from both dmesg outputs:
have you tried using the devicetree aliases node (see [0] for example)
to configure the order?

> #### With original rt5350.dtsi, uart@500 enabled
> [ 0.565407] gpio-export gpio_export: 3 gpio(s) exported
> [ 0.576247] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> [ 0.590942] console [ttyS0] disabled
> [    0.598130] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.617160] console [ttyS0] enabled
> [    0.630939] bootconsole [early0] disabled
> [    0.647968] 10000c00.uartlite: ttyS1 at MMIO 0x10000c00 (irq = 20,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.680207] spi spi0.0: force spi mode3
>
> #### With swapped items in rt5350.dtsi
> [    0.564356] gpio-export gpio_export: 3 gpio(s) exported
> [    0.575201] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> [    0.590006] console [ttyS0] disabled
> [    0.597183] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.616906] console [ttyS0] enabled
> [    0.630692] bootconsole [early0] disabled
> [    0.647677] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13,
> base_baud = 2500000) is a Palmchip BK-3103
> [    0.678972] spi spi0.0: force spi mode3
>
> Consequently (given that ttyS0 is configured as console in the kernel
> command line),
> the serial console moves to the pins of uart500 in the second (swapped)
> case.
>  Do you have any suggestion how to solve this on the level of
> RT5350F-OLINUXINO.dtsi, without touching rt5350.dtsi?
>
>
>>
>>     John
>>
>>> +
>>>           systick: systick@d00 {
>>>               compatible = "ralink,rt5350-systick",
>>> "ralink,cevt-systick";
>>>               reg = <0xd00 0x10>;
>>
>
> Thanks, regards,
>
> Zoltan Gyarmati
> https://zgyarmati.de
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>


[0] http://elinux.org/Device_Tree_Usage#aliases_Node
Zoltan Gyarmati Sept. 19, 2017, 9:49 p.m. UTC | #5
Dear Martin & All,

On 09/16/2017 04:19 PM, Martin Blumenstingl wrote:
> Hi Zoltan,
>
> On Wed, Sep 6, 2017 at 2:25 AM, Zoltan Gyarmati
> <mr.zoltan.gyarmati@gmail.com> wrote:
>> Dear John&All,
>>
>> thanks for the review, see my response inline
>>
>> On 08/29/2017 09:37 AM, John Crispin wrote:
>>> Hi,
>>>
>>> comment inline
>>>
>>>
>>> On 26/08/17 21:54, Zoltan Gyarmati wrote:
>>>>   The RT5350F's second UART pins are available on the base module and on
>>>> the EVB as well, so enable it in the device tree.
>>>>   Additionaly, the uartlite@c00 and uart@500 nodes swapped in
>>>> rt5350.dtsi
>>>> to keep the serial console as ttyS0.
>>>>
>>>> Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
>>>> ---
>>>>   target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 11 +++++++++-
>>>>   target/linux/ramips/dts/rt5350.dtsi            | 30
>>>> +++++++++++++-------------
>>>>   2 files changed, 25 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>>> b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>>> index 955a13cddd..1632f3c085 100644
>>>> --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>>> +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
>>>> @@ -46,9 +46,13 @@
>>>>   &pinctrl {
>>>>       state_default: pinctrl0 {
>>>>           gpio {
>>>> -            ralink,group = "jtag", "rgmii", "mdio", "uartf";
>>>> +            ralink,group = "jtag", "rgmii", "mdio";
>>>>               ralink,function = "gpio";
>>>>           };
>>>> +        uartf_gpio {
>>>> +            ralink,group = "uartf";
>>>> +            ralink,function = "gpio uartf";
>>>> +        };
>>>>       };
>>>>   };
>>>>   @@ -77,3 +81,8 @@
>>>>   &i2c {
>>>>       status = "okay";
>>>>   };
>>>> +
>>>> +&uart {
>>>> +    status = "okay";
>>>> +};
>>>> +
>>>> diff --git a/target/linux/ramips/dts/rt5350.dtsi
>>>> b/target/linux/ramips/dts/rt5350.dtsi
>>>> index a92c113043..f027e17d9d 100644
>>>> --- a/target/linux/ramips/dts/rt5350.dtsi
>>>> +++ b/target/linux/ramips/dts/rt5350.dtsi
>>>> @@ -83,21 +83,6 @@
>>>>               interrupts = <3>;
>>>>           };
>>>>   -        uart: uart@500 {
>>>> -            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>>> "ns16550a";
>>>> -            reg = <0x500 0x100>;
>>>> -
>>>> -            resets = <&rstctrl 12>;
>>>> -            reset-names = "uart";
>>>> -
>>>> -            interrupt-parent = <&intc>;
>>>> -            interrupts = <5>;
>>>> -
>>>> -            reg-shift = <2>;
>>>> -
>>>> -            status = "disabled";
>>>> -        };
>>>> -
>>>>           gpio0: gpio@600 {
>>>>               compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
>>>>               reg = <0x600 0x34>;
>>>> @@ -221,6 +206,21 @@
>>>>               reg-shift = <2>;
>>>>           };
>>>>   +        uart: uart@500 {
>>>> +            compatible = "ralink,rt5350-uart", "ralink,rt2880-uart",
>>>> "ns16550a";
>>>> +            reg = <0x500 0x100>;
>>>> +
>>>> +            resets = <&rstctrl 12>;
>>>> +            reset-names = "uart";
>>>> +
>>>> +            interrupt-parent = <&intc>;
>>>> +            interrupts = <5>;
>>>> +
>>>> +            reg-shift = <2>;
>>>> +
>>>> +            status = "disabled";
>>>> +        };
>>> moving the node makes no sense. the change is a no-op. please remove
>>> it and update the patch description
>>
>> I've just double checked it now, and the order of these nodes does
>> change the order of the serial port numbering, therefore it's not no-op.
>> Please see the relevant sections from both dmesg outputs:
> have you tried using the devicetree aliases node (see [0] for example)
> to configure the order?
>
>> #### With original rt5350.dtsi, uart@500 enabled
>> [ 0.565407] gpio-export gpio_export: 3 gpio(s) exported
>> [ 0.576247] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
>> [ 0.590942] console [ttyS0] disabled
>> [    0.598130] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13,
>> base_baud = 2500000) is a Palmchip BK-3103
>> [    0.617160] console [ttyS0] enabled
>> [    0.630939] bootconsole [early0] disabled
>> [    0.647968] 10000c00.uartlite: ttyS1 at MMIO 0x10000c00 (irq = 20,
>> base_baud = 2500000) is a Palmchip BK-3103
>> [    0.680207] spi spi0.0: force spi mode3
>>
>> #### With swapped items in rt5350.dtsi
>> [    0.564356] gpio-export gpio_export: 3 gpio(s) exported
>> [    0.575201] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
>> [    0.590006] console [ttyS0] disabled
>> [    0.597183] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20,
>> base_baud = 2500000) is a Palmchip BK-3103
>> [    0.616906] console [ttyS0] enabled
>> [    0.630692] bootconsole [early0] disabled
>> [    0.647677] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13,
>> base_baud = 2500000) is a Palmchip BK-3103
>> [    0.678972] spi spi0.0: force spi mode3
>>
>> Consequently (given that ttyS0 is configured as console in the kernel
>> command line),
>> the serial console moves to the pins of uart500 in the second (swapped)
>> case.
>>  Do you have any suggestion how to solve this on the level of
>> RT5350F-OLINUXINO.dtsi, without touching rt5350.dtsi?

Thanks for the hint! I've got it working without changing rt5350.dtsi,
I'm going to send a V1 of the patchset.


>>
>>>     John
>>>
>>>> +
>>>>           systick: systick@d00 {
>>>>               compatible = "ralink,rt5350-systick",
>>>> "ralink,cevt-systick";
>>>>               reg = <0xd00 0x10>;
>> Thanks, regards,
>>
>> Zoltan Gyarmati
>> https://zgyarmati.de
>>
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>
> [0] http://elinux.org/Device_Tree_Usage#aliases_Node

Regards,

Zoltan Gyarmati
https://zgyarmati.de
diff mbox

Patch

diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
index 955a13cddd..1632f3c085 100644
--- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
+++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi
@@ -46,9 +46,13 @@ 
 &pinctrl {
 	state_default: pinctrl0 {
 		gpio {
-			ralink,group = "jtag", "rgmii", "mdio", "uartf";
+			ralink,group = "jtag", "rgmii", "mdio";
 			ralink,function = "gpio";
 		};
+		uartf_gpio {
+			ralink,group = "uartf";
+			ralink,function = "gpio uartf";
+		};
 	};
 };
 
@@ -77,3 +81,8 @@ 
 &i2c {
 	status = "okay";
 };
+
+&uart {
+	status = "okay";
+};
+
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index a92c113043..f027e17d9d 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -83,21 +83,6 @@ 
 			interrupts = <3>;
 		};
 
-		uart: uart@500 {
-			compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
-			reg = <0x500 0x100>;
-
-			resets = <&rstctrl 12>;
-			reset-names = "uart";
-
-			interrupt-parent = <&intc>;
-			interrupts = <5>;
-
-			reg-shift = <2>;
-
-			status = "disabled";
-		};
-
 		gpio0: gpio@600 {
 			compatible = "ralink,rt5350-gpio", "ralink,rt2880-gpio";
 			reg = <0x600 0x34>;
@@ -221,6 +206,21 @@ 
 			reg-shift = <2>;
 		};
 
+		uart: uart@500 {
+			compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0x500 0x100>;
+
+			resets = <&rstctrl 12>;
+			reset-names = "uart";
+
+			interrupt-parent = <&intc>;
+			interrupts = <5>;
+
+			reg-shift = <2>;
+
+			status = "disabled";
+		};
+
 		systick: systick@d00 {
 			compatible = "ralink,rt5350-systick", "ralink,cevt-systick";
 			reg = <0xd00 0x10>;