This source file includes following definitions.
- out_umc
- in_umc
- init_umc8672
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 #define UMC_DRIVE0 11
41 #define UMC_DRIVE1 11
42 #define UMC_DRIVE2 11
43 #define UMC_DRIVE3 11
44
45 void out_umc (char port,char wert)
46 {
47 outb_p (port,0x108);
48 outb_p (wert,0x109);
49 }
50
51 byte in_umc (char port)
52 {
53 outb_p (port,0x108);
54 return inb_p (0x109);
55 }
56
57 void init_umc8672(void)
58 {
59 int i,tmp;
60 int speed [4];
61
62 char speedtab [3][12] = {
63 {0xf ,0xb ,0x2 ,0x2 ,0x2 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 },
64 {0x3 ,0x2 ,0x2 ,0x2 ,0x2 ,0x2 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 },
65 {0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}};
66
67 cli ();
68 outb_p (0x5A,0x108);
69 if (in_umc (0xd5) != 0xa0)
70 {
71 sti ();
72 printk ("UMC8672 not found\n");
73 return;
74 }
75 speed[0] = UMC_DRIVE0;
76 speed[1] = UMC_DRIVE1;
77 speed[2] = UMC_DRIVE2;
78 speed[3] = UMC_DRIVE3;
79 for (i = 0;i < 4;i++)
80 {
81 if ((speed[i] < 0) || (speed[i] > 11))
82 {
83 sti ();
84 printk ("UMC 8672 drive speed out of range. Drive %d Speed %d\n",
85 i, speed[i]);
86 printk ("UMC support aborted\n");
87 return;
88 }
89 }
90 out_umc (0xd7,(speedtab[0][speed[2]] | (speedtab[0][speed[3]]<<4)));
91 out_umc (0xd6,(speedtab[0][speed[0]] | (speedtab[0][speed[1]]<<4)));
92 tmp = 0;
93 for (i = 3; i >= 0; i--)
94 {
95 tmp = (tmp << 2) | speedtab[1][speed[i]];
96 }
97 out_umc (0xdc,tmp);
98 for (i = 0;i < 4; i++)
99 {
100 out_umc (0xd0+i,speedtab[2][speed[i]]);
101 out_umc (0xd8+i,speedtab[2][speed[i]]);
102 }
103 outb_p (0xa5,0x108);
104 sti ();
105 printk ("Speeds for UMC8672 \n");
106 for (i = 0;i < 4;i++)
107 printk ("Drive %d speed %d\n",i,speed[i]);
108 }