From: Anatolij Gustschin <agust@denx.de>
To: linuxppc-dev@ozlabs.org
Cc: linux-fbdev@vger.kernel.org, Wolfgang Denk <wd@denx.de>,
Detlev Zundel <dzu@denx.de>,
devicetree-discuss@lists.ozlabs.org,
Anatolij Gustschin <agust@denx.de>
Subject: [PATCH v4 1/5] fsl-diu-fb: fix issue with re-enabling DIU area descriptor
Date: Fri, 23 Jul 2010 14:00:35 +0000 [thread overview]
Message-ID: <1279893639-24333-2-git-send-email-agust@denx.de> (raw)
In-Reply-To: <1279893639-24333-1-git-send-email-agust@denx.de>
On MPC5121e Rev 2.0 re-configuring the DIU area descriptor
by writing new descriptor address doesn't always work.
As a result, DIU continues to display using old area descriptor
even if the new one has been written to the descriptor register of
the plane.
Add the code from Freescale MPC5121EADS BSP for writing descriptor
addresses properly. This fixes the problem for Rev 2.0 silicon.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
v4:
- use workaround code as suggested by FSL technical support.
v3:
- no changes since v1
drivers/video/fsl-diu-fb.c | 38 +++++++++++++++++++++++---------------
1 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 27455ce..9b8c991 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -317,6 +317,17 @@ static void fsl_diu_free(void *virt, size_t size)
free_pages_exact(virt, size);
}
+/*
+ * Workaround for failed writing desc register of planes.
+ * Needed with MPC5121 DIU rev 2.0 silicon.
+ */
+void wr_reg_wa(u32 *reg, u32 val)
+{
+ do {
+ out_be32(reg, val);
+ } while (in_be32(reg) != val);
+}
+
static int fsl_diu_enable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
@@ -330,7 +341,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
switch (mfbi->index) {
case 0: /* plane 0 */
if (hw->desc[0] != ad->paddr)
- out_be32(&hw->desc[0], ad->paddr);
+ wr_reg_wa(&hw->desc[0], ad->paddr);
break;
case 1: /* plane 1 AOI 0 */
cmfbi = machine_data->fsl_diu_info[2]->par;
@@ -340,7 +351,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
cpu_to_le32(cmfbi->ad->paddr);
else
ad->next_ad = 0;
- out_be32(&hw->desc[1], ad->paddr);
+ wr_reg_wa(&hw->desc[1], ad->paddr);
}
break;
case 3: /* plane 2 AOI 0 */
@@ -351,14 +362,14 @@ static int fsl_diu_enable_panel(struct fb_info *info)
cpu_to_le32(cmfbi->ad->paddr);
else
ad->next_ad = 0;
- out_be32(&hw->desc[2], ad->paddr);
+ wr_reg_wa(&hw->desc[2], ad->paddr);
}
break;
case 2: /* plane 1 AOI 1 */
pmfbi = machine_data->fsl_diu_info[1]->par;
ad->next_ad = 0;
if (hw->desc[1] = machine_data->dummy_ad->paddr)
- out_be32(&hw->desc[1], ad->paddr);
+ wr_reg_wa(&hw->desc[1], ad->paddr);
else /* AOI0 open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
@@ -366,7 +377,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
pmfbi = machine_data->fsl_diu_info[3]->par;
ad->next_ad = 0;
if (hw->desc[2] = machine_data->dummy_ad->paddr)
- out_be32(&hw->desc[2], ad->paddr);
+ wr_reg_wa(&hw->desc[2], ad->paddr);
else /* AOI0 was open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
@@ -390,27 +401,24 @@ static int fsl_diu_disable_panel(struct fb_info *info)
switch (mfbi->index) {
case 0: /* plane 0 */
if (hw->desc[0] != machine_data->dummy_ad->paddr)
- out_be32(&hw->desc[0],
- machine_data->dummy_ad->paddr);
+ wr_reg_wa(&hw->desc[0], machine_data->dummy_ad->paddr);
break;
case 1: /* plane 1 AOI 0 */
cmfbi = machine_data->fsl_diu_info[2]->par;
if (cmfbi->count > 0) /* AOI1 is open */
- out_be32(&hw->desc[1], cmfbi->ad->paddr);
+ wr_reg_wa(&hw->desc[1], cmfbi->ad->paddr);
/* move AOI1 to the first */
else /* AOI1 was closed */
- out_be32(&hw->desc[1],
- machine_data->dummy_ad->paddr);
+ wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
case 3: /* plane 2 AOI 0 */
cmfbi = machine_data->fsl_diu_info[4]->par;
if (cmfbi->count > 0) /* AOI1 is open */
- out_be32(&hw->desc[2], cmfbi->ad->paddr);
+ wr_reg_wa(&hw->desc[2], cmfbi->ad->paddr);
/* move AOI1 to the first */
else /* AOI1 was closed */
- out_be32(&hw->desc[2],
- machine_data->dummy_ad->paddr);
+ wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
case 2: /* plane 1 AOI 1 */
@@ -421,7 +429,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
/* AOI0 is open, must be the first */
pmfbi->ad->next_ad = 0;
} else /* AOI1 is the first in the chain */
- out_be32(&hw->desc[1], machine_data->dummy_ad->paddr);
+ wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
case 4: /* plane 2 AOI 1 */
@@ -432,7 +440,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
/* AOI0 is open, must be the first */
pmfbi->ad->next_ad = 0;
} else /* AOI1 is the first in the chain */
- out_be32(&hw->desc[2], machine_data->dummy_ad->paddr);
+ wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
default:
--
1.7.0.4
next prev parent reply other threads:[~2010-07-23 14:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 14:00 [PATCH v4 0/5] Rework MPC5121 DIU support (for 2.6.36) Anatolij Gustschin
2010-07-23 14:00 ` Anatolij Gustschin [this message]
2010-07-28 7:02 ` [PATCH v4 1/5] fsl-diu-fb: fix issue with re-enabling DIU area Grant Likely
[not found] ` <AANLkTikkLVCxU4ZC_nmUhKTQogUNeQzxOX6KqgZcxiYr-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-28 7:56 ` Anatolij Gustschin
2010-07-23 14:00 ` [PATCH v4 2/5] fsl-diu-fb: move fsl-diu-fb.h to include/linux Anatolij Gustschin
2010-07-23 14:00 ` [PATCH v4 3/5] powerpc/mpc5121: shared DIU framebuffer support Anatolij Gustschin
2011-12-15 17:27 ` Tabi Timur-B04825
2011-12-15 21:26 ` Anatolij Gustschin
2011-12-16 18:24 ` Timur Tabi
2011-12-16 22:59 ` Anatolij Gustschin
2011-12-16 23:00 ` Timur Tabi
2010-07-23 14:00 ` [PATCH v4 4/5] powerpc: doc/dts-bindings: update doc of FSL DIU bindings Anatolij Gustschin
2010-07-23 14:00 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using EDID Anatolij Gustschin
[not found] ` <1279893639-24333-6-git-send-email-agust-ynQEQJNshbs@public.gmane.org>
2010-12-16 16:47 ` Timur Tabi
[not found] ` <AANLkTin-TL5_TKnyHYtZdixosfqpkPNoarSTC+K4tTUb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-16 16:53 ` Grant Likely
2010-12-16 16:55 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using Timur Tabi
[not found] ` <4D0A446E.5020600-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-12-16 17:06 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using EDID Grant Likely
2010-12-16 17:28 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using Timur Tabi
2010-12-16 17:42 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using EDID Grant Likely
2010-12-16 17:42 ` [PATCH v4 5/5] fsl-diu-fb: Support setting display mode using Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1279893639-24333-2-git-send-email-agust@denx.de \
--to=agust@denx.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dzu@denx.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=wd@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).