R3920 jp7.2 串口使用有问题

hi:

我们在使用串口的时候,通过串口工具发送内容,在终端接收数据,发现接收不到,并且内核有报错,帮忙看看是哪里配置的问题,

[  705.740943] [TS:729763246404] 2025 Line:1448 pl011_start_tx:
[  705.740979] [TS:729763282246] arm-smmu-v3 8105000000.iommu: event 0x10 received:
[  705.740984] [TS:729763287200] arm-smmu-v3 8105000000.iommu:  0x0000080000000010
[  705.740985] [TS:729763288570] arm-smmu-v3 8105000000.iommu:  0x0000020800000000
[  705.740986] [TS:729763289663] arm-smmu-v3 8105000000.iommu:  0x00000000ffff6000
[  705.740987] [TS:729763290626] arm-smmu-v3 8105000000.iommu:  0x0000000000000000
[  705.740994] [TS:729763297663] tegra-mc 8108020000.memory-controller: ptcr: @0x0000000000000000: Read response with poison bit error status:0
[  705.741000] [TS:729763302765] tegra-mc 8108020000.memory-controller: No interrupt in HUB/HUBC
[  705.742023] [TS:729764326570] 2025 Line:1391 pl011_stop_tx:
[  705.742032] [TS:729764335107] tegra-mc 8108020000.memory-controller: gpcdmar: non-secure read @0x0000fffffffff000: EMEM address decode error (EMEM decode error)
[  717.324892] [TS:741347195093] 2025 Line:1441 pl011_start_tx:
[  717.324928] [TS:741347230945] arm-smmu-v3 8105000000.iommu: event 0x10 received:
[  717.324932] [TS:741347235565] arm-smmu-v3 8105000000.iommu:  0x0000080000000010
[  717.324934] [TS:741347236778] arm-smmu-v3 8105000000.iommu:  0x0000020800000000
[  717.324935] [TS:741347238112] arm-smmu-v3 8105000000.iommu:  0x00000000ffffc000
[  717.324936] [TS:741347239047] arm-smmu-v3 8105000000.iommu:  0x0000000000000000
[  717.324943] [TS:741347245963] tegra-mc 8108020000.memory-controller: ptcr: @0x0000000000000000: Read response with poison bit error status:0
[  717.324948] [TS:741347251019] tegra-mc 8108020000.memory-controller: No interrupt in HUB/HUBC
[  717.324952] [TS:741347255649] tegra-gpcdma 8400000.dma-controller: GPCDMA CH20 mc slave error
[  717.325974] [TS:741348277445] 2025 Line:1384 pl011_stop_tx:
[  717.325983] [TS:741348286436] tegra-mc 8108020000.memory-controller: gpcdmar: non-secure read @0x0000fffffffff000: EMEM address decode error (EMEM decode error)

日志见附件!

R3920-ttyAMA10.log (434.5 KB)

Hi mingming,

Are you using the devkit or custom board for Thor?

Which UART interface are you using?
Please check if you hit the similar issue as 7.2 uart5 issue - #13 by KevinFFF

hi:

Are you using the devkit or custom board for Thor?—》我们自己设计的板子

UART1 => UART9 (PM02, PM03, PM04, PM05): [UJ] serial@810c530000 (serial9)  - /dev/ttyAMA9  => General purpose
UART2 => UART10(PH02, PH03, PH04, PH05): [UK] serial@810c540000 (serial10) - /dev/ttyAMA10 => General purpose

在R3840上没问题,在3920上有问题,我看了下我们的设备树配置,感觉和那个case配置是一样的,

3654         uart9: serial@810c530000 {
 3655             compatible = "arm,pl011", "arm,primecell";
 3656             reg = <0x81 0x0c530000 0x0 0x10000>;
 3657             interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;
 3658             clocks = <&bpmp TEGRA264_CLK_UART9>,
 3659                  <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3660             clock-names = "uartclk", "apb_pclk";
 3661             assigned-clocks = <&bpmp TEGRA264_CLK_UART9>;
 3662             assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3663             dmas = <&gpcdma 10 10 TEGRA264_GPCDMA_SID_UART9>,
 3664                    <&gpcdma 10 20 TEGRA264_GPCDMA_SID_UART9>;
 3665             dma-names = "rx", "tx";
 3666             iommus = <&smmu1_mmu TEGRA264_GPCDMA_SID_UART9>;
 3667             dma-coherent;
 3668             arm,primecell-periphid = <0x00051011>;
 3669             resets = <&bpmp TEGRA264_RESET_UART9>;
 3670             reset-names = "serial";
 3671             status = "disabled";
 3672         };
3674         uart10: serial@810c540000 {
 3675             compatible = "arm,pl011", "arm,primecell";
 3676             reg = <0x81 0x0c540000 0x0 0x10000>;
 3677             interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
 3678             clocks = <&bpmp TEGRA264_CLK_UART10>,
 3679                  <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3680             clock-names = "uartclk", "apb_pclk";
 3681             assigned-clocks = <&bpmp TEGRA264_CLK_UART10>;
 3682             assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3683             dmas = <&gpcdma 12 12 TEGRA264_GPCDMA_SID_UART10>,
 3684                    <&gpcdma 12 22 TEGRA264_GPCDMA_SID_UART10>;
 3685             dma-names = "rx", "tx";
 3686             iommus = <&smmu1_mmu TEGRA264_GPCDMA_SID_UART10>;
 3687             dma-coherent;
 3688             arm,primecell-periphid = <0x00051011>;
 3689             resets = <&bpmp TEGRA264_RESET_UART10>;
 3690             reset-names = "serial";
 3691             status = "disabled";
 3692         };

测试发现,cat节点的时候,没有数据,上位机形成回环了,这看着不太对啊

通过echo 写数据,上位机也接收不对

Please check the device tree in runtime (i.e. captured from your board) instead.

Have you run stty to configure the UART interface before running echo to write data.

hi:

确认过了,以下是从机器里面解析出来的结果,还是上面的现象,cat 读不到数据

                serial@810c530000 {
                        iommus = <0x50 0x80a>;
                        arm,primecell-periphid = <0x51011>;
                        dma-coherent;
                        clock-names = "uartclk\0apb_pclk";
                        assigned-clocks = <0x02 0x38>;
                        assigned-clock-parents = <0x02 0x16>;
                        resets = <0x02 0x52>;
                        interrupts = <0x00 0xac 0x04>;
                        clocks = <0x02 0x38 0x02 0x16>;
                        dma-names = "rx\0tx";
                        compatible = "arm,pl011\0arm,primecell";
                        status = "okay";
                        reg = <0x81 0xc530000 0x00 0x10000>;
                        phandle = <0x292>;
                        dmas = <0x132 0x0a 0x0a 0x80a 0x132 0x0a 0x14 0x80a>;
                        reset-names = "serial";
                        rs485s0-enable-gpios = <0x133 0x64 0x01>;
                };
 serial@810c540000 {
                        iommus = <0x50 0x80c>;
                        arm,primecell-periphid = <0x51011>;
                        dma-coherent;
                        clock-names = "uartclk\0apb_pclk";
                        assigned-clocks = <0x02 0x33>;
                        assigned-clock-parents = <0x02 0x16>;
                        rs485s1-enable-gpios = <0x133 0x44 0x01>;
                        resets = <0x02 0x53>;
                        interrupts = <0x00 0xad 0x04>;
                        clocks = <0x02 0x33 0x02 0x16>;
                        dma-names = "rx\0tx";
                        compatible = "arm,pl011\0arm,primecell";
                        status = "okay";
                        reg = <0x81 0xc540000 0x00 0x10000>;
                        phandle = <0x293>;
                        dmas = <0x132 0x0c 0x0c 0x80c 0x132 0x0c 0x16 0x80c>;
                        reset-names = "serial";
                };

用的这个命令设置的串口

stty -F /dev/ttyAMA10 115200 cs8 -cstopb -parenb

Could you compare the device tree between R38.4 and R39.2?

hi:

在3840上,

 3819         uart10: serial@810c540000 {
 3820             compatible = "arm,pl011", "arm,primecell";
 3821             reg = <0x81 0x0c540000 0x0 0x10000>;
 3822             interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
 3823             clocks = <&bpmp TEGRA264_CLK_UART10>,
 3824                  <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3825             clock-names = "uartclk", "apb_pclk";
 3826             assigned-clocks = <&bpmp TEGRA264_CLK_UART10>;
 3827             assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3828             dmas = <&gpcdma 12 12 TEGRA_SID_GPCDMA>,
 3829                    <&gpcdma 12 22 TEGRA_SID_GPCDMA>;
 3830             dma-names = "rx", "tx";
 3831             dma-coherent;
 3832             arm,primecell-periphid = <0x00051011>;
 3833             resets = <&bpmp TEGRA264_RESET_UART10>;
 3834             reset-names = "serial";
 3835             status = "disabled";
 3836         };

3920上原始的没修改之前的配置

 3674         uart10: serial@810c540000 {
 3675             compatible = "arm,pl011", "arm,primecell";
 3676             reg = <0x81 0x0c540000 0x0 0x10000>;
 3677             interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
 3678             clocks = <&bpmp TEGRA264_CLK_UART10>,
 3679                  <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3680             clock-names = "uartclk", "apb_pclk";
 3681             assigned-clocks = <&bpmp TEGRA264_CLK_UART10>;
 3682             assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
 3683             dmas = <&gpcdma 12 12 TEGRA_SID_GPCDMA>,
 3684                    <&gpcdma 12 22 TEGRA_SID_GPCDMA>;
 3685             dma-names = "rx", "tx";
 3686             iommus = <&smmu1_mmu TEGRA264_GPCDMA_SID_UART10>;
 3687             dma-coherent;
 3688             arm,primecell-periphid = <0x00051011>;
 3689             resets = <&bpmp TEGRA264_RESET_UART10>;
 3690             reset-names = "serial";
 3691             status = "disabled";
 3692         };

我更新下操作的流程:

用cat 读取数据,没反应,然后用测试程序可以读取,这是第一个现象

第二个现象,用波特率115200,下位机write写数据,发现字符串太长的话,上位机接收会截断,接收不全,现象如下:

更新下测试结果:

有个方向选择的gpio口

我们是rs485 使用方式,发现测试的时候有个芯片的gpio口拉低过早,导致数据有截断,加大延时 解决了

In R39.2, could you update these 2 lines to check if it could help for your case?

-             dmas = <&gpcdma 12 12 TEGRA_SID_GPCDMA>,
-                     <&gpcdma 12 22 TEGRA_SID_GPCDMA>;
+             dmas = <&gpcdma 12 12 TEGRA264_GPCDMA_SID_UART10>,
+                     <&gpcdma 12 22 TEGRA264_GPCDMA_SID_UART10>;

hi:

这个修改是有效的,解决了 感谢支持