From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: cm4008, cm41xx: set gd->ram_size in dram_init
Date: Thu, 05 Jul 2012 16:48:22 +0200 [thread overview]
Message-ID: <4FF5A936.8010602@gmail.com> (raw)
In-Reply-To: <201207051448.09389.yann.vernier@orsoc.se>
On 05.07.2012 14:11, Yann Vernier wrote:
> Leave dram_init_banksize to set up the bank info data.
> ram_size was previously uninitialized. Also, generalize
> lowlevel assembly to support more RAM options.
>
> Signed-off-by: Yann Vernier <yann.vernier@orsoc.se>
> ---
> Changes for v2:
> - Update to use CONFIG_SYS_SDRAM_ constants
> - Update cm41xx also
> - Map SDRAM to match configuration
> ---
> arch/arm/cpu/arm920t/ks8695/lowlevel_init.S | 8 +++-----
> board/cm4008/cm4008.c | 5 +++--
> board/cm41xx/cm41xx.c | 5 +++--
> include/configs/cm4008.h | 5 ++---
> include/configs/cm41xx.h | 5 ++---
> 5 files changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> index e9f1227..df13de6 100644
> --- a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> +++ b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> @@ -131,11 +131,9 @@ highflash:
> * before relocating, we have to setup RAM timing
> */
> ldr r1, =(KS8695_IO_BASE+KS8695_SDRAM_CTRL0)
> -#if (PHYS_SDRAM_1_SIZE == 0x02000000)
> - ldr r2, =0x7fc0000e /* 32MB */
> -#else
> - ldr r2, =0x3fc0000e /* 16MB */
> -#endif
> + /* 8 column address bits, 4 banks, 32 bits data width */
> + ldr r2, =((CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_SDRAM_SIZE-0x10000)<<(22-16) | \
> + (CONFIG_SYS_SDRAM_BASE>>(16-12) | 0x00e))
ugh ... magic. Will it work for every possible setting?
How about one setting CONFIG_SYS_SDRAM_BASE != 0x0? I the base address
related to register content in any way?
Would be great to have a little documentation here why it is shifted
that way, unfortunately I can not find a KS8695 spec in the net. Don't
get me wrong it is ok to do so. I think it is way better than hard
coding the values like before but would be great to understand why it is
done that way.
Best regards
Andreas Bie?mann
next prev parent reply other threads:[~2012-07-05 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 13:08 [U-Boot] [PATCH 1/3] cm4008: set gd->ram_size in dram_init Yann Vernier
2012-07-05 10:02 ` Andreas Bießmann
2012-07-05 12:11 ` [U-Boot] [PATCH v2] arm: cm4008, cm41xx: " Yann Vernier
2012-07-05 14:48 ` Andreas Bießmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-07-06 8:15 Yann Vernier
2012-07-06 8:43 ` Andreas Bießmann
2012-07-06 9:14 ` Yann Vernier
2012-07-06 10:25 ` Andreas Bießmann
2012-07-09 21:58 ` Albert ARIBAUD
2012-07-10 12:19 ` Greg Ungerer
2012-07-12 9:32 ` Andreas Bießmann
2012-07-12 9:30 ` Andreas Bießmann
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=4FF5A936.8010602@gmail.com \
--to=andreas.devel@googlemail.com \
--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