diff --git a/README b/README
index d1b4eed020..14d6b227d6 100644
--- a/README
+++ b/README
@@ -1152,6 +1152,7 @@ The following options need to be configured:
 		CONFIG_RTC_DS1307	- use Maxim, Inc. DS1307 RTC
 		CONFIG_RTC_DS1337	- use Maxim, Inc. DS1337 RTC
 		CONFIG_RTC_DS1338	- use Maxim, Inc. DS1338 RTC
+		CONFIG_RTC_DS1339	- use Maxim, Inc. DS1339 RTC
 		CONFIG_RTC_DS164x	- use Dallas DS164x RTC
 		CONFIG_RTC_ISL1208	- use Intersil ISL1208 RTC
 		CONFIG_RTC_MAX6900	- use Maxim, Inc. MAX6900 RTC
@@ -4388,6 +4389,11 @@ use the "saveenv" command to store a valid environment.
 		later, once stdio is running and output goes to the LCD, if
 		present.
 
+- CONFIG_BOARD_SIZE_LIMIT:
+		Maximum size of the U-Boot image. When defined, the
+		build system checks that the actual size does not
+		exceed it.
+
 Low Level (hardware related) configuration options:
 ---------------------------------------------------
 
diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 40b6333ebf..3cb0571df3 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -292,6 +292,7 @@ static int get_mtd_info(u8 type, u8 num, struct mtd_info **mtd)
 		printf("Device %s not found!\n", mtd_dev);
 		return 1;
 	}
+	put_mtd_device(*mtd);
 
 	return 0;
 }
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ed113bf402..4fd9c532b3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -323,7 +323,7 @@ int __pci_hose_bus_to_phys(struct pci_controller *hose,
 			continue;
 
 		if (bus_addr >= res->bus_start &&
-			bus_addr < res->bus_start + res->size) {
+			(bus_addr - res->bus_start) < res->size) {
 			*pa = (bus_addr - res->bus_start + res->phys_start);
 			return 0;
 		}
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 003d322d23..43f85460a3 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_RTC_DS1302) += ds1302.o
 obj-$(CONFIG_RTC_DS1306) += ds1306.o
 obj-$(CONFIG_RTC_DS1307) += ds1307.o
 obj-$(CONFIG_RTC_DS1338) += ds1307.o
+obj-$(CONFIG_RTC_DS1339) += ds1307.o
 obj-$(CONFIG_RTC_DS1337) += ds1337.o
 obj-$(CONFIG_RTC_DS1374) += ds1374.o
 obj-$(CONFIG_RTC_DS1388) += ds1337.o
diff --git a/drivers/rtc/ds1307.c b/drivers/rtc/ds1307.c
index 1a2bad3c5c..03ab1a8c5d 100644
--- a/drivers/rtc/ds1307.c
+++ b/drivers/rtc/ds1307.c
@@ -9,7 +9,7 @@
 
 /*
  * Date & Time support (no alarms) for Dallas Semiconductor (now Maxim)
- * DS1307 and DS1338 Real Time Clock (RTC).
+ * DS1307 and DS1338/9 Real Time Clock (RTC).
  *
  * based on ds1337.c
  */
diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index 3eb408f004..b65bdfda32 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -77,6 +77,11 @@
 #define CONFIG_ENV_SIZE			0x20000	/* 128k */
 #define CONFIG_ENV_ADDR			0x60000
 #define CONFIG_ENV_OFFSET		0x60000	/* env starts here */
+/*
+ * Environment is right behind U-Boot in flash. Make sure U-Boot
+ * doesn't grow into the environment area.
+ */
+#define CONFIG_BOARD_SIZE_LIMIT		CONFIG_ENV_OFFSET
 
 /*
  * Default environment variables
diff --git a/tools/fit_info.c b/tools/fit_info.c
index 481ac6dd81..652abcd2bd 100644
--- a/tools/fit_info.c
+++ b/tools/fit_info.c
@@ -48,10 +48,11 @@ int main(int argc, char **argv)
 	char *fdtfile = NULL;
 	char *nodename = NULL;
 	char *propertyname = NULL;
-	char cmdname[50];
+	char cmdname[256];
 	int c;
 
-	strcpy(cmdname, *argv);
+	strncpy(cmdname, *argv, sizeof(cmdname) - 1);
+	cmdname[sizeof(cmdname) - 1] = '\0';
 	while ((c = getopt(argc, argv, "f:n:p:")) != -1)
 		switch (c) {
 		case 'f':
diff --git a/tools/image-host.c b/tools/image-host.c
index 0eff720b62..7effb6cea5 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -689,7 +689,7 @@ int fit_add_verification_data(const char *keydir, void *keydest, void *fit,
 	confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH);
 	if (confs_noffset < 0) {
 		printf("Can't find images parent node '%s' (%s)\n",
-		       FIT_IMAGES_PATH, fdt_strerror(confs_noffset));
+		       FIT_CONFS_PATH, fdt_strerror(confs_noffset));
 		return -ENOENT;
 	}
 
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 123d0c7d93..c70408c9ba 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -458,6 +458,7 @@ NXTARG:		;
 #if defined(_POSIX_SYNCHRONIZED_IO) && \
    !defined(__sun__) && \
    !defined(__FreeBSD__) && \
+   !defined(__OpenBSD__) && \
    !defined(__APPLE__)
 	(void) fdatasync (ifd);
 #else
@@ -501,6 +502,7 @@ NXTARG:		;
 #if defined(_POSIX_SYNCHRONIZED_IO) && \
    !defined(__sun__) && \
    !defined(__FreeBSD__) && \
+   !defined(__OpenBSD__) && \
    !defined(__APPLE__)
 	(void) fdatasync (ifd);
 #else