Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/omap different u-boot versions set up the video...



details:   https://anonhg.NetBSD.org/src/rev/ff328de01cdc
branches:  trunk
changeset: 783226:ff328de01cdc
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Dec 11 21:57:41 2012 +0000

description:
different u-boot versions set up the video hardware in different ways, make
sure we can deal with both

diffstat:

 sys/arch/arm/omap/omapfb.c |  24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diffs (55 lines):

diff -r 2e6d54ed9006 -r ff328de01cdc sys/arch/arm/omap/omapfb.c
--- a/sys/arch/arm/omap/omapfb.c        Tue Dec 11 21:16:22 2012 +0000
+++ b/sys/arch/arm/omap/omapfb.c        Tue Dec 11 21:57:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: omapfb.c,v 1.4 2012/10/29 18:11:36 macallan Exp $      */
+/*     $NetBSD: omapfb.c,v 1.5 2012/12/11 21:57:41 macallan Exp $      */
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.4 2012/10/29 18:11:36 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.5 2012/12/11 21:57:41 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -173,7 +173,23 @@
                return;
        }
 
+       /*
+        * XXX
+        * different u-boot versions initialize the graphics controller in
+        * different ways, so we look for the display resolution in a few
+        * different places...
+        */
        sz = bus_space_read_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_GFX_SIZE);
+       if (sz == 0) {
+               sz = bus_space_read_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_SIZE_LCD);
+       }
+       if (sz == 0) {
+               sz = bus_space_read_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_SIZE_DIG);
+       }
+       
+       /* ... and make sure it ends up where we need it */
+       bus_space_write_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_GFX_SIZE, sz);
+
        sc->sc_width = (sz & 0xfff) + 1;
        sc->sc_height = ((sz & 0x0fff0000 ) >> 16) + 1;
        sc->sc_depth = 16;
@@ -293,9 +309,11 @@
        bus_space_write_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_DEFAULT_COLOR_1,
            0x00ff0000);
 #endif
+
+       /* now we make sure the video output is actually running */
        reg = bus_space_read_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_CONTROL);
        bus_space_write_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_CONTROL,
-           reg | OMAP_DISPC_CTRL_GO_LCD);
+           reg | OMAP_DISPC_CTRL_GO_LCD | OMAP_DISPC_CTRL_GO_DIGITAL);
 
 #ifdef OMAPFB_DEBUG
        printf("attr: %08x\n", bus_space_read_4(sc->sc_iot, sc->sc_regh, OMAPFB_DISPC_GFX_ATTRIBUTES));



Home | Main Index | Thread Index | Old Index