From owner-freebsd-hackers Sat Jul 13 14:45:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A55F37B400 for ; Sat, 13 Jul 2002 14:45:23 -0700 (PDT) Received: from postfix2-2.free.fr (postfix2-2.free.fr [213.228.0.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9776843E31 for ; Sat, 13 Jul 2002 14:45:21 -0700 (PDT) (envelope-from nsouch@free.fr) Received: from armor.fastether (nas-cbv-2-62-147-133-190.dial.proxad.net [62.147.133.190]) by postfix2-2.free.fr (Postfix) with ESMTP id 6A94E5F7D6; Sat, 13 Jul 2002 23:45:19 +0200 (CEST) Received: from armor.fastether (localhost.fastether [127.0.0.1]) by armor.fastether (8.12.3/8.9.3) with ESMTP id g6DLlKVc027220; Sat, 13 Jul 2002 23:47:21 +0200 (CEST) (envelope-from nsouch@perso.free.fr) Received: (from nsouch@localhost) by armor.fastether (8.12.3/8.12.3/Submit) id g6DLlEY1027219; Sat, 13 Jul 2002 23:47:14 +0200 (CEST) Date: Sat, 13 Jul 2002 23:47:14 +0200 From: Nicolas Souchu To: Martin Faxer Cc: hackers@FreeBSD.ORG Subject: Re: ppbus questions Message-ID: <20020713234714.B26323@armor.fastether> References: <20020623101501.GA53454@lockdown.spectrum.fearmuffs.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020623101501.GA53454@lockdown.spectrum.fearmuffs.net>; from gmh003532@brfmasthugget.se on Sun, Jun 23, 2002 at 12:15:01PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jun 23, 2002 at 12:15:01PM +0200, Martin Faxer wrote: > hi! > > i'm trying to write a driver for an old cd-rom drive that you connect > to the parallel port. it is a shuttletech "para drive" 525. > > i don't have any driver docs or technical specifications but i believe > that it uses some kind of a SCSI to parallel chipset. The problem will be that FreeBSD ppbus framework is much more timing-sensitive than Linux parport. Without the tech sheets it may be hard. > the linux tree seems to have drivers for shuttletech EPSA-2 chipsets, > so i'm currently trying to port their probe routines to FreeBSD to see > if my cd-rom is indeed equipped with one of those chipsets. The best is certainly to install Linux on some partition and check that your drive is supported, then port the driver. > the linux code uses outb() and inb() directly to communicate with the > parallel port so i have to port it to use the ppbus interface. > > here are my questions: > 1) do the ppb_[rw][dcs]tr() functions have any "side effects", like > eg. does ppb_wdtr() drive strobe high or something like that to > tell the device that there is data waiting, or is it simply a > wrapper around outb() ? (ps. i tried to find the code for these A wrapper. > functions but didn't succeed since the macros make use of PPBUS_IO() > which is generated and calls some other function.) > > if the ppb_[rw][dcs]tr() function have side effects, are there any > lower level functions which simply wrap around inb() and outb() ? > > 2) do the ppb_[rw][dcs]tr() functions wait, or do i have to call some > function to do that, like DELAY() ? the linux code calls usleep() > after sending commands to the device. (i believe it is bad to call > DELAY() in a _probe() routine, but perhaps i can do that to start > with...) > > 3) should i use micro sequences instead of doing ppb_*() calls ? > i looked briefly at the man page but it seemed pretty complicated > and i'm not a very experienced kernel hacker yet. Yes, certainly. Microsequences offer you a general mechanism for bypassing the overhead of the newbus framework. > i would be very grateful for any answers or tips you might have! The task will not be easy :) Note that the first version of the vpo driver was a port of Linux driver. Then I rewrote it completly from specs. outb and inb might be used as well, but they're not portable. You should use ppb_xxx() routines preferably or even microsequences. Nicholas -- Nicholas Souchu - nsouch@free.fr - nsouch@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message