Add condition for checking size_t overflow. This fixes memtest fail
> Memtest failed. Error: -22
which appears when 4GB RAM is present.
Was tested on phyFLEX-i.MX6 modules with 4GB and 1GB RAM.
Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Calculating the size and end of the test region as
end = PAGE_ALIGN_DOWN(bank->res->end) - 1;
size = end - start + 1;
is wrong. For an example resource of
start = 0x80000000, end = 0x8fffffff
end results in:
end = PAGE_ALIGN_DOWN(0x8fffffff) - 1 = 0x8fffefff
instead of 0x8fffffff. The size is then calculated to
size = end - start + 1 = 0x8fffefff - 0x80000000 + 1 = 0x0ffff000
instead of 0x10000000
The correct way to do this is to calculate the real size and apply a
PAGE_ALIGN_DOWN afterwards:
size = PAGE_ALIGN_DOWN(bank->res->end - start + 1) = 0x10000000
Fix this in three different places.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed; The FSF site says that
address is
Free Software Foundation
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301
USA
(see http://www.fsf.org/about/contact/)
Instead of updating it each time the address changes,
just drop it completely treewide.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch removes the first and last entry check inside the loop.
There should be no functional changes there.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
memtest fails when a reserved sdram region is at the bank start at
address 0. This patch supports the exclusion of memory region at
the bank start.
Tested on P2020RDB and DA923RC, qemuarm versatilepb.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This new memtest can test the whole unused memory. The new memtest
command try to request the whole unused sdram regions on all banks and
run the mem_test routine from common/memtest.c on it.
The memtest command has only two parameters;
-i Amount of iterations, default 1, iteration of 0 is endless.
-b Set this to skip integrity check.(Do only a fast test for bus lines)
If MMU support is enable, memtest try to run memtest twice. The first with
cache enabled, the second with cache disabled.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The alternative memory test implementation needs a scratch
memory location to remove the last data from the data bus.
Instead of using a NULL pointer for this, default to the
memory start address.
No sane program should consider a NULL pointer as a safe default.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
For practical reasons I changed all string literals assumed to be constant
to reside in .rodata subsection at end of .text section.
Signed-off-by: Carsten Schlote <schlote@vahanus.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>