summaryrefslogtreecommitdiffstats
path: root/commands/memtest.c
Commit message (Collapse)AuthorAgeFilesLines
* common: memtest: prepare for reuse in self testAhmad Fatoum2023-05-231-2/+3
| | | | | | | | | | memtest is quite talkative: it narrates status and advances a progress bar. For non-interactive use, e.g. for selftest, this is a bit much, so hide that behidnd a new MEMTEST_VERBOSE flag. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230522052835.1039143-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-20/+4
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: Make use of resource_size()Andrey Smirnov2018-09-191-2/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: Adjust code for 64-bit architecturesAndrey Smirnov2018-09-191-3/+2
| | | | | | | | | Make use of %pa specifier to avoid warnings when building against 64-bit CPU (specifically AArch64) as well as adjust a number of patterns to be 64-bits wide. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: fix missing arguments in help stringAlexander Aring2016-01-041-1/+1
| | | | | | | This patch adds some missing arguments in help string of memtest. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-11-061-1/+4
|\
| * memtest.c: Print iterations count if -i is 0Andrey Smirnov2015-10-151-1/+5
| | | | | | | | | | | | | | | | Even if memtest is started in endless mode it is still useful to see current iteration count. Add the code to print that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: Make cached/uncached test configurableSascha Hauer2015-11-041-5/+21
| | | | | | | | | | | | | | | | Add options to explicitly test cached/uncached tests. Without these options still both cached and uncached is tested if remapping is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: By default only test biggest regionSascha Hauer2015-11-041-27/+55
| | | | | | | | | | | | | | | | | | Often enough the biggest free region spans most free RAM, so it doesn't add much value to test the remaining free regions. This patch changes the default behaviour to only test the biggest free region and adds the -t option to test all regions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: split tests in separate functionsSascha Hauer2015-11-031-1/+8
| | | | | | | | | | | | | | | | The memtest does a bus integrity check and a moving inversions test. Split the tests into two separate functions so that the can be called separately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | rework remap_rangeSascha Hauer2015-11-031-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: move request/release regions to common/Sascha Hauer2015-10-271-105/+2
|/ | | | | | | | Normally code providing a feature should be implemented in common/ which is then called from the command code. Follow this rule and move some more of the memtest code to common/. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: skip memory region smaller than one pageRenaud Barbier2015-06-161-4/+8
| | | | | | | | | If the size between memory regions is smaller than one page, the size is rounded down to 0. This results in a region request failure. This commit skips the memory region whose size is smaller than a page. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: fix 4GB overflow failDmitry Lavnikevich2015-01-271-1/+1
| | | | | | | | | | | 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>
* memtest: Fix SDRAM size calculationsSascha Hauer2015-01-261-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-111-4/+0
| | | | | | | | | | | | | | | | | | 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>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | 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>
* memtest: cleanup requests of regionsAlexander Aring2014-04-231-38/+28
| | | | | | | | 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: cleanup error handlingAlexander Aring2014-04-231-4/+4
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: exclude page starting at address 0.Renaud Barbier2014-03-031-5/+5
| | | | | | | | | | | 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>
* commands: Fix memtest return valueChristian Hemp2013-09-021-1/+1
| | | | | Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: add new memtest commandAlexander Aring2013-06-081-0/+253
| | | | | | | | | | | | | | | | 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>
* memtest: remove memtest commandAlexander Aring2013-06-051-351/+0
| | | | | | | Remove memtest command. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | 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>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-1/+0
| | | | | | | 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>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-191-4/+2
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* mtest: remove braindamaged NULL pointer derefSascha Hauer2009-01-131-1/+1
| | | | | | | | | | 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>
* Subject: [PATCH] [general] Fixed constant strings in data section issueSascha Hauer2008-04-041-1/+2
| | | | | | | | 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>
* Avoid memtest at scratch addressEnrik Berkhan2008-01-231-1/+4
| | | | | | When the tested address equals the scratch location, memtest will fail. Signed-Off-By: Enrik Berkhan <Enrik.Berkhan@ge.com>
* various small typos fixedJuergen Beisert2007-10-161-0/+2
|
* declare lots of functions staticSascha Hauer2007-09-281-2/+2
|
* reactivate mtestSascha Hauer2007-09-271-57/+57
|
* remove u-boot command paramter flagSascha Hauer2007-09-241-1/+1
|
* svn_rev_647Sascha Hauer2007-07-051-6/+10
|
* svn_rev_643Sascha Hauer2007-07-051-0/+348
structure cleanup