From owner-freebsd-arch Wed Jan 10 11:50:16 2001 Delivered-To: freebsd-arch@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 0D1ED37B401; Wed, 10 Jan 2001 11:49:59 -0800 (PST) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f0AJp1X58789; Wed, 10 Jan 2001 13:51:01 -0600 (CST) (envelope-from jlemon) Date: Wed, 10 Jan 2001 13:51:01 -0600 From: Jonathan Lemon To: Peter Jeremy Cc: Brian Somers , Sergey Babkin , freebsd-arch@FreeBSD.ORG Subject: Re: cvs commit: src/sys/gnu/i386/isa dgb.c dgm.c dgmreg.h dgreg.h Message-ID: <20010110135101.S29115@prism.flugsvamp.com> References: <200101052146.f05LkDi49430@hak.lan.Awfulhak.org> <20010111064126.A10214@pc0640.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <20010111064126.A10214@pc0640.alcatel.com.au> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jan 11, 2001 at 06:41:26AM +1100, Peter Jeremy wrote: > There are come significant differences between the [E]ISA aand PCI > DigiBoards: > - The [E]ISA cards use I/O ports whilst the PCI boards use > memory-mapped registers. > - The PCI cards have a flat 4MB window. The [E]ISA cards access > on-board memory via a 8KB or 32KB window. > > This means that the code does a lot of checking to see if the card > is PCI or not, resulting in expressions like: > ((IS_PCI(board_type)) ? *mem[reg] : inb(base + reg)) This should be taken care of by the bus_space() macros; which is already done by most drivers in the tree. (Many drivers can run in either PIO or memory mapped mode) > The Linux driver (maintained by Digi) uses (the equivalent of) virtual > functions for all card accesses. This is another option; the ida driver does something like this, if I understand you correctly; it uses board-specific accessor functions to hide hardware implementation details. > Would it be reasonable to have different drivers for different bus > versions of the same card? I don't think this would be a good idea. We already have a framework where the common code is kept in a foo.c file, and the bus-specific code in foo_{pci|eisa}.c files, but the entire thing is wrapped up in a single "foo" driver. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message