summaryrefslogtreecommitdiffstats
path: root/common/memtest.c
Commit message (Collapse)AuthorAgeFilesLines
* common/memtest.c: Distil common error reporting codeAndrey Smirnov2015-05-151-25/+28
| | | | | | | | | Move all of the common code for error message output into a new function mem_test_report_failure() and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/memtest.c: Refactor mem_test() into three surbroutinesAndrey Smirnov2015-05-151-37/+68
| | | | | | | | | | Original mem_test() was rather long an contained code to perform two distinct operations. This patch moves that code into two separate subroutines and converts mem_test into a high level interface that calls the subroutines. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/memtest.c: Do not omit offset of 0 from testsAndrey Smirnov2015-05-151-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Ommiting offset 0 from address line tests allows certain corner cases of faults to be undetected. For the "stuck high" case, consider scenario in which all of the tested address lines are stuck high. In original code first data filling loop would execute writing data to a single cell multiple times and second loop would just read data from that cell over and over again. Adding a write to start[0] should prevent this since it would cause the second loop to read incorrect data on its first iteration. For the "stuck low" case, having any of the tested bits of the address shorted would effectively "remap" that memory cell to start[0] in this case excluding start[0] during the verification phase would result in a false positive result. Note that both of the changes are present in Michael Barr's code here: http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/software-based-memory-testing.html and the code in barebox is based on that code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/memtest.c: Fix incorrect array boundary checkAndrey Smirnov2015-05-151-2/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: copyright to UPPER case and fix typoAlexander Aring2014-04-231-2/+2
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: add memtest.c with mem_test routineAlexander Aring2013-06-051-0/+313
Add mem_test routine. Useful to detect timing problems if someone porting a new device to barebox. This test includes a data bus test, address bus test and integrity check of memory. This mem_test routine has as parameter start and end address of testing space. The last parameter can skip the integrity check. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>