From: Alexander Aring <alex.aring@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 6/6] commands: add new memtest command
Date: Thu, 7 Feb 2013 16:42:43 +0100 [thread overview]
Message-ID: <20130207154242.GB2572@x61s.8.8.8.8> (raw)
In-Reply-To: <20130207120141.GU1906@pengutronix.de>
Hi,
On Thu, Feb 07, 2013 at 01:01:41PM +0100, Sascha Hauer wrote:
> On Thu, Feb 07, 2013 at 12:20:06PM +0100, Alexander Aring wrote:
> > On Thu, Feb 07, 2013 at 11:56:07AM +0100, Marc Kleine-Budde wrote:
> > > On 02/07/2013 11:45 AM, Alexander Aring wrote:
> > > > Add new memtest command which can enable or disable caching
> > > > on non allocted barebox regions(test area).
> > > >
> > > > This command simply parse and check parameters then call
> > > > the mem_test routine.
> > > >
> > > > If no address parameters are given then mem_test will call
> > > > for each memory bank.
> > > >
> > > > Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> > >
> > > A howto-get-rid-of-ifdef nitpick inline
> > >
> > > > ---
> > > > commands/Kconfig | 10 ++
> > > > commands/Makefile | 1 +
> > > > commands/memtest.c | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > 3 files changed, 373 insertions(+)
> > > > create mode 100644 commands/memtest.c
> > > >
> > > > diff --git a/commands/Kconfig b/commands/Kconfig
> > > > index 7cc759c..d158c3f 100644
> > > > --- a/commands/Kconfig
> > > > +++ b/commands/Kconfig
> > > > @@ -516,6 +516,16 @@ config CMD_NANDTEST
> > > > select PARTITION_NEED_MTD
> > > > prompt "nandtest"
> > > >
> > > > +config CMD_MEMTEST
> > > > + tristate
> > > > + select MEMTEST
> > > > + prompt "memtest"
> > > > + help
> > > > + This command enables a memtest to test installed memory.
> > > > + During this test allocated iomem regions will be skipped.
> > > > + If tested architecture has MMU with PTE flags support,
> > > > + caching can be set enabled or disabled.
> > > > +
> > > > endmenu
> > > >
> > > > menu "video command"
> > > > diff --git a/commands/Makefile b/commands/Makefile
> > > > index 393ba51..b39b489 100644
> > > > --- a/commands/Makefile
> > > > +++ b/commands/Makefile
> > > > @@ -7,6 +7,7 @@ obj-$(CONFIG_CMD_LOADY) += loadxy.o
> > > > obj-$(CONFIG_CMD_LOADS) += loads.o
> > > > obj-$(CONFIG_CMD_ECHO) += echo.o
> > > > obj-$(CONFIG_CMD_MEMORY) += mem.o
> > > > +obj-$(CONFIG_CMD_MEMTEST) += memtest.o
> > > > obj-$(CONFIG_CMD_EDIT) += edit.o
> > > > obj-$(CONFIG_CMD_EXEC) += exec.o
> > > > obj-$(CONFIG_CMD_SLEEP) += sleep.o
> > > > diff --git a/commands/memtest.c b/commands/memtest.c
> > > > new file mode 100644
> > > > index 0000000..22e8006
> > > > --- /dev/null
> > > > +++ b/commands/memtest.c
> > > > @@ -0,0 +1,362 @@
> > > > +/*
> > > > + * memtest - Perform a memory test
> > > > + *
> > > > + * (C) Copyright 2013
> > > > + * Alexander Aring <aar@pengutronix.de>, Pengutronix
> > > > + *
> > > > + * (C) Copyright 2000
> > > > + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
> > > > + *
> > > > + * See file CREDITS for list of people who contributed to this
> > > > + * project.
> > > > + *
> > > > + * This program is free software; you can redistribute it and/or
> > > > + * modify it under the terms of the GNU General Public License as
> > > > + * published by the Free Software Foundation; either version 2 of
> > > > + * the License, or (at your option) any later version.
> > > > + *
> > > > + * This program is distributed in the hope that it will be useful,
> > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > > > + * GNU General Public License for more details.
> > > > + *
> > > > + * You should have received a copy of the GNU General Public License
> > > > + * along with this program; if not, write to the Free Software
> > > > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> > > > + * MA 02111-1307 USA
> > > > + */
> > > > +
> > > > +#include <command.h>
> > > > +#include <getopt.h>
> > > > +#include <asm/mmu.h>
> > > > +
> > > > +#include <memory_test.h>
> > > > +
> > > > +/*
> > > > + * In CONFIG_MMU we have a special c flag.
> > > > + */
> > > > +#ifdef CONFIG_MMU
> > > > +static char optstr[] = "s:e:i:cb";
> > >
> > > const?
> > >
> >
> > This will print a compiler warning because the getopt implementation
> > doesn't accept a const char* because getopt will change this string.
>
> getopt does not modify this string. The prototype of getopt could be changed to
> take a const char *.
>
Ok I will fix this.
Regards
Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-02-07 15:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 10:44 [PATCH v3 0/6] " Alexander Aring
2013-02-07 10:44 ` [PATCH 1/6] common: fix codestyle in ALIGN macros Alexander Aring
2013-02-07 10:44 ` [PATCH 2/6] common: add ALIGN_DOWN macro Alexander Aring
2013-02-07 10:44 ` [PATCH 3/6] memory: add function address_in_sdram_regions Alexander Aring
2013-02-07 10:44 ` [PATCH 4/6] memtest: remove memtest command Alexander Aring
2013-02-07 10:44 ` [PATCH 5/6] common: add mem_test routine Alexander Aring
2013-02-07 10:52 ` Marc Kleine-Budde
2013-02-07 11:16 ` Alexander Aring
2013-02-07 11:00 ` Sascha Hauer
2013-02-07 11:40 ` Alexander Aring
2013-02-07 11:54 ` Sascha Hauer
2013-02-07 15:41 ` Alexander Aring
2013-02-07 10:45 ` [PATCH 6/6] commands: add new memtest command Alexander Aring
2013-02-07 10:56 ` Marc Kleine-Budde
2013-02-07 11:20 ` Alexander Aring
2013-02-07 12:01 ` Sascha Hauer
2013-02-07 15:42 ` Alexander Aring [this message]
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=20130207154242.GB2572@x61s.8.8.8.8 \
--to=alex.aring@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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