ARM: versatile: fix board support

Versatile board is used as example to run u-boot under qemu.
The patch fixes relocation for all versatile boards and adds
a versatileqemu target to be used under qemu.

Patch tested only under qemu, not on real boards.
Tested with QEMU emulator version 0.14.50.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Alessandro Rubini  <rubini-list@gnudd.com>
CC: Loïc Minier <loic.minier@linaro.org>
diff --git a/board/armltd/versatile/config.mk b/board/armltd/versatile/config.mk
deleted file mode 100644
index 8b57af1..0000000
--- a/board/armltd/versatile/config.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# image should be loaded at 0x01000000
-#
-
-CONFIG_SYS_TEXT_BASE = 0x01000000
diff --git a/board/armltd/versatile/versatile.c b/board/armltd/versatile/versatile.c
index 6e836dd..ee8cb5e 100644
--- a/board/armltd/versatile/versatile.c
+++ b/board/armltd/versatile/versatile.c
@@ -51,7 +51,7 @@
  * Miscellaneous platform dependent initialisations
  */
 
-int board_init (void)
+int board_early_init_f (void)
 {
 	/*
 	 * set clock frequency:
@@ -62,6 +62,11 @@
 	  ((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
 	   (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel));
 
+	return 0;
+}
+
+int board_init (void)
+{
 	/* arch number of Versatile Board */
 	gd->bd->bi_arch_number = MACH_TYPE_VERSATILE_PB;
 
@@ -88,6 +93,9 @@
 ******************************/
 int dram_init (void)
 {
+	/* dram_init must store complete ramsize in gd->ram_size */
+	gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
+				PHYS_SDRAM_1_SIZE);
 	return 0;
 }