diff options
author | Jason Liu <jason.hui.liu@nxp.com> | 2018-07-27 15:43:08 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 159219ac40fd3473bdf2b20c059f33adecd54567 (patch) | |
tree | a95be99f221468bc525bc92bc9be7019ac93b390 /drivers/dma | |
parent | 3eab1626dd64bd3b2ae7e5dfeadf1b3ebd05fab9 (diff) |
MLK-19078 dma: fsl-edma-v3: set the swap correctly
The swap is swapped between the i.MX8QM RevA and RevB
this patch handle this difference to set swap correctly
otherwise, the eDMA will not work on the i.MX8QM RevB
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/fsl-edma-v3.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/dma/fsl-edma-v3.c b/drivers/dma/fsl-edma-v3.c index a7b57f4ef503..f74f46ad3fb1 100644 --- a/drivers/dma/fsl-edma-v3.c +++ b/drivers/dma/fsl-edma-v3.c @@ -28,6 +28,9 @@ #include <linux/of_irq.h> #include <linux/of_dma.h> +#include <soc/imx/revision.h> +#include <soc/imx8/soc.h> + #include "virt-dma.h" #define EDMA_CH_CSR 0x00 @@ -844,9 +847,21 @@ static int fsl_edma3_probe(struct platform_device *pdev) if (of_property_read_bool(np, "shared-interrupt")) irqflag = IRQF_SHARED; - fsl_edma3->swap = of_device_is_compatible(np, "fsl,imx8qm-adma"); + fsl_edma3->swap = false; fsl_edma3->n_chans = chans; + /* + * FIXUP: if this is the i.MX8QM TO1.0, need set the swap. + * FIXME: This will be revisted to set the swap property + * from the device-tree node later instead of revison check, + * but, this will need add extra DT file, not perfect too. + */ + + if ((of_device_is_compatible(np, "fsl,imx8qm-adma")) && + cpu_is_imx8qm() && + imx8_get_soc_revision() == IMX_CHIP_REVISION_1_0) + fsl_edma3->swap = true; + INIT_LIST_HEAD(&fsl_edma3->dma_dev.channels); for (i = 0; i < fsl_edma3->n_chans; i++) { struct fsl_edma3_chan *fsl_chan = &fsl_edma3->chans[i]; |