From: Jan Remmet <J.Remmet@phytec.de>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: am335x: memory configuration
Date: Thu, 6 Oct 2016 15:45:45 +0200 [thread overview]
Message-ID: <20161006134545.GA7434@lws-weitzel2@phytec.de> (raw)
In-Reply-To: <CAGm1_ku0Vh=SC0omVMUZof3DBJhvFRPsgxg1BDEn4GGTpez9_g@mail.gmail.com>
On Thu, Oct 06, 2016 at 11:08:07AM +0200, Yegor Yefremov wrote:
> I've submitted a patch [1] to support our Baltos systems back in the
> May. There was an issue with dynamically detecting RAM size as the
> systems can have either 256MB or 512MB modules.
>
> So far u-boot was able to detect the RAM size dynamically. In order to
> do so it uses following code in arch/arm/cpu/armv7/am33xx/emif4.c:
>
> int dram_init(void)
> {
>
> #ifndef CONFIG_SKIP_LOWLEVEL_INIT
> sdram_init();
> #endif
>
> /* dram_init must store complete ramsize in gd->ram_size */
> gd->ram_size = get_ram_size(
> (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;
> }
>
> This peace of code will be excuted in u-boot.img (not in MLO).
>
> In Barebox we have get_ram_size(), that provides real RAM size and
> am335x_sdram_size(), that returns RAM controller settings. So far DDR
> controler will be configured for 512MB regardless of the module. Hence
> the return value from am335x_sdram_size() cannot be used for crating
> ram0 node.
On our am335x boards we use MLOs with individual RAM timings and EMIF config
values. So am335x_sdram_size works fine in barebox.bin.
Maybe get_ram_size works if the timing settings are equal?
Jan
>
> What were the best way to provide get_ram_size() from lowlevel.c to
> board.c, where I would invoke:
> arm_add_mem_device("ram0", 0x80000000, sdram_size);
>
> [1] http://lists.infradead.org/pipermail/barebox/2016-May/027224.html
>
> Yegor
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-10-06 13:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 9:08 am335x: memory configuration Yegor Yefremov
2016-10-06 13:45 ` Jan Remmet [this message]
[not found] ` <57f65594.d4491c0a.37103.324dSMTPIN_ADDED_BROKEN@mx.google.com>
2016-10-06 13:50 ` Yegor Yefremov
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=20161006134545.GA7434@lws-weitzel2@phytec.de \
--to=j.remmet@phytec.de \
--cc=barebox@lists.infradead.org \
--cc=yegorslists@googlemail.com \
/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.