linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Loongson: Add support for serial console
@ 2020-05-16  7:03 Tiezhu Yang
  2020-05-16  7:16 ` Jiaxun Yang
  2020-05-16 11:09 ` WANG Xuerui
  0 siblings, 2 replies; 5+ messages in thread
From: Tiezhu Yang @ 2020-05-16  7:03 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
  Cc: linux-mips, linux-kernel, Xuefeng Li

After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"),
there already exists the node and property of Loongson CPU UART0
in loongson3-package.dtsi:

cpu_uart0: serial@1fe001e0 {
        compatible = "ns16550a";
        reg = <0 0x1fe001e0 0x8>;
        clock-frequency = <33000000>;
        interrupt-parent = <&liointc>;
        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
        no-loopback-test;
};

In order to support for serial console on the Loongson platform,
add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig.

With this patch, we can see the following boot message:

[    1.877745] printk: console [ttyS0] disabled
[    1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, base_baud = 2062500) is a 16550A
[    1.890838] printk: console [ttyS0] enabled

And also, we can login normally from the serial console.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

Hi Jiaxun,

Thank you very much for your suggestion.

 arch/mips/configs/loongson3_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 6768c16..cd95f08 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -217,6 +217,7 @@ CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_HW_RANDOM=y
 CONFIG_RAW_DRIVER=m
 CONFIG_I2C_CHARDEV=y
-- 
2.1.0


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

* Re: [PATCH] MIPS: Loongson: Add support for serial console
  2020-05-16  7:03 [PATCH] MIPS: Loongson: Add support for serial console Tiezhu Yang
@ 2020-05-16  7:16 ` Jiaxun Yang
  2020-05-16 11:09 ` WANG Xuerui
  1 sibling, 0 replies; 5+ messages in thread
From: Jiaxun Yang @ 2020-05-16  7:16 UTC (permalink / raw)
  To: Tiezhu Yang, Thomas Bogendoerfer, Huacai Chen
  Cc: linux-mips, linux-kernel, Xuefeng Li



于 2020年5月16日 GMT+08:00 下午3:03:08, Tiezhu Yang <yangtiezhu@loongson.cn> 写到:
>After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"),
>there already exists the node and property of Loongson CPU UART0
>in loongson3-package.dtsi:
>
>cpu_uart0: serial@1fe001e0 {
>        compatible = "ns16550a";
>        reg = <0 0x1fe001e0 0x8>;
>        clock-frequency = <33000000>;
>        interrupt-parent = <&liointc>;
>        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
>        no-loopback-test;
>};
>
>In order to support for serial console on the Loongson platform,
>add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig.
>
>With this patch, we can see the following boot message:
>
>[    1.877745] printk: console [ttyS0] disabled
>[    1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, base_baud = 2062500) is a 16550A
>[    1.890838] printk: console [ttyS0] enabled
>
>And also, we can login normally from the serial console.
>
>Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>---
>
>Hi Jiaxun,
>
>Thank you very much for your suggestion.

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

Looks like we need a Kconfig clean up.
I'll do that after getting LS7A PCH support merged.

Anyway, thanks for catching this.

[...]
-- 
Jiaxun Yang

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

* Re: [PATCH] MIPS: Loongson: Add support for serial console
  2020-05-16  7:03 [PATCH] MIPS: Loongson: Add support for serial console Tiezhu Yang
  2020-05-16  7:16 ` Jiaxun Yang
@ 2020-05-16 11:09 ` WANG Xuerui
  2020-05-18  1:08   ` Tiezhu Yang
  1 sibling, 1 reply; 5+ messages in thread
From: WANG Xuerui @ 2020-05-16 11:09 UTC (permalink / raw)
  To: Tiezhu Yang, Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
  Cc: linux-mips, linux-kernel, Xuefeng Li

On 5/16/20 3:03 PM, Tiezhu Yang wrote:

> After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"),
> there already exists the node and property of Loongson CPU UART0
> in loongson3-package.dtsi:
>
> cpu_uart0: serial@1fe001e0 {
>          compatible = "ns16550a";
>          reg = <0 0x1fe001e0 0x8>;
>          clock-frequency = <33000000>;
>          interrupt-parent = <&liointc>;
>          interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
>          no-loopback-test;
> };
>
> In order to support for serial console on the Loongson platform,
> add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig.
>
> With this patch, we can see the following boot message:
>
> [    1.877745] printk: console [ttyS0] disabled
> [    1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, base_baud = 2062500) is a 16550A
> [    1.890838] printk: console [ttyS0] enabled
>
> And also, we can login normally from the serial console.
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>
> Hi Jiaxun,
>
> Thank you very much for your suggestion.
>
>   arch/mips/configs/loongson3_defconfig | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
> index 6768c16..cd95f08 100644
> --- a/arch/mips/configs/loongson3_defconfig
> +++ b/arch/mips/configs/loongson3_defconfig
> @@ -217,6 +217,7 @@ CONFIG_SERIAL_8250_EXTENDED=y
>   CONFIG_SERIAL_8250_MANY_PORTS=y
>   CONFIG_SERIAL_8250_SHARE_IRQ=y
>   CONFIG_SERIAL_8250_RSA=y
> +CONFIG_SERIAL_OF_PLATFORM=y
>   CONFIG_HW_RANDOM=y
>   CONFIG_RAW_DRIVER=m
>   CONFIG_I2C_CHARDEV=y

Hi,

The patch title is again exaggerating things. This is a defconfig 
change, so please refer to `git log` output of `arch/mips/configs` and 
use something like "MIPS: Loongson: loongson3_defconfig: enable serial 
console" or "MIPS: Loongson: enable serial console in defconfig". The 
current title reads as if Loongson kernels never were able to use a 
serial console in the past.


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

* Re: [PATCH] MIPS: Loongson: Add support for serial console
  2020-05-16 11:09 ` WANG Xuerui
@ 2020-05-18  1:08   ` Tiezhu Yang
  2020-05-18  2:36     ` WANG Xuerui
  0 siblings, 1 reply; 5+ messages in thread
From: Tiezhu Yang @ 2020-05-18  1:08 UTC (permalink / raw)
  To: WANG Xuerui, Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
  Cc: linux-mips, linux-kernel, Xuefeng Li

On 05/16/2020 07:09 PM, WANG Xuerui wrote:
> On 5/16/20 3:03 PM, Tiezhu Yang wrote:
>
>> After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"),
>> there already exists the node and property of Loongson CPU UART0
>> in loongson3-package.dtsi:
>>
>> cpu_uart0: serial@1fe001e0 {
>>          compatible = "ns16550a";
>>          reg = <0 0x1fe001e0 0x8>;
>>          clock-frequency = <33000000>;
>>          interrupt-parent = <&liointc>;
>>          interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
>>          no-loopback-test;
>> };
>>
>> In order to support for serial console on the Loongson platform,
>> add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig.
>>
>> With this patch, we can see the following boot message:
>>
>> [    1.877745] printk: console [ttyS0] disabled
>> [    1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, 
>> base_baud = 2062500) is a 16550A
>> [    1.890838] printk: console [ttyS0] enabled
>>
>> And also, we can login normally from the serial console.
>>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>> ---
>>
>> Hi Jiaxun,
>>
>> Thank you very much for your suggestion.
>>
>>   arch/mips/configs/loongson3_defconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/mips/configs/loongson3_defconfig 
>> b/arch/mips/configs/loongson3_defconfig
>> index 6768c16..cd95f08 100644
>> --- a/arch/mips/configs/loongson3_defconfig
>> +++ b/arch/mips/configs/loongson3_defconfig
>> @@ -217,6 +217,7 @@ CONFIG_SERIAL_8250_EXTENDED=y
>>   CONFIG_SERIAL_8250_MANY_PORTS=y
>>   CONFIG_SERIAL_8250_SHARE_IRQ=y
>>   CONFIG_SERIAL_8250_RSA=y
>> +CONFIG_SERIAL_OF_PLATFORM=y
>>   CONFIG_HW_RANDOM=y
>>   CONFIG_RAW_DRIVER=m
>>   CONFIG_I2C_CHARDEV=y
>
> Hi,
>
> The patch title is again exaggerating things. This is a defconfig 
> change, so please refer to `git log` output of `arch/mips/configs` and 
> use something like "MIPS: Loongson: loongson3_defconfig: enable serial 
> console" or "MIPS: Loongson: enable serial console in defconfig". The 
> current title reads as if Loongson kernels never were able to use a 
> serial console in the past.

Hi Xuerui,

Thanks for your suggestion.

We can not use the serial console without this patch,
so I use the current patch subject.

Anyway, let me modify the patch subject to make it more accurate,
I think the following is better:
"MIPS: Loongson: Enable devicetree based probing for 8250 ports"

drivers/tty/serial/8250/Kconfig:
config SERIAL_OF_PLATFORM
         tristate "Devicetree based probing for 8250 ports"

I will send v2 later.

Thanks,
Tiezhu Yang


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

* Re: [PATCH] MIPS: Loongson: Add support for serial console
  2020-05-18  1:08   ` Tiezhu Yang
@ 2020-05-18  2:36     ` WANG Xuerui
  0 siblings, 0 replies; 5+ messages in thread
From: WANG Xuerui @ 2020-05-18  2:36 UTC (permalink / raw)
  To: Tiezhu Yang, Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
  Cc: linux-mips, linux-kernel, Xuefeng Li

On 2020/5/18 09:08, Tiezhu Yang wrote:

> On 05/16/2020 07:09 PM, WANG Xuerui wrote:
>> On 5/16/20 3:03 PM, Tiezhu Yang wrote:
>>
>>> After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"),
>>> there already exists the node and property of Loongson CPU UART0
>>> in loongson3-package.dtsi:
>>>
>>> cpu_uart0: serial@1fe001e0 {
>>>          compatible = "ns16550a";
>>>          reg = <0 0x1fe001e0 0x8>;
>>>          clock-frequency = <33000000>;
>>>          interrupt-parent = <&liointc>;
>>>          interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
>>>          no-loopback-test;
>>> };
>>>
>>> In order to support for serial console on the Loongson platform,
>>> add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig.
>>>
>>> With this patch, we can see the following boot message:
>>>
>>> [    1.877745] printk: console [ttyS0] disabled
>>> [    1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, 
>>> base_baud = 2062500) is a 16550A
>>> [    1.890838] printk: console [ttyS0] enabled
>>>
>>> And also, we can login normally from the serial console.
>>>
>>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>>> ---
>>>
>>> Hi Jiaxun,
>>>
>>> Thank you very much for your suggestion.
>>>
>>>   arch/mips/configs/loongson3_defconfig | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/mips/configs/loongson3_defconfig 
>>> b/arch/mips/configs/loongson3_defconfig
>>> index 6768c16..cd95f08 100644
>>> --- a/arch/mips/configs/loongson3_defconfig
>>> +++ b/arch/mips/configs/loongson3_defconfig
>>> @@ -217,6 +217,7 @@ CONFIG_SERIAL_8250_EXTENDED=y
>>>   CONFIG_SERIAL_8250_MANY_PORTS=y
>>>   CONFIG_SERIAL_8250_SHARE_IRQ=y
>>>   CONFIG_SERIAL_8250_RSA=y
>>> +CONFIG_SERIAL_OF_PLATFORM=y
>>>   CONFIG_HW_RANDOM=y
>>>   CONFIG_RAW_DRIVER=m
>>>   CONFIG_I2C_CHARDEV=y
>>
>> Hi,
>>
>> The patch title is again exaggerating things. This is a defconfig 
>> change, so please refer to `git log` output of `arch/mips/configs` 
>> and use something like "MIPS: Loongson: loongson3_defconfig: enable 
>> serial console" or "MIPS: Loongson: enable serial console in 
>> defconfig". The current title reads as if Loongson kernels never were 
>> able to use a serial console in the past.
>
> Hi Xuerui,
>
> Thanks for your suggestion.
>
> We can not use the serial console without this patch,
> so I use the current patch subject.

One can always use their own config to build in whatever support they 
want. Only people blindly following defconfig are affected. That's why I 
think the original patch title is exaggerating.

>
> Anyway, let me modify the patch subject to make it more accurate,
> I think the following is better:
> "MIPS: Loongson: Enable devicetree based probing for 8250 ports"
>
> drivers/tty/serial/8250/Kconfig:
> config SERIAL_OF_PLATFORM
>         tristate "Devicetree based probing for 8250 ports"
>
> I will send v2 later.
>
No problem. Just make it clear that these are defconfig changes so 
people don't misunderstand, even if they're otherwise unfamiliar with 
the current state of things.
> Thanks,
> Tiezhu Yang
>

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

end of thread, other threads:[~2020-05-18  2:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16  7:03 [PATCH] MIPS: Loongson: Add support for serial console Tiezhu Yang
2020-05-16  7:16 ` Jiaxun Yang
2020-05-16 11:09 ` WANG Xuerui
2020-05-18  1:08   ` Tiezhu Yang
2020-05-18  2:36     ` WANG Xuerui

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).