Thread (12 messages) 12 messages, 4 authors, 2011-12-16

Re: [PATCH v4 3/5] powerpc/mpc5121: shared DIU framebuffer support

From: Tabi Timur-B04825 <hidden>
Date: 2011-12-15 17:27:53

On Fri, Jul 23, 2010 at 9:00 AM, Anatolij Gustschin [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -1471,7 +1476,9 @@ static int __devinit fsl_diu_probe(struct of_device *ofdev,
               goto error2;
       }

-       out_be32(&dr.diu_reg->diu_mode, 0);             /* disable DIU anyway*/
+       diu_mode = in_be32(&dr.diu_reg->diu_mode);
+       if (diu_mode != MFB_MODE1)
+               out_be32(&dr.diu_reg->diu_mode, 0);     /* disable DIU */
Anatolij,

I know this patch is old, but I just noticed something odd about it
that I need your help with.

In the above snippet, you test for != MFB_MODE1.  My understanding is
that U-boot only supports modes 0 and 1, never modes 2 or 3.  So
diu_mode can only ever be 0 or 1.  That means that that the above code
is equivalent to:

diu_mode = in_be32(&dr.diu_reg->diu_mode);
if (diu_mode = 0)
        out_be32(&dr.diu_reg->diu_mode, 0);     /* disable DIU */

which is silly, because now we're writing 0 to diu_mode only if it's already 0.

Am I missing something?

-- 
Timur Tabi
Linux kernel developer at Freescale
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help