Merge branch 'master' of /home/wd/git/u-boot/master/
diff --git a/Makefile b/Makefile
index ac0a17f..ca860ba 100644
--- a/Makefile
+++ b/Makefile
@@ -352,11 +352,9 @@
 		cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
 
 $(VERSION_FILE):
-		@( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
-		echo -n "$(U_BOOT_VERSION)" ; \
-		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
-			 $(TOPDIR)) ; \
-		echo "\"" ) > $@.tmp
+		@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
+		 '$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR))' \
+		 ) > $@.tmp
 		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
 gdbtools:
diff --git a/board/trizepsiv/eeprom.c b/board/trizepsiv/eeprom.c
index 3d3bc00..7a2b905 100644
--- a/board/trizepsiv/eeprom.c
+++ b/board/trizepsiv/eeprom.c
@@ -24,7 +24,6 @@
 #include <common.h>
 #include <command.h>
 
-static unsigned char srom[128];
 extern u16 read_srom_word(int);
 extern void write_srom_word(int offset, u16 val);
 
diff --git a/common/env_flash.c b/common/env_flash.c
index eccfb62..a92160d 100644
--- a/common/env_flash.c
+++ b/common/env_flash.c
@@ -378,7 +378,9 @@
 		puts ("*** Warning - some problems detected "
 		      "reading environment; recovered successfully\n\n");
 #endif /* CFG_ENV_ADDR_REDUND */
+#ifdef CMD_SAVEENV
 	memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE);
+#endif
 #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */
 }
 
diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
index f593968..428d251 100644
--- a/cpu/mips/cache.S
+++ b/cpu/mips/cache.S
@@ -285,6 +285,22 @@
 	jr	ra
 	END(dcache_disable)
 
+/*******************************************************************************
+*
+* dcache_enable - enable cache
+*
+* RETURNS: N/A
+*
+*/
+LEAF(dcache_enable)
+	mfc0	t0, CP0_CONFIG
+	ori	t0, CONF_CM_CMASK
+	xori	t0, CONF_CM_CMASK
+	ori	t0, CONF_CM_CACHABLE_NONCOHERENT
+	mtc0	t0, CP0_CONFIG
+	jr	ra
+	END(dcache_enable)
+
 #ifdef CFG_INIT_RAM_LOCK_MIPS
 /*******************************************************************************
 *
diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
index b505a42..a173c54 100644
--- a/cpu/mips/config.mk
+++ b/cpu/mips/config.mk
@@ -20,7 +20,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-v=$(shell $(AS) --version |grep "GNU assembler" |cut -d. -f2)
+v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2)
 MIPSFLAGS:=$(shell \
 if [ "$v" -lt "14" ]; then \
 	echo "-mcpu=4kc"; \
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips
new file mode 100644
index 0000000..476c5e6
--- /dev/null
+++ b/doc/README.qemu_mips
@@ -0,0 +1,18 @@
+
+Notes for the Qemu MIPS port
+
+Example usage:
+
+# ln -s u-boot.bin mips_bios.bin
+start it:
+qemu-system-mips -L . /dev/null -nographic
+
+or
+
+if you use a qemu version after commit 4224
+
+create image:
+# dd of=flash bs=1k count=4k if=/dev/zero
+# dd of=flash bs=1k conv=notrunc if=u-boot.bin
+start it:
+# qemu-system-mips -pflash flash -monitor null -nographic
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 9d22aa3..c7af930 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -1277,6 +1277,12 @@
 				{MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
 #ifdef CFG_VSC8601_SKEWFIX
 				{MIIM_VSC8601_EPHY_CON,MIIM_VSC8601_EPHY_CON_INIT_SKEW,NULL},
+#if defined(CFG_VSC8601_SKEW_TX) && defined(CFG_VSC8601_SKEW_RX)
+				{MIIM_EXT_PAGE_ACCESS,1,NULL},
+#define VSC8101_SKEW	(CFG_VSC8601_SKEW_TX<<14)|(CFG_VSC8601_SKEW_RX<<12)
+				{MIIM_VSC8601_SKEW_CTRL,VSC8101_SKEW,NULL},
+				{MIIM_EXT_PAGE_ACCESS,0,NULL},
+#endif
 #endif
 				{miim_end,}
 				 },
diff --git a/drivers/net/tsec.h b/drivers/net/tsec.h
index cfa7d1a..597ea1d 100644
--- a/drivers/net/tsec.h
+++ b/drivers/net/tsec.h
@@ -112,6 +112,8 @@
 #define MIIM_GBIT_CONTROL	0x9
 #define MIIM_GBIT_CONTROL_INIT	0xe00
 
+#define MIIM_EXT_PAGE_ACCESS	0x1f
+
 /* Broadcom BCM54xx -- taken from linux sungem_phy */
 #define MIIM_BCM54xx_AUXSTATUS			0x19
 #define MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK	0x0700
@@ -161,8 +163,9 @@
 
 /* Entry for Vitesse VSC8601 regs starts here (Not complete) */
 /* Vitesse VSC8601 Extended PHY Control Register 1 */
-#define MIIM_VSC8601_EPHY_CON			0x17
+#define MIIM_VSC8601_EPHY_CON		0x17
 #define MIIM_VSC8601_EPHY_CON_INIT_SKEW	0x1120
+#define MIIM_VSC8601_SKEW_CTRL		0x1c
 
 /* 88E1011 PHY Status Register */
 #define MIIM_88E1011_PHY_STATUS         0x11
@@ -177,9 +180,9 @@
 #define MIIM_88E1011_PHY_MDI_X_AUTO	0x0060
 
 /* 88E1111 PHY LED Control Register */
-#define MIIM_88E1111_PHY_LED_CONTROL   24
-#define MIIM_88E1111_PHY_LED_DIRECT    0x4100
-#define MIIM_88E1111_PHY_LED_COMBINE   0x411C
+#define MIIM_88E1111_PHY_LED_CONTROL	24
+#define MIIM_88E1111_PHY_LED_DIRECT	0x4100
+#define MIIM_88E1111_PHY_LED_COMBINE	0x411C
 
 /* 88E1145 Extended PHY Specific Control Register */
 #define MIIM_88E1145_PHY_EXT_CR 20
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index c33b9e8..f4ae307 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -123,7 +123,7 @@
  * only.  Their primary purpose is to access PCI and ISA peripherals.
  *
  * Note that for a big endian machine, this implies that the following
- * big endian mode connectivity is in place, as described by numerious
+ * big endian mode connectivity is in place, as described by numerous
  * ARM documents:
  *
  *    PCI:  D0-D7   D8-D15 D16-D23 D24-D31
diff --git a/include/configs/sbc8548.h b/include/configs/sbc8548.h
index 49a7234..c84b70a 100644
--- a/include/configs/sbc8548.h
+++ b/include/configs/sbc8548.h
@@ -148,7 +148,7 @@
  * 1111 1111 1000 0000 0110 1110 0110 0101 = ff806e65    OR0
  *
  * OR6:
- *    Addr Mask = 64M = OR6[0:16] = 1111 1100 0000 0000 0
+ *    Addr Mask = 64M = OR6[0:16] = 1111 1000 0000 0000 0
  *    XAM = OR6[17:18] = 11
  *    CSNT = OR6[20] = 1
  *    ACS = half cycle delay = OR6[21:22] = 11
@@ -157,7 +157,7 @@
  *    EAD = use external address latch delay = OR6[31] = 1
  *
  * 0    4    8    12   16   20   24   28
- * 1111 1100 0000 0000 0110 1110 0110 0101 = fc006e65    OR6
+ * 1111 1000 0000 0000 0110 1110 0110 0101 = f8006e65    OR6
  */
 
 #define CFG_BOOT_BLOCK		0xff800000	/* start of 8MB Flash */
@@ -167,7 +167,7 @@
 #define CFG_BR6_PRELIM		0xfb801801
 
 #define	CFG_OR0_PRELIM		0xff806e65
-#define	CFG_OR6_PRELIM		0xfc006e65
+#define	CFG_OR6_PRELIM		0xf8006e65
 
 #define CFG_FLASH_BANKS_LIST	{CFG_FLASH_BASE}
 #define CFG_MAX_FLASH_BANKS	1		/* number of banks */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 22d573a..67506b3 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -44,6 +44,7 @@
 #include <devices.h>
 #include <version.h>
 #include <net.h>
+#include <serial.h>
 
 #ifdef CONFIG_DRIVER_SMC91111
 #include "../drivers/net/smc91111.h"
diff --git a/lib_m68k/board.c b/lib_m68k/board.c
index 9159206..6654f97 100644
--- a/lib_m68k/board.c
+++ b/lib_m68k/board.c
@@ -45,6 +45,7 @@
 #include <status_led.h>
 #endif
 #include <net.h>
+#include <serial.h>
 #if defined(CONFIG_CMD_BEDBUG)
 #include <cmd_bedbug.h>
 #endif
diff --git a/tools/mkimage.c b/tools/mkimage.c
index ea7a826..967fe9a 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -28,7 +28,7 @@
 extern int errno;
 
 #ifndef MAP_FAILED
-#define MAP_FAILED (-1)
+#define MAP_FAILED (void *)(-1)
 #endif
 
 extern	unsigned long	crc32 (unsigned long crc, const char *buf, unsigned int len);
@@ -218,9 +218,8 @@
 			exit (EXIT_FAILURE);
 		}
 
-		ptr = (unsigned char *)mmap(0, sbuf.st_size,
-					    PROT_READ, MAP_SHARED, ifd, 0);
-		if ((caddr_t)ptr == (caddr_t)-1) {
+		ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, ifd, 0);
+		if (ptr == MAP_FAILED) {
 			fprintf (stderr, "%s: Can't read %s: %s\n",
 				cmdname, imagefile, strerror(errno));
 			exit (EXIT_FAILURE);
@@ -330,9 +329,8 @@
 		exit (EXIT_FAILURE);
 	}
 
-	ptr = (unsigned char *)mmap(0, sbuf.st_size,
-				    PROT_READ|PROT_WRITE, MAP_SHARED, ifd, 0);
-	if (ptr == (unsigned char *)MAP_FAILED) {
+	ptr = mmap(0, sbuf.st_size, PROT_READ|PROT_WRITE, MAP_SHARED, ifd, 0);
+	if (ptr == MAP_FAILED) {
 		fprintf (stderr, "%s: Can't map %s: %s\n",
 			cmdname, imagefile, strerror(errno));
 		exit (EXIT_FAILURE);
@@ -410,9 +408,8 @@
 		exit (EXIT_FAILURE);
 	}
 
-	ptr = (unsigned char *)mmap(0, sbuf.st_size,
-				    PROT_READ, MAP_SHARED, dfd, 0);
-	if (ptr == (unsigned char *)MAP_FAILED) {
+	ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0);
+	if (ptr == MAP_FAILED) {
 		fprintf (stderr, "%s: Can't read %s: %s\n",
 			cmdname, datafile, strerror(errno));
 		exit (EXIT_FAILURE);
@@ -594,9 +591,8 @@
 		exit (EXIT_FAILURE);
 	}
 
-	ptr = (unsigned char *)mmap (0, sbuf.st_size,
-			PROT_READ|PROT_WRITE, MAP_SHARED, tfd, 0);
-	if ((caddr_t)ptr == (caddr_t)-1) {
+	ptr = mmap (0, sbuf.st_size, PROT_READ|PROT_WRITE, MAP_SHARED, tfd, 0);
+	if (ptr == MAP_FAILED) {
 		fprintf (stderr, "%s: Can't read %s: %s\n",
 				cmdname, tmpfile, strerror(errno));
 		unlink (tmpfile);