public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] scb9328: Add ARM relocation support
Date: Thu, 09 Jun 2011 16:34:10 +0200	[thread overview]
Message-ID: <4DF0D9E2.6010809@denx.de> (raw)
In-Reply-To: <4DF0B05B.10708@synertronixx.de>

On 06/09/2011 01:36 PM, Torsten Koschorrek wrote:
> This patch fixed compiler errors due to missing definitions of
> CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR.
> 
> The board doesn't start, though. A v2 of this patch or a seperate patch
> will fix the error when it was found.
> 
> Signed-off-by: Torsten Koschorrek <koschorrek@synertronixx.de>
> ---
>  board/scb9328/config.mk   |    2 +-
>  board/scb9328/scb9328.c   |   10 +++++++++-
>  include/configs/scb9328.h |    3 +++
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/board/scb9328/config.mk b/board/scb9328/config.mk
> index 7c5e067..6e411de 100644
> --- a/board/scb9328/config.mk
> +++ b/board/scb9328/config.mk
> @@ -7,4 +7,4 @@
>  # the code in RAM device only.
>  #
>  -CONFIG_SYS_TEXT_BASE = 0x08f00000
> +CONFIG_SYS_TEXT_BASE = 0x10000000

Try to get rid of config.mk, too. It is obsolete, and you can move
CONFIG_SYS_TEXT_BASE inside scb9328.h.

> diff --git a/board/scb9328/scb9328.c b/board/scb9328/scb9328.c
> index 428e8c9..631f4e3 100644
> --- a/board/scb9328/scb9328.c
> +++ b/board/scb9328/scb9328.c
> @@ -39,6 +39,15 @@ int board_init (void)
>   int dram_init (void)
>  {
> +    /* dram_init must store complete ramsize in gd->ram_size */
> +    gd->ram_size = get_ram_size((volatile void *)SCB9328_SDRAM_1,
> +                    SCB9328_SDRAM_1_SIZE);
> +
> +    return 0;

Not understood. If you have more as one bank, the size is the sum of all
banks. In dram_init_banksize() you setup more as one bank if
CONFIG_NR_DRAM_BANKS > 1. Then you should set in dram_init:

size1 = get_ram_size((volatile void *)SCB9328_SDRAM_1,
	SCB9328_SDRAM_1_SIZE);
#if ( CONFIG_NR_DRAM_BANKS > 1 )
size2 = get_ram_size((volatile void *)SCB9328_SDRAM_2,
	SCB9328_SDRAM_2_SIZE);
.....

and then:
	gd->ram_size = size1 + size2 + size3 + size4;

>   /**
> diff --git a/include/configs/scb9328.h b/include/configs/scb9328.h
> index 3da214e..c610ed1 100644
> --- a/include/configs/scb9328.h
> +++ b/include/configs/scb9328.h
> @@ -127,6 +127,9 @@
>  #define SCB9328_SDRAM_1        0x08000000    /* SDRAM bank #1       */
>  #define SCB9328_SDRAM_1_SIZE    0x01000000    /* 16 MB           */
>  +#define CONFIG_SYS_SDRAM_BASE    SCB9328_SDRAM_1
> +#define CONFIG_SYS_INIT_SP_ADDR    SCB9328_SDRAM_1 + 0xf00000

In most boards/processors the stack pointer is set to the internal RAM,
that is available before the SDRAM controller is activated. When not
available, cache can be used. Is there no internal memory available for
this processor ? It could be that the stack is used before the SDRAM is
initialized, and then it hangs.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2011-06-09 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 11:36 [U-Boot] [PATCH] scb9328: Add ARM relocation support Torsten Koschorrek
2011-06-09 14:34 ` Stefano Babic [this message]
     [not found]   ` <4DF1AF2B.6030602@synertronixx.de>
2011-06-10  7:24     ` Stefano Babic
2011-06-10 17:55       ` Torsten Koschorrek
2011-07-04  9:34         ` Torsten Koschorrek
2011-07-04  9:43           ` Stefano Babic

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=4DF0D9E2.6010809@denx.de \
    --to=sbabic@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