* Patch by Martin Krause, 03 Aug 2004:
  change timing for SM501 graphics controller on TQM5200 module

* Patch by Mark Jonas, 13 July 2004:
  - Total5200 LCD now run in little endian mode. Endianess conversion
    is done in hardware.
  - Removed last reference to "console" environment variable.
diff --git a/CHANGELOG b/CHANGELOG
index ffac5a2..e7d1e73 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,14 @@
 Changes since U-Boot 1.1.1:
 ======================================================================
 
+* Patch by Martin Krause, 03 Aug 2004:
+  change timing for SM501 graphics controller on TQM5200 module
+
+* Patch by Mark Jonas, 13 July 2004:
+  - Total5200 LCD now run in little endian mode. Endianess conversion
+    is done in hardware.
+  - Removed last reference to "console" environment variable. 
+
 * Patches by Lars Munch, 12 Jul 2004:
   - move at45.c to board/at91rm9200dk/ since this is at91rm9200dk
     board specific
diff --git a/Makefile b/Makefile
index 5da1628..1bf8a65 100644
--- a/Makefile
+++ b/Makefile
@@ -249,6 +249,21 @@
 		}
 	@./mkconfig -a IceCube ppc mpc5xxx icecube
 
+PM520_config \
+PM520_DDR_config \
+PM520_ROMBOOT_config \
+PM520_ROMBOOT_DDR_config:	unconfig
+	@ >include/config.h
+	@[ -z "$(findstring DDR,$@)" ] || \
+		{ echo "#define CONFIG_MPC5200_DDR"	>>include/config.h ; \
+		  echo "... DDR memory revision" ; \
+		}
+	@[ -z "$(findstring ROMBOOT,$@)" ] || \
+		{ echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
+		  echo "... booting from 8-bit flash" ; \
+		}
+	@./mkconfig -a PM520 ppc mpc5xxx pm520
+
 MINI5200_config	\
 EVAL5200_config	\
 TOP5200_config:	unconfig
@@ -283,30 +298,15 @@
 		}
 	@./mkconfig -a Total5200 ppc mpc5xxx total5200
 
-PM520_config \
-PM520_DDR_config \
-PM520_ROMBOOT_config \
-PM520_ROMBOOT_DDR_config:	unconfig
-	@ >include/config.h
-	@[ -z "$(findstring DDR,$@)" ] || \
-		{ echo "#define CONFIG_MPC5200_DDR"	>>include/config.h ; \
-		  echo "... DDR memory revision" ; \
-		}
-	@[ -z "$(findstring ROMBOOT,$@)" ] || \
-		{ echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
-		  echo "... booting from 8-bit flash" ; \
-		}
-	@./mkconfig -a PM520 ppc mpc5xxx pm520
-
 TQM5200_AA_config	\
 TQM5200_AB_config	\
 TQM5200_AC_config	\
 MiniFAP_config:	unconfig
 	@ >include/config.h
-	@[ -z "$(findstring Mini-FAP,$@)" ] || \
+	@[ -z "$(findstring MiniFAP,$@)" ] || \
 		{ echo "#define CONFIG_MINIFAP"	>>include/config.h ; \
 		  echo "#define CONFIG_TQM5200_AC"	>>include/config.h ; \
-		  echo "... TQM5200_AC on Mini-FAP" ; \
+		  echo "... TQM5200_AC on MiniFAP" ; \
 		}
 	@[ -z "$(findstring AA,$@)" ] || \
 		{ echo "#define CONFIG_TQM5200_AA"	>>include/config.h ; \
diff --git a/drivers/cfb_console.c b/drivers/cfb_console.c
index 3d26ae2..1eaac47 100644
--- a/drivers/cfb_console.c
+++ b/drivers/cfb_console.c
@@ -123,7 +123,9 @@
 /*****************************************************************************/
 #ifdef CONFIG_VIDEO_SED13806
 
+#ifndef CONFIG_TOTAL5200
 #define VIDEO_FB_LITTLE_ENDIAN
+#endif
 #define VIDEO_HW_RECTFILL
 #define VIDEO_HW_BITBLT
 #endif
diff --git a/drivers/sed13806.c b/drivers/sed13806.c
index 114a247..6996ca8 100644
--- a/drivers/sed13806.c
+++ b/drivers/sed13806.c
@@ -36,9 +36,13 @@
 #define writeByte(ptrReg,value) \
     *(volatile unsigned char *)(sed13806.isaBase + ptrReg) = value
 
+#ifdef CONFIG_TOTAL5200
+#define writeWord(ptrReg,value) \
+    (*(volatile unsigned short *)(sed13806.isaBase + ptrReg) = value)
+#else
 #define writeWord(ptrReg,value) \
     (*(volatile unsigned short *)(sed13806.isaBase + ptrReg) = ((value >> 8 ) & 0xff) | ((value << 8) & 0xff00))
-
+#endif
 
 GraphicDevice sed13806;
 
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
index 4b27633..1f83aa5 100644
--- a/include/configs/TQM5200.h
+++ b/include/configs/TQM5200.h
@@ -474,7 +474,7 @@
 #if defined (CONFIG_TQM5200_AB) || defined (CONFIG_TQM5200_AC)
 #define CFG_CS1_START		0xE0000000
 #define CFG_CS1_SIZE		0x4000000	/* 64 MByte */
-#define CFG_CS1_CFG		0x0148FF70
+#define CFG_CS1_CFG		0x8F48FF70
 #define SM501_MMIO_BASE		CFG_CS1_START + 0x03E00000
 #endif
 
diff --git a/include/configs/Total5200.h b/include/configs/Total5200.h
index 47f24be..7e3c11e 100644
--- a/include/configs/Total5200.h
+++ b/include/configs/Total5200.h
@@ -173,7 +173,6 @@
 	"net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0"	\
 	"rootpath=/opt/eldk/ppc_82xx\0"					\
 	"bootfile=/tftpboot/MPC5200/uImage\0"				\
-	"console=serial\0"				\
 	""
 
 #define CONFIG_BOOTCOMMAND	"run flash_self"
@@ -357,7 +356,7 @@
 
 #define CFG_CS2_START		CFG_LCD_BASE
 #define CFG_CS2_SIZE		0x00400000	/* 4096 kB */
-#define CFG_CS2_CFG		0x0032FD00	/* 50WS, MX, AL, AA, CE, AS_25, DS_16 */
+#define CFG_CS2_CFG		0x0032FD0C	/* 50WS, MX, AL, AA, CE, AS_25, DS_16, endian swapping */
 
 #if CONFIG_TOTAL5200_REV==1
 #   define CFG_CS3_START	CFG_CPLD_BASE