From owner-freebsd-hackers Tue Jun 3 07:24:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA00956 for hackers-outgoing; Tue, 3 Jun 1997 07:24:34 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id HAA00729 for ; Tue, 3 Jun 1997 07:19:03 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id MAA25969; Tue, 3 Jun 1997 12:41:15 +0200 From: Luigi Rizzo Message-Id: <199706031041.MAA25969@labinfo.iet.unipi.it> Subject: Re: DMA for IDE drives ? To: toor@dyson.iquest.net (John S. Dyson) Date: Tue, 3 Jun 1997 12:41:14 +0200 (MET DST) Cc: hackers@freebsd.org In-Reply-To: <199705211437.JAA01152@dyson.iquest.net> from "John S. Dyson" at May 21, 97 09:37:22 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Following the suggestion from John Dyson, I have downloaded the documents for the PIIX controller (i82371FB/i82371SB) which is used on several of our motherboards. Maybe I am oversimplifying things but it seems that DMA for IDE could be implemented as follows: assuming that the conditions to use DMA on IDE apply (i.e a PIIX controller is detected, a drive supporting DMA is present on the channel), a read or write operation is required: in wdstart(): for write operations: instead of calling the outsw()/outsl, program the controller as specified in the PIIX manual, bottom of page 97, steps 1, 2, 4 (step 3 should have been already taken care of; or the command to request a DMA write transfer is different from a regular write command ?) for read operations: before returning, program the PIIX controller executing steps 1,2,4 as above; in wdintr() clear the stop bit in the dma-ide command register of the PIIX (step 7 page 98 of the docs) additionally, for read ops, do not issue the insw/insl instructions [One difficulty which might arise is that there is one DMA for each ide channel. So, presumably, we cannot overlap read/write ops on separate drives; I don't even know if we can do it now, btw.] Is it that simple, or there are other details I am not considering ? Thanks Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ for write operations: > John >