1 |
199 |
simons |
UDMA information for kernels 2.0.35+
|
2 |
|
|
|
3 |
|
|
Version 0.4 - July 98
|
4 |
|
|
by Andrew D. Balsa
|
5 |
|
|
|
6 |
|
|
If you are in a hurry, skip to the "How does one use UDMA support?" section.
|
7 |
|
|
|
8 |
|
|
If you need troubleshooting advice, check the "Unreliable drive +
|
9 |
|
|
motherboard + driver combination" section.
|
10 |
|
|
|
11 |
|
|
Support for UDMA is based on previous work by Kim-Hoe Pang and Christian
|
12 |
|
|
Brunner, posted on the Linux Kernel mailing list around September 1997.
|
13 |
|
|
Additional code was provided by Michel Aubry (VIA support) and Andre Hedrick
|
14 |
|
|
(support for various PCI UDMA controller cards). The code base is Mark
|
15 |
|
|
Lord's triton.c driver.
|
16 |
|
|
|
17 |
|
|
Check the Linux UDMA mini-HOWTO by Brion Vibber first! It is the only Linux
|
18 |
|
|
specific document available on the subject.
|
19 |
|
|
|
20 |
|
|
Technical references:
|
21 |
|
|
a) The Intel 82371AB data sheet, available in PDF format.
|
22 |
|
|
b) The SiS 5598 and 5591 data sheets, available in Microsoft Word format. :(
|
23 |
|
|
c) The VIA 82C586, 82C586A and 82C586B data sheets, in PDF format.
|
24 |
|
|
d) Small Form Factor document SFF 8038I v1.0. This is the original document
|
25 |
|
|
that describes the DMA mode 2 protocol. Available in PDF format.
|
26 |
|
|
e) The ATA/ATAPI-4 Working Draft, revision 17. This is document
|
27 |
|
|
d1153r17.pdf (in PDF format), available from the main IDE technical
|
28 |
|
|
reference site, ftp://fission.dt.wdc.com/pub/standards. This draft
|
29 |
|
|
describes the Ultra DMA protocol and timings.
|
30 |
|
|
|
31 |
|
|
A somewhat less technical, but still very informative document is the
|
32 |
|
|
Enhanced IDE/Fast-ATA/ATA-2 FAQ, by John Wehman and Peter den Haan. Check
|
33 |
|
|
the Web page at http://come.to/eide.
|
34 |
|
|
|
35 |
|
|
**************************************************************************
|
36 |
|
|
|
37 |
|
|
Files changed
|
38 |
|
|
-------------
|
39 |
|
|
|
40 |
|
|
Here is the set of files from Linux kernels 2.0.32/2.0.34 modified to enable
|
41 |
|
|
UDMA transfers on motherboard chipsets that support it. For each file, there
|
42 |
|
|
is a small explanation of the changes.
|
43 |
|
|
|
44 |
|
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
45 |
|
|
The following changes do not affect performance or stability of the IDE
|
46 |
|
|
driver in any way.
|
47 |
|
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
48 |
|
|
|
49 |
|
|
/drivers/block/triton.c
|
50 |
|
|
|
51 |
|
|
- removed some Intel specific timing stuff. This should not affect
|
52 |
|
|
driver operation or performance. This is the only file that is heavily
|
53 |
|
|
modified; the Promise and Artop code is by Andre Hedrick, the VIA code
|
54 |
|
|
by Michel Aubry.
|
55 |
|
|
|
56 |
|
|
/drivers/block/ide.c
|
57 |
|
|
|
58 |
|
|
- added UDMA drive reporting during driver initialization, at the end
|
59 |
|
|
of routine do_identify (single line mod).
|
60 |
|
|
|
61 |
|
|
- added data for SiS 5513 and VIA VP-1 chipset in routine probe_for_hwifs
|
62 |
|
|
(single line mods). Each new UDMA capable chipset will have to be added to
|
63 |
|
|
this list (a single line is needed each time). Notice that you don't even
|
64 |
|
|
need the motherboard chipset's data sheets to find the needed information.
|
65 |
|
|
You just have to identify the IDE controller. You can do this by checking
|
66 |
|
|
/proc/pci, and then comparing the IDE controller signature with that
|
67 |
|
|
available from the Linux kernel.
|
68 |
|
|
|
69 |
|
|
As it stands in this patched version, routine probe_for_hwifs supports the
|
70 |
|
|
following chipsets: Intel FX, HX, VX, TX, LX and SiS 5513 (which is
|
71 |
|
|
integrated in the SiS 5571, 5598 and 5591 chips). The VIA-VP1
|
72 |
|
|
chipset is supported for DMA mode 2 transfers, but compatibility has not
|
73 |
|
|
been tested with this driver. The VIA MVP-3 is reported OK with UDMA.
|
74 |
|
|
|
75 |
|
|
/drivers/block/ide.h
|
76 |
|
|
|
77 |
|
|
- added flag using_udma in struct ide_drive_s (single line mod).
|
78 |
|
|
|
79 |
|
|
Small changes to the tape and ide-floppy code, and additions to pci.h and
|
80 |
|
|
pci.c for the extra PCI UDMA controller devices.
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
Tested configurations
|
84 |
|
|
---------------------
|
85 |
|
|
|
86 |
|
|
UDMA support has been thoroughly tested on the following configurations:
|
87 |
|
|
|
88 |
|
|
Intel TX motherboard, PCI bus at 33 and 37.5MHz. (ASUS TX-97E)
|
89 |
|
|
|
90 |
|
|
SiS 5598 motherboards, PCI bus at 33 and 37.5MHz. (Chaintech P5-SDA; ASUS
|
91 |
|
|
SP-97V at 33MHz only)
|
92 |
|
|
|
93 |
|
|
IBM DeskStar 6.4Gb and 8.4Gb drives. Samsung UDMA hard disk proved
|
94 |
|
|
unreliable under Linux _and_ Windows95 (so it was not a driver problem).
|
95 |
|
|
Other UDMA drives not tested.
|
96 |
|
|
|
97 |
|
|
libc5 and gcc2.7.2. Also tested under libc6 (RedHat 5.0).
|
98 |
|
|
|
99 |
|
|
6x86MX processor running at 166MHz or 187.5MHz.
|
100 |
|
|
|
101 |
|
|
DANGER: EIDE drives do not accept a PCI bus at 41.5MHz (83MHz / 2). Trying
|
102 |
|
|
to run DMA Mode 2 or UDMA at these PCI bus clocks will result in crashes and
|
103 |
|
|
loss of data. If your FSB runs at > 75MHz you MUST set the PCI bus for
|
104 |
|
|
asynchronous 33MHz operation. YOU HAVE BEEN WARNED.
|
105 |
|
|
|
106 |
|
|
Andre Hedrick Tests [IMPORTANT: those are SMP configurations]
|
107 |
|
|
-------------------------------------------------------------
|
108 |
|
|
|
109 |
|
|
Test I
|
110 |
|
|
------
|
111 |
|
|
|
112 |
|
|
Tyan Tomcat III bios v4.01 SMP Dual P5 200 w/ Artop AEC6210 w/ DMA2 drives
|
113 |
|
|
|
114 |
|
|
Intel MultiProcessor Specification v1.4
|
115 |
|
|
Virtual Wire compatibility mode.
|
116 |
|
|
OEM ID: OEM00000 Product ID: PROD00000000 APIC at: 0xFEE00000
|
117 |
|
|
Processor #0 Pentium(tm) APIC version 17
|
118 |
|
|
Processor #1 Pentium(tm) APIC version 17
|
119 |
|
|
I/O APIC #2 Version 17 at 0xFEC00000.
|
120 |
|
|
Processors: 2
|
121 |
|
|
|
122 |
|
|
Linux version 2.0.34 (root@Zosma) (gcc version 2.8.1) #1 Mon Jun 8 16:40:25 CDT
|
123 |
|
|
Booting processor 1 stack 00002000: Calibrating delay loop.. ok - 79.67
|
124 |
|
|
BogoMIPSTotal of 2 processors activated (159.33 BogoMIPS).
|
125 |
|
|
Starting kswapd v 1.4.2.2
|
126 |
|
|
|
127 |
|
|
ide: DMA Bus Mastering IDE controller on PCI bus 0 function 57
|
128 |
|
|
ide: ports are not enabled (BIOS)
|
129 |
|
|
ide: AEC6210 ROM enabled but no address
|
130 |
|
|
ide: UDMA Bus Mastering IDE controller on PCI bus 0 function 160
|
131 |
|
|
ide: timings == 04010401
|
132 |
|
|
ide0: BM-DMA at 0x6700-0x6707
|
133 |
|
|
ide1: BM-DMA at 0x6708-0x670f
|
134 |
|
|
hda: Maxtor 72004 AP, 1916MB w/128kB Cache, CHS=973/64/63, DMA
|
135 |
|
|
hdb: Maxtor 71626 A, 1554MB w/64kB Cache, CHS=789/64/63, DMA
|
136 |
|
|
hdc: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive
|
137 |
|
|
hdd: HP COLORADO 5GB, ATAPI TAPE drive
|
138 |
|
|
ide-tape: Sorry, DRQ types other than Accelerated DRQ
|
139 |
|
|
ide-tape: are still not supported by the driver
|
140 |
|
|
ide-tape: the tape is not supported by this version of the driver
|
141 |
|
|
ide2: ports already in use, skipping probe
|
142 |
|
|
ide0 at 0x6300-0x6307,0x6402 on irq 11
|
143 |
|
|
ide1 at 0x6500-0x6507,0x6602 on irq 11 (shared with ide0)
|
144 |
|
|
scsi0 : ncr53c8xx - revision 2.5f.1
|
145 |
|
|
|
146 |
|
|
Test II
|
147 |
|
|
-------
|
148 |
|
|
|
149 |
|
|
SuperMicro P6DNF SMP Dual P6 233 w/ Artop AEC6210 and Promise Ultra33
|
150 |
|
|
|
151 |
|
|
Intel MultiProcessor Specification v1.4
|
152 |
|
|
Virtual Wire compatibility mode.
|
153 |
|
|
OEM ID: INTEL Product ID: 440FX APIC at: 0xFEE00000
|
154 |
|
|
Processor #0 Pentium(tm) Pro APIC version 17
|
155 |
|
|
Processor #1 Pentium(tm) Pro APIC version 17
|
156 |
|
|
I/O APIC #2 Version 17 at 0xFEC00000.
|
157 |
|
|
Processors: 2
|
158 |
|
|
|
159 |
|
|
Linux version 2.0.34 (root@Orion) (gcc version 2.8.1) #1 Wed Jun 17 01:13:15 CDT 1998
|
160 |
|
|
Booting processor 1 stack 00002000: Calibrating delay loop.. ok - 232.65 BogoMIPS
|
161 |
|
|
Total of 2 processors activated (464.49 BogoMIPS).
|
162 |
|
|
|
163 |
|
|
ide: Intel 82371 (single FIFO) DMA Bus Mastering IDE
|
164 |
|
|
Controller on PCI bus 0 function 57
|
165 |
|
|
ide: ports are not enabled (BIOS)
|
166 |
|
|
ide: AEC6210 ROM enabled at 0xfebf8000
|
167 |
|
|
ide: PCI UDMA Bus Mastering IDE
|
168 |
|
|
Controller on PCI bus 0 function 160
|
169 |
|
|
ide: timings == 04010401
|
170 |
|
|
ide0: BM-DMA at 0xef90-0xef97
|
171 |
|
|
ide1: BM-DMA at 0xef98-0xef9f
|
172 |
|
|
hda: QUANTUM FIREBALL ST3.2A, 3079MB w/81kB Cache, CHS=782/128/63, UDMA
|
173 |
|
|
hdb: QUANTUM FIREBALL ST6.4A, 6149MB w/81kB Cache, CHS=784/255/63, UDMA
|
174 |
|
|
hdc: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive
|
175 |
|
|
hdd: CD-ROM CDU611, ATAPI CDROM drive
|
176 |
|
|
ide2: ports already in use, skipping probe
|
177 |
|
|
ide0 at 0xeff0-0xeff7,0xefe6 on irq 10
|
178 |
|
|
ide1 at 0xefa8-0xefaf,0xefe2 on irq 10 (shared with ide0)
|
179 |
|
|
|
180 |
|
|
Test III
|
181 |
|
|
--------
|
182 |
|
|
|
183 |
|
|
Same kernel above but with Promise Ultra33
|
184 |
|
|
|
185 |
|
|
ide: Intel 82371 (single FIFO) DMA Bus Mastering IDE
|
186 |
|
|
Controller on PCI bus 0 function 57
|
187 |
|
|
ide: ports are not enabled (BIOS)
|
188 |
|
|
ide: PDC20246 ROM enabled at 0xfebd0000
|
189 |
|
|
ide: PCI UDMA Bus Mastering IDE
|
190 |
|
|
Controller on PCI bus 0 function 160
|
191 |
|
|
ide: timings == 000003ee
|
192 |
|
|
ide0: BM-DMA at 0xef80-0xef87
|
193 |
|
|
ide1: BM-DMA at 0xef88-0xef8f
|
194 |
|
|
hda: QUANTUM FIREBALL ST3.2A, 3079MB w/81kB Cache, CHS=782/128/63, UDMA
|
195 |
|
|
hdb: QUANTUM FIREBALL ST6.4A, 6149MB w/81kB Cache, CHS=784/255/63, UDMA
|
196 |
|
|
hdc: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive
|
197 |
|
|
hdd: CD-ROM CDU611, ATAPI CDROM drive
|
198 |
|
|
ide2: ports already in use, skipping probe
|
199 |
|
|
ide0 at 0xeff0-0xeff7,0xefe6 on irq 10
|
200 |
|
|
ide1 at 0xefa8-0xefaf,0xebe6 on irq 10 (shared with ide0)
|
201 |
|
|
|
202 |
|
|
All tests cases yield this problem, IOMEGA ZIP 100 ATAPI FW 23.D
|
203 |
|
|
I have a patch fix for 2.1.99->106 similar for FW 21.D drives.
|
204 |
|
|
|
205 |
|
|
ide-floppy: hdc: I/O error, pc = 5a, key = 5, asc = 24, ascq = 0
|
206 |
|
|
ide-floppy: Can't get drive capabilities
|
207 |
|
|
|
208 |
|
|
Note that both AEC6210 and PDC20246 have onboard bios that auto-config.
|
209 |
|
|
|
210 |
|
|
|
211 |
|
|
What UDMA support does
|
212 |
|
|
----------------------
|
213 |
|
|
|
214 |
|
|
- It enables UDMA transfers on the Intel TX chipset.
|
215 |
|
|
- It enables DMA mode2 transfers on the SiS 5571 and VIA VP-1
|
216 |
|
|
(82C586) chipsets.
|
217 |
|
|
- It enables DMA mode2 and UDMA mode2 transfers on the SiS 5598 and
|
218 |
|
|
SiS 5591 chipsets, and the VIA VP3 and MVP-3.
|
219 |
|
|
- With single line mods for each new chipset, it will support any DMA
|
220 |
|
|
mode2 and/or UDMA capable chipset compatible with document
|
221 |
|
|
SFF 8038I v1.0.
|
222 |
|
|
- Supports a variety of PCI UDMA controller cards.
|
223 |
|
|
|
224 |
|
|
|
225 |
|
|
Support for other chipsets
|
226 |
|
|
--------------------------
|
227 |
|
|
|
228 |
|
|
It is relatively easy to add support for other chipsets. Some chipsets are
|
229 |
|
|
entirely integrated (e.g. the SiS 5598 chipset has various devices in a
|
230 |
|
|
single chip), others are divided into a Northbridge (CPU to PCI circuitry,
|
231 |
|
|
L2 cache control, etc) and Southbridge (PCI to IDE bus mastering interface,
|
232 |
|
|
USB, etc). We are dealing here with the Southbridge, specifically with the
|
233 |
|
|
IDE bus master PCI device. If the data sheet says the device is SFF 8038I
|
234 |
|
|
v1.0 compatible, then the registers have a more or less standard layout and
|
235 |
|
|
this driver should work with the below changes:
|
236 |
|
|
|
237 |
|
|
1) Check that the chipset is correctly identified by /proc/pci. Search for
|
238 |
|
|
the line that identifies a bus-mastering IDE controller device.
|
239 |
|
|
|
240 |
|
|
2) If the chipset is not correctly identified (new chipsets are not in
|
241 |
|
|
kernels up to 2.0.33), you will need to edit /include/linux/pci.h and
|
242 |
|
|
/drivers/pci/pci.c. This is actually quite easy, requiring a single line in
|
243 |
|
|
each of these files.
|
244 |
|
|
|
245 |
|
|
3) Now add a single line to ide.c, in routine probe_for_hwifs.
|
246 |
|
|
|
247 |
|
|
4) Test and report results; when troubleshooting, please check first that
|
248 |
|
|
you have the latest BIOS for your motherboard.
|
249 |
|
|
|
250 |
|
|
|
251 |
|
|
HOW does UDMA mode2 work?
|
252 |
|
|
-------------------------
|
253 |
|
|
|
254 |
|
|
Well, actually, the excellent triton.c driver written by Mark Lord is a
|
255 |
|
|
generic DMA transfer hard disk driver. It does not depend on any chipset
|
256 |
|
|
feature or transfer mode (i.e. it will work with DMA mode 2, UDMA and other
|
257 |
|
|
future DMA modes with little or no changes). BTW in late 2.1.x kernels the
|
258 |
|
|
driver was renamed ide-dma.c, to indicate that it is independent of the
|
259 |
|
|
chipset used.
|
260 |
|
|
|
261 |
|
|
(Note: triton is the "old" name for the Intel FX chipset, for which Mark
|
262 |
|
|
Lord wrote the driver initially.)
|
263 |
|
|
|
264 |
|
|
The Intel chipset specific parts were slightly changed in the triton.c
|
265 |
|
|
driver. These are only used to gather information for driver testing, and
|
266 |
|
|
actually do not affect the operation or performance of the driver, so the
|
267 |
|
|
changes are (well, should be) relatively inocuous.
|
268 |
|
|
|
269 |
|
|
The real work involved in setting up the chips for DMA transfers is done
|
270 |
|
|
mostly by the BIOS of each motherboard. Now of course one hopes that the
|
271 |
|
|
BIOS has been correctly programmed...
|
272 |
|
|
|
273 |
|
|
For example, the ASUS SP-97V motherboard with its original BIOS (Rev. 1.03)
|
274 |
|
|
would malfunction with the modified Linux driver in both DMA mode 2 and UDMA
|
275 |
|
|
modes; it would work well using PIO mode 4, or under Windows 95 in all
|
276 |
|
|
modes. I downloaded the latest BIOS image (Rev. 1.06) from the ASUS Web site
|
277 |
|
|
and flashed the BIOS EPROM with the latest BIOS revision. It has been
|
278 |
|
|
working perfectly ever since (at 66 MHz bus speeds).
|
279 |
|
|
|
280 |
|
|
What this tells us is that the BIOS sets up the DMA controller with specific
|
281 |
|
|
timing parameters (active pulse and recovery clock cycles). My initial BIOS
|
282 |
|
|
revision probably had bad timings. Since the Windows 95 driver sets up those
|
283 |
|
|
timings by itself (i.e. it does not depend on the BIOS to setup the hard
|
284 |
|
|
disk controller timing parameters), I initially had problems only with the
|
285 |
|
|
Linux driver, while Windows 95 worked well.
|
286 |
|
|
|
287 |
|
|
So, let me state this again: this Linux (U)DMA driver depends on the BIOS for
|
288 |
|
|
correct (U)DMA controller setup. If you have problems, first check that you
|
289 |
|
|
have the latest BIOS revision for your specific motherboard.
|
290 |
|
|
|
291 |
|
|
OTOH Michel Aubry's code for the VIA Apollo chipset has complete support for
|
292 |
|
|
setting up the timing parameters. Check the triton.c source code for
|
293 |
|
|
details.
|
294 |
|
|
|
295 |
|
|
New BIOS revisions can be downloaded from your motherboard manufacturer's
|
296 |
|
|
Web site. Flashing a new BIOS image is a simple operation but one must
|
297 |
|
|
strictly follow the steps explained on the motherboard manual.
|
298 |
|
|
|
299 |
|
|
Late Award BIOS revisions seem stable with respect to UDMA. Anything with a
|
300 |
|
|
date of 1998 should be fine.
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
Features missing from the present UDMA support code
|
304 |
|
|
---------------------------------------------------
|
305 |
|
|
|
306 |
|
|
It does not set UDMA transfer parameters (the driver assumes the BIOS has
|
307 |
|
|
correctly setup all timing parameters) in the various chipsets. This
|
308 |
|
|
requires access to a complete set of data sheets for the various chipsets,
|
309 |
|
|
and testing on a variety of configurations, so it's not exactly within the
|
310 |
|
|
reach of a humble Linux hacker. IMHO this is best left to the guys at Award
|
311 |
|
|
and AMI (the BIOS guys), and to the motherboard engineers.
|
312 |
|
|
|
313 |
|
|
Basically, UDMA transfers depend on two timing parameters:
|
314 |
|
|
1) The pulse width of the active strobe signal for data transfers
|
315 |
|
|
(usually described as the active pulse width).
|
316 |
|
|
2) The delay between the negation of the DMA READY signal to the
|
317 |
|
|
assertion of STOP when the IDE controller wants to stop a read operation
|
318 |
|
|
(usually described as the recovery time).
|
319 |
|
|
|
320 |
|
|
Both timing parameters can be set individually for each hard disk (up to two
|
321 |
|
|
hard disks per channel).
|
322 |
|
|
|
323 |
|
|
Knowing which registers must hold this data and the appropriate values, one
|
324 |
|
|
could program the Linux triton.c driver to setup the IDE controller device,
|
325 |
|
|
without relying on BIOS settings. However, some chipsets allow setting other
|
326 |
|
|
timing parameters, and the required code would quickly increase to a
|
327 |
|
|
not-so-easy-to-manage size. Better keep it simple, IMHO.
|
328 |
|
|
|
329 |
|
|
It seems Mark Lord has devised a neat way to do this in the ide-dma driver
|
330 |
|
|
included in late kernels 2.1.x: each chipset has an entry in a table, with
|
331 |
|
|
safe timing values. The chipset is also identified when the driver is
|
332 |
|
|
loaded.
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
How does one use UDMA support?
|
336 |
|
|
------------------------------
|
337 |
|
|
|
338 |
|
|
1) Backup your data or you will be sorry. Now do "hdparm -t -T
|
339 |
|
|
/dev/hda". Write a small note with the transfer rates you see.
|
340 |
|
|
|
341 |
|
|
2) Reboot. Press [Del] to launch the CMOS SETUP routine, go to the
|
342 |
|
|
CHIPSET SPECIFIC or PERIPHERALS SETUP menus, and enable UDMA transfers
|
343 |
|
|
for your hard disk drives which are UDMA capable, or leave the fields in
|
344 |
|
|
the default "AUTO" value. Enable both IDE channels even if you have just
|
345 |
|
|
one IDE drive (default setting).
|
346 |
|
|
|
347 |
|
|
3) Boot Linux, compile the kernel with the TRITON support enabled. Install
|
348 |
|
|
the new kernel (the lilo thingy). Reboot Linux.
|
349 |
|
|
|
350 |
|
|
4) Watch for the drive parameters message when the kernel loads (or type
|
351 |
|
|
"dmesg | more" after login). After the Cyl, Heads, Sect parameters you
|
352 |
|
|
should see "DMA" or "UDMA" depending on your hard disk drive and chipset
|
353 |
|
|
capabilities.
|
354 |
|
|
|
355 |
|
|
Here is what I get with UDMA enabled in the BIOS of my SiS 5598 based
|
356 |
|
|
configuration, with an IBM UDMA capable hard disk as hda:
|
357 |
|
|
|
358 |
|
|
...
|
359 |
|
|
ide: DMA Bus Mastering IDE controller on PCI bus 0 function 9
|
360 |
|
|
ide0: BM-DMA at 0x4000-0x4007
|
361 |
|
|
ide1: BM-DMA at 0x4008-0x400f
|
362 |
|
|
hda: IBM-DHEA-36480, 6197MB w/476kB Cache, LBA, CHS=790/255/63, UDMA
|
363 |
|
|
...
|
364 |
|
|
|
365 |
|
|
If I disable UDMA in the BIOS, I get:
|
366 |
|
|
|
367 |
|
|
...
|
368 |
|
|
ide: DMA Bus Mastering IDE controller on PCI bus 0 function 9
|
369 |
|
|
ide0: BM-DMA at 0x4000-0x4007
|
370 |
|
|
ide1: BM-DMA at 0x4008-0x400f
|
371 |
|
|
hda: IBM-DHEA-36480, 6197MB w/476kB Cache, LBA, CHS=790/255/63, DMA
|
372 |
|
|
...
|
373 |
|
|
|
374 |
|
|
5) Again, do "hdparm -t -T /dev/hda". Smile. Test your setup by copying
|
375 |
|
|
a few large files around or doing some large compilation (e.g. the Linux
|
376 |
|
|
kernel itself).
|
377 |
|
|
|
378 |
|
|
|
379 |
|
|
Performance issues
|
380 |
|
|
------------------
|
381 |
|
|
|
382 |
|
|
1) Sustained transfer rates.
|
383 |
|
|
|
384 |
|
|
Here is some data gathered after extensive testing, using the hdparm utility
|
385 |
|
|
(also written by Mark Lord):
|
386 |
|
|
|
387 |
|
|
PIO mode 4 transfer rates under Linux: +/- 5.2MB/s
|
388 |
|
|
|
389 |
|
|
DMA mode 2 transfer rates under Linux: +/- 7.2MB/s
|
390 |
|
|
|
391 |
|
|
UDMA mode 2 transfer rates under Linux: +/- 9.8MB/s
|
392 |
|
|
|
393 |
|
|
Data gathered on a Chaintech SiS 5598 motherboard, 6x86MX @ 187.5MHz, Linux
|
394 |
|
|
2.0.32/2.0.33 with patched triton.c driver as explained above, IBM DeskStar
|
395 |
|
|
6.4GB hard disk (IBM-DHEA-36480).
|
396 |
|
|
|
397 |
|
|
The integrated video hardware in the SiS 5598 chip was disabled (a standard
|
398 |
|
|
PCI video board was used); enabling the integrated SVGA controller will
|
399 |
|
|
cause a 20% performance hit in processing performance, due to limited main
|
400 |
|
|
memory bandwidth.
|
401 |
|
|
|
402 |
|
|
The TX motherboard under the same test conditions will be slightly
|
403 |
|
|
slower (0.1 - 0.2 MB/s slower).
|
404 |
|
|
|
405 |
|
|
Burst (instantaneous) transfer rates are supposed to go from 16.6MB/s (PIO
|
406 |
|
|
mode 4) to 16.6MB/s (DMA mode 2) up to 33MB/s (UDMA). In his patch against
|
407 |
|
|
kernel 2.1.55, Kim-Hoe Pang actually checked the UDMA burst transfer rate
|
408 |
|
|
with a logic analiser: 60ns/word, which translates into 33MB/s.
|
409 |
|
|
|
410 |
|
|
Note that burst transfer rates only affect data transfers to/from the EIDE
|
411 |
|
|
drive cache (476kB for the IBM 6.4GB drive), and IMHO are not particularly
|
412 |
|
|
relevant for most Linux users.
|
413 |
|
|
|
414 |
|
|
The Linux kernel uses as much RAM as possible to cache hard disk data
|
415 |
|
|
accesses, and so if data is not in the kernel cache there is little chance
|
416 |
|
|
that it will be in the (much smaller) hard disk cache.
|
417 |
|
|
|
418 |
|
|
2) Processor utilization
|
419 |
|
|
|
420 |
|
|
Unfortunately, it is very difficult to gather data about processor
|
421 |
|
|
utilization during data transfers, but this is exactly the biggest advantage
|
422 |
|
|
of DMA transfers over PIO transfers. My estimate is that CPU utilization
|
423 |
|
|
during UDMA transfers will be as low as 3-4%, while being somewhere around
|
424 |
|
|
30% for PIO transfers and 6-8% for DMA mode 2.
|
425 |
|
|
|
426 |
|
|
3) UDMA vs SCSI
|
427 |
|
|
|
428 |
|
|
The main advantage of DMA mode 2 and UDMA over SCSI is that the controller
|
429 |
|
|
is already on your motherboard, so why not use it?
|
430 |
|
|
|
431 |
|
|
Mark Lord's triton.c driver has a very small latency and so UDMA drives
|
432 |
|
|
may beat their Ultra-Wide SCSI-2 counterparts in some cases (at equal
|
433 |
|
|
spindle speeds) e.g. lots of small files (loaded news servers) being
|
434 |
|
|
read/written at irregular intervals.
|
435 |
|
|
|
436 |
|
|
Note however that SCSI drives are available at spindle speeds of 7,200,
|
437 |
|
|
10,000 and even a recently announced 12,030 rpm. IBM is planning some 7,200
|
438 |
|
|
rpm UDMA EIDE drives, but those are not yet available. Seagate has just
|
439 |
|
|
released its EIDE 7,200 rpm drives, but they have special cooling
|
440 |
|
|
requirements just like their SCSI counterparts. Expect this technology to
|
441 |
|
|
become commonplace by the end of 98, though.
|
442 |
|
|
|
443 |
|
|
The UDMA burst data transfer rates exceed maximum head transfer rates
|
444 |
|
|
(maximum head transfer rates in the industry have reached 160 Mbits/s in
|
445 |
|
|
1998) and so for large files neither Ultra-Wide SCSI-2 nor UDMA will have an
|
446 |
|
|
advantage over the other technology.
|
447 |
|
|
|
448 |
|
|
It used to be that high-capacity drives were only available with SCSI
|
449 |
|
|
interfaces, but this isn't true anymore. Right now top capacity for an EIDE
|
450 |
|
|
drive is Maxtor's 11.3Gb monster, which is quite affordable in fact. One can
|
451 |
|
|
drive four of these with a standard motherboard: 45Gb for < $2k.
|
452 |
|
|
|
453 |
|
|
SCSI drives can chain, overlap and re-order commands, EIDE drives cannot.
|
454 |
|
|
However, Linux already has an intelligent "elevator" algorithm for hard disk
|
455 |
|
|
accesses.
|
456 |
|
|
|
457 |
|
|
At present, EIDE top speed is 33MB/s burst. Ultra-Wide II SCSI is 80MB/s
|
458 |
|
|
burst. The cost of an Ultra-Wide II SCSI controller + 9Gb hard disk is > 4 x
|
459 |
|
|
the cost of an 8GB UDMA drive. IMHO the price/performance ratio of UDMA
|
460 |
|
|
beats SCSI.
|
461 |
|
|
|
462 |
|
|
A new standard is emerging called ATA-66, which will double the burst
|
463 |
|
|
transfer speed of EIDE drives to 66Mb/s. I don't have any technical info
|
464 |
|
|
about it, unfortunately. The first ATA-66 drives will be shipped by Quantum
|
465 |
|
|
in 1999, but VIA has already announced two ATA-66 capable chipsets (in fact
|
466 |
|
|
based on the same Southbridge chip); as I write this, data sheets are not
|
467 |
|
|
available to the general public. Probably Intel will come out with a chipset
|
468 |
|
|
of its own with ATA-66 capabilities.
|
469 |
|
|
|
470 |
|
|
4) What is the best UDMA chipset/hard disk?
|
471 |
|
|
|
472 |
|
|
Intel designed the first DMA mode 2 capable chipset, the FX (Triton I) a few
|
473 |
|
|
years ago. The Linux DMA mode 2 driver was initially written by Mark Lord
|
474 |
|
|
for the original Intel FX chipset and appeared around kernel 1.3.20 if I
|
475 |
|
|
remember well. The later HX and VX chipsets had exactly the same DMA mode 2
|
476 |
|
|
capabilities and the triton.c driver was for a long time Intel-only. Mark
|
477 |
|
|
planned to support the Opti Viper chipset but Opti went out of the
|
478 |
|
|
motherboard chipset business so fast that Mark didn't even have the time to
|
479 |
|
|
get his hands on an Opti motherboard, I guess.
|
480 |
|
|
|
481 |
|
|
Intel later introduced a UDMA compatible motherboard chipset with its TX
|
482 |
|
|
chipset. Kernel 2.0.31 was the first Linux kernel to support the TX chipset,
|
483 |
|
|
however only DMA mode 2 (16.6MB/s) was supported.
|
484 |
|
|
|
485 |
|
|
The TX chipset has a proven record of reliability. But DMA mode 2 and UDMA
|
486 |
|
|
transfers on the TX suffer from a flaw common to previous Intel DMA mode 2
|
487 |
|
|
only chipsets: a single data buffer is shared between the two IDE channels.
|
488 |
|
|
This buffer (64 bytes deep) is used to hold data on its way from the PCI bus
|
489 |
|
|
to/from the hard disk's small cache. A hardware arbitration mechanism
|
490 |
|
|
prevents data loss when the OS tries to simultaneously use both IDE
|
491 |
|
|
channels.
|
492 |
|
|
|
493 |
|
|
VIA chips also have a single FIFO, with the same 64 bytes deep buffer.
|
494 |
|
|
However, VIA chips can have the buffer split 1:1 or 3:1 between both IDE
|
495 |
|
|
channels; an interesting feature, but difficult to use.
|
496 |
|
|
|
497 |
|
|
How is this FIFO buffer used? Remember that the PCI bus can transfer data at
|
498 |
|
|
a maximum rate of 132MB/s when clocked at 33MHz, 150MB/s when clocked at
|
499 |
|
|
37.5MHz (maximum safe clock speed for PCI is 33MHz, after that well..). So the
|
500 |
|
|
PCI bus mastering IDE controller will be transfering data from main memory
|
501 |
|
|
DRAM to this FIFO buffer in small bursts of < 64 bytes, then from the buffer
|
502 |
|
|
to the IDE disk drive cache (when writing; the other way around for reads).
|
503 |
|
|
|
504 |
|
|
I recently managed to get hold of the SiS 5598 data sheet and studied the
|
505 |
|
|
IDE controller part of this highly integrated chip, a device identified by
|
506 |
|
|
the number 5513. The 5598 even includes an SVGA controller, which should be
|
507 |
|
|
disabled if one wants to get decent performance from this chipset: it
|
508 |
|
|
severely limits CPU/memory bandwidth. The SiS5597 is the same part with
|
509 |
|
|
a different pinout.
|
510 |
|
|
|
511 |
|
|
It appears the 5513 has two completely independent IDE channels, each with
|
512 |
|
|
its own 64 bytes deep data buffer. On disk-to-disk or CD-to-disk transfers,
|
513 |
|
|
the 5598 and 5591 chipsets will easily beat the Intel TX and VIA. On
|
514 |
|
|
simultaneous (U)DMA transfers to two disks (for example, when the Linux md
|
515 |
|
|
driver is used to create a RAID-0 array with data striping), the 5513 device
|
516 |
|
|
will be faster than the TX Southbridge device since there will be no
|
517 |
|
|
contention for the data buffer, assuming each drive is connected to a
|
518 |
|
|
different IDE channel. Other PCI bus related features will also improve its
|
519 |
|
|
performance of the SiS devices. So, compared to the Intel TX and various VIA
|
520 |
|
|
chipsets, the 5598 and 5591 win hands down in terms of UDMA implementation.
|
521 |
|
|
|
522 |
|
|
Unfortunately, it is very difficult to get data sheets for the ALi Aladdin
|
523 |
|
|
IV+ and Aladdin V chipsets. These newer chipsets support up to 1 MB of L2
|
524 |
|
|
SRAM cache, the AGP bus (2X), 100 MHz CPU bus and of course, UDMA data
|
525 |
|
|
transfers. The newest VIA chipset for Socket 7 motherboards beats them all
|
526 |
|
|
in terms of features, as it sports ATA-66 compatibility.
|
527 |
|
|
|
528 |
|
|
On the UDMA hard drive front, the present performance leaders are the IBM
|
529 |
|
|
Deskstar drives. These drives have relatively large data caches (476kB
|
530 |
|
|
available), a 5,400 rpm rotational speed and < 10ms random access times.
|
531 |
|
|
They run very cool and although they can't be called silent, their noise
|
532 |
|
|
level is acceptable. They are also reliable.
|
533 |
|
|
|
534 |
|
|
Seagate has just begun shipping 7,200 rpm EIDE drives which will obviously
|
535 |
|
|
benefit from the lower data latency. They are reported as particularly
|
536 |
|
|
silent due to the use of Fluid Dynamic Bearing motors, but running quite
|
537 |
|
|
hot. IMHO if one has to add a fan to cool them, this defeats any advantage
|
538 |
|
|
these drives will have in terms of noise level. Another advantage of this
|
539 |
|
|
technology is the lower vibration levels compared to ball bearings.
|
540 |
|
|
|
541 |
|
|
IBM has pre-announced very large capacity (14GB), 7,200 rpm EIDE UDMA drives
|
542 |
|
|
a month ago, but those are not shipping yet. They are based on a new head
|
543 |
|
|
technology called Giant Magneto-Resistive Heads, which is supposed to
|
544 |
|
|
increase the data density on the disks by a factor of 4 or more. More details
|
545 |
|
|
when I get my hands on one. IBM licensed Western Digital to use this
|
546 |
|
|
technology.
|
547 |
|
|
|
548 |
|
|
Quantum has always shipped among the best and fastest EIDE drives, and they
|
549 |
|
|
worked with Intel to create the UDMA standard. They used to have the fastest
|
550 |
|
|
drives for Linux DMA mode 2 transfers (see the comments in
|
551 |
|
|
/Documentation/ide.txt).
|
552 |
|
|
|
553 |
|
|
Well, I just got an email from Denny de Jonge that proves
|
554 |
|
|
Quantum drives will keep their reputation:
|
555 |
|
|
|
556 |
|
|
"Andre,
|
557 |
|
|
|
558 |
|
|
After I applied the UDMA-patch for Linux 2.0.33 hdparm showed up with the
|
559 |
|
|
following benchmarks:
|
560 |
|
|
|
561 |
|
|
/dev/hda:
|
562 |
|
|
|
563 |
|
|
Timing buffer-cache reads: 64 MB in 1.02 seconds =62.75 MB/sec
|
564 |
|
|
Timing buffered disk reads: 32 MB in 3.02 seconds =10.60 MB/sec
|
565 |
|
|
|
566 |
|
|
Not bad, don't you think ?
|
567 |
|
|
|
568 |
|
|
These results have been obtained using the Intel 82371 Chipset and a
|
569 |
|
|
Quantum Fireball 4.3SE harddisk."
|
570 |
|
|
|
571 |
|
|
I later asked what kind of processor Denny was using: it's a 266MHz PII.
|
572 |
|
|
|
573 |
|
|
BTW I have been collecting hard disk/file subsystem benchmarking information
|
574 |
|
|
based on bonnie, a popular benchmark available for Linux. I have come to the
|
575 |
|
|
conclusion that bonnie is not a reliable benchmark when it comes to
|
576 |
|
|
comparing different systems, basically because it depends so much on how
|
577 |
|
|
much RAM one has installed and how much of it is free, as well as system
|
578 |
|
|
load, CPU speed, etc. For this reason I will not quote bonnie results
|
579 |
|
|
anymore. For comparative benchmarking between two hard disk drives on
|
580 |
|
|
exactly the same hardware it may be acceptable, but otherwise it's too
|
581 |
|
|
unreliable as an indicator of performance.
|
582 |
|
|
|
583 |
|
|
|
584 |
|
|
Unreliable drive + motherboard + driver combination
|
585 |
|
|
---------------------------------------------------
|
586 |
|
|
|
587 |
|
|
Quoting Kim-Hoe Pang:
|
588 |
|
|
|
589 |
|
|
"The UDMA mode of an UDMA drive would NOT be enabled on a non-UDMA capable
|
590 |
|
|
chipset mobo. On power-up or after a hardware reset, the drive is in normal
|
591 |
|
|
PIO/DMA mode. To enable the UDMA mode in the drive, the host, BIOS or OS,
|
592 |
|
|
needs to send a SET FEATURE ("enable UDMA mode subcommand") AT command to
|
593 |
|
|
the drive. A non-UDMA capable mobo will not send this command to the drive.
|
594 |
|
|
|
595 |
|
|
UDMA mode is dis/enabled via BIOS setup. The patch does not attempt to
|
596 |
|
|
override user's BIOS setting."
|
597 |
|
|
|
598 |
|
|
There may be some combinations of drives, motherboards (BIOS) and Linux
|
599 |
|
|
driver which may prove unreliable. Remember we are transfering data at
|
600 |
|
|
33MB/s over unshielded ribbon cable in a very noisy (electromagnetically
|
601 |
|
|
speaking) environment.
|
602 |
|
|
|
603 |
|
|
In the future it would be nice if hard disk manufacturers would publish the
|
604 |
|
|
timings required by their drives, and chipset manufacturers would follow a
|
605 |
|
|
single standard for registers and controller architecture. Right now UDMA is
|
606 |
|
|
extremely timing sensitive.
|
607 |
|
|
|
608 |
|
|
A few recommendations for troubleshooting:
|
609 |
|
|
|
610 |
|
|
1) Make sure you have the latest BIOS for your motherboard. Connect to the
|
611 |
|
|
motherboard manufacturer's Web site and download the latest BIOS image file
|
612 |
|
|
and EEPROM flashing utilities. Check your BIOS version, and only flash your
|
613 |
|
|
EEPROM if needed.
|
614 |
|
|
|
615 |
|
|
2) Keep the IDE cable going from the motherboard to the drive short, and do
|
616 |
|
|
not loop it around another cable. I recommend < 30 cm (12") total cable
|
617 |
|
|
length.
|
618 |
|
|
|
619 |
|
|
3) If you have just a single UDMA hard disk drive per channel (which I
|
620 |
|
|
recommend), use the connectors at both ends of the cable to connect
|
621 |
|
|
motherboard and drive, do _not_ use the middle connector. If you have a UDMA
|
622 |
|
|
hard disk drive and a CD-ROM drive on the same cable, plug the hard disk
|
623 |
|
|
drive at the end of the cable (use the middle connector for the CD-ROM
|
624 |
|
|
drive). Also the hard disk must be the master EIDE device, the CD-ROM drive
|
625 |
|
|
the slave EIDE device, never the other way around (this is not determined by
|
626 |
|
|
cable position, but by small jumpers on the drive and at the back of the
|
627 |
|
|
CD-ROM). The same rules apply to CD-RW, ZIP and tape EIDE drives.
|
628 |
|
|
|
629 |
|
|
4) If you have (shudder) Windows 95 installed in your system, and have been
|
630 |
|
|
able to use UDMA, you should be able to use UDMA with Linux.
|
631 |
|
|
|
632 |
|
|
5) DON'T OVERCLOCK the PCI bus. 33MHz is the maximum supported speed for
|
633 |
|
|
the PCI bus. Some (supposedly compatible) UDMA drives will not even take
|
634 |
|
|
37.5MHz, but should be OK at 33.3MHz.
|
635 |
|
|
|
636 |
|
|
In any case, NEVER, NEVER set the PCI bus to 41.5MHz.
|
637 |
|
|
|
638 |
|
|
The RECOMMENDED safe setting is 33MHz.
|
639 |
|
|
|
640 |
|
|
Adequate testing is needed in each case. The golden rule here, as always:
|
641 |
|
|
backup, backup, backup.
|
642 |
|
|
|
643 |
|
|
|
644 |
|
|
Aknowledgments
|
645 |
|
|
--------------
|
646 |
|
|
|
647 |
|
|
Mark Lord for his excellent, reliable and very readable triton.c driver code
|
648 |
|
|
and all his (E)IDE Linux programming.
|
649 |
|
|
|
650 |
|
|
Kim-Hoe Pang for the first UDMA patch against kernel 2.1.55.
|
651 |
|
|
|
652 |
|
|
Christian Brunner for his patch converting triton.c into a generic DMA mode
|
653 |
|
|
2 EIDE driver.
|
654 |
|
|
|
655 |
|
|
Brion Vibber for his neat Linux UDMA mini-HOWTO, for his help and
|
656 |
|
|
contributions to this package, and for bearing with my various documentation
|
657 |
|
|
changes and suggestions.
|
658 |
|
|
|
659 |
|
|
Michel Aubry for his complete VIA support and neat diagnostics code, as well
|
660 |
|
|
as the patch to hdparm to support UDMA.
|
661 |
|
|
|
662 |
|
|
Andre Hedrick for his great code for the various PCI UDMA controller cards.
|
663 |
|
|
|