All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] post, arm, memorytest: add support for arm based boards
Date: Wed, 01 Jun 2011 08:54:30 +0200	[thread overview]
Message-ID: <4DE5E226.3090008@denx.de> (raw)
In-Reply-To: <20110601063728.9F731CF5CA6@gemini.denx.de>

Hello Wolfgang,

Wolfgang Denk wrote:
> Dear Heiko Schocher,
> 
> In message <1306909447-19603-2-git-send-email-hs@denx.de> you wrote:
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> ---
>>  post/drivers/memory.c |   20 ++++++++++++++++++++
>>  1 files changed, 20 insertions(+), 0 deletions(-)
>>
>> diff --git a/post/drivers/memory.c b/post/drivers/memory.c
>> index b7943ef..47b312d 100644
>> --- a/post/drivers/memory.c
>> +++ b/post/drivers/memory.c
>> @@ -455,10 +455,30 @@ static int memory_post_tests (unsigned long start, unsigned long size)
>>  __attribute__((weak))
>>  int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
>>  {
>> +#if defined(CONFIG_ARM)
> 
> This is a weak function, so there should be no need to have #ifdef's
> in there.
>
> Just define your own code as you need it.

Yes (I did this for my case, as I use it in nand_spl code,
and therefore I need a "own" function, because there I have no
bd ) ... but, for arm there is no bd->bi_memsize! ... so this
file fails compiling. Independent, if it gets replaced by
another function.

>> +	bd_t *bd = gd->bd;
>> +	int i;
>> +
>> +	*size = 0;
>> +	for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
>> +		if (i == 0) {
>> +			*vstart = bd->bi_dram[0].start;
>> +			*size += bd->bi_dram[i].size;
> 
> This is a constant part and should be moved out of the loop.  Then
> you can also get rid of th if...else clause.

Yep, you are right! Change this.

>> +		} else {
>> +			if (bd->bi_dram[i].start ==
>> +			(bd->bi_dram[i - 1].start + bd->bi_dram[i - 1].size)) {
>> +				*size += bd->bi_dram[i].size;
>> +			} else {
>> +				break;
> 
> So how do you handle non-contiguous memory banks?  It appears these
> are quite frequent on ARM these days.

Actually, I could not handle this. Ok, I add a comment, that this
function is actually only valid for contiguous mem banks.

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2011-06-01  6:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  6:24 [U-Boot] [PATCH] post, memorytest: fix if vstart is not = 0x0 Heiko Schocher
2011-06-01  6:24 ` [U-Boot] [PATCH] post, arm, memorytest: add support for arm based boards Heiko Schocher
2011-06-01  6:37   ` Wolfgang Denk
2011-06-01  6:54     ` Heiko Schocher [this message]
2011-06-01 13:51       ` Mike Frysinger
2011-06-02  5:53         ` Heiko Schocher
2011-06-02 12:40           ` Wolfgang Denk
2011-06-02 15:08           ` Mike Frysinger
2011-06-03  5:39             ` Heiko Schocher
2011-06-03  6:30               ` Wolfgang Denk
2011-06-01  6:24 ` [U-Boot] [PATCH] post, memory test: add memory_post_test() to include file Heiko Schocher
2011-07-25 21:43   ` Wolfgang Denk
2011-07-26  8:26     ` Wolfgang Denk
2011-07-26 11:57       ` Wolfgang Denk
2011-07-26 16:41         ` Heiko Schocher
2011-07-27  6:31   ` [U-Boot] [PATCH v2] " Heiko Schocher
2011-07-28 20:39     ` Wolfgang Denk
2011-07-27 21:37 ` [U-Boot] [PATCH] post, memorytest: fix if vstart is not = 0x0 Wolfgang Denk

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=4DE5E226.3090008@denx.de \
    --to=hs@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 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.