From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 32300 invoked from network); 28 Mar 1998 01:51:45 -0000 Received: from wopr.campus.luth.se (ajo@130.240.192.27) by mail2.redhat.com with SMTP; 28 Mar 1998 01:51:45 -0000 Received: from localhost (ajo@localhost) by wopr.campus.luth.se (8.8.7/8.8.7) with SMTP id CAA07357 for ; Sat, 28 Mar 1998 02:51:40 +0100 Date: Sat, 28 Mar 1998 02:51:39 +0100 (MET) From: Andreas Johansson Reply-To: Andreas Johansson To: axp-list@redhat.com Subject: SX DMA IDE (Was: Re: cheapest SX System i ever have seen) In-Reply-To: <19980328000743Z92200-4547+5@mea.tmt.tele.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 28 Mar 1998, Matti Aarnio wrote: > ... > > from what i understand, the IDE controller in the PC164, etc. (CMD646) is > > actually a decent device. the problem is that because the prior version > > (the CMD640) was buggy and slow, nobody ever bothered to develop the > > driver for the 646 very far. it's another case of "if only somebody would > > write the [better] driver for it" ... > > > > i would be willing to give it a go, if only i knew the first thing about > > IDE or the CMD ... > > Indeed. Having browsed chip specifications I would say that > the 2.1.X kernel's revised generic IDE stuff is sufficient to > drive CMD646. > > The thing that CMD640 "driver" did was to activate certain > bug work-arounds for the chip, NOT to do actual driving. > > > can anybody confirm my hunches about this controller? if so, can anybody > > point me toward online documentation for these things so that might toy > > around with it and see what i can do? (ah, the ignorance of youth ...) > > Use the generic (E)IDE driver. Ok, I was going to wait with this until I finished, but I have run into some problems, so I thought I'd tell you all what to expect of the 164SX's EIDE controller even though my driver for it isn't finished yet. First of all, the 164SX doesn't use the CMD64x chipset at all. That means that my work probably will be of no use for the PC164 which people seem to be talking about under this subject :/ Instead, the 164SX uses the Cypress CY82C693U chip. I have not checked whether the 164LX uses the same chipset, but I think it does. For some reason this chipset is detected as "Contaq" with the same numbers: ajo@ymer ~ >cat /proc/pci PCI devices found: [...] Bus 0, device 8, function 2: IDE interface: Contaq 82C693 (rev 0). Medium devsel. Fast back-to-back capable. Master Capable. No bursts. I/O at 0x170. I/O at 0x374. Non-prefetchable 32 bit memory at 0x28a0000. [...] Now, one day I got tired of my IDE driver taking ~100% cpu at the blazing transfer rate of 1.2MB/s, so I decided to do something about it. Now, I seemed to remeber that the Cypress device was quite similar to the Intel devices, so I checked my Cypress documentation against the triton.c DMA ide driver. And yes, the dma interface works the same way, but one needs to set up some pci registers an other way with the Cypress device, mainly for mapping the dma registers in io space. I solved this very quickly, and now I have quite decent transfer speed and cpu percentage to my IBM Ultrastar 6.4GB drive (these figures are while doing multiple mode DMA transfers mode 2): Mar 26 22:48:45 ymer kernel: hdc: IBM-DHEA-36480, 6197MB w/476kB Cache, CHS=12592/16/63, DMA ajo@ymer /home/ajo #time dd if=/dev/hdc of=/dev/null bs=65536 count=4096 4096+0 records in 4096+0 records out 0.013u 3.117s 0:39.88 7.8% 0+0k 0+0io 73pf+0w ajo@ymer /home/ajo #expr 65536 "*" 4096 / 40 6710886 This test was done several times and I only have 128MB ram, so none of the data was read from the cache. My drive can actually do Ultra-ATA, but I haven't tried it with a motherboard that supports this mode, so I don't know if I have hit the limit of the drive. This might very well be the case, though. I could easily make a working driver now, but I ran into another problem. While doing large transfers from the IDE-drive I noticed a problem with my DMA-using sound card. It actually can't play sound at the desired rate! It seems the Cypress device never ever detaches from the pci bus while doing dma transfers (and these can be up to 64k large). This happens even if the transfer is divided in several smaller transfers via a transfer descriptor table. I have never heard of this problem with the triton chipset. Then I tried setting the Cypress chip for using single mode transfer (detach from the pci bus after each 32 bit transfer). This solved the sound card problem, but in this mode the transfer rate stinks. So my plan now is to make larger changes to the driver which will indeed split up the transfers for real so that my soundcard may get enough pci cycles for sound play. I'll post a patch for the kernel once I'm finished with my dma driver for the Contaq chip, so stay tuned folks! Any comments are naturally welcome. /Andreas