]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc/fsl_lbc: Add workaround for ELBC-A001 erratum
authorShengzhou Liu <Shengzhou.Liu@freescale.com>
Thu, 19 May 2011 10:48:01 +0000 (18:48 +0800)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 20 May 2011 13:46:49 +0000 (08:46 -0500)
Simultaneous FCM and GPCM or UPM operation may erroneously trigger
bus monitor timeout.

Set the local bus monitor timeout value to the maximum by setting
LBCR[BMT] = 0 and LBCR[BMTPS] = 0xF.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/include/asm/fsl_lbc.h
arch/powerpc/sysdev/fsl_lbc.c

index 5c1bf3466749563d2ee683b1a7c4dfef0903e0ea..8a0b5ece8f76f8e6152bfe0a7be812426c06ce95 100644 (file)
@@ -157,6 +157,8 @@ struct fsl_lbc_regs {
 #define LBCR_EPAR_SHIFT    16
 #define LBCR_BMT   0x0000FF00
 #define LBCR_BMT_SHIFT      8
+#define LBCR_BMTPS 0x0000000F
+#define LBCR_BMTPS_SHIFT    0
 #define LBCR_INIT  0x00040000
        __be32 lcrr;            /**< Clock Ratio Register */
 #define LCRR_DBYP    0x80000000
index 4fcb5a4e60dddaeca9143a79c2ebb61a581d3be6..0608b1657da41f511ceca7a5bb4ef677ee14fbad 100644 (file)
@@ -184,7 +184,8 @@ int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
 }
 EXPORT_SYMBOL(fsl_upm_run_pattern);
 
-static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl)
+static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl,
+                                      struct device_node *node)
 {
        struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
@@ -198,6 +199,10 @@ static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl)
        /* Enable interrupts for any detected events */
        out_be32(&lbc->lteir, LTEIR_ENABLE);
 
+       /* Set the monitor timeout value to the maximum for erratum A001 */
+       if (of_device_is_compatible(node, "fsl,elbc"))
+               clrsetbits_be32(&lbc->lbcr, LBCR_BMT, LBCR_BMTPS);
+
        return 0;
 }
 
@@ -304,7 +309,7 @@ static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev)
 
        fsl_lbc_ctrl_dev->dev = &dev->dev;
 
-       ret = fsl_lbc_ctrl_init(fsl_lbc_ctrl_dev);
+       ret = fsl_lbc_ctrl_init(fsl_lbc_ctrl_dev, dev->dev.of_node);
        if (ret < 0)
                goto err;