From: Marcel <korgull@home.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] {Spam?} u-boot relocation
Date: Sun, 26 Dec 2010 20:05:12 +0100 [thread overview]
Message-ID: <201012262005.12722.korgull@home.nl> (raw)
In-Reply-To: <4D17453C.9050706@emk-elektronik.de>
On Sunday, December 26, 2010 02:38:04 pm Reinhard Meyer wrote:
> Dear Marcel,
>
> > Hi,
> >
> > I updated my u-boot-usb to continue my work on the SAM9 USB parts, but
> > got stuck with the following issue :
> >
> > There seems to be a new relocation scheme. I also added some stuff to
> > make it detect the SDRAM, but than I get stuck.
> >
> > int dram_init(void)
> >
> > {
> >
> > gd->bd->bi_dram[0].start = PHYS_SDRAM;
> > gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
>
> This is accessing bss before relocation. BSS does not exist then.
At what point bss does exist ?
Forgive me for not having a clue on this. I started working on u-boot to make
USB working a while ago. I almost had that working but unfortunately had to go
away for a while for business. Now that I can continue I usually first update
to keep up with the latest things, but this is not always easy if things break
completely.
> > /* dram_init must store complete ramsize in gd->ram_size */
> > gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM,
> >
> > PHYS_SDRAM_SIZE);
> >
> > dram_init_banksize();
>
> This function, if defined, is called automagically. Normally, with single
> DRAM bank AT91SAM9 designs the default weak function provided by u-boot is
> sufficient:
> void __dram_init_banksize(void)
> {
> gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
> gd->bd->bi_dram[0].size = gd->ram_size;
> }
> void dram_init_banksize(void)
> __attribute__((weak, alias("__dram_init_banksize")));
>
> Don't define this function in your board file!!!
I got rid of the call in my board file.
> > return 0;
> >
> > }
>
> Please have a look at the emk/top9000 board for what is needed:
>
> int dram_init(void)
> {
> gd->ram_size = get_ram_size(
> (void *)CONFIG_SYS_SDRAM_BASE,
> CONFIG_SYS_SDRAM_SIZE);
> return 0;
> }
>
> /* NO dram_init_banksize() !!! */
>
> Note also that the defines have changed to have a CONFIG_SYS_ prefix.
> Change your board definition accordingly.
>
> Best Regards,
> Reinhard
I currently only have this :
int dram_init(void)
{
gd->ram_size = get_ram_size(
(void *)CONFIG_SYS_SDRAM_BASE,
CONFIG_SYS_SDRAM_SIZE);
return 0;
}
I defined CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_SDRAM_SIZE but I gave them the
same address and size as my previous PHYS_SDRAM and PHYS_SDRAM_SIZE.
It doesn't change anything so far, so I must have missed some things I guess.
I'll continue reading and hope I find something. I do however feel like I'm
wasting my time on this one.
Thanks for your reply,
Marcel
next prev parent reply other threads:[~2010-12-26 19:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-26 12:28 [U-Boot] {Spam?} u-boot relocation Marcel
2010-12-26 13:38 ` Reinhard Meyer
2010-12-26 19:05 ` Marcel [this message]
2010-12-26 20:10 ` Reinhard Meyer
2010-12-26 21:09 ` Marcel
2010-12-27 10:02 ` Albert ARIBAUD
2010-12-28 16:48 ` Simon Glass
2010-12-30 19:38 ` Marcel
2010-12-30 22:34 ` Marcel
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=201012262005.12722.korgull@home.nl \
--to=korgull@home.nl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.