Re: Bus-Mastered DMA support for Triton Chipset?
On Wed, 1 Oct 1997, Richard S. Gray wrote:
> Hi,
>
> I'm trying to understand bus-mastered dma (ide) for a long time but I
> clearly don't understand what is going on. I first compile support into
> my kernel by selecting:
>
> [*] Intel PIIX/PIIX3/PIIX4 (Triton 430FX/HX/VX/TX, 440FX) DMA support
>
> I then added the following code to my rc.local initialization script:
>
> # Added by Scott Gray on 9/5/97
> # hdparm used to set transfer mode to
> # multiword DMA mode2
> #
> # -d1: enable the "using_dma" flag
> # -X34: ensure the drive is programmed for DMA mode 2
>
> if [ -f /sbin/hdparm ]; then
> echo "Setting hda transfer mode to DMA mode2"
> /sbin/hdparm -d1 -X34 /dev/hda
> echo "Setting hdb transfer mode to DMA mode2"
> /sbin/hdparm -d1 -X34 /dev/hdb
> fi
>
> # A message indicating success/failure is generated
> # and sent to STDOUT at boot-up.
>
I don't think that should be necessary (the kernel recognized mine without
anything like this).
> When I enter the command: "hdparm -i" the follow output is generated:
>
> /dev/hda:
> multcount = 16 (on)
> I/O support = 1 (32-bit)
> unmaskirq = 0 (off)
> using_dma = 1 (on)
> keepsettings = 0 (off)
> nowerr = 0 (off)
> readonly = 0 (off)
> readahead = 8 (on)
> geometry = 622/255/63, sectors = 10003456, start = 0
That looks like the output from hdparm, not hdparm -i
>
> However, when cat /proc/dma I get:
>
> 1: SoundBlaster8
> 4: cascade
> 5: SoundBlaster16
>
> I believe the DMA BusMastering is probably working but I would like to
> understand a little more about what is going on. Shouldn't a channel be
> allocated for the ide drive? Or does this form of DMA bypass the DMA
> controller found on the main board. If yes then does this mean that the
> DMA controller is actually on the drive itself? When I cat
> /proc/ioports I get:
>
> 0000-001f : dma1
> 0020-003f : pic1
> 0040-005f : timer
> 0060-006f : keyboard
> 0070-007f : rtc
> 0080-008f : dma page reg
> 00a0-00bf : pic2
> 00c0-00df : dma2
> 00f0-00ff : fpu
> 0170-0177 : ide1
> 01f0-01f7 : ide0
> 0220-022f : soundblaster
> 02f8-02ff : serial(auto)
> 0300-031f : NE2000
> 0330-0333 : SB MIDI
> 0376-0376 : ide1
> 0388-038b : OPL3/OPL2
> 03c0-03df : vga+
> 03f0-03f5 : floppy
> 03f6-03f6 : ide0
> 03f7-03f7 : floppy DIR
> 03f8-03ff : serial(auto)
> ffa0-ffa7 : IDE DMA <--- What is
> this?
> ffa8-ffaf : IDE DMA <--- What is
> this?
>
look at 'dmesg|grep ide'. You should get something like:
ide: i82371 PIIX (Triton) on PCI bus 0 function 57
ide0: BM-DMA at 0xf000-0xf007
ide1: BM-DMA at 0xf008-0xf00f
>
> As you can see, I pretty confused but I think if someone who know could
> expain this to me I'm not that far away from understanding.
>
> Thanks,
> Scott Gray :)
>
> PS: I'm interested in learning more about device drivers in particular
> "block device drivers." Could anyone recommend a book or some web
> resource. I was hoping to find something that talked about the big
> picture "in otherwords the basic things that need to be done" before
> diving into the kernel source code.
>
> My drive info is as follows:
>
> /dev/hda:
>
> Model=Maxtor 85120A8, FwRev=AA8Z2225, SerialNo=C804RA6A
> Config={ Fixed }
> RawCHS=9924/16/63, TrkSize=0, SectSize=0, ECCbytes=20
> BuffType=3(DualPortCache), BuffSize=256kB, MaxMultSect=16, MultSect=16
> DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=2(fast)
> CurCHS=9924/16/63, CurSects=10003392, LBA=yes, LBAsects=10003456
> tDMA={min:120,rec:120}, DMA modes: mword0 mword1 mword2
> IORDY=on/off, tPIO={min:120,w/IORDY:120}, PIO modes: mode3 mode4
>
This looks more like the 'hdparm -i' output. Note the above
DMA=yes, maxDMA=2(fast)
DMA modes: mword0 mword1 mword2
>From 'man hdparm':
-d Disable/enable the "using_dma" flag for this drive.
This option only works with a few combinations of
drives and interfaces which support DMA and which
are known to the IDE driver. In particular, the
Intel Triton chipset is supported for bus-mastered
DMA operation with many drives (experimental). It
is also a good idea to use the -X34 option in com-
bination with -d1 to ensure that the drive itself
is programmed for multiword DMA mode2. Using DMA
does not necessarily provide any improvement in
throughput or system performance, but many folks
swear by it. Your mileage may vary.
As I read it, things are working correctly.
----
Bob Nielsen Internet: nielsen@primenet.com
Tucson, AZ AMPRnet: w6swe@w6swe.ampr.org
http://www.primenet.com/~nielsen
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: