* Patches by Anders Larsen, 17 Sep 2003:
  - fix spelling errors
  - set GD_FLG_DEVINIT flag only after device function pointers
    are valid
  - Allow CFG_ALT_MEMTEST on systems where address zero isn't
    writeable
  - enable 3.rd UART (ST-UART) on PXA(XScale) CPUs
  - trigger watchdog while waiting in serial driver
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 3e22598..3918678 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -555,7 +555,11 @@
 	vu_long	temp;
 	vu_long	anti_pattern;
 	vu_long	num_words;
+#if defined(CFG_MEMTEST_SCRATCH)
+	vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
+#else
 	vu_long *dummy = NULL;
+#endif
 	int	j;
 	int iterations = 1;
 
diff --git a/common/console.c b/common/console.c
index 148c599..d933c33 100644
--- a/common/console.c
+++ b/common/console.c
@@ -436,6 +436,8 @@
 		console_setfile (stdin, inputdev);
 	}
 
+	gd->flags |= GD_FLG_DEVINIT;	/* device initialization completed */
+
 #ifndef CFG_CONSOLE_INFO_QUIET
 	/* Print information */
 	printf ("In:    ");
@@ -480,6 +482,8 @@
 /* Called after the relocation - use desired console functions */
 int console_init_r (void)
 {
+	DECLARE_GLOBAL_DATA_PTR;
+
 	device_t *inputdev = NULL, *outputdev = NULL;
 	int i, items = ListNumItems (devlist);
 
@@ -514,6 +518,8 @@
 		console_setfile (stdin, inputdev);
 	}
 
+	gd->flags |= GD_FLG_DEVINIT;	/* device initialization completed */
+
 #ifndef CFG_CONSOLE_INFO_QUIET
 	/* Print information */
 	printf ("In:    ");
diff --git a/common/devices.c b/common/devices.c
index 4839eac..7b4a1cd 100644
--- a/common/devices.c
+++ b/common/devices.c
@@ -158,8 +158,6 @@
 
 int devices_init (void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
 	ulong relocation_offset = gd->reloc_off;
 	int i;
@@ -195,8 +193,6 @@
 #endif
 	drv_system_init ();
 
-	gd-> flags |= GD_FLG_DEVINIT;	/* device initialization done */
-
 	return (0);
 }
 
diff --git a/common/usb.c b/common/usb.c
index 9474abe..a96052a 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -595,7 +595,7 @@
 	int i;
 	USB_PRINTF("New Device %d\n",dev_index);
 	if(dev_index==USB_MAX_DEVICE) {
-		printf("ERROR, to many USB Devices max=%d\n",USB_MAX_DEVICE);
+		printf("ERROR, too many USB Devices, max=%d\n",USB_MAX_DEVICE);
 		return NULL;
 	}
 	usb_dev[dev_index].devnum=dev_index+1; /* default Address is 0, real addresses start with 1 */