From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] [TESTING] da8xx: fixup ARM relocation support
Date: Mon, 23 Aug 2010 08:12:38 +0200 [thread overview]
Message-ID: <4C721156.20207@denx.de> (raw)
In-Reply-To: <1281706277-27200-1-git-send-email-bengardiner@nanometrics.ca>
Hello Ben,
Ben Gardiner wrote:
> Split the existing dram_init for da8xx when ARM reloc is enabled, like the
> changes to arch/arm/cpu/arm926ejs/orion5x/dram.c in
> 0f234d263b17ccf1b8fd776eb8c15b7cdb27a887 by Heiko Schocher <hs@denx.de>.
>
> Without these changes gd->ram_size is '0' which leads to incorrect relocation
> when CONFIG_SYS_ARM_WITHOUT_RELOC is defined and the board does not boot.
>
> We use get_ram_size to dynamically calculate the available RAM because it runs
> on different board version with different ram, as suggested by Heiko in private
> communication.
>
> Tested on a da850evm with 128M of DDR2 installed; with both
> CONFIG_SYS_ARM_WITHOUT_RELOC defined and undefined.
>
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> ---
> This patch is submitted for the arm-reloc-and-cache-support branch of
> git://git.denx.de/u-boot-testing.git
>
> V2:
> * added Nori Sehkar to the to: list
> * indicated for which branch of testing this patch is submitted.
>
> board/davinci/common/misc.c | 17 +++++++++++++++++
> include/configs/da850evm.h | 1 +
> 2 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c
> index 25ca326..e8acefe 100644
> --- a/board/davinci/common/misc.c
> +++ b/board/davinci/common/misc.c
> @@ -33,6 +33,7 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
> int dram_init(void)
> {
> gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> @@ -40,6 +41,22 @@ int dram_init(void)
>
> return(0);
> }
> +#else
> +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,
> + CONFIG_MAX_RAM_BANK_SIZE);
> + return(0);
> +}
> +
> +void dram_init_banksize (void)
> +{
> + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
> + gd->bd->bi_dram[0].size = gd->ram_size;
> +}
> +#endif
>
> #ifdef CONFIG_DRIVER_TI_EMAC
>
> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index 016a21e..c929f6b 100644
> --- a/include/configs/da850evm.h
> +++ b/include/configs/da850evm.h
> @@ -47,6 +47,7 @@
> #define CONFIG_SYS_GBL_DATA_SIZE 128 /* reserved for initial data */
> #define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
> #define PHYS_SDRAM_1_SIZE (64 << 20) /* SDRAM size 64MB */
> +#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /*DDR2 Data region maximum size from SPRS586*/
Line to long, please fix.
> /* memtest start addr */
> #define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x2000000)
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2010-08-23 6:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 13:17 [U-Boot] [PATCH] [TESTING] da8xx: fixup ARM relocation support Ben Gardiner
2010-08-13 13:31 ` [U-Boot] [PATCH v2] " Ben Gardiner
2010-08-19 6:25 ` Sudhakar Rajashekhara
2010-08-19 13:02 ` Ben Gardiner
2010-08-23 11:53 ` Sudhakar Rajashekhara
2010-08-23 6:12 ` Heiko Schocher [this message]
2010-08-23 13:08 ` [U-Boot] [PATCH v3] " Ben Gardiner
2010-08-24 12:02 ` Sudhakar Rajashekhara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C721156.20207@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox