i.MX8MM ECSPI slave mode restriction

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX8MM ECSPI slave mode restriction

ソリューションへジャンプ
1,475件の閲覧回数
AustinHan
Contributor I

I am currently using the i.MX8MM ECSPI Slave in PIO mode.
The issue is that in Slave mode, the burst length appears to be limited to 512 bytes.
While it's not clear whether using DMA mode instead of PIO mode would remove the transmission data size limitation, I have applied a kernel patch to try using DMA mode.

Can I get sample code or materials related to SPI data transmission and reception in Slave mode(using DMA)?
I am referring to the AN13633 document, but I would appreciate any comments if there are other helpful resources available.
Let me know if you would like me to help you find specific resources or documentation about implementing DMA mode for ECSPI on i.MX8MM.

0 件の賞賛
返信
1 解決策
1,258件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

double checked again, this limitation is HW limitation, the AN is released and based on the old bsp, the new bsp add 512 bytes limitation because of HW limitation, so you couldn't remove this,  it seems imx8mm ecspi couldn't support this(no 512 bytes limitation) if you want to use slave mode

元の投稿で解決策を見る

0 件の賞賛
返信
10 返答(返信)
1,462件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

AN13633 is very detailed application note for your request, for dma support, you also can refer to the patch as below, and you also can focus on the ERR003775 from errata

LF-6680 spi: imx: add dma support for target mode · nxp-imx/linux-imx@1aef8ed · GitHub

0 件の賞賛
返信
1,444件の閲覧回数
AustinHan
Contributor I

Thank you for your response.

I was trying to enable DMA mode thinking there were no transfer size restrictions in DMA mode.
Based on the linked document, does it mean that both PIO and DMA modes have a 512-byte limit for transfer data size?

タグ(1)
0 件の賞賛
返信
1,439件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

yes, DMA has this limtitaion too

0 件の賞賛
返信
1,376件の閲覧回数
AustinHan
Contributor I
I apologize for contacting you.
I have a question I'd like to ask for clarification.
Could you please help me understand the meaning of the note on page 5 of the linked document?

(Link)
https://www.nxp.com/docs/en/application-note/AN13633.pdf

" Note: From testing, it seems no such transfer length restriction must be added in DMA mode. So only PIO mode has this restriction."
0 件の賞賛
返信
1,325件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

I checked the driver again, the limitation is

https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/drivers/spi/spi-imx.c#L1492

if you want to test this, you can comment the 512 limitation to test based on your detailed user case

 

0 件の賞賛
返信
1,293件の閲覧回数
AustinHan
Contributor I

Thank you for your reply.
But, I didn't understand exactly what you said.
Does annotating the 512 byte limit in kernel code mean I can transfer more than 512 bytes in SPI Slave mode?

if ((is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) &&
transfer->len > MX53_MAX_TRANSFER_BYTES && spi_imx->target_mode) {
    dev_err(spi_imx->dev, "Transaction too big, max size is %d bytes\n",
    MX53_MAX_TRANSFER_BYTES);
    return -EMSGSIZE;
}

0 件の賞賛
返信
1,259件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

double checked again, this limitation is HW limitation, the AN is released and based on the old bsp, the new bsp add 512 bytes limitation because of HW limitation, so you couldn't remove this,  it seems imx8mm ecspi couldn't support this(no 512 bytes limitation) if you want to use slave mode

0 件の賞賛
返信
1,252件の閲覧回数
AustinHan
Contributor I

Thank you for your quick response.
Have a nice day.

0 件の賞賛
返信
1,350件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

confirmed that DMA/PIO mode has 512 limitation, and DMA has 4 bytes align limitation, you can refer to the patch I sent to you before

0 件の賞賛
返信
1,437件の閲覧回数
AustinHan
Contributor I

Thank you for your quick reply.

0 件の賞賛
返信