From patchwork Fri Jun 24 13:04:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 101790 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D5050B6F83 for ; Fri, 24 Jun 2011 23:11:22 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 802762807F; Fri, 24 Jun 2011 15:11:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wZrxDDiJETHh; Fri, 24 Jun 2011 15:11:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F28CA28080; Fri, 24 Jun 2011 15:11:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 578F728080 for ; Fri, 24 Jun 2011 15:11:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g+USi3mZ2fc3 for ; Fri, 24 Jun 2011 15:11:13 +0200 (CEST) X-Greylist: delayed 384 seconds by postgrey-1.27 at theia; Fri, 24 Jun 2011 15:11:12 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from linux-laptop (unknown [88.149.182.160]) by theia.denx.de (Postfix) with ESMTP id 467A82807F for ; Fri, 24 Jun 2011 15:11:12 +0200 (CEST) Received: by linux-laptop (Postfix, from userid 1000) id 3EA3BAA0AB; Fri, 24 Jun 2011 15:04:47 +0200 (CEST) From: Stefano Babic To: u-boot@lists.denx.de Date: Fri, 24 Jun 2011 15:04:38 +0200 Message-Id: <1308920678-7013-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= , Alessandro Rubini Subject: [U-Boot] [PATCH] ARM: versatile: fix board support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 CC: Alessandro Rubini CC: Loïc Minier --- Because the versatile board is still broken, the patch tries to fix board support to be used with qemu. The versatile board is the board commonly described in the examples to run u-boot under qemu. The patch tries to fix the comments to former Alessandro Rubini's patch: http://www.mail-archive.com/u-boot@lists.denx.de/msg51136.html Makefile | 9 --------- board/armltd/versatile/config.mk | 5 ----- board/armltd/versatile/versatile.c | 10 +++++++++- boards.cfg | 3 +++ include/configs/versatile.h | 21 ++++++++++++++++++++- 5 files changed, 32 insertions(+), 16 deletions(-) delete mode 100644 board/armltd/versatile/config.mk diff --git a/Makefile b/Makefile index d14955f..2a85f91 100644 --- a/Makefile +++ b/Makefile @@ -975,15 +975,6 @@ 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 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 @@ 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; } diff --git a/boards.cfg b/boards.cfg index ac20c81..9397345 100644 --- a/boards.cfg +++ b/boards.cfg @@ -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 diff --git a/include/configs/versatile.h b/include/configs/versatile.h index db68965..32cee82 100644 --- a/include/configs/versatile.h +++ b/include/configs/versatile.h @@ -74,6 +74,7 @@ /* * Size of malloc() pool */ +#define CONFIG_ENV_SIZE 8192 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024) /* @@ -168,9 +169,26 @@ #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 */ @@ -222,7 +240,6 @@ /* 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) @@ -230,4 +247,6 @@ #define CONFIG_SYS_FLASH_PROTECTION /* The devices have real protection */ #define CONFIG_SYS_FLASH_EMPTY_INFO /* flinfo indicates empty blocks */ +#endif + #endif /* __CONFIG_H */