Fix watchdog reset problems on LWMON board
[platform/kernel/u-boot.git] / common / lcd.c
index 85b44ca..6650638 100644 (file)
 #include <post.h>
 #endif
 #include <lcd.h>
+#include <watchdog.h>
 
 #if defined(CONFIG_PXA250)
 #include <asm/byteorder.h>
 #endif
 
 #if defined(CONFIG_MPC823)
-#include <watchdog.h>
 #include <lcdvideo.h>
 #endif
 
@@ -620,6 +620,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
                cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
+#else
+# error "Don't know location of color map"
 #endif
 
                /* Set color map */
@@ -631,9 +633,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                                ( (cte.blue) & 0x001f) ;
 
 #ifdef CFG_INVERT_COLORS
-                       *cmap++ = 0xffff - colreg;
+                       *cmap = 0xffff - colreg;
 #else
-                       *cmap++ = colreg;
+                       *cmap = colreg;
+#endif
+#if defined(CONFIG_PXA250)
+                       cmap++;
+#elif defined(CONFIG_MPC823)
+                       cmap--;
 #endif
                }
        }
@@ -648,6 +655,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
        fb   = (uchar *) (lcd_base +
                (y + height - 1) * lcd_line_length + x);
        for (i = 0; i < height; ++i) {
+               WATCHDOG_RESET();
                for (j = 0; j < width ; j++)
 #if defined(CONFIG_PXA250)
                        *(fb++)=*(bmap++);