diff options
author | Alexey Dobriyan <adobriyan@sw.ru> | 2008-04-27 09:38:33 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-27 09:38:33 -0400 |
commit | 19ba7b8f35116dfafcb02bdb745d5015d97d9cb6 (patch) | |
tree | aeaf933c00d92e06f9083d9d0551e7efed0945d0 /drivers/ide | |
parent | d01dbc3b85d57f3ab89be4291d4739152bb1713a (diff) |
ide: remove /proc/ide/ali
Bart says: "can be done from user-space and is not especially interesting
even when debugging problems (raw PCI config space dump is far more useful)."
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/pci/alim15x3.c | 240 |
1 files changed, 0 insertions, 240 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 075dcf9802f0..b36a22b8c213 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -38,8 +38,6 @@ | |||
38 | 38 | ||
39 | #include <asm/io.h> | 39 | #include <asm/io.h> |
40 | 40 | ||
41 | #define DISPLAY_ALI_TIMINGS | ||
42 | |||
43 | /* | 41 | /* |
44 | * ALi devices are not plug in. Otherwise these static values would | 42 | * ALi devices are not plug in. Otherwise these static values would |
45 | * need to go. They ought to go away anyway | 43 | * need to go. They ought to go away anyway |
@@ -49,236 +47,6 @@ static u8 m5229_revision; | |||
49 | static u8 chip_is_1543c_e; | 47 | static u8 chip_is_1543c_e; |
50 | static struct pci_dev *isa_dev; | 48 | static struct pci_dev *isa_dev; |
51 | 49 | ||
52 | #if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) | ||
53 | #include <linux/stat.h> | ||
54 | #include <linux/proc_fs.h> | ||
55 | |||
56 | static u8 ali_proc = 0; | ||
57 | |||
58 | static struct pci_dev *bmide_dev; | ||
59 | |||
60 | static char *fifo[4] = { | ||
61 | "FIFO Off", | ||
62 | "FIFO On ", | ||
63 | "DMA mode", | ||
64 | "PIO mode" }; | ||
65 | |||
66 | static char *udmaT[8] = { | ||
67 | "1.5T", | ||
68 | " 2T", | ||
69 | "2.5T", | ||
70 | " 3T", | ||
71 | "3.5T", | ||
72 | " 4T", | ||
73 | " 6T", | ||
74 | " 8T" | ||
75 | }; | ||
76 | |||
77 | static char *channel_status[8] = { | ||
78 | "OK ", | ||
79 | "busy ", | ||
80 | "DRQ ", | ||
81 | "DRQ busy ", | ||
82 | "error ", | ||
83 | "error busy ", | ||
84 | "error DRQ ", | ||
85 | "error DRQ busy" | ||
86 | }; | ||
87 | |||
88 | /** | ||
89 | * ali_get_info - generate proc file for ALi IDE | ||
90 | * @buffer: buffer to fill | ||
91 | * @addr: address of user start in buffer | ||
92 | * @offset: offset into 'file' | ||
93 | * @count: buffer count | ||
94 | * | ||
95 | * Walks the Ali devices and outputs summary data on the tuning and | ||
96 | * anything else that will help with debugging | ||
97 | */ | ||
98 | |||
99 | static int ali_get_info (char *buffer, char **addr, off_t offset, int count) | ||
100 | { | ||
101 | unsigned long bibma; | ||
102 | u8 reg53h, reg5xh, reg5yh, reg5xh1, reg5yh1, c0, c1, rev, tmp; | ||
103 | char *q, *p = buffer; | ||
104 | |||
105 | /* fetch rev. */ | ||
106 | pci_read_config_byte(bmide_dev, 0x08, &rev); | ||
107 | if (rev >= 0xc1) /* M1543C or newer */ | ||
108 | udmaT[7] = " ???"; | ||
109 | else | ||
110 | fifo[3] = " ??? "; | ||
111 | |||
112 | /* first fetch bibma: */ | ||
113 | |||
114 | bibma = pci_resource_start(bmide_dev, 4); | ||
115 | |||
116 | /* | ||
117 | * at that point bibma+0x2 et bibma+0xa are byte | ||
118 | * registers to investigate: | ||
119 | */ | ||
120 | c0 = inb(bibma + 0x02); | ||
121 | c1 = inb(bibma + 0x0a); | ||
122 | |||
123 | p += sprintf(p, | ||
124 | "\n Ali M15x3 Chipset.\n"); | ||
125 | p += sprintf(p, | ||
126 | " ------------------\n"); | ||
127 | pci_read_config_byte(bmide_dev, 0x78, ®53h); | ||
128 | p += sprintf(p, "PCI Clock: %d.\n", reg53h); | ||
129 | |||
130 | pci_read_config_byte(bmide_dev, 0x53, ®53h); | ||
131 | p += sprintf(p, | ||
132 | "CD_ROM FIFO:%s, CD_ROM DMA:%s\n", | ||
133 | (reg53h & 0x02) ? "Yes" : "No ", | ||
134 | (reg53h & 0x01) ? "Yes" : "No " ); | ||
135 | pci_read_config_byte(bmide_dev, 0x74, ®53h); | ||
136 | p += sprintf(p, | ||
137 | "FIFO Status: contains %d Words, runs%s%s\n\n", | ||
138 | (reg53h & 0x3f), | ||
139 | (reg53h & 0x40) ? " OVERWR" : "", | ||
140 | (reg53h & 0x80) ? " OVERRD." : "." ); | ||
141 | |||
142 | p += sprintf(p, | ||
143 | "-------------------primary channel" | ||
144 | "-------------------secondary channel" | ||
145 | "---------\n\n"); | ||
146 | |||
147 | pci_read_config_byte(bmide_dev, 0x09, ®53h); | ||
148 | p += sprintf(p, | ||
149 | "channel status: %s" | ||
150 | " %s\n", | ||
151 | (reg53h & 0x20) ? "On " : "Off", | ||
152 | (reg53h & 0x10) ? "On " : "Off" ); | ||
153 | |||
154 | p += sprintf(p, | ||
155 | "both channels togth: %s" | ||
156 | " %s\n", | ||
157 | (c0&0x80) ? "No " : "Yes", | ||
158 | (c1&0x80) ? "No " : "Yes" ); | ||
159 | |||
160 | pci_read_config_byte(bmide_dev, 0x76, ®53h); | ||
161 | p += sprintf(p, | ||
162 | "Channel state: %s %s\n", | ||
163 | channel_status[reg53h & 0x07], | ||
164 | channel_status[(reg53h & 0x70) >> 4] ); | ||
165 | |||
166 | pci_read_config_byte(bmide_dev, 0x58, ®5xh); | ||
167 | pci_read_config_byte(bmide_dev, 0x5c, ®5yh); | ||
168 | p += sprintf(p, | ||
169 | "Add. Setup Timing: %dT" | ||
170 | " %dT\n", | ||
171 | (reg5xh & 0x07) ? (reg5xh & 0x07) : 8, | ||
172 | (reg5yh & 0x07) ? (reg5yh & 0x07) : 8 ); | ||
173 | |||
174 | pci_read_config_byte(bmide_dev, 0x59, ®5xh); | ||
175 | pci_read_config_byte(bmide_dev, 0x5d, ®5yh); | ||
176 | p += sprintf(p, | ||
177 | "Command Act. Count: %dT" | ||
178 | " %dT\n" | ||
179 | "Command Rec. Count: %dT" | ||
180 | " %dT\n\n", | ||
181 | (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, | ||
182 | (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, | ||
183 | (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, | ||
184 | (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16 ); | ||
185 | |||
186 | p += sprintf(p, | ||
187 | "----------------drive0-----------drive1" | ||
188 | "------------drive0-----------drive1------\n\n"); | ||
189 | p += sprintf(p, | ||
190 | "DMA enabled: %s %s" | ||
191 | " %s %s\n", | ||
192 | (c0&0x20) ? "Yes" : "No ", | ||
193 | (c0&0x40) ? "Yes" : "No ", | ||
194 | (c1&0x20) ? "Yes" : "No ", | ||
195 | (c1&0x40) ? "Yes" : "No " ); | ||
196 | |||
197 | pci_read_config_byte(bmide_dev, 0x54, ®5xh); | ||
198 | pci_read_config_byte(bmide_dev, 0x55, ®5yh); | ||
199 | q = "FIFO threshold: %2d Words %2d Words" | ||
200 | " %2d Words %2d Words\n"; | ||
201 | if (rev < 0xc1) { | ||
202 | if ((rev == 0x20) && | ||
203 | (pci_read_config_byte(bmide_dev, 0x4f, &tmp), (tmp &= 0x20))) { | ||
204 | p += sprintf(p, q, 8, 8, 8, 8); | ||
205 | } else { | ||
206 | p += sprintf(p, q, | ||
207 | (reg5xh & 0x03) + 12, | ||
208 | ((reg5xh & 0x30)>>4) + 12, | ||
209 | (reg5yh & 0x03) + 12, | ||
210 | ((reg5yh & 0x30)>>4) + 12 ); | ||
211 | } | ||
212 | } else { | ||
213 | int t1 = (tmp = (reg5xh & 0x03)) ? (tmp << 3) : 4; | ||
214 | int t2 = (tmp = ((reg5xh & 0x30)>>4)) ? (tmp << 3) : 4; | ||
215 | int t3 = (tmp = (reg5yh & 0x03)) ? (tmp << 3) : 4; | ||
216 | int t4 = (tmp = ((reg5yh & 0x30)>>4)) ? (tmp << 3) : 4; | ||
217 | p += sprintf(p, q, t1, t2, t3, t4); | ||
218 | } | ||
219 | |||
220 | #if 0 | ||
221 | p += sprintf(p, | ||
222 | "FIFO threshold: %2d Words %2d Words" | ||
223 | " %2d Words %2d Words\n", | ||
224 | (reg5xh & 0x03) + 12, | ||
225 | ((reg5xh & 0x30)>>4) + 12, | ||
226 | (reg5yh & 0x03) + 12, | ||
227 | ((reg5yh & 0x30)>>4) + 12 ); | ||
228 | #endif | ||
229 | |||
230 | p += sprintf(p, | ||
231 | "FIFO mode: %s %s %s %s\n", | ||
232 | fifo[((reg5xh & 0x0c) >> 2)], | ||
233 | fifo[((reg5xh & 0xc0) >> 6)], | ||
234 | fifo[((reg5yh & 0x0c) >> 2)], | ||
235 | fifo[((reg5yh & 0xc0) >> 6)] ); | ||
236 | |||
237 | pci_read_config_byte(bmide_dev, 0x5a, ®5xh); | ||
238 | pci_read_config_byte(bmide_dev, 0x5b, ®5xh1); | ||
239 | pci_read_config_byte(bmide_dev, 0x5e, ®5yh); | ||
240 | pci_read_config_byte(bmide_dev, 0x5f, ®5yh1); | ||
241 | |||
242 | p += sprintf(p,/* | ||
243 | "------------------drive0-----------drive1" | ||
244 | "------------drive0-----------drive1------\n")*/ | ||
245 | "Dt RW act. Cnt %2dT %2dT" | ||
246 | " %2dT %2dT\n" | ||
247 | "Dt RW rec. Cnt %2dT %2dT" | ||
248 | " %2dT %2dT\n\n", | ||
249 | (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, | ||
250 | (reg5xh1 & 0x70) ? ((reg5xh1 & 0x70) >> 4) : 8, | ||
251 | (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, | ||
252 | (reg5yh1 & 0x70) ? ((reg5yh1 & 0x70) >> 4) : 8, | ||
253 | (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, | ||
254 | (reg5xh1 & 0x0f) ? (reg5xh1 & 0x0f) : 16, | ||
255 | (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16, | ||
256 | (reg5yh1 & 0x0f) ? (reg5yh1 & 0x0f) : 16 ); | ||
257 | |||
258 | p += sprintf(p, | ||
259 | "-----------------------------------UDMA Timings" | ||
260 | "--------------------------------\n\n"); | ||
261 | |||
262 | pci_read_config_byte(bmide_dev, 0x56, ®5xh); | ||
263 | pci_read_config_byte(bmide_dev, 0x57, ®5yh); | ||
264 | p += sprintf(p, | ||
265 | "UDMA: %s %s" | ||
266 | " %s %s\n" | ||
267 | "UDMA timings: %s %s" | ||
268 | " %s %s\n\n", | ||
269 | (reg5xh & 0x08) ? "OK" : "No", | ||
270 | (reg5xh & 0x80) ? "OK" : "No", | ||
271 | (reg5yh & 0x08) ? "OK" : "No", | ||
272 | (reg5yh & 0x80) ? "OK" : "No", | ||
273 | udmaT[(reg5xh & 0x07)], | ||
274 | udmaT[(reg5xh & 0x70) >> 4], | ||
275 | udmaT[reg5yh & 0x07], | ||
276 | udmaT[(reg5yh & 0x70) >> 4] ); | ||
277 | |||
278 | return p-buffer; /* => must be less than 4k! */ | ||
279 | } | ||
280 | #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ | ||
281 | |||
282 | /** | 50 | /** |
283 | * ali_set_pio_mode - set host controller for PIO mode | 51 | * ali_set_pio_mode - set host controller for PIO mode |
284 | * @drive: drive | 52 | * @drive: drive |
@@ -465,14 +233,6 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c | |||
465 | 233 | ||
466 | isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); | 234 | isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
467 | 235 | ||
468 | #if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) | ||
469 | if (!ali_proc) { | ||
470 | ali_proc = 1; | ||
471 | bmide_dev = dev; | ||
472 | ide_pci_create_host_proc("ali", ali_get_info); | ||
473 | } | ||
474 | #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ | ||
475 | |||
476 | local_irq_save(flags); | 236 | local_irq_save(flags); |
477 | 237 | ||
478 | if (m5229_revision < 0xC2) { | 238 | if (m5229_revision < 0xC2) { |