public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mtest: Fix end address of increment/decrement test
Date: Thu, 20 May 2010 22:32:51 +0200	[thread overview]
Message-ID: <20100520203251.D1BA6CCF026@gemini.denx.de> (raw)
In-Reply-To: <1274386292.18152.119.camel@petert>

Dear Peter Tyser,

In message <1274386292.18152.119.camel@petert> you wrote:
> 
> The current output leaves a lot of interpretation up to the user.

Agreed. This is one of the typical commands that where never well
designed or even intnded for normal users, but serrved a purpose, and
found useful, so it stuck.  No surprise it has sharp edges ;-)

> It depends on interpretation.  eg:
> => mtest 0x1000 0x1ffd 1 1       
> Testing 00001000 ... 00001ffd:

To be honest - I wasn't even aware we support such a notation ;-)

> This is *really* testing bytes 0x1000-0x1fff.  It's impossible for Joe
> User to figure that out though...

...not without reading the source code, indeed. But then, this is
always a good excercise :-)

> As far as the output, my vote would be to align the end address to a
> 32-bit address and add 3.  eg assuming a starting address of 1000 and
> ending addresses of:
> 0x1ffc - output: Testing 00001000 ... 00001fff
> 0x1ffd - output: Testing 00001000 ... 00001fff
> 0x1ffe - output: Testing 00001000 ... 00001fff
> 0x1fff - output: Testing 00001000 ... 00001fff
> 0x2000 - output: Testing 00001000 ... 00002003
> 0x2001 - output: Testing 00001000 ... 00002003

No, please do not implement such automatic alignment; it may be useful
for some cases, but it may as well hurt, for example if you
intentionally want to run mtest with misalignment, like giving both
odd start and end addresses.

> Another possibility would be to replace the "end address" argument with
> a "size" argument.  So "mtest 0x1000 0x1000" would test 0x1000 bytes at
> address 0x1000, from 0x1000-0x1fff.  I think that would be clearer to
> most people, but the downside is you'd have to do some math to calculate
> the size parameter in some cases (eg testing the region after exception
> vectors, but before the U-Boot image in RAM).

I think it is more difficult to calculate the sizes instead of the end
addresses.

> Let me know what you think about how to display the tested memory
> region.  I'm fine with leaving the "end addr" vs "size" debate for the
> next release, if at all.

I always appreciate is someone is thorough and willing enough to clean
up such old mess.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                           -- H. L. Mencken

  reply	other threads:[~2010-05-20 20:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 17:08 [U-Boot] [PATCH] mtest: Fix end address of increment/decrement test Peter Tyser
2010-05-20 18:43 ` Wolfgang Denk
2010-05-20 19:07   ` Peter Tyser
2010-05-20 19:44     ` Wolfgang Denk
2010-05-20 20:11       ` Peter Tyser
2010-05-20 20:32         ` Wolfgang Denk [this message]
2010-05-20 22:00           ` Peter Tyser
2010-05-20 22:07             ` 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=20100520203251.D1BA6CCF026@gemini.denx.de \
    --to=wd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox