【驱动大全】【UART驱动情景分析】【改用imx-uart2的接收问题】

各位老师,我在使用imx6ull的uart2做接收通讯,NXP imx6ull的官方设备树中uart2比uart1中多了dma的默认配置,能否简述设备树中uart2的dma配置方式?

uart2: serial@21e8000 {

compatible = "fsl,imx6ul-uart",

     "fsl,imx6q-uart", "fsl,imx21-uart";

reg = <0x21e8000 0x4000>;

interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clks IMX6UL_CLK_UART2_IPG>,

<&clks IMX6UL_CLK_UART2_SERIAL>;

clock-names = "ipg", "per";

//dmas = <&sdma 27 4 0>, <&sdma 28 4 0>;

//dma-names = "rx", "tx";

status = "disabled";

};

我现在删除dma两行,可以正常接收(cpu占用率30%,太高了,需要改用dma),但是带着dma,就会报错(下面是报错的源码位置imx.c):

slave_config.direction = DMA_DEV_TO_MEM;

slave_config.src_addr = sport->port.mapbase + URXD0;

slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;

/* one byte less than the watermark level to enable the aging timer */

slave_config.src_maxburst = RXTL_DMA - 1;

ret = dmaengine_slave_config(sport->dma_chan_rx, &slave_config);

if (ret) {

dev_err(dev, "error in RX dma configuration.\n");//报错

goto err;

}

请先 登录 后评论