summaryrefslogtreecommitdiff
path: root/board/mpl/common/memtst.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-05-23 11:38:58 +0000
committerwdenk <wdenk>2003-05-23 11:38:58 +0000
commit33149b8812d12dc57f31fa7bf2ec0c1451dbf6f0 (patch)
tree4d06ca4a5b01325e24293577cc47bb9a55285985 /board/mpl/common/memtst.c
parent9919f13cc1d39c0fe4ff0162673afe657539d762 (diff)
downloadu-boot-imx-33149b8812d12dc57f31fa7bf2ec0c1451dbf6f0.zip
u-boot-imx-33149b8812d12dc57f31fa7bf2ec0c1451dbf6f0.tar.gz
u-boot-imx-33149b8812d12dc57f31fa7bf2ec0c1451dbf6f0.tar.bz2
Patch by Denis Peter, 19 Mai 2003:
add support for the MIP405-3 board
Diffstat (limited to 'board/mpl/common/memtst.c')
-rw-r--r--board/mpl/common/memtst.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/board/mpl/common/memtst.c b/board/mpl/common/memtst.c
index f0ace2a..122ba2e 100644
--- a/board/mpl/common/memtst.c
+++ b/board/mpl/common/memtst.c
@@ -457,7 +457,7 @@ typedef struct {
#define TEST_STAGES 5
-const RAM_MEMTEST_FUNC test_stage[TEST_STAGES] = {
+static RAM_MEMTEST_FUNC test_stage[TEST_STAGES] = {
{RAM_MemTest_WriteData1, "data test 1...\n", RAM_MemTest_CheckData1,
NULL},
{RAM_MemTest_WriteData2, "data test 2...\n", RAM_MemTest_CheckData2,
@@ -470,9 +470,35 @@ const RAM_MEMTEST_FUNC test_stage[TEST_STAGES] = {
RAM_MemTest_CheckRandomPattern, NULL}
};
+void mem_test_reloc(void)
+{
+ DECLARE_GLOBAL_DATA_PTR;
+ unsigned long addr;
+ int i;
+ for (i=0; i< TEST_STAGES; i++) {
+ addr = (ulong) (test_stage[i].test_write) + gd->reloc_off;
+ test_stage[i].test_write=
+ (void (*) (unsigned long startaddr, unsigned long size,
+ unsigned long *pat))addr;
+ addr = (ulong) (test_stage[i].test_write_desc) + gd->reloc_off;
+ test_stage[i].test_write_desc=(char *)addr;
+ if(test_stage[i].test_check1) {
+ addr = (ulong) (test_stage[i].test_check1) + gd->reloc_off;
+ test_stage[i].test_check1=
+ (void *(*) (int mode, unsigned long startaddr,
+ unsigned long size, unsigned long *pat))addr;
+ }
+ if(test_stage[i].test_check2) {
+ addr = (ulong) (test_stage[i].test_check2) + gd->reloc_off;
+ test_stage[i].test_check2=
+ (void *(*) (int mode, unsigned long startaddr,
+ unsigned long size, unsigned long *pat))addr;
+ }
+ }
+}
-int mem_test (unsigned long start, unsigned long ramsize, int quiet)
+int mem_test (unsigned long start, unsigned long ramsize, int quiet, int reloc)
{
unsigned long errors, stage;
unsigned long startaddr, size, i;