public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tanmay Upadhyay - Embedded <tanmay.upadhyay@einfochips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Kirkwood: bugfix: DRAM size initialization
Date: Fri, 22 Oct 2010 09:04:48 +0530 (IST)	[thread overview]
Message-ID: <218320114.217247.1287718488706.JavaMail.root@ahm.einfochips.com> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D19A6A465A0@SC-VEXCH4.marvell.com>

----- Original Message -----
From: Prafulla Wadaskar &lt;prafulla at marvell.com&gt;
To: Tanmay Upadhyay &lt;tanmay.upadhyay at einfochips.com&gt;
Cc: u-boot at lists.denx.de, g remlin &lt;g_remlin at rocketmail.com&gt;, Ashish Karkare &lt;akarkare at marvell.com&gt;, Prabhanjan Sarnaik &lt;sarnaik at marvell.com&gt;
Sent: Thu, 21 Oct 2010 10:27:28 +0530 (IST)
Subject: RE: [PATCH v2] Kirkwood: bugfix: DRAM size initialization
> -----Original Message-----
> From: Tanmay Upadhyay [mailto:tanmay.upadhyay at einfochips.com] 
> Sent: Friday, October 15, 2010 5:28 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Tanmay Upadhyay
> Subject: [PATCH v2] Kirkwood: bugfix: DRAM size initialization
> 
> If start of any DRAM bank is greater than total DDR size, remaining
> DDR banks' start address & size were left un-initialized in dram_init
> function. This could break other functions who uses array
> 'gd->bd->bi_dram'. Kirkwood network driver is one example. This also
> stops Linux kernel from booting.
> 
> v2 - Set start address also to 0. Without this Linux kernel couldn't
> boot up
> 
> Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
> ---
> arch/arm/cpu/arm926ejs/kirkwood/dram.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c 
> b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> index 7439c87..a4344b8 100644
> --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> @@ -81,6 +81,16 @@ int dram_init(void)
> gd->ram_size += gd->bd->bi_dram[i].size;
> 
> }
> +
> + for (; i < CONFIG_NR_DRAM_BANKS; i++) {
> + /* If above loop terminated prematurely, we need to set
> + * remaining banks' start address & size as 0. 
> Otherwise other
> + * u-boot functions and Linux kernel gets wrong 
> values which
> + * could result in crash */
> + gd->bd->bi_dram[i].start = 0;
> + gd->bd->bi_dram[i].size = 0;
> + }
> +
> return 0;
> }
Hi Tanmay
I hope you would not mind if I apply the below patch by Gray for similar fix
http://lists.denx.de/pipermail/u-boot/2010-October/079655.html
Regards..
Prafulla . .

Hi Prafulla,

Gray's patch takes care of ram size in u-boot. But still with his patch non-contiguous memory would be exposed -if it's there - to Linux kernel by start and size variables of bi_dram. My patch takes care of that by zeroing these variables. What's your opinion?

Thanks,
Tanmay 

  reply	other threads:[~2010-10-22  3:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 11:58 [U-Boot] [PATCH v2] Kirkwood: bugfix: DRAM size initialization Tanmay Upadhyay
2010-10-21  4:57 ` Prafulla Wadaskar
2010-10-22  3:34   ` Tanmay Upadhyay - Embedded [this message]
2010-10-28 10:23 ` Prafulla Wadaskar

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=218320114.217247.1287718488706.JavaMail.root@ahm.einfochips.com \
    --to=tanmay.upadhyay@einfochips.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