Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: imx-sdma: remove ERR009165 on i.mx6ul

ECSPI issue fixed from i.mx6ul at hardware level, no need
ERR009165 anymore on those chips such as i.mx8mq.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Robin Gong and committed by
Shawn Guo
4852e9a2 8eb1252b

+24 -2
+24 -2
drivers/dma/imx-sdma.c
··· 476 476 int num_events; 477 477 struct sdma_script_start_addrs *script_addrs; 478 478 bool check_ratio; 479 + /* 480 + * ecspi ERR009165 fixed should be done in sdma script 481 + * and it has been fixed in soc from i.mx6ul. 482 + * please get more information from the below link: 483 + * https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf 484 + */ 485 + bool ecspi_fixed; 479 486 }; 480 487 481 488 struct sdma_engine { ··· 603 596 .script_addrs = &sdma_script_imx6q, 604 597 }; 605 598 599 + static struct sdma_driver_data sdma_imx6ul = { 600 + .chnenbl0 = SDMA_CHNENBL0_IMX35, 601 + .num_events = 48, 602 + .script_addrs = &sdma_script_imx6q, 603 + .ecspi_fixed = true, 604 + }; 605 + 606 606 static struct sdma_script_start_addrs sdma_script_imx7d = { 607 607 .ap_2_ap_addr = 644, 608 608 .uart_2_mcu_addr = 819, ··· 643 629 { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, 644 630 { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, 645 631 { .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, }, 632 + { .compatible = "fsl,imx6ul-sdma", .data = &sdma_imx6ul, }, 646 633 { .compatible = "fsl,imx8mq-sdma", .data = &sdma_imx8mq, }, 647 634 { /* sentinel */ } 648 635 }; ··· 963 948 break; 964 949 case IMX_DMATYPE_CSPI: 965 950 per_2_emi = sdma->script_addrs->app_2_mcu_addr; 966 - emi_2_per = sdma->script_addrs->mcu_2_ecspi_addr; 967 - sdmac->is_ram_script = true; 951 + 952 + /* Use rom script mcu_2_app if ERR009165 fixed */ 953 + if (sdmac->sdma->drvdata->ecspi_fixed) { 954 + emi_2_per = sdma->script_addrs->mcu_2_app_addr; 955 + } else { 956 + emi_2_per = sdma->script_addrs->mcu_2_ecspi_addr; 957 + sdmac->is_ram_script = true; 958 + } 959 + 968 960 break; 969 961 case IMX_DMATYPE_EXT: 970 962 case IMX_DMATYPE_SSI: