iMX6ULL I2C使用DMA传输

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6ULL I2C使用DMA传输

Jump to solution
954 Views
Tamako
Contributor I

Hello,Everyone.

我最近想使用imx6ull实现裸机开发I2C读取MPU6050,并使用DMA方式传输数据。我在官方的I2C寄存器手册里并没有看到关于DMA使能相关的寄存器,但是我在内核中发现了一些与i2c dma相关的函数,例如:

static int i2c_imx_dma_xfer(struct imx_i2c_struct *i2c_imx,
                    struct i2c_msg *msgs)
相关函数定义在i2c-imx.c文件中。并且我在其中发现可能是I2C控制寄存器DMA使能位的宏定义
#define I2CR_DMAEN  0x02,根据这个宏定义我去查看了参考手册,但是手册中的bit[1:0]都是保留位,所以我不清楚如何具体实现裸机IIC使用DMA传输数据(我是菜鸟)。期待大牛们的回答,非常感谢!
Labels (3)
0 Kudos
1 Solution
919 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Tamako,

I hope you are doing well.

There is no support given for using i2c SDMA in i.MX6 series.

One can find the supported SDMA channel usage for different peripherals in the linux reference manual, please refer to that.

https://www.nxp.com/docs/en/reference-manual/IMX_REFERENCE_MANUAL.pdf

Thanks & Regards,
Dhruvit Vasavada

View solution in original post

0 Kudos
3 Replies
912 Views
Tamako
Contributor I

Hi @Dhruvit 

Thans for your reply.

I have given up this paln before your reply.

Thanks

0 Kudos
920 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Tamako,

I hope you are doing well.

There is no support given for using i2c SDMA in i.MX6 series.

One can find the supported SDMA channel usage for different peripherals in the linux reference manual, please refer to that.

https://www.nxp.com/docs/en/reference-manual/IMX_REFERENCE_MANUAL.pdf

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
877 Views
ceggers
Contributor V

There is no support given for using i2c SDMA in i.MX6 series.

That's not fully correct. Some engineers at NXP have developed SDMA support for I2C. These changes are part of SDMA firmware 3.6/4.6 which is available in recent firmware-imx.bin packages (the firmware files in linux-firmware-git are still 3.5/4.5).

Looking around on the internet will find the necessary patches for the Linux I2C driver. Unfortunately these patches have some small bugs and haven't been ported to recent kernels.

I use fixed version of the I2C driver and the a custom SDMA firmware for many months now and think it does what it should. But I haven't tested "advanced" I2C features like bus recovery.

regards,
Christian

0 Kudos