MLK-14518-1 pxp: initialize pxp according to recommended flow
authorRobby Cai <robby.cai@nxp.com>
Tue, 21 Mar 2017 12:12:14 +0000 (20:12 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:59 +0000 (15:21 -0500)
use pxp_soft_reset() in probe and resume function because this implementation
follows the recommended flow in the IC spec.
without soft reset, when only use wfe_a process without legacy process it's
likely to meet timeout issue since. In other words, wfe_a process need the
soft reset to work properly.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
drivers/dma/pxp/pxp_dma_v3.c

index b2e68e6..0854757 100644 (file)
@@ -5212,9 +5212,6 @@ static int pxp_probe(struct platform_device *pdev)
        if (err)
                goto exit;
 
-       /* enable all the possible irq raised by PXP */
-       __raw_writel(0xffff, pxp->base + HW_PXP_IRQ_MASK);
-
        /* Initialize DMA engine */
        err = pxp_dma_init(pxp);
        if (err < 0)
@@ -5228,6 +5225,10 @@ static int pxp_probe(struct platform_device *pdev)
 
        device_create_file(&pdev->dev, &dev_attr_block_size);
        pxp_clk_enable(pxp);
+       pxp_soft_reset(pxp);
+       /* enable all the possible irq raised by PXP */
+       __raw_writel(0xffff, pxp->base + HW_PXP_IRQ_MASK);
+
        dump_pxp_reg(pxp);
        pxp_clk_disable(pxp);
 
@@ -5321,7 +5322,9 @@ static int pxp_resume(struct device *dev)
 
        pxp_clk_enable(pxp);
        /* Pull PxP out of reset */
-       __raw_writel(0, pxp->base + HW_PXP_CTRL);
+       pxp_soft_reset(pxp);
+       /* enable all the possible irq raised by PXP */
+       __raw_writel(0xffff, pxp->base + HW_PXP_IRQ_MASK);
        pxp_clk_disable(pxp);
 
        return 0;