i.MX8MM ECSPI maximum operational SCLK

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

i.MX8MM ECSPI maximum operational SCLK

跳至解决方案
1,742 次查看
sreedhar_appala
Contributor IV

Hi,

I am working with i.MX8MM EVK and 4.19-warrior yocto distribution.

From the i.MX8MM product datasheet:

"Full-duplex enhanced Synchronous Serial Interface, with data rate
up to 52 Mbit/s. Configurable to support Master/Slave modes, four
chip selects to support multiple peripherals"

The maximum SCLK can be 52MHz.

But, we have interfaced a slave to ECSPI2 and tried to do SPI transfer with 52MHz. it fails.

Could you please let me know up to what frequency(SCLK) SPI transfer is succesful in i.MX8MM EVK board?

Thank you, Sreedhar

0 项奖励
1 解答
1,735 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello sreedhar_appala ,

>>The maximum SCLK can be 52MHz.

yes, right. On hardware, max clock is 52MHz.

>>Could you please let me know up to what frequency(SCLK) SPI transfer is succesful in i.MX8MM EVK board?

you can set speed to 30MHz.

>> Further advice for your test

in spi driver, ECSPI ROOT clock is limited 60MHz, and in eCSPI module, the clock is divided by 2 to be spi clock. so you can set max speed 30MHz.  But you can try higher speed by tuning spi driver like below:

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 91e32291c44e..00e092f2f4ff 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1602,8 +1602,8 @@ spi_imx_unprepare_message(struct spi_master *master, struct spi_message *msg)
{
struct spi_imx_data *spi_imx = spi_master_get_devdata(master);

- clk_disable_unprepare(spi_imx->clk_ipg);
- clk_disable_unprepare(spi_imx->clk_per);
+ // clk_disable_unprepare(spi_imx->clk_ipg);
+ // clk_disable_unprepare(spi_imx->clk_per);
return 0;
}

@@ -1791,8 +1791,8 @@ static int spi_imx_probe(struct platform_device *pdev)

dev_info(&pdev->dev, "probed\n");

- clk_disable_unprepare(spi_imx->clk_ipg);
- clk_disable_unprepare(spi_imx->clk_per);
+ // clk_disable_unprepare(spi_imx->clk_ipg);
+ // clk_disable_unprepare(spi_imx->clk_per);
return ret

 

Try it , please!

[comment]

whatever it is successful or unsuccessful, 30MHz speed is recommended. because High speed will cause system to be unstable.

 

Have a nice day!

B.R,

Weidong

在原帖中查看解决方案

2 回复数
1,736 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello sreedhar_appala ,

>>The maximum SCLK can be 52MHz.

yes, right. On hardware, max clock is 52MHz.

>>Could you please let me know up to what frequency(SCLK) SPI transfer is succesful in i.MX8MM EVK board?

you can set speed to 30MHz.

>> Further advice for your test

in spi driver, ECSPI ROOT clock is limited 60MHz, and in eCSPI module, the clock is divided by 2 to be spi clock. so you can set max speed 30MHz.  But you can try higher speed by tuning spi driver like below:

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 91e32291c44e..00e092f2f4ff 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1602,8 +1602,8 @@ spi_imx_unprepare_message(struct spi_master *master, struct spi_message *msg)
{
struct spi_imx_data *spi_imx = spi_master_get_devdata(master);

- clk_disable_unprepare(spi_imx->clk_ipg);
- clk_disable_unprepare(spi_imx->clk_per);
+ // clk_disable_unprepare(spi_imx->clk_ipg);
+ // clk_disable_unprepare(spi_imx->clk_per);
return 0;
}

@@ -1791,8 +1791,8 @@ static int spi_imx_probe(struct platform_device *pdev)

dev_info(&pdev->dev, "probed\n");

- clk_disable_unprepare(spi_imx->clk_ipg);
- clk_disable_unprepare(spi_imx->clk_per);
+ // clk_disable_unprepare(spi_imx->clk_ipg);
+ // clk_disable_unprepare(spi_imx->clk_per);
return ret

 

Try it , please!

[comment]

whatever it is successful or unsuccessful, 30MHz speed is recommended. because High speed will cause system to be unstable.

 

Have a nice day!

B.R,

Weidong

1,731 次查看
sreedhar_appala
Contributor IV

Hi Weidong,

Thank you very much for the complete details.

I will try to tune the SPI clock as per your suggestion.

Thank you once again.

Regards, Sreedhar

0 项奖励