Hi,KevinFFF
I modified the device tree as dmas = <0xed 0x8 0xed 0x8>;, but I still cannot receive any data when performing a loopback test. Here are the updated device tree and the dmesg output. I didn’t find any abnormal error messages. Could you please advise how I can check the detailed DMA channel allocation and data transfer status for further analysis?
dmesg.new.txt (82.6 KB)
tegra234-p3737-0000+p3701-0008-nv.dts.txt (310.6 KB)
I only used the FDT to update the device tree under the kernel. The hardware flow control signals CTS and RTS are not physically routed. That shouldn’t affect DMA triggering, right? There is data available in PIO mode.
root@tegra-ubuntu:/mnt/rootfs# xxd /sys/firmware/devicetree/base/bus@0/serial@3100000/dmas
00000000: 0000 00e0 0000 0014 0000 00e0 0000 0014 ................
root@tegra-ubuntu:/mnt/rootfs#
root@tegra-ubuntu:/mnt/rootfs#
root@tegra-ubuntu:/mnt/rootfs#
root@tegra-ubuntu:/mnt/rootfs# dmesg | grep -i "dma pause\|gpcdma\|3100000"
[ 6.559982] tegra-gpcdma 2600000.dma-controller: Adding to iommu group 4
[ 6.560925] tegra-gpcdma 2600000.dma-controller: GPC DMA driver register 31 channels
[ 6.561919] serial-tegra 3100000.serial: Adding to iommu group 4
[ 6.561968] 3100000.serial: ttyTHS1 at MMIO 0x3100000 (irq = 112, base_baud = 0) is a TEGRA_UART
[ 56.682634] tegra-gpcdma 2600000.dma-controller: DMA pause timed out
[ 109.539525] tegra-gpcdma 2600000.dma-controller: DMA pause timed out
Does “DMA pause timed out” indicate a problem?
However, I seem to be able to receive data using this method:
root@tegra-ubuntu:/mnt/rootfs# stty -F /dev/ttyTHS1 921600 raw -echo
cat /dev/ttyTHS1 > /tmp/rx_out &
echo -n "ABCD" > /dev/ttyTHS1
sleep 1
kill %1
xxd /tmp/rx_out
[1] 1781
00000000: 4142 4344 ABCD
[1]+ Terminated cat /dev/ttyTHS1 > /tmp/rx_out
root@tegra-ubuntu:/mnt/rootfs#
But when I open two terminals—one in the foreground to cat and the other to echo—no data is received.
I also cannot receive data when sending it through a program.
root@tegra-ubuntu:/mnt/rootfs# cat /sys/kernel/debug/dmaengine/summary
dma0 (2600000.dma-controller): number of channels: 31
dma0chan0 | 3210000.spi:rx
dma0chan1 | 3210000.spi:tx
dma0chan2 | 3230000.spi:rx
dma0chan3 | 3230000.spi:tx
dma0chan4 | 3160000.i2c:rx
dma0chan5 | 3160000.i2c:tx
dma0chan6 | 3180000.i2c:rx
dma0chan7 | 3180000.i2c:tx
dma0chan8 | 3190000.i2c:rx
dma0chan9 | 3190000.i2c:tx
dma0chan10 | 31b0000.i2c:rx
dma0chan11 | 31b0000.i2c:tx
dma0chan12 | 31c0000.i2c:rx
dma0chan13 | 31c0000.i2c:tx
dma0chan14 | 31e0000.i2c:rx
dma0chan15 | 31e0000.i2c:tx
dma0chan16 | c240000.i2c:rx
dma0chan17 | c240000.i2c:tx
dma0chan18 | c250000.i2c:rx
dma0chan19 | c250000.i2c:tx
dma1 (2930000.dma-controller): number of channels: 32
root@tegra-ubuntu:/mnt/rootfs#
The DMA channels are visible when the serial port is opened.
root@tegra-ubuntu:~# cat /sys/kernel/debug/dmaengine/summary
dma0 (2600000.dma-controller): number of channels: 31
dma0chan0 | 3210000.spi:rx
dma0chan1 | 3210000.spi:tx
dma0chan2 | 3230000.spi:rx
dma0chan3 | 3230000.spi:tx
dma0chan4 | 3160000.i2c:rx
dma0chan5 | 3160000.i2c:tx
dma0chan6 | 3180000.i2c:rx
dma0chan7 | 3180000.i2c:tx
dma0chan8 | 3190000.i2c:rx
dma0chan9 | 3190000.i2c:tx
dma0chan10 | 31b0000.i2c:rx
dma0chan11 | 31b0000.i2c:tx
dma0chan12 | 31c0000.i2c:rx
dma0chan13 | 31c0000.i2c:tx
dma0chan14 | 31e0000.i2c:rx
dma0chan15 | 31e0000.i2c:tx
dma0chan16 | c240000.i2c:rx
dma0chan17 | c240000.i2c:tx
dma0chan18 | c250000.i2c:rx
dma0chan19 | c250000.i2c:tx
dma0chan20 | 3100000.serial:tx
dma0chan21 | 3100000.serial:rx
dma1 (2930000.dma-controller): number of channels: 32
root@tegra-ubuntu:~# dmesg | tail -10
[ 1085.306871] mttcan_controller_config: ctrlmode 0
[ 1085.306900] mttcan c310000.mttcan can0: Bitrate set
[ 1085.307917] mttcan_controller_config: ctrlmode 0
[ 1085.307939] mttcan c320000.mttcan can1: Bitrate set
[ 1085.309279] mttcan c310000.mttcan can0: Bitrate set
[ 1085.309592] mttcan_controller_config: ctrlmode 0
[ 1085.309612] mttcan c310000.mttcan can0: Bitrate set
[ 1085.310855] mttcan c320000.mttcan can1: Bitrate set
[ 1085.311052] mttcan_controller_config: ctrlmode 0
[ 1085.311071] mttcan c320000.mttcan can1: Bitrate set
root@tegra-ubuntu:~# dmesg | grep -i "smmu\|context fault\|iommu.*fault"
[ 0.102580] iommu: Default domain type: Translated
[ 0.209140] arm-smmu 8000000.iommu: probing hardware configuration...
[ 0.209146] arm-smmu 8000000.iommu: SMMUv2 with:
[ 0.209153] arm-smmu 8000000.iommu: stage 1 translation
[ 0.209155] arm-smmu 8000000.iommu: stage 2 translation
[ 0.209159] arm-smmu 8000000.iommu: nested translation
[ 0.209166] arm-smmu 8000000.iommu: stream matching with 128 register groups
[ 0.209170] arm-smmu 8000000.iommu: 128 context banks (0 stage-2 only)
[ 0.209185] arm-smmu 8000000.iommu: Supported page sizes: 0x61311000
[ 0.209187] arm-smmu 8000000.iommu: Stage-1: 48-bit VA -> 48-bit IPA
[ 0.209188] arm-smmu 8000000.iommu: Stage-2: 48-bit IPA -> 48-bit PA
[ 0.210180] arm-smmu 10000000.iommu: probing hardware configuration...
[ 0.210184] arm-smmu 10000000.iommu: SMMUv2 with:
[ 0.210188] arm-smmu 10000000.iommu: stage 1 translation
[ 0.210192] arm-smmu 10000000.iommu: stage 2 translation
[ 0.210192] arm-smmu 10000000.iommu: nested translation
[ 0.210196] arm-smmu 10000000.iommu: stream matching with 128 register groups
[ 0.210202] arm-smmu 10000000.iommu: 128 context banks (0 stage-2 only)
[ 0.210216] arm-smmu 10000000.iommu: Supported page sizes: 0x61311000
[ 0.210217] arm-smmu 10000000.iommu: Stage-1: 48-bit VA -> 48-bit IPA
[ 0.210218] arm-smmu 10000000.iommu: Stage-2: 48-bit IPA -> 48-bit PA
[ 0.210587] arm-smmu 12000000.iommu: probing hardware configuration...
[ 0.210590] arm-smmu 12000000.iommu: SMMUv2 with:
[ 0.210592] arm-smmu 12000000.iommu: stage 1 translation
[ 0.210592] arm-smmu 12000000.iommu: stage 2 translation
[ 0.210594] arm-smmu 12000000.iommu: nested translation
[ 0.210596] arm-smmu 12000000.iommu: stream matching with 128 register groups
[ 0.210600] arm-smmu 12000000.iommu: 128 context banks (0 stage-2 only)
[ 0.210604] arm-smmu 12000000.iommu: Supported page sizes: 0x61311000
[ 0.210605] arm-smmu 12000000.iommu: Stage-1: 48-bit VA -> 48-bit IPA
[ 0.210606] arm-smmu 12000000.iommu: Stage-2: 48-bit IPA -> 48-bit PA
[ 25.658774] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx0: initialized (streamid=18, iommu=smmu.0x0000000008000000)
[ 25.685303] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx1: initialized (streamid=19, iommu=smmu.0x0000000008000000)
[ 25.709824] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx2: initialized (streamid=20, iommu=smmu.0x0000000008000000)
[ 25.730617] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx3: initialized (streamid=21, iommu=smmu.0x0000000008000000)
[ 25.734633] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx4: initialized (streamid=22, iommu=smmu.0x0000000008000000)
[ 25.751408] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx5: initialized (streamid=23, iommu=smmu.0x0000000008000000)
[ 25.776637] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx6: initialized (streamid=24, iommu=smmu.0x0000000008000000)
[ 25.796714] pva_iommu_context_dev 16000000.pva0:pva0_niso1_ctx7: initialized (streamid=25, iommu=smmu.0x0000000008000000)