[Letux-kernel] X1600 / LX16 support - here: UART issue
H. Nikolaus Schaller
hns at goldelico.com
Thu Feb 29 19:09:51 CET 2024
Hi all,
with UART drivers working now I have made a strange observation:
root at letux:~# ls -l /dev/ttyS*
crw-rw---- 1 root dialout 4, 64 Jan 1 01:12 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Jan 1 01:12 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Jan 1 01:12 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Jan 1 01:12 /dev/ttyS3
crw-rw---- 1 root dialout 4, 68 Jan 1 01:12 /dev/ttyS4
root at letux:~#
But we only have 4 UARTs in device tree?
/dev/ttyS2 is the console.
root at letux:~# echo x >/dev/ttyS2
x
root at letux:~#
/dev/ttyS4 reports:
root at letux:~# echo x >/dev/ttyS4
-bash: echo: write error: Input/output error
root at letux:~#
Any ideas?
BR,
Nikolaus
> Am 23.02.2024 um 09:18 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>
>
>
>> Am 23.02.2024 um 09:12 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>
>> Bug #1 is that we have to disable the UART nodes in the DTS.
>>
>> By accident I found that all UARTs (incl. UART2) can be broken
>> by this single line in the DTS:
>>
>> &uart0 { status = "disable"; };
>>
>> Maybe a bug in "status =" processing?
>>
>> Or it has something to do with pinctrl which is set up before
>> probing a driver and turned down if probe fails.
>>
>> On the other hand there are no pinctrl entries involved.
>>
>> Having status = "disable" may also do something differently from
>> having no status at all.
>>
>> The default from x1600.dtsi is:
>>
>> uart0: serial at 10030000 {
>> compatible = "ingenic,x1600-uart";
>> reg = <0x10030000 0x100>;
>> reg-shift = <2>;
>> interrupt-parent = <&core_intc>;
>> interrupts = <IRQ_UART0>;
>> clocks = <&extclk>, <&cgu X1600_CLK_UART0>;
>> clock-names = "baud", "module";
>> dmas = <&dma X1600_DMA_UART0_TX 0xffffffff>,
>> <&dma X1600_DMA_UART0_RX 0xffffffff>;
>> dma-names = "tx", "rx";
>> #address-cells = <1>;
>> #size-cells = <0>;
>> };
>
> I think I understand a little better:
>
> https://elixir.bootlin.com/linux/latest/source/drivers/of/fdt.c#L83
>
> This code means that NO "status" property is the same as "ok" or "okay".
>
> In other words the feature to disable one or more UARTs is broken
> and breaks all of them.
>
> And that is what we have tried: disable UART0,1,3 by default.
>
> If we set all of them to "ok" it should also work.
>
> BR,
> Nikolaus
>
> _______________________________________________
> https://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel
More information about the Letux-kernel
mailing list