[PATCH 6/6] commands: add new memtest command
Sascha Hauer
s.hauer at pengutronix.de
Thu Feb 7 07:01:41 EST 2013
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 at 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 at pengutronix.de>, Pengutronix
> > > + *
> > > + * (C) Copyright 2000
> > > + * Wolfgang Denk, DENX Software Engineering, wd at 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 *.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list