Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 1996 16:07:41 +0100
From:      se@zpr.uni-koeln.de (Stefan Esser)
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        hackers@freebsd.org
Subject:   Re: scanpci.c and pci-related stuff
Message-ID:  <199602091507.AA07402@Sysiphos>
In-Reply-To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> "scanpci.c and pci-related stuff" (Feb  9, 13:17)

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 9, 13:17, Luigi Rizzo wrote:
} Subject: scanpci.c and pci-related stuff
} I noticed in /usr/X11R6/bin a program called scanpci which apparently
} scans the pci bus looking for devices.
} 
} The source is deep into the XF86 source tree,
} 
} 	/usr/src/X11R6/xc/programs/Xserver/hw/xfree86/etc/scanpci.c
} 
} and apparently compiles easily.  I find it useful, and although it
} has some funny imprecisions (it detects the SAA 7116 by Philips as
} an "Intel SAA7116") I believe it is a nice tool for scanning system
} configurations.

Scanning the PCI bus is quite simple,
if you know which configuration mode
(1 or 2) to use and have access to I/O
ports (i.e. it maust be a setuid ROOT
program).

} How about contacting the author Robin Cutshaw (robin@xfree86.org)
} to see if it can be included in /sbin ? The source (which I will
} be glad to post if needed, it's about 30KB) have a berkeley-like
} copyright, so that should not be much of a problem.

There is code in the PCI sources, that
prints out a lot of information about
PCI chip sets (boot with -v, if you got
some kind of Intel chip set).

But it surely is useful to have a user
land tool to do the scan.

} And, one thing I would like to know, is if there exist any program to
} reconfigure a peripheral on the PCI bus.

What do you mean with "reconfigure" ???
The PCI bus is designed to be configured 
by the BIOS, and you can query the values
choosen (memory, port and IRQ mappings,
which possibly have resulted in chip set 
registers being set accordingly) but you
can't easily modify them. If an interrupt
has been assigned to some PCI chip, for
example, then the chip set has set up a
connection from the PCI IntA line to some
IRQ input of the system interrupt controller
(in the simplest case).
You can change this value without knowing 
the details of the chip set. There are now
PCI BIOS calls that ought to allow such an
assignment to be done from user code, but
I'd rather not rely on it, since I doubt
the functionality is working in more than
5% of the PCI systems currently in use ...

Similar problems exist with I/O and memory 
mappings. There might be hardware limitations
which are known to the PCI BIOS (e.g. only
accesses to the address range 1GB to 2GB are 
routed to the PCI bus at all).

} I believe I have a broken BIOS on one of our motherboards which
} incorrectly assigns the same interrupt to two boards. I'd like to
} override this somehow. And I would also like to avoid using INT10 on
} the PCI bus, as many ISA board often use this interrupt line and they
} cannot be configured on INT11, 12 or 13

The PCI BIOS is not necessarily broken, if
it assigns one IRQ to multiple devices. Most
motherboards sold until mid 1995 had the PCI
IntA line of one slot connected to IntB of its
neighbour, under the assumption, that devices
that use IntB (multi-function devices or PCI 
to PCI bridges) aren't commonly used.

Please describe the situation where the same
IRQ was used for two PCI devices.

PCI requires the hardware and software to deal
with shared interrupts, and FreeBSD got a good
implementation of the required software ...

Regards, STefan
-- 
 Stefan Esser, Zentrum fuer Paralleles Rechnen		Tel:	+49 221 4706021
 Universitaet zu Koeln, Weyertal 80, 50931 Koeln	FAX:	+49 221 4705160
 ==============================================================================
 http://www.zpr.uni-koeln.de/~se			  <se@ZPR.Uni-Koeln.DE>



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