mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
Added watchdog triggering calls in the "mtest" test function.
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
This commit is contained in:
parent
d32a874b9b
commit
a6e6fc610e
1 changed files with 7 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
#ifdef CONFIG_HAS_DATAFLASH
|
#ifdef CONFIG_HAS_DATAFLASH
|
||||||
#include <dataflash.h>
|
#include <dataflash.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <watchdog.h>
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_MEMORY) \
|
#if defined(CONFIG_CMD_MEMORY) \
|
||||||
|| defined(CONFIG_CMD_I2C) \
|
|| defined(CONFIG_CMD_I2C) \
|
||||||
|
@ -868,6 +869,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
start[test_offset] = pattern;
|
start[test_offset] = pattern;
|
||||||
|
WATCHDOG_RESET();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for addr bits stuck low or shorted.
|
* Check for addr bits stuck low or shorted.
|
||||||
|
@ -905,6 +907,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
* Fill memory with a known pattern.
|
* Fill memory with a known pattern.
|
||||||
*/
|
*/
|
||||||
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
start[offset] = pattern;
|
start[offset] = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -912,6 +915,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
* Check each location and invert it for the second pass.
|
* Check each location and invert it for the second pass.
|
||||||
*/
|
*/
|
||||||
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
temp = start[offset];
|
temp = start[offset];
|
||||||
if (temp != pattern) {
|
if (temp != pattern) {
|
||||||
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
|
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
|
||||||
|
@ -928,6 +932,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
* Check each location for the inverted pattern and zero it.
|
* Check each location for the inverted pattern and zero it.
|
||||||
*/
|
*/
|
||||||
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
anti_pattern = ~pattern;
|
anti_pattern = ~pattern;
|
||||||
temp = start[offset];
|
temp = start[offset];
|
||||||
if (temp != anti_pattern) {
|
if (temp != anti_pattern) {
|
||||||
|
@ -954,6 +959,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
pattern, "");
|
pattern, "");
|
||||||
|
|
||||||
for (addr=start,val=pattern; addr<end; addr++) {
|
for (addr=start,val=pattern; addr<end; addr++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
*addr = val;
|
*addr = val;
|
||||||
val += incr;
|
val += incr;
|
||||||
}
|
}
|
||||||
|
@ -961,6 +967,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
puts ("Reading...");
|
puts ("Reading...");
|
||||||
|
|
||||||
for (addr=start,val=pattern; addr<end; addr++) {
|
for (addr=start,val=pattern; addr<end; addr++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
readback = *addr;
|
readback = *addr;
|
||||||
if (readback != val) {
|
if (readback != val) {
|
||||||
printf ("\nMem error @ 0x%08X: "
|
printf ("\nMem error @ 0x%08X: "
|
||||||
|
|
Loading…
Add table
Reference in a new issue