Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2001 13:51:01 -0600
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        Peter Jeremy <peter.jeremy@alcatel.com.au>
Cc:        Brian Somers <brian@Awfulhak.org>, Sergey Babkin <babkin@FreeBSD.ORG>, 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>
In-Reply-To: <20010111064126.A10214@pc0640.alcatel.com.au>
References:  <babkin@FreeBSD.org> <200101052146.f05LkDi49430@hak.lan.Awfulhak.org> <20010111064126.A10214@pc0640.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010110135101.S29115>