diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt index 0839b70f0261d33defe472a15cf7aecdb6b9f72d..81b8cad86d1705526950299f1f0ce829609c5f7b 100644 --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt @@ -69,6 +69,7 @@ Optional properties: reg is the GPR register offset. shift is the bit position inside the GPR register. val is the value of the bit (0 or 1). +- fsl,ratio-1-1: AHB/SDMA core clock ration 1:1, 2:1 without this. Examples: diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 97bb4630b9c9835b8c24e07d7e3490f0bc9f2274..ebfc585db4ca4cdd8914201b11af8af45c097c18 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -462,6 +462,8 @@ struct sdma_engine { struct sdma_buffer_descriptor *bd0; bool suspend_off; int idx; + /* clock ration for AHB:SDMA core. 1:1 is 1, 2:1 is 0*/ + bool clk_ratio; }; static struct sdma_driver_data sdma_imx31 = { @@ -2175,7 +2177,10 @@ static int sdma_init(struct sdma_engine *sdma) /* Set bits of CONFIG register but with static context switching */ /* FIXME: Check whether to set ACR bit depending on clock ratios */ - writel_relaxed(0, sdma->regs + SDMA_H_CONFIG); + if (sdma->clk_ratio) + writel_relaxed(SDMA_H_CONFIG_ACR, sdma->regs + SDMA_H_CONFIG); + else + writel_relaxed(0, sdma->regs + SDMA_H_CONFIG); writel_relaxed(ccb_phys, sdma->regs + SDMA_H_C0PTR); @@ -2268,6 +2273,8 @@ static int sdma_probe(struct platform_device *pdev) if (!sdma) return -ENOMEM; + sdma->clk_ratio = of_property_read_bool(np, "fsl,ratio-1-1"); + spin_lock_init(&sdma->channel_0_lock); sdma->dev = &pdev->dev;