MLK-20561: drm/mxsfb: Clear OUTSTANDING_REQS bits
authorRobert Chiras <robert.chiras@nxp.com>
Mon, 10 Dec 2018 10:46:49 +0000 (12:46 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Bit 21 can alter the CTRL2_OUTSTANDING_REQS value right after the eLCDIF
is enabled, since it comes up with default value of 1.
In order to fix this, clear CTRL2_OUTSTANDING_REQS bits before setting
its value.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
drivers/gpu/drm/mxsfb/mxsfb_crtc.c

index 9aca445..64ad135 100644 (file)
@@ -232,6 +232,13 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb)
        clk_prepare_enable(mxsfb->clk);
 
        if (mxsfb->devdata->ipversion >= 4) {
+               /*
+                * On some platforms, bit 21 is defaulted to 1, which may alter
+                * the below setting. So, to make sure we have the right setting
+                * clear all the bits for CTRL2_OUTSTANDING_REQS.
+                */
+               writel(CTRL2_OUTSTANDING_REQS(0x7),
+                       mxsfb->base + LCDC_V4_CTRL2 + REG_CLR);
                writel(CTRL2_OUTSTANDING_REQS(REQ_16),
                        mxsfb->base + LCDC_V4_CTRL2 + REG_SET);
                /* Assert LCD Reset bit */