diff --git a/Makefile b/Makefile
index ac0a17f6ce5dccaa836389321ae13dd6f876d286..ca860ba9f3cc800a0ac3581a4e666f728fc98b49 100644
--- a/Makefile
+++ b/Makefile
@@ -352,11 +352,9 @@ $(U_BOOT_ONENAND):	$(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
 		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 3d3bc00221bfbf458ce71df1e0da90a0043be6cb..7a2b90585b886a1947aa28a4f7e1df36639b8990 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 eccfb62a3beb9fe7a24713830ab0d6a06cf0aecc..a92160ddfb3f8652fc35989b80823eb1af5a4a7d 100644
--- a/common/env_flash.c
+++ b/common/env_flash.c
@@ -378,7 +378,9 @@ void env_relocate_spec (void)
 		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 f5939683208f03ccf985b0f0025a4cd70efd02c1..428d251bf126022d56bf22477662cfdc67321094 100644
--- a/cpu/mips/cache.S
+++ b/cpu/mips/cache.S
@@ -285,6 +285,22 @@ LEAF(dcache_disable)
 	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 b505a42550c2845e035ae976d711088a25346e71..a173c5480c0131e2c89808fee7f6398737061b52 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 0000000000000000000000000000000000000000..476c5e6899205bf004d6069450c6c15f94c9e8cc
--- /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 9d22aa38be5ce9f7a2ddae06af3c1542a1d30167..c7af930b6b0cbf8af807457a903f07434ec843b3 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -1277,6 +1277,12 @@ struct phy_info phy_info_VSC8601 = {
 				{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 cfa7d1aad77761e431c3293d926c3a03d231a40f..597ea1d3c7fd8fff8466a143ab717fb1ac15f5c2 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 c33b9e8d34271e2c531ed1483dfe3d279270a7d6..f4ae3070036bf2814ee3c1aaff2ff806195d4aa1 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -123,7 +123,7 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
  * 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 49a72347fb7e1d929acdd11e4d8b68ca168f0ea2..c84b70a87d59e92758edba6c2d53b6e70c5ace3a 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 22d573a39834e1c2a813bf73c672e3818b8b4660..67506b35e1ec6fbac0d00ee000341dc97c345414 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 915920641dba42de9a5dd31c421d5f162e2d6849..6654f971b24130b96b81174307eb99d21e60e10f 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 ea7a826f8c2292d666fba8b53643b0fc29ce095a..967fe9a776a87c9e88a2f68a295a0a48d5da8d85 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 @@ NXTARG:		;
 			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 @@ NXTARG:		;
 		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 @@ copy_file (int ifd, const char *datafile, int pad)
 		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 @@ static void fit_handle_file (void)
 		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);