git repos for lemote 502 board
[pmon-gdium.git] / Targets / Bonito / Bonito / test / testmem6.S
blob42c3d8a447950fea1a1130b54bf65bfd16d10755
1 //#include "test/testmem.S"
2 //#include "test/testmem5.S"
4 //#define TESTCACHE
5 #define TREAD
6 #define TWRITE
7 #ifdef TESTCACHE
8         mfc0   a0,COP_0_CONFIG
9         and    a0,a0,0xfffffff8
10         or     a0,a0,0x3
11         mtc0   a0,COP_0_CONFIG
12 #endif
13 PRINTSTR("begin test\r\n");
14         dli  t5, 0x5555555555555555
15         dli  t7, 0x3333333333333333
16         dli  t6, 0xaaaaaaaaaaaaaaaa
17 #ifdef TESTCACHE
18         li   t2, 0x80000000
19         li   t3, 0xa1000000
20 #else
21         li   t2, 0xa0000000
22         li   t3, 0xa1000000
23 #endif
25 #if 0
26 /* test continous write */
27         move t0, t2
29         sd   t7,0(t0)
30         addiu t0,t0,8
31         blt   t0,t3,1b
32         nop
34         move t0, t2
36         ld   t4,0(t0)
37         beq  t4, t7, 2f
38         nop
39         addiu t0,t0,8
40         blt   t0,t3,1b
41         nop
43         PRINTSTR("block write test failed!\r\n");
44         b  3f;
45         nop
47         PRINTSTR("block write test ok!addr=\r\n");
48         move a0,t0
49         bal hexserial
50         nop
52 #endif
55 #ifdef TWRITE
56         #sd t5,-8(t2)
57         sd t7,(t2)
58         #sd t6,8(t2)
59         PRINTSTR("\r\nwrite="); 
60         move a0,t7;
61         bal  hexserial
62         nop
63         dsrl a0,t7,32;
64         bal  hexserial
65         nop
66 #endif
67         SET_LED(7)
68 #ifdef TESTCACHE
69         cache 1,(t2)
70         cache 1,1(t2)
71         cache 1,2(t2)
72         cache 1,3(t2)
73 #endif
74 #ifdef TREAD
75         ld t8,(t2)
76         PRINTSTR("\r\nread="); 
77         move a0,t8;
78         bal  hexserial
79         nop
80         dsrl a0,t8,32;
81         bal  hexserial
82         nop
84         ld t8,8(t2)
85         PRINTSTR("\r\nread="); 
86         move a0,t8;
87         bal  hexserial
88         nop
89         dsrl a0,t8,32;
90         bal  hexserial
91         nop
92 #endif
94 #ifdef TESTCACHE
95         cache 1,(t2)
96         cache 1,1(t2)
97         cache 1,(t2)
98         cache 1,1(t2)
99         cache 1,2(t2)
100         cache 1,3(t2)
101 #endif
102         SET_LED(0)
103         nop
105 #if 0
106 222:
107         li  t3, 0x10000
109         sd t0,(t2)
110         addu t3,-1
111         bnez t3,1b
112         nop
113         li  t3, 0x10000
115         ld v0,(t2)
116         addu t3,-1
117         bnez t3,1b
118         nop
119         b 222b
120         nop
123         sd  t0,0(t1)
124         not t0
125         addiu t1,t1,8
126         addiu t2,t2,-1
127         bnez  t2,1b
128         nop
130         PRINTSTR("Start reading memory 0xa0000000\r\n");
132         li  t1, 0xa0000000
133         ld  t0, 0(t1);
134         ld  t0, 40(t1);
135         b  1b
136         nop
138 #endif