summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2015-12-25 10:06:27 +0800
committerOctavian Purdila <octavian.purdila@nxp.com>2017-02-23 14:21:42 +0200
commitd2263c1e5fee7b1508d740770b2c8c932f4f162e (patch)
tree3bb0d71f62bba5e83689f476bf4abd45d7f9bfe6
parent12a5f297603753a69768b5fb54ff9d31ddd9892d (diff)
MLK-12076-3: dma: imx-sdma: add imx6ul device type
Add imx6ul device type to enable the ERR008517 workaround or not by dts. Signed-off-by: Robin Gong <b38343@freescale.com> (cherry picked from commit 17d6a090b7a39bfd7836a3685d20201dcb0fa25e)
-rw-r--r--drivers/dma/imx-sdma.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 66925c571de2..b0dcdfa9fe27 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -516,6 +516,12 @@ static struct sdma_driver_data sdma_imx6sx = {
.script_addrs = &sdma_script_imx6sx,
};
+static struct sdma_driver_data sdma_imx6ul = {
+ .chnenbl0 = SDMA_CHNENBL0_IMX35,
+ .num_events = 48,
+ .script_addrs = &sdma_script_imx6sx,
+};
+
static struct sdma_script_start_addrs sdma_script_imx7d = {
.ap_2_ap_addr = 644,
.uart_2_mcu_addr = 819,
@@ -566,6 +572,7 @@ static const struct platform_device_id sdma_devtypes[] = {
MODULE_DEVICE_TABLE(platform, sdma_devtypes);
static const struct of_device_id sdma_dt_ids[] = {
+ { .compatible = "fsl,imx6ul-sdma", .data = &sdma_imx6ul, },
{ .compatible = "fsl,imx6sx-sdma", .data = &sdma_imx6sx, },
{ .compatible = "fsl,imx6q-sdma", .data = &sdma_imx6q, },
{ .compatible = "fsl,imx53-sdma", .data = &sdma_imx53, },
@@ -1119,8 +1126,15 @@ static int sdma_config_channel(struct dma_chan *chan)
if (sdmac->peripheral_type == IMX_DMATYPE_ASRC_SP ||
sdmac->peripheral_type == IMX_DMATYPE_ASRC)
sdma_set_watermarklevel_for_p2p(sdmac);
- } else
+ } else {
+ /* ERR008517 fixed on i.mx6ul, no workaround needed */
+ if (sdmac->peripheral_type == IMX_DMATYPE_CSPI &&
+ sdmac->direction == DMA_MEM_TO_DEV &&
+ sdmac->sdma->drvdata == &sdma_imx6ul)
+ __set_bit(31, &sdmac->watermark_level);
+
__set_bit(sdmac->event_id0, sdmac->event_mask);
+ }
/* Address */
sdmac->shp_addr = sdmac->per_address;
@@ -2175,7 +2189,8 @@ static int sdma_suspend(struct device *dev)
int i, ret = 0;
/* Do nothing if not i.MX6SX or i.MX7D*/
- if (sdma->drvdata != &sdma_imx6sx && sdma->drvdata != &sdma_imx7d)
+ if (sdma->drvdata != &sdma_imx6sx && sdma->drvdata != &sdma_imx7d
+ && sdma->drvdata != &sdma_imx6ul)
return 0;
clk_enable(sdma->clk_ipg);
@@ -2213,7 +2228,8 @@ static int sdma_resume(struct device *dev)
int i, ret;
/* Do nothing if not i.MX6SX or i.MX7D*/
- if (sdma->drvdata != &sdma_imx6sx && sdma->drvdata != &sdma_imx7d)
+ if (sdma->drvdata != &sdma_imx6sx && sdma->drvdata != &sdma_imx7d
+ && sdma->drvdata != &sdma_imx6ul)
return 0;
clk_enable(sdma->clk_ipg);