OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [arm/] [xscale/] [iq80310/] [v2_0/] [src/] [diag/] [memtest.c] - Blame information for rev 565

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//=============================================================================
2
//
3
//      memtest.c - Cyclone Diagnostics
4
//
5
//=============================================================================
6
//####ECOSGPLCOPYRIGHTBEGIN####
7
// -------------------------------------------
8
// This file is part of eCos, the Embedded Configurable Operating System.
9
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
10
//
11
// eCos is free software; you can redistribute it and/or modify it under
12
// the terms of the GNU General Public License as published by the Free
13
// Software Foundation; either version 2 or (at your option) any later version.
14
//
15
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
16
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18
// for more details.
19
//
20
// You should have received a copy of the GNU General Public License along
21
// with eCos; if not, write to the Free Software Foundation, Inc.,
22
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23
//
24
// As a special exception, if other files instantiate templates or use macros
25
// or inline functions from this file, or you compile this file and link it
26
// with other works to produce a work based on this file, this file does not
27
// by itself cause the resulting work to be covered by the GNU General Public
28
// License. However the source code for this file must still be made available
29
// in accordance with section (3) of the GNU General Public License.
30
//
31
// This exception does not invalidate any other reasons why a work based on
32
// this file might be covered by the GNU General Public License.
33
//
34
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
35
// at http://sources.redhat.com/ecos/ecos-license/
36
// -------------------------------------------
37
//####ECOSGPLCOPYRIGHTEND####
38
//=============================================================================
39
//#####DESCRIPTIONBEGIN####
40
//
41
// Author(s):   Scott Coulter, Jeff Frazier, Eric Breeden
42
// Contributors:
43
// Date:        2001-01-25
44
// Purpose:     
45
// Description: 
46
//
47
//####DESCRIPTIONEND####
48
//
49
//===========================================================================*/
50
 
51
/*************************************************************************
52
* Memtest.c - this file performs an address/address bar memory test.
53
*
54
*  Modification History
55
*  --------------------
56
*  01sep00 ejb Ported to StrongARM2
57
*  18dec00 snc
58
*  02feb01 jwf for snc
59
*/
60
 
61
#include <cyg/infra/diag.h>
62
#define printf diag_printf
63
 
64
#include "7_segment_displays.h"
65
 
66
#if 0
67
extern void store_double (unsigned long, unsigned long, unsigned long);
68
extern void read_double (unsigned long, unsigned long Data[]);
69
extern int quadtest(long startaddr);
70
#endif
71
 
72
extern void hex32out (unsigned int num);
73
#if 0
74
extern int printf(char*,...);
75
#endif
76
 
77
/* 02/02/01 jwf */
78
#ifndef TRUE
79
#define TRUE    1
80
#endif
81
#ifndef FALSE
82
#define FALSE   0
83
#endif
84
 
85
 
86
 
87
#define FAILED          1
88
#define PASSED          0
89
 
90
 
91
 
92
/* Do walking one's test */
93
static int
94
onesTest(
95
         long testAddr                  /* address to test */
96
         )
97
{
98
        long testData = 1; /* Current pattern being used */
99
        long dataRead;
100
        int     fail = 0;           /* Test hasn't failed yet */
101
        int     loopCount = 0; /* To keep track of when to print CR */
102
 
103
        printf("\n");
104
 
105
        while(testData && !fail)
106
        {       /* Loop until bit shifted out */
107
                *((long *) testAddr) = testData;         /* Write test data */
108
                *((long *) (testAddr + 4)) = 0xFFFFFFFF; /* Drive d0-d31 hi */
109
                dataRead = *((long *) testAddr);         /* Read back data */
110
 
111
                hex32out(dataRead);
112
                if (!(++loopCount % 8) && (loopCount != 32))
113
                        printf("\n");
114
                else
115
                        printf(" ");
116
 
117
                if (dataRead != testData) /* Verify data */
118
                        return FAILED;    /* Signal failure */
119
                else
120
                        testData <<= 1;   /* Shift data over one bit */
121
        }
122
 
123
        return PASSED;
124
}
125
 
126
 
127
 
128
 
129
#if 0
130
/*************************************************************************
131
*
132
* onesTest - perform a 64 bit walking one's test on a specified address
133
*
134
*
135
* RETURNS: PASSED if the test passes or FAILED otherwise
136
*
137
*/
138
static int onesTest(long testAddr)
139
{
140
        /* need to be arrays of sequential words in order to be
141
           able to test a 64bit wide memory bus */
142
        unsigned long testData[2];      /* Current pattern being used */
143
        unsigned long dataRead[2];      /* Data read back from memory */
144
        int     bitsTested = 0;          /* To keep track of when to print CR and
145
                                                           when to switch words */
146
 
147
        printf("\n");
148
 
149
        /* test variable initialization */
150
        testData[0] = 0x00000001;        /* lower 32 bit word */
151
        testData[1] = 0x00000000;       /* upper 32 bit word */
152
 
153
        bitsTested = 0;
154
 
155
 
156
        /* Loop until all 64 data bits are tested */
157
        while (bitsTested < 64)
158
        {
159
                /* perform a double word write to cause a 64bit memory access */
160
                store_double (testAddr, testData[0], testData[1]);
161
 
162
                /* drive 64 bit data bus high and flush bus unit */
163
                store_double (testAddr + 8, 0xffffffff, 0xffffffff);
164
 
165
                /* perform a double word read to cause a 64bit memory access */
166
                read_double (testAddr, dataRead);
167
 
168
                hex32out((long)dataRead[1]);    /* print out MS word */
169
                hex32out((long)dataRead[0]);     /* print out LS word */
170
 
171
                if (!(++bitsTested % 4) && (bitsTested != 64))
172
                        printf("\n");
173
                else
174
                        printf(" ");
175
 
176
                /* verify the data */
177
                if ((dataRead[0] != testData[0]) || (dataRead[1] != testData[1]))
178
                        return (FAILED);                        /* Signal failure */
179
                else
180
                {
181
                        if (bitsTested < 32)                    /* data bits 0 - 31 */
182
                        {
183
                                testData[0] <<= 1;                       /* shift data through LS word */
184
                        }
185
                        else if (bitsTested == 32)              /* start testing MS word */
186
                        {
187
                                testData[0] = 0x00000000;        /* clear LS word */
188
                                testData[1] = 0x00000001;       /* shift into MS word */
189
                        }
190
                        else                                                    /* data bits 32 - 63 */
191
                        {
192
                                testData[1] <<= 1;                      /* shift data through MS word */
193
                        }
194
                }
195
        }
196
                return (PASSED);
197
}
198
 
199
#endif
200
 
201
 
202
 
203
/* Do long word address test */
204
 
205
static int LWAddr (
206
        long    start,                  /* Starting address of test */
207
        long    end,                    /* Ending address */
208
        long    *badAddr                /* Failure address */
209
        )
210
{
211
        register long   currentAddr;    /* Current address being tested */
212
        register long   data;
213
        char    fail = 0;                /* Test hasn't failed yet */
214
 
215
        for(currentAddr = start; currentAddr < end; currentAddr += 4)
216
                *((long *) currentAddr) = currentAddr;
217
 
218
        for (currentAddr = start;
219
             (currentAddr < end);
220
             currentAddr += 4)
221
        {
222
                data = *(long *) currentAddr;
223
            if (data != currentAddr)
224
                {
225
                        fail = 1;
226
                        printf ("\n\nLWAddr Bad Read, Address = 0x%08x, Data Read = 0x%08x\n\n", currentAddr, data);
227
                        break;
228
                }
229
        }
230
 
231
        if (fail)
232
        {
233
            *badAddr = currentAddr;
234
            return FAILED;
235
        }
236
        else
237
            return PASSED;
238
}
239
 
240
/* Do inverse long word address test */
241
 
242
static int LWBar (long  start,                  /* Starting address of test */
243
       long     end,                    /* Ending address */
244
       long     *badAddr                /* Failure address */
245
           )
246
{
247
        register long   currentAddr;    /* Current address being tested */
248
        register long   data;
249
        int     fail = 0;                /* Test hasn't failed yet */
250
 
251
        for(currentAddr = start; currentAddr < end; currentAddr += 4)
252
                *((long *) currentAddr) = ~currentAddr;
253
 
254
        for (currentAddr = start;
255
             (currentAddr < end);
256
             currentAddr += 4)
257
        {
258
                data = *(long *) currentAddr;
259
            if (data != ~currentAddr)
260
                {
261
                        fail = 1;
262
                        printf ("\n\nLWBar Bad Read, Address = 0x%08x, Data Read = 0x%08x\n\n", currentAddr, data);
263
                        break;
264
                }
265
        }
266
        if (fail)
267
        {
268
            *badAddr = currentAddr;
269
            return FAILED;
270
        }
271
        else
272
            return PASSED;
273
}
274
 
275
/* Do byte address test */
276
 
277
static int
278
ByteAddr (
279
          long  start,                          /* Starting address of test */
280
          long  end,                            /* Ending address */
281
          long  *badAddr                        /* Failure address */
282
          )
283
{
284
        long    currentAddr;    /* Current address being tested */
285
        int     fail = 0;                /* Test hasn't failed yet */
286
 
287
        for(currentAddr = start; currentAddr < end; currentAddr++)
288
                *((char *) currentAddr) = (char) currentAddr;
289
 
290
        for(currentAddr = start; (currentAddr < end) && (!fail); currentAddr++)
291
                if (*((char *) currentAddr) != (char) currentAddr)
292
                        fail = 1;
293
 
294
        if (fail)
295
        {
296
                *badAddr = currentAddr - 1;
297
                return FAILED;
298
        }
299
        else
300
                return PASSED;
301
}
302
 
303
/* Do inverse byte address test */
304
 
305
static int ByteBar (
306
         long   start,                          /* Starting address of test */
307
         long   end,                            /* Ending address */
308
         long   *badAddr                        /* Failure address */
309
         )
310
{
311
        long    currentAddr;            /* Current address being tested */
312
        int     fail = 0;                /* Test hasn't failed yet */
313
 
314
        for(currentAddr = start; currentAddr < end; currentAddr++)
315
                *((char *) currentAddr) = (char) ~currentAddr;
316
 
317
        for(currentAddr = start; (currentAddr < end) && (!fail); currentAddr++)
318
                if (*((char *) currentAddr) != (char) ~currentAddr)
319
                        fail = 1;
320
        if (fail) {
321
                *badAddr = currentAddr - 1;
322
                return FAILED;
323
        }
324
        else
325
                return PASSED;
326
}
327
 
328
/*
329
 * This routine is called if one of the memory tests fails.  It dumps
330
 * the 8 32-bit words before and the 8 after the failure address
331
 */
332
 
333
void dumpMem (
334
         long   badAddr                 /* Failure address */
335
         )
336
{
337
        unsigned long *addr;
338
        unsigned short *saddr;
339
 
340
        printf("\n");                                   /* Print out first line of mem dump */
341
        hex32out(badAddr - 32);         /* Starting address */
342
        printf(": ");
343
        hex32out(*((long *) (badAddr - 32)));   /* First longword */
344
        printf(" ");
345
        hex32out(*((long *) (badAddr - 28)));
346
        printf(" ");
347
        hex32out(*((long *) (badAddr - 24)));
348
        printf(" ");
349
        hex32out(*((long *) (badAddr - 20)));
350
 
351
        printf("\n");
352
        hex32out(badAddr - 16);
353
        printf(": ");
354
        hex32out(*((long *) (badAddr - 16)));
355
        printf(" ");
356
        hex32out(*((long *) (badAddr - 12)));
357
        printf(" ");
358
        hex32out(*((long *) (badAddr - 8)));
359
        printf(" ");
360
        hex32out(*((long *) (badAddr - 4)));
361
 
362
        printf("\n");           /* Print out contents of fault addr */
363
        hex32out(badAddr);
364
        printf(": ");
365
        hex32out(*((long *) badAddr));
366
 
367
 
368
        printf("\n");           /* Print out next line of mem dump */
369
        hex32out(badAddr + 4);          /* Starting address */
370
        printf(": ");
371
        hex32out(*((long *) (badAddr + 4)));    /* First longword */
372
        printf(" ");
373
        hex32out(*((long *) (badAddr + 8)));
374
        printf(" ");
375
        hex32out(*((long *) (badAddr + 12)));
376
        printf(" ");
377
        hex32out(*((long *) (badAddr + 16)));
378
 
379
        printf("\n");
380
        hex32out(badAddr + 20);
381
        printf(": ");
382
        hex32out(*((long *) (badAddr + 20)));
383
        printf(" ");
384
        hex32out(*((long *) (badAddr + 24)));
385
        printf(" ");
386
        hex32out(*((long *) (badAddr + 28)));
387
        printf(" ");
388
        hex32out(*((long *) (badAddr + 32)));
389
 
390
        /* DEBUG */
391
        printf ("\n\nReading back data in 32bit chunks:\n");
392
        addr = (unsigned long *)(badAddr - 16);
393
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
394
        addr = (unsigned long *)(badAddr - 12);
395
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
396
        addr = (unsigned long *)(badAddr - 8);
397
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
398
        addr = (unsigned long *)(badAddr - 4);
399
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
400
        addr = (unsigned long *)(badAddr);
401
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
402
        addr = (unsigned long *)(badAddr + 4);
403
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
404
        addr = (unsigned long *)(badAddr + 8);
405
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
406
        addr = (unsigned long *)(badAddr + 12);
407
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
408
        addr = (unsigned long *)(badAddr + 16);
409
        printf ("Address = 0x%08x, Data = 0x%08x\n", addr, *addr);
410
        printf ("\n");
411
 
412
        printf ("Reading back data in 16bit chunks:\n");
413
        saddr = (unsigned short *)(badAddr - 16);
414
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
415
        saddr = (unsigned short *)(badAddr - 14);
416
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
417
        saddr = (unsigned short *)(badAddr - 12);
418
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
419
        saddr = (unsigned short *)(badAddr - 10);
420
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
421
        saddr = (unsigned short *)(badAddr - 8);
422
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
423
        saddr = (unsigned short *)(badAddr - 6);
424
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
425
        saddr = (unsigned short *)(badAddr - 4);
426
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
427
        saddr = (unsigned short *)(badAddr - 2);
428
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
429
        saddr = (unsigned short *)(badAddr);
430
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
431
        saddr = (unsigned short *)(badAddr + 2);
432
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
433
        saddr = (unsigned short *)(badAddr + 4);
434
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
435
        saddr = (unsigned short *)(badAddr + 6);
436
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
437
        saddr = (unsigned short *)(badAddr + 8);
438
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
439
        saddr = (unsigned short *)(badAddr + 10);
440
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
441
        saddr = (unsigned short *)(badAddr + 12);
442
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
443
        saddr = (unsigned short *)(badAddr + 14);
444
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
445
        saddr = (unsigned short *)(badAddr + 16);
446
        printf ("Address = 0x%08x, Data = 0x%04x\n", saddr, *saddr);
447
        printf ("\n");
448
 
449
}
450
 
451
/*
452
 * Returns 1 if passed, 0 if failed.
453
 */
454
 
455
int
456
memTest (
457
         long   startAddr,              /* Start address of test */
458
         long   endAddr                 /* End address + 1 */
459
         )
460
{
461
        long    badAddr;                /* Addr test failed at */
462
 
463
        printf("\n");
464
 
465
        if (onesTest(startAddr) == FAILED)
466
        {
467
                printf("\nWalking 1's test: failed");
468
                return 0;
469
        }
470
        printf("\nWalking 1's test: passed\n");
471
 
472
        /* rval = quadtest(startAddr);
473
 
474
        switch (rval)
475
        {
476
                case 0:
477
                        printf("\nQuadword test passed\n");
478
                        break;
479
 
480
                case 1:
481
                        printf("\nQuadword test failed: Quadword Write, Longword Read\n");
482
                        dumpMem(startAddr);
483
                        return 0;
484
 
485
                case 2:
486
                        printf("\nQuadword test failed: Longword Write, Quadword Read\n");
487
                        dumpMem(startAddr);
488
                        return 0;
489
 
490
                default:
491
                        printf("\nQuadword test: Unknown return value 0x%X\n", rval);
492
                        return 0;
493
        }
494
        */
495
 
496
        printf("\nLong word address test: ");
497
        if (LWAddr(startAddr, endAddr, &badAddr) == FAILED)
498
        {
499
                printf("failed");
500
                dumpMem(badAddr);
501
                return 0;
502
        }
503
        printf("passed");
504
 
505
        printf("\nLong word address bar test: ");
506
        if (LWBar(startAddr, endAddr, &badAddr) == FAILED)
507
        {
508
                printf("failed");
509
                dumpMem(badAddr);
510
                return 0;
511
        }
512
        printf("passed");
513
 
514
        printf("\nByte address test: ");
515
        if (ByteAddr(startAddr, endAddr, &badAddr) == FAILED)
516
        {
517
                printf("failed");
518
                dumpMem(badAddr);
519
                return 0;
520
        }
521
        printf("passed");
522
 
523
        printf("\nByte address bar test: ");
524
        if (ByteBar(startAddr, endAddr, &badAddr) == FAILED)
525
        {
526
                printf("failed");
527
                dumpMem(badAddr);
528
                return 0;
529
        }
530
        printf("passed");
531
 
532
        return 1;
533
}
534
 
535
 
536
/* 02/02/01 jwf */
537
/* Do alternating inverse long word address test */
538
static int
539
LWABar(long     start,                  /* Starting address of test */
540
       long     end,                    /* Ending address */
541
       long     *badAddr)               /* Failure address */
542
{
543
        register long   currentAddr;    /* Current address being tested */
544
        int                             fail = 0;                /* Test hasn't failed yet */
545
        register long   data;
546
 
547
        /* In this test, the contents of each longword address toggles
548
           between the Address and the Address BAR */
549
        for(currentAddr = start; currentAddr < end; currentAddr += 4)
550
        {
551
                /* Address ending in 0x4 or 0xc */
552
                if (currentAddr & 4)
553
                        *((long *) currentAddr) = ~currentAddr;
554
 
555
                /* Address ending in 0x0 or 0x8 */
556
                else
557
                        *((long *) currentAddr) = currentAddr;
558
        }
559
 
560
        for (currentAddr = start; (currentAddr < end) && (!fail); currentAddr += 4)
561
        {
562
                data = *(long *) currentAddr;
563
 
564
                switch (currentAddr & 0xf)
565
                {
566
                        case 0x0:
567
                        case 0x8:
568
                                if (data != currentAddr)
569
                                {
570
                                        fail = 1;
571
                                        printf ("\nFailed at Address 0x%08X, Expected 0x%08X, Read 0x%08X\n",
572
                                                currentAddr, currentAddr, data);
573
                                }
574
                                break;
575
 
576
                        case 0x4:
577
                        case 0xc:
578
                                if (data != ~currentAddr)
579
                                {
580
                                        fail = 1;
581
                                        printf ("\nFailed at Address 0x%08X, Expected 0x%08X, Read 0x%08X\n",
582
                                                currentAddr, ~currentAddr, data);
583
                                }
584
                                break;
585
 
586
                        default:
587
                                fail = 1;
588
                                printf ("\nFailed at Address 0x%08X, Unaligned address\n", currentAddr);
589
                                break;
590
                }
591
        }
592
 
593
        if (fail) {
594
            *badAddr = currentAddr - 4;
595
            return FAILED;
596
        } else
597
            return PASSED;
598
}
599
 
600
 
601
/* 02/02/01 jwf */
602
/*
603
 * Returns 1 if passed, 0 if failed.
604
 */
605
int
606
LoopMemTest (
607
         long   startAddr,              /* Start address of test */
608
         long   endAddr                 /* End address + 1 */
609
         )
610
{
611
        long    badAddr;                /* Addr test failed at */
612
        volatile int junk;
613
        extern int ecc_error_reported;
614
 
615
        /* indicate no ECC errors recorded */
616
        *MSB_DISPLAY_REG = DISPLAY_OFF;
617
 
618
        /* indicate passing test */
619
        *LSB_DISPLAY_REG = LETTER_P;
620
 
621
        while (1)
622
        {
623
                printf("\n");
624
 
625
                printf("\nLong word address test: ");
626
                if (LWAddr(startAddr, endAddr, &badAddr) == FAILED)
627
                {
628
                        /* indicate failing test */
629
                        *LSB_DISPLAY_REG = LETTER_F;
630
 
631
                        printf("failed at Address 0x%08x\n", badAddr);
632
                        printf("Performing Continuous Write/Read/!Write/Read...\n\n");
633
                        while (1)
634
                        {
635
                                *(volatile int *)badAddr = badAddr;
636
                                junk = *(volatile int *)badAddr;
637
                                *(volatile int *)badAddr = ~badAddr;
638
                                junk = *(volatile int *)badAddr;
639
 
640
                                if (ecc_error_reported)
641
                                {
642
                                        printf ("Disabling ECC reporting\n");
643
                                        /* disable single and multi-bit reporting */
644
                                        *(volatile unsigned long *)0x1534 = 0x4;
645
                                        ecc_error_reported = FALSE;
646
                                }
647
                        }
648
                        return 0;        /* not reached */
649
                }
650
                printf("passed");
651
 
652
                printf("\nLong word address bar test: ");
653
                if (LWBar(startAddr, endAddr, &badAddr) == FAILED)
654
                {
655
                        /* indicate failing test */
656
                        *LSB_DISPLAY_REG = LETTER_F;
657
 
658
                        printf("failed at Address 0x%08x\n", badAddr);
659
                        printf("Performing Continuous Write/Read/!Write/Read...\n\n");
660
                        while (1)
661
                        {
662
                                *(volatile int *)badAddr = badAddr;
663
                                junk = *(volatile int *)badAddr;
664
                                *(volatile int *)badAddr = ~badAddr;
665
                                junk = *(volatile int *)badAddr;
666
 
667
                                if (ecc_error_reported)
668
                                {
669
                                        printf ("Disabling ECC reporting\n");
670
                                        /* disable single and multi-bit reporting */
671
                                        *(volatile unsigned long *)0x1534 = 0x4;
672
                                        ecc_error_reported = FALSE;
673
                                }
674
                        }
675
                        return 0;        /* not reached */
676
                }
677
                printf("passed");
678
 
679
                printf("\nAlternating Long word, Long word address bar test: ");
680
                if (LWABar(startAddr, endAddr, &badAddr) == FAILED)
681
                {
682
                        /* indicate failing test */
683
                        *LSB_DISPLAY_REG = LETTER_F;
684
 
685
                        printf("failed at Address 0x%08x\n", badAddr);
686
                        printf("Performing Continuous Write/Read/!Write/Read...\n\n");
687
                        while (1)
688
                        {
689
                                *(volatile int *)badAddr = badAddr;
690
                                junk = *(volatile int *)badAddr;
691
                                *(volatile int *)badAddr = ~badAddr;
692
                                junk = *(volatile int *)badAddr;
693
 
694
                                if (ecc_error_reported)
695
                                {
696
                                        printf ("Disabling ECC reporting\n");
697
                                        /* disable single and multi-bit reporting */
698
                                        *(volatile unsigned long *)0x1534 = 0x4;
699
                                        ecc_error_reported = FALSE;
700
                                }
701
                        }
702
                        return 0;        /* not reached */
703
                }
704
                printf("passed");
705
        }
706
 
707
        return 1;
708
}
709
 
710
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.