]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: versatile: fix board support
authorStefano Babic <sbabic@denx.de>
Fri, 24 Jun 2011 03:04:38 +0000 (03:04 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 4 Aug 2011 11:12:44 +0000 (13:12 +0200)
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>
Makefile
board/armltd/versatile/config.mk [deleted file]
board/armltd/versatile/versatile.c
boards.cfg
include/configs/versatile.h

index aa788513d77e15d825ea43567df1592bb629ee10..03d80b7c50ed503900fb872246ccb54026b04d09 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -933,15 +933,6 @@ edb9315_config \
 edb9315a_config: unconfig
        @$(MKCONFIG) -n $@ -t $(@:_config=) edb93xx arm arm920t edb93xx - ep93xx
 
-#########################################################################
-# ARM supplied Versatile development boards
-#########################################################################
-
-versatile_config       \
-versatileab_config     \
-versatilepb_config :   unconfig
-       @board/armltd/versatile/split_by_variant.sh $@
-
 #########################################################################
 ## XScale Systems
 #########################################################################
diff --git a/board/armltd/versatile/config.mk b/board/armltd/versatile/config.mk
deleted file mode 100644 (file)
index 8b57af1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# image should be loaded at 0x01000000
-#
-
-CONFIG_SYS_TEXT_BASE = 0x01000000
index 6e836dd1f93d780f761402a47b94a281e9cf5112..ee8cb5e3c7d9b276a9defdf7d752d3411ee59eab 100644 (file)
@@ -51,7 +51,7 @@ void show_boot_progress(int progress)
  * Miscellaneous platform dependent initialisations
  */
 
-int board_init (void)
+int board_early_init_f (void)
 {
        /*
         * set clock frequency:
@@ -62,6 +62,11 @@ int board_init (void)
          ((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 misc_init_r (void)
 ******************************/
 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;
 }
 
index 38ccb8c27e2c3510e0997f35cbc7c98f90129927..3fe7d1bc6ad6256c50f803faf2e3f237dbc81a90 100644 (file)
@@ -71,6 +71,9 @@ smdk2410                     arm         arm920t     -                   samsung
 netstar                      arm         arm925t
 voiceblue                    arm         arm925t
 omap1510inn                  arm         arm925t     -                   ti
+versatileqemu                arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_QEMU
+versatilepb                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_PB
+versatileab                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_AB
 aspenite                     arm         arm926ejs   -                   Marvell        armada100
 afeb9260                     arm         arm926ejs   -                   -              at91
 at91cap9adk                  arm         arm926ejs   -                   atmel          at91
index db6896584a56a72242aa068030689193b8105f40..32cee824bb64132a1de1b2e5d14b9a2d4f40a407 100644 (file)
@@ -74,6 +74,7 @@
 /*
  * Size of malloc() pool
  */
+#define CONFIG_ENV_SIZE                        8192
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 128 * 1024)
 
 /*
 #define PHYS_SDRAM_1_SIZE      0x08000000      /* 128 MB */
 #define PHYS_FLASH_SIZE                0x04000000      /* 64MB */
 
+#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR       0x00800000
+#define CONFIG_SYS_INIT_RAM_SIZE       0x000FFFFF
+#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - \
+                                               GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_INIT_RAM_ADDR + \
+                                               CONFIG_SYS_GBL_DATA_OFFSET)
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
+#ifdef CONFIG_ARCH_VERSATILE_QEMU
+#define CONFIG_SYS_TEXT_BASE           0x10000
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_SYS_MONITOR_LEN         0x80000
+#else
+#define CONFIG_SYS_TEXT_BASE           0x01000000
 /*
  * Use the CFI flash driver for ease of use
  */
 /* The ARM Boot Monitor is shipped in the lowest sector of flash */
 
 #define FLASH_TOP                      (CONFIG_SYS_FLASH_BASE + PHYS_FLASH_SIZE)
-#define CONFIG_ENV_SIZE                        8192
 #define CONFIG_ENV_ADDR                        (FLASH_TOP - CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_OFFSET              (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
 #define CONFIG_SYS_MONITOR_BASE                (CONFIG_ENV_ADDR - CONFIG_SYS_MONITOR_LEN)
 #define CONFIG_SYS_FLASH_PROTECTION    /* The devices have real protection */
 #define CONFIG_SYS_FLASH_EMPTY_INFO    /* flinfo indicates empty blocks */
 
+#endif
+
 #endif /* __CONFIG_H */