how to driver ecspi in linux6.1.x for imx6ull ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to driver ecspi in linux6.1.x for imx6ull ?

616 次查看
bighero77
Contributor III

Hi.

    I need use linux 6.1.x and ecspi on imx6ull.

up to now. I cannot make this works. for example, I find the probe function would not run into.

I have no idea.  would you please tell me where can I find the driver code on imx6ull with the 

linux kernel is 6.1.x.

is it possible to run linux6.1.x on imx6ull ?

how to driver ecspi in linux6.1.x for imx6ull ?

thanks.

标记 (3)
0 项奖励
回复
3 回复数

589 次查看
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

ECSPI can be used in Linux as spidev, have you tried it before?

FYI, IMX8MN-ECSPI-buses-not-available-in-Linuxspidev.rst 

Regards

0 项奖励
回复

541 次查看
bighero77
Contributor III

would you please give me an example code for ecspi drvier  on imx6ull (linux6.1.x)

0 项奖励
回复

551 次查看
bighero77
Contributor III

In the kernel spi driver code.  I find the device_id is found. that is, the compatible string matched.

but. the probe would not run into.

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/device.h>

struct imx6ull_ecspi {
struct spi_controller *controller;
void __iomem *base;
struct device *dev;
};

static struct class *imx6ull_ecspi_class; // 全局变量保存设备类指针

static int imx6ull_ecspi_setup(struct spi_device *spi)
{

}

static int imx6ull_ecspi_transfer_one_message(struct spi_controller *controller,
struct spi_message *message)
{

}

static int imx6ull_ecspi_probe(struct platform_device *pdev)
{
// cannot run into this.
}

static int imx6ull_ecspi_remove(struct platform_device *pdev)
{

}

static const struct of_device_id imx6ull_ecspi_of_match[] = {
{ .compatible = "fsl,imx6ull-ecspi", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, imx6ull_ecspi_of_match);

static struct platform_driver imx6ull_ecspi_driver = {
.probe = imx6ull_ecspi_probe,
.remove = imx6ull_ecspi_remove,
.driver = {
.name = "imx6ull-ecspi",
.of_match_table = imx6ull_ecspi_of_match,
},
};

module_platform_driver(imx6ull_ecspi_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Your Name");
MODULE_DESCRIPTION("i.MX6ULL eCSPI driver");

0 项奖励
回复