1 | /*
|
---|
2 | * $ZEL$
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "test_3100.h"
|
---|
6 |
|
---|
7 | /*
|
---|
8 | static int
|
---|
9 | check_rw_remote(struct path* path)
|
---|
10 | {
|
---|
11 | struct vmespace space;
|
---|
12 | int res, size;
|
---|
13 |
|
---|
14 | printf("testing sdram over VME\n");
|
---|
15 | if (vme_probe(path, VMESTART)) return 0;
|
---|
16 |
|
---|
17 | space.am=0x9;
|
---|
18 | space.datasize=4;
|
---|
19 | space.swap=1;
|
---|
20 | space.mapit=0;
|
---|
21 | space.mindmalen=-1;
|
---|
22 | res=ioctl(path->p, SIS1100_SETVMESPACE, &space);
|
---|
23 | if (res) {
|
---|
24 | printf("SETVMESPACE(%s): %s\n", path->name, strerror(errno));
|
---|
25 | return -1;
|
---|
26 | }
|
---|
27 | if (check_rw_single(path, VMESTART, 10000)<0) return -1;
|
---|
28 |
|
---|
29 | space.am=0xb;
|
---|
30 | res=ioctl(path->p, SIS1100_SETVMESPACE, &space);
|
---|
31 | if (res) {
|
---|
32 | printf("SETVMESPACE(%s): %s\n", path->name, strerror(errno));
|
---|
33 | return -1;
|
---|
34 | }
|
---|
35 | size=1;
|
---|
36 | while (check_rw_block(path, VMESTART, size)>=0) {
|
---|
37 | printf(".");
|
---|
38 | fflush(stdout);
|
---|
39 | size<<=4;
|
---|
40 | }
|
---|
41 | printf("OK.\n");
|
---|
42 | return 0;
|
---|
43 | }
|
---|
44 | */
|
---|
45 |
|
---|
46 | static int
|
---|
47 | check_rw_ram(struct path* path)
|
---|
48 | {
|
---|
49 | printf("testing sdram\n");
|
---|
50 | if (check_rw_single(path, 0, 1000)<0) return -1;
|
---|
51 | if (check_r_block(path, 0, bufsize)<0) return -1;
|
---|
52 | if (check_w_block(path, 0, bufsize)<0) return -1;
|
---|
53 | printf("OK.\n");
|
---|
54 | return 0;
|
---|
55 | }
|
---|
56 |
|
---|
57 | static int
|
---|
58 | check_rw_ctrl(struct path* path)
|
---|
59 | {
|
---|
60 | return 0;
|
---|
61 | }
|
---|
62 |
|
---|
63 | static int
|
---|
64 | check_rw_dsp(struct path* path)
|
---|
65 | {
|
---|
66 | return 0;
|
---|
67 | }
|
---|
68 |
|
---|
69 | int
|
---|
70 | check_rw(struct path* path)
|
---|
71 | {
|
---|
72 | int res;
|
---|
73 | switch (path->type) {
|
---|
74 | case sis1100_subdev_remote:
|
---|
75 | /*if ((res=check_rw_remote(path))<0) return res;*/
|
---|
76 | break;
|
---|
77 | case sis1100_subdev_ram:
|
---|
78 | if ((res=check_rw_ram(path))<0) return res;
|
---|
79 | break;
|
---|
80 | #if MAJORVERSION >= 2
|
---|
81 | case sis1100_subdev_ctrl:
|
---|
82 | if ((res=check_rw_ctrl(path))<0) return res;
|
---|
83 | break;
|
---|
84 | #endif
|
---|
85 | case sis1100_subdev_dsp:
|
---|
86 | if ((res=check_rw_dsp(path))<0) return res;
|
---|
87 | break;
|
---|
88 | default:
|
---|
89 | printf("check_rw: %s has unknown type %d\n",
|
---|
90 | path->name, path->type);
|
---|
91 | return -1;
|
---|
92 | }
|
---|
93 | return 0;
|
---|
94 | }
|
---|
95 |
|
---|